:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-rgb: 37,99,235;
    --secondary: #7c3aed;
    --bg: #ffffff;
    --bg-surface: #f8fafc;
    --bg-card: #ffffff;
    --bg-dark: #0f172a;
    --bg-darker: #0f172a;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --radius: 8px;
    --radius-lg: 12px;
    --card-gap: 4px;
    --card-radius: var(--radius-lg);
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --max-width: 1800px;
    --logo-h: 36px;
    --logo-h-mobile: 28px;
    --header-mid-height: 64px;
    --header-nav-height: 44px;
    --header-height: calc(var(--header-mid-height) + var(--header-nav-height));
    --grid-cols: 5;
    --cat-cols: 5;
    --perf-cols: 5;
    --studio-cols: 5;
}

/* ========== DARK MODE ========== */
[data-theme="dark"] {
    --bg: #0f172a;
    --bg-surface: #020617;
    --bg-card: #1e293b;
    --bg-dark: #020617;
    --bg-darker: #020617;
    --primary-light: rgba(37,99,235,0.15);
    --text: #f1f5f9;
    --text-muted: #b8c5d4;
    --text-light: #8899ab;
    --border: #334155;
    --border-light: #1e293b;
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    color-scheme: dark;
}
[data-theme="dark"] img { opacity: 0.92; }
[data-theme="dark"] .video-card__thumb img,
[data-theme="dark"] .video-player img,
[data-theme="dark"] .video-player video { opacity: 1; }
[data-theme="dark"] .header__logo img { opacity: 1; }
[data-theme="dark"] .footer__logo img { opacity: 1; }
/* Single logo fallback: invert in dark mode */
[data-theme="dark"] .header__logo-only { filter: brightness(0) invert(1); }
/* Dual logos: toggle visibility */
.header__logo-dark, .auth-modal__logo-dark { display: none; }
[data-theme="dark"] .header__logo-dark, [data-theme="dark"] .auth-modal__logo-dark { display: block; }
[data-theme="dark"] .header__logo-light, [data-theme="dark"] .auth-modal__logo-light { display: none; }
[data-theme="dark"] .sort-tabs a.active { background: var(--primary); color: #fff; }
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea { color-scheme: dark; }
.theme-transitioning,
.theme-transitioning *,
.theme-transitioning *::before,
.theme-transitioning *::after {
    transition: background-color 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s !important;
}

/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-surface);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* Global select styling */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' fill='none' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

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

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--container-padding, 24px); }
main.container { padding-top: 24px; padding-bottom: 24px; }

/* ========== TOP BAR ========== */
.topbar {
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    line-height: 1;
}
.topbar__inner {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 6px;
    padding-bottom: 6px;
    flex-wrap: wrap;
}
.topbar__text {
    opacity: 0.9;
    white-space: nowrap;
}
.topbar__text + .topbar__link::before {
    content: '\00b7';
    margin-right: 6px;
    opacity: 0.5;
}
.topbar__link {
    color: inherit;
    text-decoration: none;
    opacity: 0.85;
    white-space: nowrap;
    transition: opacity 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.topbar__link i { font-size: 11px; }
.topbar__link:hover { opacity: 1; }
.topbar__link + .topbar__link::before {
    content: '\00b7';
    margin-right: 6px;
    opacity: 0.5;
}
@media (max-width: 768px) {
    .topbar { font-size: 11px; }
    .topbar__inner { gap: 4px; padding-top: 5px; padding-bottom: 5px; }
}

/* ========== HEADER ========== */
.header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* -- Logo group (burger + logo) -- */
.header__logo-group {
    display: flex;
    align-items: center;
    gap: 0;
}

/* -- Scroll burger (hidden by default, shown when scrolled) -- */
.header__scroll-burger {
    display: none;
    width: 0;
    overflow: hidden;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    color: var(--text);
    flex-shrink: 0;
    transition: width 0.25s ease, margin 0.25s ease, opacity 0.2s ease;
    opacity: 0;
}
.header__scroll-burger i { font-size: 22px; pointer-events: none; }
.header__scroll-burger:hover { color: var(--primary); }

/* -- Scrolled state: show burger, hide nav -- */
.header--scrolled .header__scroll-burger {
    display: flex;
    width: 40px;
    margin-right: 14px;
    opacity: 1;
}
body.header-scrolled .scroll-sidebar { display: block; }

/* Nav hidden on scroll — no transition to prevent height oscillation */
.header--scrolled .header-nav {
    display: none;
}

/* ========== SCROLL SIDEBAR ========== */
.scroll-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    pointer-events: none;
}
.scroll-sidebar.open {
    pointer-events: auto;
}
.scroll-sidebar__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.scroll-sidebar.open .scroll-sidebar__backdrop {
    opacity: 1;
}
.scroll-sidebar__panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: var(--bg);
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.scroll-sidebar.open .scroll-sidebar__panel {
    transform: translateX(0);
}
.scroll-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.scroll-sidebar__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.scroll-sidebar__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg-surface);
    border-radius: var(--radius);
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.15s, color 0.15s;
}
.scroll-sidebar__close:hover {
    background: var(--primary);
    color: #fff;
}
.scroll-sidebar__links {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.scroll-sidebar__links a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}
.scroll-sidebar__links a:hover {
    color: var(--text);
    background: var(--bg-surface);
}
.scroll-sidebar__links a.active {
    color: var(--primary);
    background: var(--bg-surface);
}
.scroll-sidebar__links a .nav-icon {
    width: 18px;
    text-align: center;
    font-size: 13px;
    opacity: 0.6;
}
.scroll-sidebar__links a:hover .nav-icon,
.scroll-sidebar__links a.active .nav-icon {
    opacity: 1;
}
.scroll-sidebar__child {
    padding-left: 36px !important;
    font-size: 13px !important;
    opacity: 0.85;
}
.scroll-sidebar__child::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 50%;
    width: 6px;
    height: 1px;
    background: var(--text-muted);
    opacity: 0.3;
}
.scroll-sidebar__links .scroll-sidebar__child { position: relative; }

/* Sidebar vtype switcher — pill buttons side by side */
.scroll-sidebar__vtype {
    display: flex;
    gap: 6px;
    padding: 16px 12px 8px;
}
.scroll-sidebar__vtype-pill {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 6px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-surface);
    border: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.scroll-sidebar__vtype-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--pill-color);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.scroll-sidebar__vtype-pill:hover {
    border-color: var(--pill-color);
    color: var(--text);
}
.scroll-sidebar__vtype-pill:hover::before {
    opacity: 0.08;
}
.scroll-sidebar__vtype-pill.active {
    background: var(--pill-color);
    color: #fff;
    border-color: var(--pill-color);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--pill-color) 40%, transparent);
}
.scroll-sidebar__vtype-pill.active::before {
    opacity: 0;
}
.scroll-sidebar__vtype-icon {
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    position: relative;
    z-index: 1;
}
.scroll-sidebar__vtype-pill span {
    position: relative;
    z-index: 1;
}

/* -- Zone 2: Middle bar (Logo / Search / Actions) -- */
.header-mid {
    height: var(--header-mid-height);
}

.header-mid__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    height: 100%;
    gap: 24px;
}

.header-mid__center {
    display: flex;
    justify-content: center;
}

.header__logo {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.header__logo-img {
    height: var(--logo-h);
    max-width: 220px;
    object-fit: contain;
}
.header__logo span { color: var(--primary); }
.header__logo:hover { color: var(--text); }

/* -- Zone 3: Navigation bar -- */
.header-nav {
    height: var(--header-nav-height);
    border-top: 1px solid var(--border-light);
}

.header-nav__inner {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 2px;
}

.header-nav__inner > a,
.header__nav-dropdown > a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
    position: relative;
}

.header-nav__inner > a:hover,
.header-nav__inner > a.active,
.header__nav-dropdown > a:hover,
.header__nav-dropdown > a.active {
    color: var(--text);
    background: var(--bg-surface);
}

.header-nav__inner > a.active,
.header__nav-dropdown > a.active {
    color: var(--primary);
}

/* Nav menu icons (FA) */
.header-nav__inner .nav-icon {
    font-size: 13px;
    opacity: 0.6;
    width: 16px;
    text-align: center;
}
.header-nav__inner a:hover .nav-icon,
.header-nav__inner a.active .nav-icon {
    opacity: 1;
}
.mobile-nav__links .nav-icon {
    font-size: 14px;
    opacity: 0.5;
    width: 18px;
    text-align: center;
    margin-right: 4px;
}

