/* ===== VideoStream PHP Platform - Core Stylesheet ===== */
:root {
    --bg: #0f0f0f;
    --bg-soft: #1a1a1a;
    --bg-card: #202020;
    --bg-hover: #2b2b2b;
    --border: #303030;
    --text: #f1f1f1;
    --text-dim: #9a9a9a;
    --brand: #ff9000;
    --brand-dark: #e07d00;
    --accent: #f97316;
    --danger: #e5484d;
    --success: #30a46c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* ===== Header ===== */
.header {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 0;
}
.logo a {
    font-size: 24px;
    font-weight: 800;
    color: var(--brand);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.search-bar { flex: 1; max-width: 620px; }
.search-bar form { display: flex; }
.search-bar input {
    flex: 1;
    padding: 11px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 8px 0 0 8px;
    color: var(--text);
    font-size: 15px;
    outline: none;
}
.search-bar input:focus { border-color: var(--brand); }
.search-bar button {
    padding: 0 22px;
    background: var(--brand);
    border: none;
    border-radius: 0 8px 8px 0;
    color: #111;
    font-size: 16px;
    cursor: pointer;
}
.search-bar button:hover { background: var(--brand-dark); }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: .15s;
    background: var(--bg-card);
    color: var(--text);
}
.btn:hover { background: var(--bg-hover); }
.btn-primary, .btn-signup, .btn-upload { background: var(--brand); color: #111; }
.btn-primary:hover, .btn-signup:hover, .btn-upload:hover { background: var(--brand-dark); }
.btn-login { background: transparent; border: 1px solid var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ===== Dropdown ===== */
.dropdown { position: relative; }
.dropdown-menu {
    position: absolute;
    right: 0;
    top: 115%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 200px;
    padding: 6px;
    display: none;
    box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 7px;
    font-size: 14px;
}
.dropdown-menu a:hover { background: var(--bg-hover); }
.btn-user img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }

/* ===== Navigation ===== */
.nav { background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.nav .container { display: flex; gap: 4px; overflow-x: auto; }
.nav-item {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dim);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}
.nav-item:hover, .nav-item.active { color: var(--text); border-bottom-color: var(--brand); }

/* ===== Categories bar ===== */
.categories-bar { background: #151515; border-bottom: 1px solid var(--border); padding: 12px 0; }
.categories-bar .container { display: flex; gap: 10px; overflow-x: auto; }
.category-tag {
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
    color: var(--text-dim);
}
.category-tag:hover { background: var(--brand); color: #111; border-color: var(--brand); }

/* ===== Main ===== */
.main-content { padding: 30px 0 60px; }
h1 { font-size: 26px; margin-bottom: 20px; }
h2 { font-size: 20px; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
section { margin-bottom: 45px; }

/* ===== Video grid ===== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.video-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: .2s;
    border: 1px solid transparent;
}
.video-card:hover { transform: translateY(-4px); border-color: var(--border); }
.thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: #000 center/cover no-repeat;
    display: block;
}
.thumb .duration {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(0,0,0,.8);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}
.thumb .badge-premium {
    position: absolute;
    left: 8px;
    top: 8px;
    background: var(--brand);
    color: #111;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}
.video-card-body { padding: 12px; }
.video-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-meta { font-size: 12px; color: var(--text-dim); display: flex; gap: 12px; flex-wrap: wrap; }
.no-results { color: var(--text-dim); padding: 40px 0; }

/* ===== Watch page ===== */
.watch-layout { display: grid; grid-template-columns: 1fr 360px; gap: 28px; }
@media (max-width: 1000px) { .watch-layout { grid-template-columns: 1fr; } }
.player-wrap { background: #000; border-radius: 12px; overflow: hidden; }
.player-wrap video { width: 100%; display: block; max-height: 78vh; }
.watch-title { font-size: 22px; margin: 18px 0 10px; }
.watch-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.channel { display: flex; align-items: center; gap: 12px; }
.channel img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.channel-name { font-weight: 700; }
.spacer { flex: 1; }
.action-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 16px; border-radius: 22px;
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer;
}
.action-btn:hover { background: var(--bg-hover); }
.action-btn.active { background: var(--brand); color: #111; border-color: var(--brand); }
.description {
    background: var(--bg-card); padding: 16px; border-radius: 10px;
    margin-top: 18px; font-size: 14px; color: var(--text-dim);
    white-space: pre-wrap;
}
.tags { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag { color: var(--brand); font-size: 13px; }

/* ===== Sidebar ===== */
.sidebar-item { display: flex; gap: 10px; margin-bottom: 14px; }
.sidebar-item .thumb { width: 160px; flex-shrink: 0; border-radius: 8px; }
.sidebar-item .info h4 { font-size: 13px; font-weight: 600; line-height: 1.35; }
.sidebar-item .info span { font-size: 12px; color: var(--text-dim); }

/* ===== Forms / Auth ===== */
.auth-wrap { max-width: 420px; margin: 60px auto; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 28px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-dim); }
.form-control {
    width: 100%; padding: 11px 14px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-size: 15px; outline: none;
    font-family: inherit;
}
.form-control:focus { border-color: var(--brand); }
textarea.form-control { resize: vertical; min-height: 90px; }
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
.alert-error { background: rgba(229,72,77,.15); border: 1px solid var(--danger); color: #ff9a9d; }
.alert-success { background: rgba(48,164,108,.15); border: 1px solid var(--success); color: #7ee2b0; }
.muted { color: var(--text-dim); font-size: 13px; }
.center { text-align: center; }

/* ===== Comments ===== */
.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.comment-body { flex: 1; }
.comment-head { display: flex; gap: 10px; align-items: baseline; }
.comment-head b { font-size: 14px; }
.comment-head span { font-size: 12px; color: var(--text-dim); }
.comment-text { font-size: 14px; margin-top: 4px; }

/* ===== Table ===== */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ===== Stats ===== */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.stat-card .num { font-size: 30px; font-weight: 800; color: var(--brand); }
.stat-card .lbl { font-size: 13px; color: var(--text-dim); }
.stat-card i { float: right; font-size: 26px; opacity: .25; }

/* ===== Pagination ===== */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; max-width: 100%; margin: 30px 0; }
.pagination .pg-ellipsis { padding: 8px 4px; color: var(--muted); }
.pagination .pg-arrow { font-weight: 600; }
.pagination a, .pagination span {
    padding: 8px 14px; border-radius: 8px; background: var(--bg-card);
    border: 1px solid var(--border); font-size: 14px;
}
.pagination a:hover { background: var(--brand); color: #111; }
.pagination .current { background: var(--brand); color: #111; border-color: var(--brand); font-weight: 700; }

/* ===== Overflow guard (mobile) =====
   Any element wider than the viewport (ads, long strings, legacy pages)
   must never force the whole document into horizontal scroll. */
html, body { max-width: 100%; overflow-x: hidden; }
img, iframe, video { max-width: 100%; }

/* ===== Footer ===== */
.footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 45px 0 20px; margin-top: 40px; }
.footer-content { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
@media (max-width: 800px) { .footer-content { grid-template-columns: 1fr 1fr; } }
.footer-section h3 { color: var(--brand); margin-bottom: 12px; }
.footer-section h4 { margin-bottom: 12px; font-size: 15px; }
.footer-section ul { list-style: none; }
.footer-section li { margin-bottom: 8px; }
.footer-section a { color: var(--text-dim); font-size: 14px; }
.footer-section a:hover { color: var(--brand); }
.social-links { display: flex; gap: 14px; font-size: 20px; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 30px; padding-top: 20px; text-align: center; color: var(--text-dim); font-size: 13px; }

/* ===== Compliance notice ===== */
.compliance-note {
    background: #171717; border: 1px solid var(--border); border-radius: 10px;
    padding: 16px; font-size: 13px; color: var(--text-dim); margin-top: 30px;
}
.age-gate {
    position: fixed; inset: 0; background: rgba(0,0,0,.96);
    display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.age-gate .card { max-width: 440px; text-align: center; }
.age-gate h2 { justify-content: center; }

/* ============================================================
   Admin UI, ad slots, badges, pills, SEO blocks
   ============================================================ */

h1 { font-size: 26px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
h2 { font-size: 19px; margin-bottom: 14px; display: flex; align-items: center; gap: 9px; }
h3 { font-size: 16px; margin-bottom: 10px; }

/* ===== Alerts ===== */
.alert {
    border-radius: 10px; padding: 13px 16px; margin-bottom: 18px;
    font-size: 14px; border: 1px solid transparent;
}
.alert-success { background: rgba(48,164,108,.14); border-color: rgba(48,164,108,.45); color: #7ee2b0; }
.alert-error, .alert-danger { background: rgba(229,72,77,.14); border-color: rgba(229,72,77,.45); color: #ff9ea1; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
    padding: 10px 16px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--bg-hover); color: var(--text); font-size: 14px;
    font-family: inherit; transition: .15s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn-primary, .btn-signup { background: var(--brand); border-color: var(--brand); color: #111; font-weight: 700; }
.btn-primary:hover, .btn-signup:hover { background: var(--brand-dark); color: #111; }
.btn-danger { background: transparent; border-color: rgba(229,72,77,.6); color: #ff9ea1; }
.btn-danger:hover { background: rgba(229,72,77,.15); color: #ff9ea1; border-color: var(--danger); }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.actions { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ===== Pills / badges ===== */
.pill {
    display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px;
    background: var(--bg-hover); border: 1px solid var(--border); color: var(--text-dim);
    cursor: pointer; font-family: inherit; line-height: 1.7;
}
.pill-ok  { background: rgba(48,164,108,.18); border-color: rgba(48,164,108,.5); color: #7ee2b0; }
.pill-off { background: rgba(229,72,77,.14); border-color: rgba(229,72,77,.4); color: #ff9ea1; }
.pill-info { background: rgba(255,144,0,.16); border-color: rgba(255,144,0,.45); color: var(--brand); }
.badge-embed, .badge-premium {
    position: absolute; top: 8px; left: 8px; z-index: 2;
    padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 700;
    background: rgba(0,0,0,.75); color: #fff; letter-spacing: .4px;
}
.badge-premium { left: auto; right: 8px; background: var(--brand); color: #111; }
.duration {
    position: absolute; bottom: 8px; right: 8px; z-index: 2;
    background: rgba(0,0,0,.8); color: #fff; font-size: 12px;
    padding: 1px 7px; border-radius: 4px;
}
.thumb { position: relative; }

/* ===== Ad slots ===== */
.ad-slot {
    position: relative; margin: 18px 0; text-align: center;
    border-radius: 10px; overflow: hidden;
}
.ad-slot .ad-label {
    display: block; font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
    color: #6b6b6b; margin-bottom: 4px;
}
.ad-slot .ad-body img { margin: 0 auto; max-width: 100%; height: auto; }
.ad-slot.ad-in_feed { background: var(--bg-card); border: 1px solid var(--border); padding: 12px; }
.ad-slot.ad-sidebar_top, .ad-slot.ad-sidebar_bottom { max-width: 320px; margin-left: auto; margin-right: auto; }
.ad-slot.ad-player_overlay { margin-bottom: -8px; }
.ad-slot.ad-header_banner { max-width: 970px; margin: 14px auto; }
.ad-slot.ad-type-script { min-height: 0; }
.house-ad { pointer-events: auto; }

/* ===== Admin layout ===== */
.admin-body { background: #101013; }
.admin-nav { background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.admin-nav .container { display: flex; gap: 4px; overflow-x: auto; }
.admin-nav .nav-item { padding: 13px 16px; white-space: nowrap; font-size: 14px; }
.admin-nav .nav-item.active { color: var(--brand); border-bottom: 2px solid var(--brand); }
.admin-footer { padding: 22px 0; margin-top: 40px; }
.admin-footer p { font-size: 13px; }
.admin-footer a { color: var(--text-dim); }
.admin-footer a:hover { color: var(--brand); }

.admin-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 22px; margin-bottom: 24px;
}
.admin-grid {
    display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px;
    align-items: start; margin-bottom: 6px;
}
@media (max-width: 980px) { .admin-grid { grid-template-columns: 1fr; } }

.admin-form label {
    display: block; margin-bottom: 15px; font-size: 13px;
    font-weight: 600; color: var(--text-dim);
}
.admin-form .form-control { margin-top: 6px; font-weight: 400; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.checkbox { display: flex !important; align-items: center; gap: 9px; font-weight: 500; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--brand); }
.hint { display: block; font-size: 12px; color: #7d7d7d; font-weight: 400; margin-top: 5px; }
.code-input, .code-block {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px; line-height: 1.5;
}
.code-block {
    display: block; background: var(--bg); border: 1px solid var(--border);
    border-radius: 7px; padding: 9px 12px; margin-top: 8px;
    color: #b9c6d4; overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}
.inline-select { width: auto !important; display: inline-block !important; padding: 6px 10px !important; }

/* ===== Admin tables ===== */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td {
    text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table th {
    color: var(--text-dim); font-size: 12px; text-transform: uppercase;
    letter-spacing: .6px; font-weight: 700;
}
.admin-table tr:hover td { background: rgba(255,255,255,.02); }
.admin-table img { display: block; }
.small-table { font-size: 13px; }
.small-table th, .small-table td { padding: 8px 10px; }
.small { font-size: 12.5px; }
.row-off td { opacity: .45; }

/* ===== Chart ===== */
.spark-chart {
    display: flex; align-items: flex-end; gap: 8px; height: 150px;
    padding: 10px 4px 0; margin-bottom: 22px; border-bottom: 1px solid var(--border);
}
.bar-wrap {
    flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
    align-items: center; height: 100%;
}
.bar {
    width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--brand), #7a4600);
    border-radius: 5px 5px 0 0; min-height: 3px; transition: .2s;
}
.bar-wrap:hover .bar { background: linear-gradient(180deg, #ffb347, var(--brand)); }
.bar-label { font-size: 10.5px; color: var(--text-dim); margin-top: 6px; white-space: nowrap; }

/* ===== Notice / info boxes ===== */
.notice-box {
    background: #161616; border: 1px solid var(--border); border-left: 3px solid var(--brand);
    border-radius: 9px; padding: 18px 20px; margin-top: 26px;
}
.notice-box h3 { color: var(--brand); }
.notice-box ol, .notice-box ul { margin: 10px 0 0 20px; }
.notice-box li { margin-bottom: 9px; font-size: 13.5px; }

/* ===== Misc content blocks ===== */
.breadcrumbs { font-size: 13px; color: var(--text-dim); margin-bottom: 14px; display: flex; gap: 7px; flex-wrap: wrap; }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs .sep { opacity: .5; }
.seo-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.category-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.comments-section { margin-top: 34px; }
.embed-wrap { position: relative; padding-top: 56.25%; background: #000; border-radius: 12px; overflow: hidden; }
.embed-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-locked {
    background: #000; border-radius: 12px; padding: 60px 20px; text-align: center;
    position: relative; overflow: hidden;
}
.source-credit { font-size: 12.5px; color: var(--text-dim); margin-top: 10px; }
.source-credit a { color: var(--brand); }
.share-row { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.share-btn {
    display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px;
    border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card);
    font-size: 13px; cursor: pointer;
}
.share-btn:hover { border-color: var(--brand); color: var(--brand); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.empty-state i { font-size: 46px; opacity: .3; margin-bottom: 16px; display: block; }
.featured-section, .latest-section { margin-bottom: 40px; }
.featured-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.section-more { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-more a { font-size: 13.5px; color: var(--brand); }
.mt-lg { margin-top: 30px; }
.info { color: #8ab4f8; }
.center { text-align: center; }

/* Category tiles (categories.php) */
.cat-tile { display: flex; flex-direction: column; gap: 10px; text-decoration: none; transition: border-color .2s; }
.cat-tile:hover { border-color: var(--brand); }
.cat-tile-name { margin: 0; font-size: 22px; color: var(--brand); }
.cat-tile-desc { margin: 0; color: #9aa3b5; font-size: 14px; line-height: 1.5; }
.cat-tile-count { margin-top: auto; font-size: 13px; font-weight: 600; color: #fff; background: var(--brand); display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; align-self: flex-start; }
/* Category page header */
.category-head { margin-bottom: 18px; }
.category-head h1 { margin-bottom: 6px; }

/* ==================================================================
   Homepage (Pornhub-style pro layout)
   Hero -> trending rail -> category showcase -> latest -> rails
   ================================================================== */

.home-section { margin-bottom: 42px; }
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}
.section-head h2 { margin: 0; font-size: 21px; }
.section-head h2 i { color: var(--brand); }
.section-link { font-size: 13.5px; color: var(--text-dim); white-space: nowrap; transition: color .2s; }
.section-link:hover { color: var(--brand); }

/* --- Hero ------------------------------------------------------- */
.home-hero {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 42px;
}
.hero-main {
    position: relative;
    display: block;
    min-height: 400px;
    border-radius: 14px;
    overflow: hidden;
    background: #000 center/cover no-repeat;
    border: 1px solid var(--border);
    transition: border-color .25s;
}
.hero-main:hover { border-color: var(--brand); }
.hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.45) 45%, rgba(0,0,0,.92) 100%);
}
.hero-body {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 26px 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.hero-badge {
    align-self: flex-start;
    background: var(--brand);
    color: #111;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 5px 11px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.hero-title {
    font-size: 30px;
    line-height: 1.2;
    margin: 0;
    font-weight: 800;
    text-shadow: 0 2px 12px rgba(0,0,0,.6);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: #d8d8d8; }
.hero-meta i { color: var(--brand); }
.hero-cta {
    align-self: flex-start;
    margin-top: 4px;
    background: var(--brand);
    color: #111;
    font-weight: 700;
    font-size: 14px;
    padding: 9px 20px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.hero-main:hover .hero-cta { background: #fff; }

.hero-side { display: grid; grid-template-rows: repeat(3, 1fr); gap: 16px; }
.hero-side-item {
    display: flex;
    gap: 12px;
    align-items: stretch;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color .2s, transform .2s;
}
.hero-side-item:hover { border-color: var(--brand); transform: translateX(3px); }
.hero-side-thumb {
    position: relative;
    flex: 0 0 44%;
    min-height: 92px;
    background: #000 center/cover no-repeat;
}
.hero-side-thumb .duration {
    position: absolute;
    right: 6px; bottom: 6px;
    background: rgba(0,0,0,.82);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}
.hero-side-text { padding: 10px 12px 10px 0; display: flex; flex-direction: column; gap: 6px; }
.hero-side-text b {
    font-size: 13.5px;
    line-height: 1.35;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-side-text em { font-style: normal; font-size: 12px; color: var(--text-dim); margin-top: auto; }

/* --- Horizontal rails ------------------------------------------- */
.rail {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x proximity;
}
.rail::-webkit-scrollbar { height: 8px; }
.rail::-webkit-scrollbar-track { background: var(--bg-soft); border-radius: 4px; }
.rail::-webkit-scrollbar-thumb { background: #3a3a3a; border-radius: 4px; }
.rail::-webkit-scrollbar-thumb:hover { background: var(--brand); }
.rail-card {
    flex: 0 0 268px;
    scroll-snap-align: start;
    background: var(--bg-card);
    border: 1px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    transition: .2s;
}
.rail-card:hover { transform: translateY(-4px); border-color: var(--border); }
.rail-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16/9;
    background: #000 center/cover no-repeat;
}
.rail-thumb .duration {
    position: absolute;
    right: 8px; bottom: 8px;
    background: rgba(0,0,0,.82);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}
.rank-badge {
    position: absolute;
    left: 8px; top: 8px;
    width: 30px; height: 30px;
    border-radius: 8px;
    background: var(--brand);
    color: #111;
    font-weight: 800;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.5);
}
.rail-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.35);
    color: #fff;
    font-size: 22px;
    opacity: 0;
    transition: opacity .2s;
}
.rail-card:hover .rail-play { opacity: 1; }
.rail-title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    margin: 10px 12px 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.rail-meta { font-size: 12px; color: var(--text-dim); display: flex; gap: 12px; padding: 0 12px 12px; }

/* --- Category showcase ------------------------------------------ */
.cat-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}
.cat-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: .2s;
}
.cat-card:hover { border-color: var(--brand); transform: translateY(-3px); }
.cat-card-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16/10;
    background: #000 center/cover no-repeat;
}
.cat-card-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.75));
}
.cat-card-icon {
    position: absolute;
    left: 10px; top: 10px;
    z-index: 2;
    width: 32px; height: 32px;
    border-radius: 9px;
    background: rgba(0,0,0,.6);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}
.cat-card-name {
    position: absolute;
    left: 12px; right: 12px; bottom: 26px;
    z-index: 2;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,.7);
}
.cat-card-count {
    position: absolute;
    left: 12px; bottom: 8px;
    z-index: 2;
    font-size: 11.5px;
    color: var(--brand);
    font-weight: 600;
}

/* --- Responsive ------------------------------------------------- */
@media (max-width: 1000px) {
    .home-hero { grid-template-columns: 1fr; }
    .hero-main { min-height: 320px; }
    .hero-side { grid-template-rows: none; grid-template-columns: repeat(3, 1fr); }
    .hero-side-item { flex-direction: column; }
    .hero-side-thumb { flex: none; width: 100%; min-height: 0; aspect-ratio: 16/9; }
    .hero-side-text { padding: 10px 12px; }
    .hero-title { font-size: 23px; }
}
@media (max-width: 700px) {
    .hero-side { grid-template-columns: 1fr; }
    .rail-card { flex: 0 0 220px; }
    .cat-showcase { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .hero-body { padding: 18px; }
    .hero-title { font-size: 20px; }
    .hero-meta { gap: 12px; font-size: 12px; }
}

/* ===== Mobile header fix: two-row layout (logo+actions / full-width search) ===== */
@media (max-width: 700px) {
    .header-content {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 0;
    }
    .logo a { font-size: 19px; gap: 6px; }
    .logo a i { font-size: 22px; }
    .search-bar { order: 3; flex: 1 1 100%; max-width: none; }
    .search-bar input { padding: 9px 12px; font-size: 14px; border-radius: 8px 0 0 8px; }
    .search-bar button { padding: 0 16px; }
    .header-actions { gap: 6px; }
    .header-actions .btn { padding: 7px 11px; font-size: 12.5px; white-space: nowrap; }
    .btn-user { padding: 5px 10px !important; font-size: 12.5px !important; }
    .btn-user img { width: 22px; height: 22px; }

    /* Compact, clean scrollable nav + category strips */
    .nav .container,
    .categories-bar .container {
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .nav .container::-webkit-scrollbar,
    .categories-bar .container::-webkit-scrollbar { display: none; }
    .nav-item { padding: 10px 10px; font-size: 13px; gap: 5px; }
    .nav-item i { font-size: 12px; }
    .categories-bar { padding: 9px 0; }
    .category-tag { padding: 5px 11px; font-size: 12px; }
}