/* Video type dropdown */
.vtype-dd {
    margin-left: auto;
}
.vtype-dd .header__nav-submenu {
    left: auto;
    right: 0;
}
.vtype-dd__trigger {
    cursor: pointer;
}
.vtype-dd__icon {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
}
.vtype-dd__icon--hetero { color: #4a90d9; }
.vtype-dd__icon--gay { color: #b44adb; }
.vtype-dd__icon--hentai { color: #e84393; }
.header__nav-submenu a.active .vtype-dd__icon--hetero,
.vtype-dd__mob-link.active .vtype-dd__icon--hetero { color: #4a90d9; }
.header__nav-submenu a.active .vtype-dd__icon--gay,
.vtype-dd__mob-link.active .vtype-dd__icon--gay { color: #b44adb; }
.header__nav-submenu a.active .vtype-dd__icon--hentai,
.vtype-dd__mob-link.active .vtype-dd__icon--hentai { color: #e84393; }
/* Full-width nav: push switcher to far right */
.header-nav--full .vtype-dd {
    margin-left: auto;
}
/* Mobile: icon + label links */
.vtype-dd__mob-link {
    display: flex;
    align-items: center;
    gap: 10px;
}
.vtype-dd__mob-link .vtype-dd__icon {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

/* Nav dropdowns (sub-menus) */
.header__nav-dropdown {
    position: relative;
}
.header__nav-dropdown > a .nav-chevron {
    font-size: 9px;
    opacity: 0.5;
    margin-left: 4px;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
}
.header__nav-dropdown:hover > a .nav-chevron {
    transform: rotate(180deg);
    opacity: 0.85;
}
.header__nav-submenu {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    min-width: 100%;
    width: max-content;
    padding: 0 0 4px 0;
    z-index: 100;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    overflow: hidden;
}
.header__nav-dropdown:hover .header__nav-submenu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}
/* Active indicator line under tab when dropdown is open */
.header__nav-dropdown > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}
.header__nav-dropdown:hover > a::after {
    transform: scaleX(1);
}
.header__nav-submenu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: color 0.12s, background 0.12s;
}
.header__nav-submenu a:hover {
    background: var(--bg-surface);
    color: var(--text);
}
.header__nav-submenu a.active {
    color: var(--primary);
    background: var(--bg-surface);
}

/* Mobile nav sub-items */
.mobile-nav__links .mobile-nav__child {
    padding-left: 44px;
    font-size: 14px;
    opacity: 0.75;
    position: relative;
}
.mobile-nav__links .mobile-nav__child::before {
    content: '';
    position: absolute;
    left: 28px;
    top: 50%;
    width: 6px;
    height: 1px;
    background: var(--text-muted);
    opacity: 0.3;
}

[dir="rtl"] .header__nav-submenu { left: auto; right: 0; }
[dir="rtl"] .mobile-nav__links .mobile-nav__child { padding-left: 12px; padding-right: 44px; }
[dir="rtl"] .mobile-nav__links .mobile-nav__child::before { left: auto; right: 28px; }

/* -- Mega-menu (categories) -- */
.header-nav__inner { position: relative; }
.header__nav-dropdown--mega { position: static; }
.header__mega-menu {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: 0 8px 20px -4px rgba(0,0,0,0.15);
    padding: 0;
    z-index: 100;
    overflow: hidden;
    transform: translateY(-6px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}
/* Full-width nav: inset by container padding so mega-menu aligns with nav items */
.header-nav--full .header__mega-menu {
    left: var(--container-padding, 24px);
    right: var(--container-padding, 24px);
}
.header__nav-dropdown--mega:hover .header__mega-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}
/* Two-column layout */
.mega-menu__wrap {
    display: flex;
    min-height: 280px;
}
/* Left sidebar */
.mega-menu__sidebar {
    flex: 0 0 260px;
    padding: 24px 20px 24px 20px;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}
.mega-menu__title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: normal;
    color: var(--text);
    margin: 0 12px 16px;
    padding: 0 0 12px;
    text-align: left;
    border-bottom: 2px solid var(--primary);
}
.mega-menu__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.mega-menu__nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--radius);
    align-self: flex-start;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}
.mega-menu__nav-link:hover {
    color: var(--text);
    background: var(--bg-surface);
}
.mega-menu__nav-link.active {
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.08);
    font-weight: 600;
}
.mega-menu__nav-icon {
    width: 16px;
    font-size: 12px;
    text-align: center;
    flex-shrink: 0;
}
.mega-menu__nav-link.active .mega-menu__nav-icon {
    color: var(--primary);
}
.mega-menu__nav-arrow {
    margin-left: auto;
    font-size: 10px;
    opacity: 0.4;
    transition: transform 0.15s, opacity 0.15s;
}
.mega-menu__nav-link:hover .mega-menu__nav-arrow {
    transform: translateX(2px);
    opacity: 0.8;
}
/* Right content */
.mega-menu__content {
    flex: 1;
    min-width: 0;
    padding: 20px 20px 20px 24px;
}
.mega-menu__heading {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: left;
    padding-bottom: 12px;
    margin: 0 0 14px;
    border-bottom: 2px solid var(--border);
}
.mega-menu__grid {
    display: grid;
    grid-template-columns: repeat(var(--cat-cols), 1fr);
    gap: var(--card-gap, 4px);
    overflow: hidden;
    grid-template-rows: 1fr;
    grid-auto-rows: 0;
}
.mega-menu__heading--spaced {
    margin-top: 20px;
}
/* When CTR is off: show 2 rows */
.mega-menu__content--2rows .mega-menu__grid {
    grid-template-rows: 1fr 1fr;
    grid-auto-rows: 0;
}
.mega-menu__item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/10;
    background: var(--bg-dark);
    display: block;
}
.mega-menu__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s, opacity 0.3s;
}
@media (hover: hover) {
    .mega-menu__item:hover img {
        transform: scale(1.06);
        opacity: 0.85;
    }
}
.mega-menu__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-surface);
}
.mega-menu__name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 18px 8px 5px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mega-menu__count {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    line-height: 1.3;
}

/* -- Full-width navigation variant -- */
.header-nav--full .header-nav__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding, 24px);
    align-items: stretch;
    gap: 0;
}
.header-nav--full .header-nav__inner > a,
.header-nav--full .header__nav-dropdown:not(.vtype-dd) {
    flex: 1;
    justify-content: center;
    text-align: center;
}
.header-nav--full .header__nav-dropdown {
    display: flex;
}
.header-nav--full .header-nav__inner > a,
.header-nav--full .header-nav__inner > .header__nav-dropdown > a {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    padding-top: 0;
    padding-bottom: 0;
    width: 100%;
}
.header__search {
    position: relative;
    width: 100%;
    max-width: 480px;
}

.header__search input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    background: var(--bg-surface);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.header__search input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.header__search svg,
.header__search > i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    font-size: 14px;
}

.header__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    justify-self: end;
}

/* Theme icon visibility (used by mobile nav) */
.header__theme-icon--dark { display: none; }
[data-theme="dark"] .header__theme-icon--light { display: none; }
[data-theme="dark"] .header__theme-icon--dark { display: inline; }

/* ========== UNIFIED DROPDOWN (udd__) ========== */
.udd { position: relative; flex-shrink: 0; }

.udd__trigger {
    display: flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--text);
    cursor: pointer;
    padding: 0;
    font-size: 32px;
    transition: background 0.15s, color 0.15s;
}
.udd__trigger:hover {
    color: var(--primary);
}
.udd__trigger--auth { color: var(--primary); }

.udd__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    overflow: hidden;
    animation: uddFadeIn 0.15s ease;
}
.udd.open .udd__dropdown { display: block; }

@keyframes uddFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Header */
.udd__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.udd__avatar {
    font-size: 28px;
    color: var(--text-muted);
    line-height: 1;
}
.udd__username {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sections */
.udd__section {
    padding: 6px;
    border-bottom: 1px solid var(--border);
}
.udd__section:last-child { border-bottom: none; }

/* Links */
.udd__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-muted);
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}
.udd__link i {
    width: 16px;
    text-align: center;
    font-size: 14px;
    opacity: 0.6;
    flex-shrink: 0;
}
.udd__link:hover {
    background: var(--bg-surface);
    color: var(--text);
}
.udd__link:hover i { opacity: 0.9; }

/* Danger link (logout) */
.udd__link--danger { color: var(--danger); }
.udd__link--danger i { color: var(--danger); opacity: 0.7; }
.udd__link--danger:hover { background: rgba(220,38,38,0.08); color: var(--danger); }

/* Auth buttons (logged out) */
.udd__auth-buttons {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
}
.udd__btn {
    flex: 1;
    height: 34px;
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}
.udd__btn:hover { opacity: 0.85; }
.udd__btn--primary {
    background: var(--primary);
    color: #fff;
}
.udd__btn--outline {
    background: var(--bg-surface);
    color: var(--text);
    border: 1px solid var(--border);
}

/* Appearance row */
.udd__row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
}
.udd__row > i {
    font-size: 14px;
    color: var(--text-muted);
    opacity: 0.6;
    width: 16px;
    text-align: center;
}
.udd__row-label {
    font-size: 13px;
    color: var(--text-muted);
    flex: 1;
}

/* Segmented theme toggle */
.udd__seg {
    position: relative;
    display: flex;
    background: var(--bg-surface);
    border-radius: 8px;
    padding: 2px;
    gap: 0;
}
.udd__seg-btn {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s;
}
.udd__seg-btn.active { color: var(--primary); }
.udd__seg-indicator {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 32px;
    height: 28px;
    background: var(--bg-card);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
    z-index: 0;
}
.udd__seg[data-active="dark"] .udd__seg-indicator {
    transform: translateX(32px);
}
[dir="rtl"] .udd__seg[data-active="dark"] .udd__seg-indicator {
    transform: translateX(-32px);
}

/* Section label */
.udd__section-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    padding: 6px 10px 4px;
}

/* Language grid */
.udd__lang-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    max-height: 200px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.udd__lang-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: 11px;
    color: var(--text-muted);
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.udd__lang-item:hover {
    background: var(--bg-surface);
    color: var(--text);
}
.udd__lang-item.active {
    color: var(--primary);
    font-weight: 600;
    background: var(--primary-light);
}
.udd__flag {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

/* Logout section */
.udd__section--logout { padding: 4px 6px; }

/* Mobile icons group */
.header__mobile-icons {
    display: none;
    align-items: center;
    margin-left: auto;
}

/* Mobile menu toggle */
.header__burger {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius);
    background: none;
    cursor: pointer;
    padding: 0;
    color: var(--text);
    flex-shrink: 0;
    transition: background 0.15s;
}
.header__burger:hover { background: var(--bg-surface); }

.header__burger svg,
.header__burger i { pointer-events: none; width: 22px; height: 22px; font-size: 22px; }

/* ========== MOBILE NAV SIDEBAR ========== */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1002;
    pointer-events: none;
}

.mobile-nav.open { pointer-events: auto; }

.mobile-nav__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mobile-nav.open .mobile-nav__backdrop { opacity: 1; }

.mobile-nav__panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    max-width: 85vw;
    height: 100%;
    background: var(--bg);
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.mobile-nav.open .mobile-nav__panel { transform: translateX(0); }

/* User header */
.mobile-nav__user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.mobile-nav__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.mobile-nav__user-info { flex: 1; min-width: 0; }
.mobile-nav__user-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mobile-nav__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius);
    background: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.15s;
}
.mobile-nav__close:hover {
    background: var(--bg-surface);
    color: var(--text);
}

/* Search */
.mobile-nav__search-wrap { padding: 12px 12px 4px; flex-shrink: 0; }
.mobile-nav__search { position: relative; }
.mobile-nav__search input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-surface);
    color: var(--text);
}
.mobile-nav__search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.mobile-nav__search > i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
    font-size: 14px;
}

/* Video type pills */
.mobile-nav__vtype {
    display: flex;
    gap: 6px;
    padding: 12px 12px 4px;
    flex-shrink: 0;
}
.mobile-nav__vtype-pill {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
}
.mobile-nav__vtype-pill::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--pill-color);
    opacity: 0;
    transition: opacity 0.2s;
}
.mobile-nav__vtype-pill:hover {
    border-color: var(--pill-color);
    color: var(--text);
}
.mobile-nav__vtype-pill:hover::before { opacity: 0.08; }
.mobile-nav__vtype-pill.active {
    background: var(--pill-color);
    color: #fff;
    border-color: var(--pill-color);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--pill-color) 40%, transparent);
}
.mobile-nav__vtype-pill.active::before { opacity: 0; }
.mobile-nav__vtype-icon {
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    position: relative;
    z-index: 1;
}
.mobile-nav__vtype-pill span { position: relative; z-index: 1; }

/* Nav links */
.mobile-nav__links {
    padding: 8px 8px 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.mobile-nav__links + .mobile-nav__links {
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 4px;
}
/* Allow scrolling for all nav content */
.mobile-nav__panel > nav.mobile-nav__links { flex: 1; overflow-y: auto; }

.mobile-nav__section-label {
    padding: 10px 12px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
}

.mobile-nav__links a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}
.mobile-nav__links a:hover { color: var(--text); background: var(--bg-surface); }
.mobile-nav__links a.active { color: var(--primary); background: var(--primary-light); }

.mobile-nav__icon {
    width: 18px;
    text-align: center;
    font-size: 15px;
    opacity: 0.55;
    flex-shrink: 0;
}
.mobile-nav__links a:hover .mobile-nav__icon,
.mobile-nav__links a.active .mobile-nav__icon { opacity: 1; }

.mobile-nav__logout { color: var(--danger, #ef4444) !important; }
.mobile-nav__logout .mobile-nav__icon { color: var(--danger, #ef4444); }

/* Bottom actions (dark mode + lang) */
.mobile-nav__bottom {
    border-top: 1px solid var(--border);
    padding: 8px;
    flex-shrink: 0;
    margin-top: auto;
}

.mobile-nav__toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: var(--radius);
    background: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.mobile-nav__toggle-row:hover { background: var(--bg-surface); color: var(--text); }
.mobile-nav__toggle-row i { width: 18px; text-align: center; font-size: 15px; opacity: 0.55; }

.mobile-nav__lang-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 4px 0;
}
.mobile-nav__lang-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-muted);
    transition: all 0.15s;
}
.mobile-nav__lang-item:hover { background: var(--bg-surface); color: var(--text); }
.mobile-nav__lang-item.active { color: var(--primary); font-weight: 600; }
.mobile-nav__lang-item .header__flag { width: 16px; height: 16px; border-radius: 2px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover { text-decoration: none; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-outline { border-color: var(--border); color: var(--text-muted); background: var(--bg); }
.btn-outline:hover { border-color: var(--text-muted); color: var(--text); }

.btn-sm { padding: 5px 12px; font-size: 13px; }

.btn-danger { background: var(--danger); color: #fff; }

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    cursor: pointer;
}

.btn-icon:hover { background: var(--bg-surface); color: var(--text); }
.btn-icon.active { color: var(--primary); border-color: var(--primary); }

/* ========== SORT TABS ========== */
.sort-tabs {
    display: flex;
    gap: 4px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sort-tabs a {
    padding: 8px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.15s;
    white-space: nowrap;
}

.sort-tabs a:hover { color: var(--text); background: var(--bg-surface); }
.sort-tabs a.active { color: var(--bg); background: var(--text); }

/* ========== VIDEO GRID ========== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols), 1fr);
    gap: var(--card-gap, 4px);
}

/* Grid column classes — set on <body> by admin setting */
body.cols-4 { --grid-cols: 4; }
body.cols-5 { --grid-cols: 5; }
body.cols-6 { --grid-cols: 6; }
body.cat-3 { --cat-cols: 3; }
body.cat-4 { --cat-cols: 4; }
body.cat-5 { --cat-cols: 5; }
body.cat-6 { --cat-cols: 6; }
body.perf-4 { --perf-cols: 4; }
body.perf-5 { --perf-cols: 5; }
body.perf-6 { --perf-cols: 6; }
body.perf-7 { --perf-cols: 7; }
body.studio-4 { --studio-cols: 4; }
body.studio-5 { --studio-cols: 5; }
body.studio-6 { --studio-cols: 6; }
body.studio-7 { --studio-cols: 7; }

/* Video Card */
.video-card {
    background: var(--bg-card);
    border-radius: var(--card-radius, var(--radius-lg));
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-light);
}

@media (hover: hover) {
    .video-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }
}

.video-card__thumb {
    position: relative;
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #1e293b;
}

.video-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

@media (hover: hover) {
    .video-card:hover .video-card__thumb img {
        transform: scale(1.05);
    }
    body.no-thumb-hover .video-card:hover .video-card__thumb img {
        transform: none;
    }
}

/* Play icon overlay */
.video-card__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    opacity: 0.75;
    transition: opacity 0.25s;
    pointer-events: none;
}

.video-card__play svg {
    width: 44px;
    height: 44px;
    color: #fff;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

@media (hover: hover) {
    .video-card:hover .video-card__play { opacity: 0; }
}
.video-card__thumb.is-previewing .video-card__play {
    opacity: 0;
}

/* Timeline sprite (hover-to-scrub) */
.video-card__sprite {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    opacity: 0;
    z-index: 2;
    transition: opacity 0.3s;
    pointer-events: none;
}

.video-card__sprite.is-playing {
    opacity: 1;
}

/* Preview video (hover-to-play) */
.video-card__preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    z-index: 2;
    transition: opacity 0.3s;
    pointer-events: none;
}

.video-card__preview.is-playing {
    opacity: 1;
}

/* Hide duration badge and suppress zoom when preview is playing */
.video-card__thumb.is-previewing .video-card__duration {
    opacity: 0;
    transition: opacity 0.3s;
}

.video-card__thumb.is-previewing img {
    transform: none !important;
}

/* Progress bar under the preview */
.video-card__preview-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    z-index: 2;
    transition: width 0.2s linear;
    border-radius: 0 0 0 var(--card-radius, var(--radius-lg));
}

.video-card__duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.video-card__info {
    padding: 12px;
}

.video-card__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.video-card__title--clamp2 {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.video-card__title a { color: var(--text); }
.video-card__title a:hover { color: var(--primary); }

.video-card__meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.video-card__meta span:last-child {
    font-size: 11px;
    opacity: 0.8;
}

/* ========== VIDEO PAGE ========== */
.video-page {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 28px;
    padding: 24px 0;
    align-items: start;
}
.video-page--full {
    grid-template-columns: 1fr;
}

.video-player {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/9;
}
.video-player iframe {
    width: 100%;
    height: 100%;
    display: block;
}

/* Info section */
.video-info {
    padding: 16px 4px 0;
}

.video-info__title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 14px;
}

.video-info__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.video-info__stats {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.video-info__stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}

.video-info__stat svg { opacity: 0.6; flex-shrink: 0; }

.video-info__actions {
    display: flex;
    gap: 8px;
}



/* Vote buttons */
.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    transition: all 0.15s;
}

.vote-btn:hover { border-color: var(--text-muted); color: var(--text); }
.vote-btn.active.like { color: var(--success); border-color: var(--success); background: #f0fdf4; }
.vote-btn.active.dislike { color: var(--danger); border-color: var(--danger); background: #fef2f2; }

/* Detail sections (performers, studios, categories, tags) */
.video-detail-section {
    padding: 14px 0;
    border-bottom: 1px solid var(--border-light);
}

.video-detail-section:first-of-type {
    border-top: none;
}

.video-detail-block {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.video-detail-block:last-child {
    margin-bottom: 0;
}

.video-detail-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    min-width: 100px;
    flex-shrink: 0;
}

.video-detail-label svg { opacity: 0.5; }

/* Performers */
.video-performers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.performer-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px 5px 5px;
    border-radius: 9999px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    transition: all 0.15s;
}

.performer-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.performer-chip img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.performer-chip__initial {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

/* Studios */
.video-studios {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.studio-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    transition: all 0.15s;
}

.studio-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* Categories */
.video-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Tags */
.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-link {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 12px;
    background: var(--bg-surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: all 0.15s;
}

.tag-link:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

/* Detail overflow "+N" button */
.detail-overflow { align-items: center; }
.detail-overflow__more {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 4px 12px; border-radius: 9999px; font-size: 12px; font-weight: 600;
    background: var(--primary); color: #fff; border: 1px solid var(--primary);
    cursor: pointer; transition: all 0.15s; min-width: 32px;
}
.detail-overflow__more:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* Embed Code Box */
.video-embed-box {
    padding: 8px 4px;
    border-bottom: 1px solid var(--border-light);
}
.video-embed-box__inner {
    display: flex;
    gap: 6px;
    align-items: center;
}
.video-embed-box__input {
    flex: 1;
    padding: 7px 10px;
    font-size: 11px;
    font-family: monospace;
    border: 1px solid var(--border, #333);
    border-radius: 6px;
    background: var(--bg-surface, #1a1a2e);
    color: var(--text-muted, #888);
    outline: none;
    cursor: text;
}
.video-embed-box__copy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border, #333);
    border-radius: 6px;
    background: var(--bg-surface, #1a1a2e);
    color: var(--text-muted, #888);
    cursor: pointer;
    flex-shrink: 0;
}
.video-embed-box__copy:hover { color: var(--text); background: var(--bg-card); }

/* Description */
.video-description {
    padding: 14px 4px;
    border-bottom: 1px solid var(--border-light);
}

.video-description__label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.video-description__text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary, var(--text-muted));
    margin: 0;
}

/* Comments login */
.comments__login {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 14px 18px;
    font-size: 14px;
    color: var(--text-muted);
    background: var(--bg-surface);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
}

.comments__login svg { flex-shrink: 0; opacity: 0.5; }
.comments__login a { font-weight: 600; }

/* Sidebar related */
.video-sidebar h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--card-gap, 4px);
}

.related-grid .video-card__info {
    padding: 8px 10px;
}

.related-grid .video-card__title {
    font-size: 12px;
    margin-bottom: 2px;
}

.related-grid .video-card__meta {
    font-size: 11px;
}

/* ========== COMMENTS ========== */
.comments {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.comments__header {
    margin-bottom: 14px;
}

.comments__header h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
}

.comments__header h3 svg { color: var(--text-muted); }

/* Comment form — YouTube-style with avatar */
.comment-form {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    align-items: flex-start;
}

.comment-form__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
}

.comment-form__input {
    flex: 1;
}

.comment-form textarea {
    width: 100%;
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 24px;
    overflow: hidden;
    background: transparent;
    color: var(--text);
    transition: border-color 0.2s;
}

.comment-form textarea:focus {
    outline: none;
    border-bottom-color: var(--primary);
}

.comment-form__actions {
    display: none;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.comment-form.focused .comment-form__actions {
    display: flex;
}

.comment-form__cancel {
    padding: 8px 16px;
    border: none;
    background: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 20px;
    transition: background 0.15s;
}

.comment-form__cancel:hover { background: var(--bg-surface); }

.comment-form__submit {
    padding: 8px 16px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 20px;
    transition: background 0.15s;
}

.comment-form__submit:hover { background: var(--primary-dark); }

/* Empty state */
.comments__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 24px 16px;
    color: var(--text-light);
    text-align: center;
}

.comments__empty svg { opacity: 0.3; }
.comments__empty p { font-size: 14px; }

/* Comment items */
.comment {
    display: flex;
    gap: 10px;
    padding: 10px 0;
}

.comment--hidden { display: none !important; }

.comments__list > .comment { border-bottom: 1px solid var(--border-light); }
.comments__list > .comment:last-child { border-bottom: none; }

.comment__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--border-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 14px;
    flex-shrink: 0;
}

.comment__avatar--sm {
    width: 26px;
    height: 26px;
    font-size: 11px;
}

.comment__body { flex: 1; min-width: 0; }

.comment__header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 1px;
}

.comment__author {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}

.comment__date {
    font-size: 11px;
    color: var(--text-light);
}

.comment__text {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
    word-wrap: break-word;
}

.comment__text--clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.comment__text--clamped.comment__text--expanded {
    -webkit-line-clamp: unset;
    display: block;
}

.comment__text-more {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 0;
    margin-top: 4px;
    display: block;
}

.comment__text-more:hover { color: var(--text); }

/* View more comments button */
.comments__view-more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 8px;
}

.comments__view-more:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

/* Replies */
.comment__replies {
    margin-top: 4px;
    margin-left: 16px;
    padding-left: 12px;
    border-left: 2px solid var(--border-light);
}

.comment--reply { padding: 8px 0; }
.comment--reply:last-child { padding-bottom: 0; }

/* ========== CATEGORIES PAGE ========== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(var(--cat-cols), 1fr);
    gap: var(--card-gap, 4px);
}

.category-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16/10;
    background: var(--bg-dark);
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s;
}

@media (hover: hover) { .category-card:hover img { opacity: 0.8; transform: scale(1.05); } }

.category-card__name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-card__count {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px 8px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius);
    line-height: 1.4;
}

.category-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-darker, #1e293b);
    color: var(--text-muted);
    font-size: 48px;
    font-weight: 700;
}

/* ========== TAGS PAGE ========== */

/* Header row: title left, search right */
.tags-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 0 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.tags-header__left {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.tags-header__title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.tags-header__count {
    font-size: 14px;
    color: var(--text-muted);
    white-space: nowrap;
}

.tags-header__right {
    flex-shrink: 0;
    width: 280px;
}

/* Tag search */
.tag-search__wrapper {
    position: relative;
}

.tag-search__icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.tag-search__input {
    width: 100%;
    padding: 10px 16px 10px 42px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    font-size: 14px;
    color: var(--text);
    transition: border-color 0.15s;
}

.tag-search__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.tag-search__input::placeholder {
    color: var(--text-muted);
}

/* Sticky alphabet bar */
.tag-alphabet {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px 0;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 16px;
}

.tag-alphabet__letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 4px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-surface);
    text-decoration: none;
    transition: all 0.15s;
}

a.tag-alphabet__letter:hover {
    color: var(--text);
    background: var(--border);
}

.tag-alphabet__letter--disabled {
    opacity: 0.25;
    cursor: default;
    pointer-events: none;
}

/* 3-column grid of letter sections */
.tag-sections-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding-bottom: 32px;
}

.tag-section {
    background: var(--bg-surface);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border-light);
}

.tag-section__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.tag-section__letter {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.tag-section__count {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--border-light);
    padding: 2px 8px;
    border-radius: 10px;
}

.tag-section__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-section .tag-link {
    font-size: 13px;
    padding: 4px 12px;
}

/* Tags page — tablet */
@media (max-width: 900px) {
    .tag-sections-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ========== PERFORMERS PAGE ========== */
.performer-grid {
    display: grid;
    grid-template-columns: repeat(var(--perf-cols), 1fr);
    gap: 16px;
}

.studio-grid {
    display: grid;
    grid-template-columns: repeat(var(--studio-cols), 1fr);
    gap: var(--card-gap, 4px);
}

/* Performer cards — rounded square image with overlay text */
.performer-card {
    position: relative;
    display: block;
    text-decoration: none;
    width: 100%;
    padding-bottom: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-dark);
    box-shadow: 0 0 0 3px var(--border, rgba(255,255,255,0.12));
    transition: box-shadow 0.3s;
}
@media (hover: hover) {
    .performer-card:hover {
        box-shadow: 0 0 0 3px var(--primary);
    }
}

.performer-card__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.88);
    transition: transform 0.5s, filter 0.3s;
}
@media (hover: hover) {
    .performer-card:hover .performer-card__photo {
        transform: scale(1.1);
        filter: brightness(0.75);
    }
}

.performer-card__photo--placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-darker, #1e293b);
    color: var(--text-muted);
    font-size: 42px;
    font-weight: 700;
}

.performer-card__overlay {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.35) 45%, transparent 65%);
    pointer-events: none;
}

.performer-card__info {
    position: absolute;
    bottom: 12%;
    left: 8%;
    right: 8%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
}

.performer-card__name {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-shadow: 0 2px 6px rgba(0,0,0,0.7);
    line-height: 1.3;
}

.performer-card__videos {
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    line-height: 1.3;
}

.performer-card__views {
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    line-height: 1.3;
}

/* Studio cards — rounded square style (matches performer cards) */
.studio-card {
    position: relative;
    display: block;
    text-decoration: none;
    width: 100%;
    padding-bottom: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-dark);
    box-shadow: 0 0 0 3px var(--border, rgba(255,255,255,0.12));
    transition: box-shadow 0.3s;
}
@media (hover: hover) {
    .studio-card:hover {
        box-shadow: 0 0 0 3px var(--primary);
    }
}

.studio-card__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.88);
    transition: transform 0.5s, filter 0.3s;
}
@media (hover: hover) {
    .studio-card:hover .studio-card__photo {
        transform: scale(1.1);
        filter: brightness(0.75);
    }
}

.studio-card__photo--placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-darker, #1e293b);
    color: var(--text-muted);
    font-size: 42px;
    font-weight: 700;
}

.studio-card__overlay {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.35) 45%, transparent 65%);
    pointer-events: none;
}

.studio-card__info {
    position: absolute;
    bottom: 12%;
    left: 8%;
    right: 8%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
}

.studio-card__name {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-shadow: 0 2px 6px rgba(0,0,0,0.7);
    line-height: 1.3;
}

.studio-card__videos {
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    line-height: 1.3;
}

.studio-card__views {
    color: rgba(255,255,255,0.7);
    font-size: 11px;
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    line-height: 1.3;
}

/* ========== PERFORMER / STUDIO PROFILE ========== */
.performer-profile {
    display: flex;
    gap: 28px;
    padding: 28px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    margin-top: 28px;
    margin-bottom: 24px;
    align-items: flex-start;
}

.performer-profile__photo-wrap {
    flex-shrink: 0;
}

.performer-profile__photo {
    width: 160px;
    height: 160px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    box-shadow: 0 0 0 4px var(--border, rgba(255,255,255,0.12));
}

.performer-profile__photo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-darker, #1e293b);
    color: var(--text-muted);
    font-size: 52px;
}

.performer-profile__info { flex: 1; min-width: 0; }

.performer-profile__name {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
}

.performer-profile__bio {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.performer-profile__stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.performer-profile__stat {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: var(--radius);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

.performer-profile__stat i {
    color: var(--primary);
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.performer-profile__links {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.performer-profile__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius);
    background: var(--bg-surface);
    color: var(--primary);
    font-size: 13px;
    border: 1px solid var(--border);
    transition: border-color 0.2s, background 0.2s;
    text-decoration: none;
}

.performer-profile__link:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb, 250,0,62), 0.06);
}

.performer-profile__link i {
    font-size: 12px;
}

/* ========== SEARCH ========== */
.search-page__form {
    max-width: 600px;
    margin: 24px auto;
    position: relative;
}

.search-page__input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 16px;
    background: var(--bg);
    color: var(--text);
}

.search-page__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.search-page__form svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-results__count {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ========== AUTH MODAL ========== */
.auth-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-modal.open { display: flex; }

.auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s;
}

.auth-modal.open .auth-modal__backdrop { opacity: 1; }

.auth-modal__card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: scale(0.92) translateY(20px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
}

.auth-modal.open .auth-modal__card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.auth-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--bg-surface);
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    z-index: 1;
}

.auth-modal__close:hover { background: var(--border); color: var(--text); }

.auth-modal__header {
    padding: 32px 32px 0;
    text-align: center;
}

.auth-modal__logo {
    margin: 0 auto 16px;
    text-align: center;
}
.auth-modal__logo img {
    max-height: 40px;
    max-width: 200px;
    object-fit: contain;
}
.auth-modal__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 28px;
}

.auth-modal__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.auth-modal__subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

/* Tabs */
.auth-tabs {
    display: flex;
    margin: 24px 32px 0;
    background: var(--bg-surface);
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
}

.auth-tabs__btn {
    flex: 1;
    padding: 10px 8px;
    background: none;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.auth-tabs__btn:hover { color: var(--text); }

.auth-tabs__btn.active {
    background: var(--bg-card);
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Panels */
.auth-modal__body { padding: 24px 32px 32px; }

.auth-panel { display: none; }
.auth-panel.active { display: block; }

.auth-panel__desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Form elements inside modal */
.auth-modal .form-group { margin-bottom: 16px; }

.auth-modal .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.auth-modal .form-group input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    color: var(--text);
    background: var(--bg-surface);
    transition: all 0.2s;
}

.auth-modal .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: var(--bg);
}

.auth-modal .form-group input::placeholder {
    color: var(--text-light);
}

.auth-modal .btn-submit {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

.auth-modal .btn-submit:hover { background: var(--primary-dark); }

.auth-modal .btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-forgot-link {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
}
.auth-forgot-link:hover { color: var(--primary); }

/* Messages */
.auth-msg {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    display: none;
    line-height: 1.4;
}

.auth-msg.error {
    display: block;
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.auth-msg.success {
    display: block;
    background: #f0fdf4;
    color: var(--success);
    border: 1px solid #bbf7d0;
}

/* Fallback (form-error / form-success used elsewhere) */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-error {
    padding: 10px 14px;
    background: #fee2e2;
    color: var(--danger);
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
}

.form-success {
    padding: 10px 14px;
    background: #d1fae5;
    color: var(--success);
    border-radius: var(--radius);
    font-size: 14px;
    margin-bottom: 16px;
}

/* Legacy auth page (profile) */
.auth-page { max-width: 440px; margin: 48px auto; }

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
    padding: 32px;
}

.auth-card__title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 24px;
}

.auth-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a { font-weight: 500; }

/* ========== USER PAGES ========== */
.user-page__header {
    margin-bottom: 24px;
}

.user-page__title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.user-page__subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

/* ========== PROFILE PAGE ========== */
.profile-page {
    width: 100%;
    padding: 24px 0;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.profile-header__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-header__name {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.profile-header__meta {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 2px;
}

.profile-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.profile-tabs::-webkit-scrollbar { display: none; }

.profile-tabs__btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all 0.15s;
    text-decoration: none;
}

.profile-tabs__btn:hover {
    color: var(--text);
}

.profile-tabs__btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.profile-tabs__btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.6;
}

.profile-tabs__btn.active svg {
    opacity: 1;
}

.profile-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    padding: 32px;
    max-width: 560px;
}

.profile-content__subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.profile-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.profile-history-header .profile-content__subtitle {
    margin: 0;
}

@media (max-width: 768px) {
    .profile-page { padding: 16px 0; }
    .profile-header { gap: 12px; margin-bottom: 16px; }
    .profile-header__avatar { width: 48px; height: 48px; font-size: 20px; }
    .profile-header__name { font-size: 20px; }
    .profile-tabs { justify-content: center; }
    .profile-tabs__label { display: none; }
    .profile-tabs__btn { padding: 10px 16px; }
    .profile-tabs__btn svg { width: 20px; height: 20px; opacity: 0.7; }
    .profile-tabs__btn.active svg { opacity: 1; }
    .profile-card { padding: 24px; max-width: 100%; }
}

@media (max-width: 480px) {
    .profile-page { padding: 8px 0; }
    .profile-header { gap: 10px; margin-bottom: 12px; }
    .profile-header__avatar { width: 40px; height: 40px; font-size: 18px; }
    .profile-header__name { font-size: 18px; }
    .profile-header__meta { font-size: 12px; }
    .profile-tabs { margin-bottom: 16px; }
    .profile-tabs__btn { padding: 10px 14px; }
    .profile-tabs__btn svg { width: 18px; height: 18px; }
    .profile-card { padding: 16px; }
    .profile-card .form-group label { font-size: 13px; }
    .profile-card .form-group input { padding: 9px 12px; font-size: 14px; }
    .profile-content__subtitle { font-size: 13px; margin-bottom: 12px; }
}

/* ========== STATIC PAGE ========== */
.static-page {
    max-width: 100%;
    margin: 0 auto;
    padding: 40px 48px 48px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
}
.static-page__header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-light);
}
.static-page__title {
    font-size: 30px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}
@media (max-width: 768px) {
    .static-page { padding: 24px 20px 28px; margin: 0 auto; }
    .static-page__title { font-size: 24px; }
}

/* ========== RICH CONTENT (TinyMCE output) ========== */
.rich-content { font-size: 15px; color: var(--text); }
.rich-content h1 { font-size: 26px; font-weight: 700; margin: 32px 0 14px; color: var(--text); }
.rich-content h2 { font-size: 21px; font-weight: 700; margin: 28px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-light); color: var(--text); }
.rich-content h3 { font-size: 17px; font-weight: 600; margin: 24px 0 10px; color: var(--text); }
.rich-content h4 { font-size: 15px; font-weight: 600; margin: 20px 0 8px; color: var(--text); }
.rich-content h2:first-child, .rich-content h3:first-child { margin-top: 0; }
.rich-content p { margin-bottom: 1em; line-height: 1.75; }
.rich-content ul, .rich-content ol { padding-left: 24px; margin: 12px 0; }
.rich-content ul { list-style: disc; }
.rich-content ol { list-style: decimal; }
.rich-content li { margin-bottom: 6px; line-height: 1.65; }
.rich-content li strong { color: var(--text); }
.rich-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; transition: color 0.15s; }
.rich-content a:hover { color: var(--primary-dark); }
.rich-content strong { font-weight: 600; }
.rich-content img { max-width: 100%; height: auto; border-radius: var(--radius, 8px); margin: 16px 0; }
.rich-content table { width: 100%; border-collapse: collapse; margin: 20px 0; border-radius: var(--radius, 8px); overflow: hidden; }
.rich-content th, .rich-content td { border: 1px solid var(--border-light, #e5e7eb); padding: 10px 14px; text-align: left; font-size: 14px; }
.rich-content th { background: var(--bg-surface, #f8fafc); font-weight: 600; }
.rich-content blockquote { border-left: 4px solid var(--primary, #3b82f6); padding: 14px 20px; margin: 20px 0; color: var(--text-muted, #6b7280); background: var(--bg-surface, #f8fafc); border-radius: 0 var(--radius, 8px) var(--radius, 8px) 0; }
.rich-content blockquote p:last-child { margin-bottom: 0; }
.rich-content pre { background: #1e293b; color: #e2e8f0; padding: 16px 20px; border-radius: var(--radius, 8px); overflow-x: auto; margin: 20px 0; font-size: 13px; line-height: 1.6; }
.rich-content code { background: var(--bg-surface, #f1f5f9); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
.rich-content pre code { background: transparent; padding: 0; border-radius: 0; font-size: inherit; }
.rich-content hr { border: none; border-top: 1px solid var(--border-light, #e5e7eb); margin: 32px 0; }
.rich-content figure { margin: 20px 0; }
.rich-content figcaption { font-size: 13px; color: var(--text-muted, #6b7280); text-align: center; margin-top: 8px; }
.rich-content p[style*="text-align:center"] { font-size: 14px; color: var(--text-muted); }
.rich-content p[style*="text-align:center"] a { color: var(--text-muted); text-decoration: none; font-weight: 500; }
.rich-content p[style*="text-align:center"] a:hover { color: var(--primary); }

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 32px 0;
    flex-wrap: wrap;
}

.pagination__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: all 0.15s;
}

@media (hover: hover) { .pagination__link:hover { color: var(--primary); border-color: var(--primary); } }

.pagination__link--active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination__dots {
    padding: 0 8px;
    color: var(--text-light);
}

/* ========== FOOTER ========== */
.footer {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 48px 0 24px;
    margin-top: 48px;
}
[data-theme="dark"] .footer {
    border-top: 1px solid var(--border);
}

.footer__inner {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
}

.footer__cols-1 .footer__inner { grid-template-columns: 1fr; }
.footer__cols-2 .footer__inner { grid-template-columns: 1fr 1fr; }
.footer__cols-3 .footer__inner { grid-template-columns: 1fr 1fr 1fr; }
.footer__cols-4 .footer__inner { grid-template-columns: 2fr 1fr 1fr 1fr; }

.footer__text { font-size: 13px; line-height: 1.7; opacity: 0.8; }
.footer__text a { color: var(--primary-light); }
.footer__text a:hover { color: #fff; }

.footer__social--wrap { flex-wrap: wrap; }

.footer__col { min-width: 0; }

.footer__logo {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.footer__logo span { color: var(--primary); }

.footer__desc {
    font-size: 13px;
    line-height: 1.7;
    opacity: 0.7;
    max-width: 320px;
}

.footer__links h4 {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}

.footer__links a {
    display: block;
    font-size: 13px;
    color: var(--text-light);
    padding: 4px 0;
    transition: color 0.15s, padding-left 0.15s;
}

.footer__links a:hover { color: #fff; padding-left: 4px; }

.footer__badges {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer__badge {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-light);
}

.footer__badge svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 36px;
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    opacity: 0.85;
    flex-wrap: wrap;
    gap: 12px;
}

.footer__disclaimer {
    font-size: 11px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.footer__copyright {
    white-space: nowrap;
    flex-shrink: 0;
}

.footer__social {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer__social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-light);
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    opacity: 1;
}

.footer__social a:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

/* Footer responsive */
@media (max-width: 1024px) {
    .footer__inner,
    .footer__cols-3 .footer__inner,
    .footer__cols-4 .footer__inner { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 768px) {
    .footer__inner,
    .footer__cols-2 .footer__inner,
    .footer__cols-3 .footer__inner,
    .footer__cols-4 .footer__inner { grid-template-columns: 1fr; gap: 24px; }
    .footer__desc { max-width: 100%; }
}

@media (max-width: 480px) {
    .footer { padding: 32px 0 16px; }
    .footer__bottom { flex-direction: column; text-align: center; }
    .footer__disclaimer { white-space: normal; text-align: center; }
}

[dir="rtl"] .footer__links a:hover { padding-left: 0; padding-right: 4px; }

/* ========== PAGE HEADER ========== */
.page-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 28px 0 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.page-header:has(+ .sort-tabs) {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 12px;
}

.page-header--with-search {
    justify-content: space-between;
}

.listing-search {
    position: relative;
    flex-shrink: 0;
    width: 240px;
}

.listing-search__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.listing-search__input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    font-size: 14px;
    color: var(--text);
    transition: border-color 0.15s;
}

.listing-search__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.listing-search__input::placeholder { color: var(--text-muted); }

.page-header__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.page-header__content {
    flex: 1;
    min-width: 0;
}

.page-header__title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
}

.page-header__subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.page-header__desc {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
    margin-top: 8px;
    max-width: 700px;
}

/* ========== HOMEPAGE ========== */
.home-section {
    margin-bottom: 36px;
}

/* ========== SECTION TITLES ========== */
.section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
}

/* Title row: title left, "More" right, line below both with gap */
.section-title-row {
    display: flex;
    align-items: flex-end;
    margin-bottom: 16px;
}
.section-title-row .section-title {
    flex: 1;
    margin-bottom: 0;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--primary);
    white-space: nowrap;
}
.section-more {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    padding: 0 28px 6px;
    margin-left: 12px;
    border-bottom: 2px solid var(--primary);
    transition: color 0.15s;
}
.section-more:hover {
    color: var(--primary);
}
.section-more-placeholder { display: none; }
.section-title-row__search {
    position: relative;
    margin-left: 12px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 6px;
    flex-shrink: 0;
    width: 240px;
}
.section-title-row__search .listing-search__icon {
    position: absolute;
    left: 12px;
    top: calc(50% - 3px);
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.section-title-row__search .listing-search__input {
    width: 100%;
    padding: 7px 14px 7px 36px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    font-size: 14px;
    color: var(--text);
    transition: border-color 0.15s;
}
.section-title-row__search .listing-search__input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.section-title-row__search .listing-search__input::placeholder { color: var(--text-muted); }
.section-sort-dropdown {
    position: relative;
    margin-left: 12px;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 6px;
}
.section-sort-dropdown__toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px 0 8px;
    white-space: nowrap;
}
.section-sort-dropdown__toggle:hover {
    color: var(--text);
}
.section-sort-dropdown__arrow {
    transition: transform 0.2s;
}
.section-sort-dropdown.open .section-sort-dropdown__arrow {
    transform: rotate(180deg);
}
.section-sort-dropdown__menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 160px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 50;
    overflow: hidden;
}
.section-sort-dropdown.open .section-sort-dropdown__menu {
    display: block;
}
.section-sort-dropdown__item {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    transition: background 0.15s;
}
.section-sort-dropdown__item:hover {
    background: var(--bg-surface);
}
.section-sort-dropdown__item--active {
    color: var(--primary);
}
.section-sort-dropdown__divider {
    height: 1px;
    background: var(--border);
    margin: 0 12px;
}

/* ========== 404 PAGE ========== */
.error-404 {
    text-align: center;
    padding: 48px 20px 32px;
    max-width: 800px;
    margin: 0 auto;
}

.error-404__illustration {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
}

.error-404__svg {
    width: 280px;
    height: 210px;
}

/* TV screen glow animation */
@keyframes screenGlow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.3)); }
    50% { filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.6)); }
}

/* Static noise movement */
@keyframes staticNoise {
    0% { transform: translateY(0); }
    10% { transform: translateY(-10px); }
    20% { transform: translateY(-20px); }
    30% { transform: translateY(-30px); }
    40% { transform: translateY(-40px); }
    50% { transform: translateY(-50px); }
    60% { transform: translateY(-40px); }
    70% { transform: translateY(-30px); }
    80% { transform: translateY(-20px); }
    90% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

/* 404 text flicker */
@keyframes textFlicker {
    0%, 100% { opacity: 1; }
    4% { opacity: 0.6; }
    6% { opacity: 1; }
    12% { opacity: 0.4; }
    14% { opacity: 1; }
    50% { opacity: 1; }
    54% { opacity: 0.7; }
    56% { opacity: 1; }
}

/* Floating particles */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.error-404__tv { animation: screenGlow 3s ease-in-out infinite; }
.error-404__static { animation: staticNoise 0.3s steps(10) infinite; }
.error-404__flicker { animation: textFlicker 4s linear infinite; }
.error-404__particle1 { animation: float 3s ease-in-out infinite; }
.error-404__particle2 { animation: float 3s ease-in-out 0.5s infinite; }
.error-404__particle3 { animation: float 3s ease-in-out 1s infinite; }
.error-404__particle4 { animation: float 3s ease-in-out 1.5s infinite; }

.error-404__title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text);
}

.error-404__desc {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 28px;
    line-height: 1.6;
}

.error-404__search {
    max-width: 480px;
    margin: 0 auto 20px;
    position: relative;
}

.error-404__search svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.error-404__search input {
    width: 100%;
    padding: 14px 20px 14px 46px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.error-404__search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.error-404__home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
    margin-bottom: 40px;
}

.error-404__home:hover { background: var(--primary-dark); color: #fff; }

.error-404__suggestions {
    margin-top: 16px;
    text-align: left;
}

.error-404__suggestions .section-title {
    text-align: center;
}

@media (max-width: 768px) {
    .error-404 { padding: 32px 16px 24px; }
    .error-404__svg { width: 200px; height: 150px; }
    .error-404__title { font-size: 22px; }
    .error-404__desc { font-size: 14px; margin-bottom: 20px; }
    .error-404__search input { padding: 12px 16px 12px 42px; font-size: 14px; }
}

@media (max-width: 480px) {
    .error-404 { padding: 24px 10px 16px; }
    .error-404__svg { width: 160px; height: 120px; }
    .error-404__title { font-size: 20px; }
    .error-404__desc { font-size: 13px; }
    .error-404__search input { padding: 10px 14px 10px 38px; font-size: 13px; }
    .error-404__home { padding: 9px 20px; font-size: 13px; }
}

[dir="rtl"] .error-404__search svg { left: auto; right: 16px; }
[dir="rtl"] .error-404__search input { padding-left: 20px; padding-right: 46px; }

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    font-size: 28px;
    margin-bottom: 16px;
    color: var(--text-light);
    background: var(--bg-surface);
    border-radius: 50%;
}
.empty-state__text { font-size: 15px; }

/* ========== TOAST NOTIFICATIONS ========== */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
    max-width: 420px;
    width: calc(100% - 32px);
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
    font-size: 14px;
    color: var(--text);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast--exit {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    transition-duration: 0.2s;
}

.toast__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.toast--error .toast__icon { background: #fef2f2; color: var(--danger); }
.toast--warning .toast__icon { background: #fffbeb; color: var(--warning); }
.toast--success .toast__icon { background: #f0fdf4; color: var(--success); }
.toast--info .toast__icon { background: var(--primary-light); color: var(--primary); }

.toast--error { border-color: #fecaca; }
.toast--warning { border-color: #fde68a; }
.toast--success { border-color: #bbf7d0; }
.toast--info { border-color: var(--primary-light); }

.toast__text {
    flex: 1;
    font-weight: 500;
    line-height: 1.4;
}

.toast__close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    transition: color 0.15s;
}

.toast__close:hover { color: var(--text); }

@media (max-width: 480px) {
    .toast-container { bottom: 16px; max-width: 100%; width: calc(100% - 24px); }
    .toast { padding: 12px 14px; font-size: 13px; }
    .toast__icon { width: 28px; height: 28px; }
    .toast__icon svg { width: 16px; height: 16px; }
}

/* ========== RESPONSIVE ========== */

/* 6 cols → 5 on smaller desktops */
@media (max-width: 1600px) {
    body.cols-6 { --grid-cols: 5; }
}

/* 5,6,7 cols → 4 on laptops */
@media (max-width: 1280px) {
    body.cols-5, body.cols-6 { --grid-cols: 4; }
    body.cat-5, body.cat-6 { --cat-cols: 4; }
    body.perf-5, body.perf-6, body.perf-7 { --perf-cols: 4; }
    body.studio-5, body.studio-6, body.studio-7 { --studio-cols: 4; }
}

/* Recommended section */
.recommended-section {
    padding: 32px 0 0;
}

.recommended-more {
    display: flex;
    justify-content: center;
    padding: 24px 0 8px;
}

.recommended-more__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.recommended-more__btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* Tablet landscape: 3 cols, video page single column, hide sidebar */
@media (max-width: 1024px) {
    body.cols-4, body.cols-5, body.cols-6 { --grid-cols: 3; }
    body.cat-3, body.cat-4, body.cat-5, body.cat-6 { --cat-cols: 3; }
    body.perf-4, body.perf-5, body.perf-6, body.perf-7 { --perf-cols: 3; }
    body.studio-4, body.studio-5, body.studio-6, body.studio-7 { --studio-cols: 3; }
    .video-page { grid-template-columns: 1fr; gap: 20px; }
    .video-sidebar { display: none; }
}

/* Logo mobile height */
@media (max-width: 768px) {
    .header__logo-img { height: var(--logo-h-mobile); }
}

/* Tablet portrait: switch to mobile layout */
@media (max-width: 768px) {
    body.cols-4, body.cols-5, body.cols-6 { --grid-cols: 2; }
    body.cat-3, body.cat-4, body.cat-5, body.cat-6 { --cat-cols: 2; }
    body.perf-4, body.perf-5, body.perf-6, body.perf-7 { --perf-cols: 2; }
    body.studio-4, body.studio-5, body.studio-6, body.studio-7 { --studio-cols: 2; }

    /* Page header */
    .page-header { padding: 20px 0 16px; gap: 12px; margin-bottom: 16px; }
    .page-header__icon { width: 40px; height: 40px; }
    .page-header__icon svg { width: 18px; height: 18px; }
    .page-header__title { font-size: 20px; }
    .page-header__subtitle { font-size: 13px; }
    .page-header--with-search { flex-wrap: wrap; }
    .listing-search { width: 100%; order: 3; }
    .page-header__desc { font-size: 13px; margin-top: 6px; }

    /* Header: mobile layout */
    :root {
        --header-nav-height: 0px;
        --header-height: var(--header-mid-height);
    }
    .header-nav { display: none; }
    .header-mid__inner { grid-template-columns: auto 1fr; gap: 12px; }
    .header-mid__center { display: none; }
    .header__mobile-icons { display: flex; }
    .header__burger { display: flex; }
    .header__actions { display: none; }
    .header__nav-submenu { display: none !important; visibility: hidden !important; }
    .mobile-nav { display: block; }

    .container { padding: 0 var(--container-padding-mobile, 16px); }
    .topbar__inner { padding-top: 5px; padding-bottom: 5px; }

    /* Video page — tighter layout */
    .video-page { gap: 0; padding: 0; }
    .video-player { border-radius: 0; }
    .video-main { padding: 0; }
    .video-info { padding: 12px 16px 0; }
    .video-info__title { font-size: 17px; margin-bottom: 10px; line-height: 1.35; }

    /* Stats & actions — stack vertically */
    .video-info__bar { flex-direction: column; align-items: stretch; gap: 10px; padding-bottom: 12px; }
    .video-info__stats { gap: 12px; }
    .video-info__stat { font-size: 12px; }
    .video-info__stat svg { width: 13px; height: 13px; }
    .video-info__actions { justify-content: flex-start; gap: 6px; }
    .vote-btn { padding: 6px 12px; font-size: 12px; }
    .vote-btn svg { width: 14px; height: 14px; }
    .btn-icon { width: 32px; height: 32px; }
    .btn-icon svg { width: 16px; height: 16px; }

    /* Detail blocks — all inline, same style */
    .video-detail-section { padding: 10px 16px; margin: 0; }
    .video-detail-block { flex-direction: row; flex-wrap: wrap; gap: 6px; align-items: center; }
    .video-detail-label { min-width: auto; width: auto; margin-bottom: 0; font-size: 11px; }

    /* Chips smaller on mobile */
    .performer-chip { padding: 3px 10px 3px 3px; font-size: 12px; gap: 6px; }
    .performer-chip img { width: 24px; height: 24px; }
    .performer-chip__initial { width: 24px; height: 24px; font-size: 11px; }
    .studio-chip { padding: 4px 10px; font-size: 12px; }
    .tag-link { padding: 3px 10px; font-size: 11px; }

    /* Description */
    .video-description { padding: 10px 0; }
    .video-description__text { font-size: 13px; }

    /* Comments compact */
    .comments { margin-top: 0; padding: 16px; border-top: 1px solid var(--border-light); }
    .comments__header { margin-bottom: 12px; }
    .comments__header h3 { font-size: 14px; }
    .comment { padding: 8px 0; gap: 8px; }
    .comment__avatar { width: 28px; height: 28px; font-size: 12px; }
    .comment__avatar--sm { width: 22px; height: 22px; font-size: 10px; }
    .comment__author { font-size: 12px; }
    .comment__date { font-size: 10px; }
    .comment__text { font-size: 12px; }
    .comment__text-more { font-size: 11px; }
    .comment__replies { margin-left: 10px; padding-left: 10px; }
    .comment-form__avatar { width: 28px; height: 28px; font-size: 12px; }
    .comment-form textarea { font-size: 13px; }
    .comments__login { padding: 10px 14px; font-size: 13px; }
    .comments__view-more { font-size: 12px; padding: 8px; }

    /* Listing grids */
    .video-grid { gap: min(var(--card-gap, 4px), 3px); }
    .video-card__info { padding: 10px; }
    .video-card__title { font-size: 13px; }
    .video-card__meta { font-size: 11px; }

    /* Recommended section */
    .recommended-section { padding: 24px 16px 0; }
    .recommended-section .section-title { font-size: 16px; margin-bottom: 14px; padding-bottom: 10px; }
    .recommended-more { padding: 18px 0 4px; }
    .recommended-more__btn { padding: 9px 22px; font-size: 13px; }

    .performer-profile { flex-direction: column; align-items: center; text-align: center; }
    .performer-profile__photo { width: 130px; height: 130px; }
    .performer-profile__stats { justify-content: center; }
    .performer-profile__links { justify-content: center; }

    /* Circle cards — smaller text on tablet */
    .performer-card__name, .studio-card__name { font-size: 13px; }
    .performer-card__videos, .studio-card__videos { font-size: 11px; }
    .performer-card__views, .studio-card__views { font-size: 10px; }
    .performer-card__photo--placeholder, .studio-card__photo--placeholder { font-size: 36px; }
}

/* Small phones (< 480px) */
@media (max-width: 480px) {
    body.cols-4, body.cols-5, body.cols-6 { --grid-cols: 2; }
    .container { padding: 0 var(--container-padding-mobile, 10px); }
    .sort-tabs a { white-space: nowrap; padding: 8px 12px; font-size: 13px; }

    .tags-header { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px 0 12px; }
    .tags-header__right { width: 100%; }
    .tag-alphabet { gap: 3px; overflow-x: auto; flex-wrap: nowrap; justify-content: flex-start; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
    .tag-alphabet__letter { min-width: 30px; height: 30px; font-size: 12px; flex-shrink: 0; }
    .tag-search__input { padding: 8px 12px 8px 38px; font-size: 13px; }
    .tag-sections-grid { grid-template-columns: 1fr; gap: 10px; }
    .tag-section { padding: 12px; }
    .tag-section__letter { font-size: 18px; }
    .tag-section .tag-link { font-size: 12px; padding: 3px 10px; }

    .page-header { padding: 16px 0 12px; gap: 10px; margin-bottom: 12px; }
    .page-header__icon { width: 36px; height: 36px; }
    .page-header__icon svg { width: 16px; height: 16px; }
    .page-header__title { font-size: 18px; }
    .page-header__subtitle { font-size: 12px; }

    /* Video page extra compact */
    .video-info { padding: 10px 12px 0; }
    .video-info__title { font-size: 15px; margin-bottom: 8px; }
    .video-info__stats { gap: 8px; }
    .video-info__stat { font-size: 11px; gap: 3px; }
    .video-info__stat svg { width: 12px; height: 12px; }
    .vote-btn { padding: 5px 10px; font-size: 11px; gap: 4px; }

    /* Detail sections tighter */
    .video-detail-section { padding: 8px 12px; }
    .video-detail-label { font-size: 10px; }
    .performer-chip { font-size: 11px; padding: 2px 8px 2px 2px; }
    .performer-chip img { width: 22px; height: 22px; }
    .performer-chip__initial { width: 22px; height: 22px; font-size: 10px; }
    .studio-chip { padding: 3px 8px; font-size: 11px; }
    .tag-link { padding: 2px 8px; font-size: 10px; }

    .video-description__text { font-size: 12px; line-height: 1.6; }
    .comments { padding: 12px; }

    .recommended-section { padding: 20px 10px 0; }
    .recommended-section .section-title { font-size: 14px; margin-bottom: 10px; }

    /* Circle cards — phone */
    .performer-grid, .studio-grid { gap: 12px; }
    .performer-card__info, .studio-card__info { bottom: 10%; }
    .performer-card__name, .studio-card__name { font-size: 14px; }
    .performer-card__videos, .studio-card__videos { font-size: 11px; }
    .performer-card__views, .studio-card__views { font-size: 10px; }

    /* Listing grids */
    .video-grid { gap: min(var(--card-gap, 4px), 2px); }
    .video-card { border-radius: 6px; }
    .video-card__info { padding: 8px; }
    .video-card__title { font-size: 12px; margin-bottom: 2px; }
    .video-card__meta { font-size: 10px; }
    .video-card__duration { font-size: 10px; padding: 1px 4px; bottom: 4px; right: 4px; }
}

/* header__flag kept for mobile nav */
.header__flag {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

/* ========== RTL OVERRIDES ========== */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

/* Header */
[dir="rtl"] .header__search input { padding: 9px 38px 9px 14px; }
[dir="rtl"] .header__search svg,
[dir="rtl"] .header__search > i { left: auto; right: 12px; }
[dir="rtl"] .header__mobile-icons { margin-left: 0; margin-right: auto; }
[dir="rtl"] .udd__dropdown { right: auto; left: 0; }

/* Video card */
[dir="rtl"] .video-card__duration { right: auto; left: 8px; }

/* Video page */
[dir="rtl"] .video-detail-label { text-align: right; }
[dir="rtl"] .video-info__actions { direction: ltr; }

/* Comments */
[dir="rtl"] .comment__replies { margin-left: 0; margin-right: 16px; padding-left: 0; padding-right: 12px; border-left: none; border-right: 2px solid var(--border-light); }
[dir="rtl"] .comment-form__actions { justify-content: flex-start; }

/* Auth modal */
[dir="rtl"] .auth-modal__close { right: auto; left: 16px; }

/* Pagination */
[dir="rtl"] .pagination { direction: ltr; }

/* Footer */
[dir="rtl"] .footer__inner { direction: rtl; }

/* Search */
[dir="rtl"] .search-page__input { padding: 14px 48px 14px 20px; }
[dir="rtl"] .search-page__form svg { left: auto; right: 16px; }

/* Tag search */
[dir="rtl"] .tag-search__icon { left: auto; right: 14px; }
[dir="rtl"] .tag-search__input { padding: 10px 42px 10px 16px; }

/* Mobile nav search */
[dir="rtl"] .mobile-nav__search input { padding: 10px 38px 10px 12px; }
[dir="rtl"] .mobile-nav__search > i { left: auto; right: 12px; }
[dir="rtl"] .mobile-nav__panel { right: auto; left: 0; transform: translateX(-100%); }
[dir="rtl"] .mobile-nav.open .mobile-nav__panel { transform: translateX(0); }

/* Mobile responsive RTL fixes */
@media (max-width: 768px) {
    [dir="rtl"] .video-detail-section { padding: 10px 16px; }
    [dir="rtl"] .video-info { padding: 12px 16px 0; }
    [dir="rtl"] .comments { padding: 16px; }
    [dir="rtl"] .section-title-row__search { margin-left: 0; margin-right: 0; }
    [dir="rtl"] .section-more { margin-left: 0; margin-right: auto; }
    [dir="rtl"] .section-sort-dropdown { margin-left: 0; margin-right: auto; }
}

@media (max-width: 480px) {
    [dir="rtl"] .video-card__duration { left: 4px; right: auto; }
    [dir="rtl"] .video-info { padding: 10px 12px 0; }
    [dir="rtl"] .video-detail-section { padding: 8px 12px; }
}

/* ========== CONTACT PAGE LAYOUT ========== */

/* Two-column layout: form left, body right */
.page-contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}
.page-contact-layout__form {
    position: sticky;
    top: calc(var(--header-height, 60px) + 24px);
}
.page-contact-layout__body {
    padding-left: 24px;
    border-left: 1px solid var(--border-light);
}

/* Contact-only (no body): centered narrower form */
.page-contact-centered {
    max-width: 640px;
    margin: 0 auto;
}

/* Flash messages */
.contact-flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.contact-flash--success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.contact-flash--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Form base */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.contact-form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.contact-form__group {
    display: flex;
    flex-direction: column;
}
.contact-form__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
    letter-spacing: 0.01em;
}
.contact-form__required {
    color: var(--danger, #ef4444);
}
.contact-form__input,
.contact-form__textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.contact-form__input:focus,
.contact-form__textarea:focus {
    border-color: var(--primary);
    background: var(--bg);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.contact-form__textarea {
    resize: vertical;
    min-height: 120px;
}

/* URL fields for DMCA/Report */
.contact-form__url-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.contact-form__url-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.contact-form__url-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.contact-form__url-row .contact-form__input {
    flex: 1;
}
.contact-form__remove-url {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    color: var(--text-muted, #6b7280);
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}
.contact-form__remove-url:hover {
    background: var(--danger, #ef4444);
    color: #fff;
    border-color: var(--danger, #ef4444);
}
.contact-form__add-url {
    align-self: flex-start;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    font-family: inherit;
}
.contact-form__add-url:hover {
    text-decoration: underline;
}
select.contact-form__input {
    cursor: pointer;
}

/* Submit button */
.contact-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    align-self: flex-start;
}
.contact-form__submit:hover {
    background: var(--primary-dark);
}
.contact-form__submit:active {
    transform: scale(0.98);
}
.contact-form__submit-icon {
    width: 18px;
    height: 18px;
}

@media (max-width: 900px) {
    .page-contact-layout {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .page-contact-layout__form {
        position: static;
    }
    .page-contact-layout__body {
        padding-left: 0;
        border-left: none;
        padding-top: 24px;
        border-top: 1px solid var(--border-light);
    }
}
@media (max-width: 768px) {
    .contact-form__grid {
        grid-template-columns: 1fr;
    }
}

/* ========== MOBILE UX ENHANCEMENTS ========== */

/* Touch feedback: active states for interactive elements */
@media (hover: none) {
    .video-card:active { transform: scale(0.98); }
    .category-card:active, .performer-card:active, .studio-card:active { transform: scale(0.97); }
    .pagination a:active, .pagination button:active { transform: scale(0.92); }
    .sort-tabs a:active, .sort-dropdown__item:active { opacity: 0.7; }
    .btn:active, button[type="submit"]:active { transform: scale(0.97); }
    .mobile-nav__links a:active { background: var(--bg-surface); }
}

/* Disable tap highlight for a cleaner feel */
a, button, label, input, select, textarea, .video-card, .category-card, .performer-card, .studio-card {
    -webkit-tap-highlight-color: transparent;
}

/* Safe area padding for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
    .mobile-nav__bottom { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
    .footer__bottom { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
    body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
}

/* Smooth scrolling for the entire page */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Better mobile inputs: larger touch targets */
@media (max-width: 768px) {
    input[type="text"], input[type="email"], input[type="password"],
    input[type="url"], input[type="search"], input[type="number"],
    select, textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }
    .auth-modal input { font-size: 16px; }
}

/* Mobile nav: close button position for right-side panel */
.mobile-nav__close { order: -1; margin-right: 10px; margin-left: 0; }
[dir="rtl"] .mobile-nav__close { order: unset; margin-right: 0; margin-left: 10px; }

/* Container mobile padding uses CSS var */
@media (max-width: 480px) {
    .container { padding-left: var(--container-padding-mobile, 10px); padding-right: var(--container-padding-mobile, 10px); }
}

/* ========== SORT TABS SCROLL HINT ========== */
/* Fade edges on mobile to indicate horizontal scroll */
.sort-tabs {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.sort-tabs::-webkit-scrollbar { display: none; }
@media (max-width: 768px) {
    .sort-tabs {
        mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 12px), transparent);
        -webkit-mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 12px), transparent);
    }
    .profile-tabs {
        mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 12px), transparent);
        -webkit-mask-image: linear-gradient(to right, transparent, black 12px, black calc(100% - 12px), transparent);
    }
}

/* ========== SECTION TITLE ROW — MOBILE WRAP ========== */
@media (max-width: 768px) {
    .section-title-row { flex-wrap: wrap; }
    .section-title-row__search {
        width: 100%;
        margin-left: 0;
        order: 3;
        border-bottom: none;
        padding-bottom: 0;
        margin-top: 8px;
    }
    .section-sort-dropdown {
        margin-left: auto;
        padding-bottom: 6px;
    }
    .section-more { padding: 0 12px 6px; margin-left: auto; }
}

@media (max-width: 480px) {
    .section-title { font-size: 16px; margin-bottom: 12px; padding-bottom: 6px; }
    .section-title-row .section-title { font-size: 16px; }
    .section-more { font-size: 13px; padding: 0 8px 6px; }
    .section-sort-dropdown__toggle { font-size: 13px; }
}

/* ========== 640PX INTERMEDIATE BREAKPOINT ========== */
@media (max-width: 640px) {
    /* Performer/studio grids: 3→2 for medium phones */
    body.perf-4, body.perf-5, body.perf-6, body.perf-7 { --perf-cols: 2; }
    body.studio-4, body.studio-5, body.studio-6, body.studio-7 { --studio-cols: 2; }

    /* Related videos: single column on smaller screens */
    .related-grid { grid-template-columns: 1fr; }

    /* Tighter main padding */
    main.container { padding-top: 16px; padding-bottom: 16px; }

    /* Home sections tighter */
    .home-section { margin-bottom: 24px; }

    /* Sort tabs tighter */
    .sort-tabs { padding: 10px 0; margin-bottom: 16px; }
    .sort-tabs a { padding: 7px 14px; font-size: 13px; }

    /* Pagination compact */
    .pagination { gap: 3px; margin: 24px 0; }
    .pagination__link { min-width: 36px; height: 36px; padding: 0 10px; font-size: 13px; }
    .pagination__dots { padding: 0 4px; }

    /* Performer profile tighter */
    .performer-profile { padding: 20px; gap: 20px; margin-top: 16px; }
    .performer-profile__photo { width: 110px; height: 110px; }
    .performer-profile__name { font-size: 22px; }
    .performer-profile__bio { font-size: 13px; }
    .performer-profile__stat { padding: 6px 12px; font-size: 12px; }

    /* Search page */
    .search-page__input { padding: 12px 16px 12px 44px; font-size: 15px; }

    /* Video card play button smaller */
    .video-card__play svg { width: 36px; height: 36px; }

    /* Auth modal — near full-screen */
    .auth-modal { padding: 12px; }
    .auth-modal__card { max-width: 100%; border-radius: 12px; }
    .auth-modal__header { padding: 24px 20px 0; }
    .auth-modal__title { font-size: 20px; }
    .auth-tabs { margin: 20px 20px 0; }
    .auth-modal__body { padding: 20px 20px 24px; }

    /* Footer tighter */
    .footer { margin-top: 32px; }
}

/* ========== PAGINATION — SMALL PHONES ========== */
@media (max-width: 480px) {
    .pagination { gap: 2px; margin: 20px 0; }
    .pagination__link { min-width: 32px; height: 34px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
}

/* ========== AUTH MODAL — SMALL PHONES ========== */
@media (max-width: 480px) {
    .auth-modal { padding: 0; align-items: flex-end; }
    .auth-modal__card {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .auth-modal__header { padding: 20px 16px 0; }
    .auth-modal__title { font-size: 18px; }
    .auth-modal__icon { width: 48px; height: 48px; font-size: 24px; margin-bottom: 12px; }
    .auth-tabs { margin: 16px 16px 0; padding: 3px; }
    .auth-tabs__btn { padding: 9px 6px; font-size: 12px; }
    .auth-modal__body { padding: 16px 16px 20px; }
    .auth-modal .form-group input { padding: 10px 12px; font-size: 14px; }
    .auth-modal .btn-submit { padding: 11px; font-size: 14px; }
}

/* ========== CATEGORY CARD — SMALL PHONES ========== */
@media (max-width: 480px) {
    .category-card__name { font-size: 12px; padding: 6px 8px; }
    .category-card__count { font-size: 10px; padding: 2px 6px; top: 4px; right: 4px; }
}

/* ========== VIDEO CARD — PLAY BUTTON MOBILE ========== */
@media (max-width: 480px) {
    .video-card__play svg { width: 28px; height: 28px; }
    .video-card__play { opacity: 0.65; }
}

/* ========== LISTING SEARCH — MOBILE ========== */
@media (max-width: 480px) {
    .listing-search__input { padding: 8px 12px 8px 34px; font-size: 13px; }
    .listing-search__icon svg { width: 14px; height: 14px; }
}

/* ========== SEARCH AUTOCOMPLETE ========== */
.search-suggest {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: hidden;
    margin-top: 4px;
}
.search-suggest__item {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.12s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-suggest__item:hover {
    background: var(--bg-surface);
    color: var(--primary);
}

/* ========== AGE VERIFICATION GATE ========== */
.age-gate {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: ageGateBgIn 0.5s ease;
}
.age-gate--closing {
    animation: ageGateBgOut 0.3s ease forwards;
}
.age-gate--closing .age-gate__card {
    animation: ageGateCardOut 0.3s ease forwards;
}

/* -- Background Styles -- */
.age-gate--gradient {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a2e 25%, #16213e 50%, #0a0a0a 100%);
    background-size: 400% 400%;
    animation: ageGateBgIn 0.5s ease, ageGateGradient 12s ease infinite;
}
.age-gate--gradient.age-gate--closing {
    animation: ageGateGradient 12s ease infinite, ageGateBgOut 0.3s ease forwards;
}
.age-gate--dark {
    background: #0a0a0a;
}
.age-gate--blur {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px) saturate(0.3);
    -webkit-backdrop-filter: blur(20px) saturate(0.3);
}

/* Subtle particles/dots overlay for gradient style */
.age-gate--gradient::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.08) 50%, transparent 50%),
        radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.05) 50%, transparent 50%),
        radial-gradient(1px 1px at 50% 40%, rgba(255,255,255,0.06) 50%, transparent 50%),
        radial-gradient(1px 1px at 70% 80%, rgba(255,255,255,0.04) 50%, transparent 50%),
        radial-gradient(1px 1px at 90% 30%, rgba(255,255,255,0.07) 50%, transparent 50%);
    pointer-events: none;
}

@keyframes ageGateGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes ageGateBgIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes ageGateBgOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* -- Card -- */
.age-gate__card {
    position: relative;
    background: rgba(18, 18, 24, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 44px 40px 36px;
    max-width: 460px;
    width: 100%;
    text-align: center;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03),
        0 32px 100px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(99, 102, 241, 0.05);
    animation: ageGateCardIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}
@keyframes ageGateCardIn {
    from { opacity: 0; transform: scale(0.92) translateY(20px); }
    to { opacity: 1; transform: none; }
}
@keyframes ageGateCardOut {
    from { opacity: 1; transform: none; }
    to { opacity: 0; transform: scale(0.95) translateY(-10px); }
}

/* -- Header (logo zone) -- */
.age-gate__header {
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.age-gate__logo {
    display: block;
    max-width: 170px;
    max-height: 44px;
    margin: 0 auto;
    object-fit: contain;
}
.age-gate__site-name {
    display: block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

/* -- Body (text content) -- */
.age-gate__body {
    margin-bottom: 28px;
}
.age-gate__title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}
.age-gate__message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.7;
    margin-bottom: 0;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}
.age-gate__disclaimer {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.6;
    margin-top: 10px;
    margin-bottom: 0;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}

/* -- Actions -- */
.age-gate__actions {}

/* -- Enter Button -- */
.age-gate__enter {
    display: block;
    width: 100%;
    padding: 15px 28px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    margin-bottom: 12px;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
}
.age-gate__enter::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.25s;
}
.age-gate__enter:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 30px rgba(220, 38, 38, 0.4), inset 0 1px 0 rgba(255,255,255,0.1);
}
.age-gate__enter:hover::before {
    opacity: 1;
}
.age-gate__enter:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 12px rgba(220, 38, 38, 0.3);
}
.age-gate__enter:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.age-gate__enter:disabled:hover {
    transform: none;
    box-shadow: none;
}
.age-gate__enter:disabled::before {
    display: none;
}

/* -- Exit link -- */
.age-gate__exit {
    display: inline-block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.35);
    text-decoration: none;
    padding: 10px 20px;
    transition: color 0.2s;
    font-weight: 500;
}
.age-gate__exit:hover {
    color: rgba(255, 255, 255, 0.65);
}

/* -- DOB Fields -- */
.age-gate__dob {
    margin-bottom: 20px;
}
.age-gate__dob-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}
.age-gate__dob-fields {
    display: grid;
    grid-template-columns: 1fr 0.6fr 0.8fr;
    gap: 10px;
}
.age-gate__dob-select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.age-gate__dob-select:focus {
    outline: none;
    border-color: rgba(220, 38, 38, 0.5);
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
.age-gate__dob-select option {
    background: #1a1a2e;
    color: #fff;
}
.age-gate__dob-select--denied {
    border-color: rgba(239, 68, 68, 0.5);
    background-color: rgba(239, 68, 68, 0.06);
}
.age-gate__dob-error {
    margin-top: 10px;
    font-size: 12px;
    color: #ef4444;
    font-weight: 500;
    animation: ageGateShake 0.35s ease;
}
@keyframes ageGateShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(2px); }
}

/* -- Checkbox -- */
.age-gate__checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-align: left;
    cursor: pointer;
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.2s, background 0.2s;
}
.age-gate__checkbox:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
}
.age-gate__checkbox input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.age-gate__checkbox-mark {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    margin-top: 1px;
    transition: all 0.2s;
    position: relative;
    background: rgba(255, 255, 255, 0.04);
}
.age-gate__checkbox-mark::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.15s ease;
}
.age-gate__checkbox input:checked ~ .age-gate__checkbox-mark {
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}
.age-gate__checkbox input:checked ~ .age-gate__checkbox-mark::after {
    transform: rotate(45deg) scale(1);
}
.age-gate__checkbox-text {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.55);
}

/* -- Legal links -- */
.age-gate__legal {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.age-gate__legal a {
    color: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    transition: color 0.15s;
    font-weight: 500;
}
.age-gate__legal a:hover {
    color: rgba(255, 255, 255, 0.6);
}
.age-gate__legal-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

/* -- Responsive -- */
@media (max-width: 480px) {
    .age-gate { padding: 16px; }
    .age-gate__card { padding: 32px 24px 28px; border-radius: 16px; }
    .age-gate__badge { width: 64px; height: 64px; margin-bottom: 16px; }
    .age-gate__badge svg { width: 64px; height: 64px; }
    .age-gate__title { font-size: 19px; }
    .age-gate__message { font-size: 13px; }
    .age-gate__dob-fields { grid-template-columns: 1fr; gap: 8px; }
    .age-gate__dob-select { padding: 11px 14px; }
    .age-gate__enter { padding: 14px 24px; font-size: 14px; }
    .age-gate__legal { gap: 6px; }
}
