:root {
    --bg: #0b0b12;
    --bg2: #10101a;
    --panel: #151521;
    --card: #1a1a28;
    --card2: #202034;
    --border: #26263a;
    --orange: #ff7a00;
    --orange2: #ff9838;
    --yellow: #ffd400;
    --green: #2ecc71;
    --text: #f2f2f6;
    --muted: #9a9ab3;
    --muted2: #6b6b86;
    --radius: 14px;
}

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

html, body {
    height: 100%;
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: #2e2e46; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #3d3d5c; }

.hidden { display: none !important; }

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

.spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .8s linear infinite;
    vertical-align: middle;
}
.spinner.visible { display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ============ LOGIN ============ */
.login-view {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(1200px 600px at 50% -10%, #241228 0%, var(--bg) 55%);
    overflow: hidden;
    padding: 24px;
}
.login-glow {
    position: absolute;
    width: 460px; height: 460px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,122,0,.18) 0%, transparent 70%);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.login-panel {
    position: relative;
    width: 100%; max-width: 400px;
    background: linear-gradient(180deg, var(--panel), #12121c);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 40px 34px 30px;
    box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 14px;
}
.logo-badge {
    display: inline-flex;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(255,122,0,.35);
}
.logo-badge svg { width: 46px; height: 46px; display: block; }
.logo-badge.small svg { width: 34px; height: 34px; }
.logo-badge.small { border-radius: 9px; box-shadow: none; }
.logo-text { font-size: 26px; font-weight: 800; letter-spacing: .5px; }
.logo-text.small { font-size: 19px; }
.logo-perfect { color: #fff; }
.logo-list { color: var(--yellow); }
.login-tagline {
    text-align: center;
    color: var(--muted);
    font-size: 13.5px;
    margin-bottom: 26px;
}
.login-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: .3px; }
.field input {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 13px 15px;
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.field input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255,122,0,.18);
}
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
    background: linear-gradient(135deg, #ff9838, #ff5e00);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 15px;
    border: none;
    border-radius: 12px;
    transition: transform .15s, box-shadow .2s, filter .2s;
    box-shadow: 0 12px 30px rgba(255,122,0,.3);
}
.btn-login:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 16px 36px rgba(255,122,0,.42); }
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: .75; cursor: default; transform: none; }

.login-security {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 22px;
    flex-wrap: wrap;
}
.sec-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 600;
}
.sec-item svg { width: 15px; height: 15px; }
.sec-green { color: var(--green); }
.sec-yellow { color: var(--yellow); }
.login-footer {
    position: relative;
    margin-top: 26px;
    color: var(--muted2);
    font-size: 12px;
}

/* ============ TOPBAR ============ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 22px;
    height: 62px;
    background: rgba(12,12,20,.9);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; }
.logo-mini { display: flex; align-items: center; gap: 10px; }
.main-nav { display: flex; align-items: center; gap: 6px; }
.nav-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--muted);
    padding: 9px 15px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: all .18s;
}
.nav-btn svg { width: 18px; height: 18px; }
.nav-btn:hover { color: var(--text); background: rgba(255,255,255,.05); }
.nav-btn.active { color: #fff; background: rgba(255,122,0,.14); border-color: rgba(255,122,0,.45); }
.topbar-right { position: relative; display: flex; align-items: center; }
.profile-btn { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 10px; cursor: pointer; transition: background .18s; }
.profile-btn:hover { background: rgba(255,255,255,.05); }
.avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff9838, #ff5e00);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 15px;
}
.profile-name { font-size: 14px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 190px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 20px 50px rgba(0,0,0,.55);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: all .18s;
}
.profile-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.profile-menu-user { padding: 10px 12px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 6px; word-break: break-all; }
.menu-item {
    display: flex; align-items: center; gap: 9px;
    width: 100%;
    background: transparent; border: none;
    color: #ff6b6b;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px; font-weight: 600;
    transition: background .15s;
}
.menu-item svg { width: 17px; height: 17px; }
.menu-item:hover { background: rgba(255,107,107,.1); }

/* ============ MAIN ============ */
.main { max-width: 1500px; margin: 0 auto; padding: 22px; }

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.section-title { display: flex; align-items: baseline; gap: 12px; }
.section-title h1 { font-size: 22px; font-weight: 800; }
.count { color: var(--muted); font-size: 13.5px; font-weight: 600; }
.section-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 0 13px;
    height: 40px;
    width: 250px;
    transition: border-color .2s;
}
.search-box:focus-within { border-color: var(--orange); }
.search-box svg { width: 17px; height: 17px; color: var(--muted); flex-shrink: 0; }
.search-box input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); font-size: 14px; }
.sort-select {
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 11px;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
    cursor: pointer;
}
.sort-select:focus { border-color: var(--orange); }

.content-layout { display: flex; gap: 20px; align-items: flex-start; }

.sidebar {
    width: 232px;
    flex-shrink: 0;
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 104px);
    overflow-y: auto;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
}
.cat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 9px 10px;
    border-radius: 9px;
    font-size: 13.5px;
    text-align: left;
    transition: all .15s;
}
.cat-item:hover { background: rgba(255,255,255,.04); color: var(--text); }
.cat-item.active { background: rgba(255,122,0,.13); color: #fff; }
.cat-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.cat-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-count { font-size: 11.5px; color: var(--muted2); font-weight: 600; }

/* ============ GRIDS ============ */
.grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
    gap: 14px;
    min-height: 200px;
    width: 100%;
}
.grid.posters { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.empty-state { grid-column: 1 / -1; text-align: center; color: var(--muted2); padding: 60px 0; font-size: 14px; }

.card {
    position: relative;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .18s, box-shadow .2s, border-color .2s;
    display: flex;
    flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0,0,0,.5); }
.card.fav { border-color: rgba(255,212,0,.55); }

.fav-btn {
    position: absolute;
    top: 8px; right: 8px;
    z-index: 5;
    width: 30px; height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(10,10,18,.72);
    color: #55556f;
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
    backdrop-filter: blur(4px);
}
.fav-btn svg { width: 16px; height: 16px; }
.fav-btn:hover { color: var(--yellow); }
.card.fav .fav-btn { color: var(--yellow); }

/* ============ CHANNEL CARD ============ */
.channel-card { padding: 12px; }
.channel-logo {
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 30%, #23233a, #14141f);
    border-radius: 10px;
    margin-bottom: 11px;
}
.channel-logo img { max-width: 82%; max-height: 74px; object-fit: contain; }
.channel-info { flex: 1; min-width: 0; }
.channel-name { font-size: 14.5px; font-weight: 700; line-height: 1.25; margin-bottom: 3px; }
.channel-meta { font-size: 12px; color: var(--muted2); margin-bottom: 9px; }
.epg-box { font-size: 12px; }
.epg-muted { color: var(--muted2); }
.epg-now {
    color: var(--yellow);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}
.epg-progress {
    height: 4px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}
.epg-bar { height: 100%; background: linear-gradient(90deg, var(--orange), var(--yellow)); border-radius: 3px; transition: width 1s linear; }
.epg-next { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.btn-watch {
    width: 100%;
    margin-top: 11px;
    padding: 9px;
    border: none;
    border-radius: 9px;
    background: linear-gradient(135deg, #ff9838, #ff5e00);
    color: #fff;
    font-size: 13.5px;
    font-weight: 700;
    transition: filter .15s, transform .12s;
}
.btn-watch:hover { filter: brightness(1.08); }
.btn-watch:active { transform: scale(.98); }

/* ============ POSTER CARD ============ */
.poster-card { background: var(--card); }
.poster {
    position: relative;
    aspect-ratio: 2 / 3;
    background: #14141f;
    overflow: hidden;
}
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8,8,14,.62);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .2s;
}
.poster-card:hover .poster-overlay { opacity: 1; }
.btn-view {
    background: var(--orange);
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
}
.tag {
    position: absolute;
    top: 8px;
    padding: 3px 8px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 800;
    z-index: 4;
}
.tag-rating { left: 8px; background: var(--yellow); color: #222; }
.tag-type { right: 8px; background: #000; color: #fff; border: 1px solid rgba(255,255,255,.15); }
.tag-class { left: 8px; top: 34px; background: rgba(0,0,0,.8); color: var(--yellow); border: 1px solid var(--yellow); }
.poster-title {
    padding: 10px 11px 2px;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.3;
    min-height: 38px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.poster-year { padding: 0 11px 11px; font-size: 12px; color: var(--muted2); }

/* ============ MODALS ============ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(6,6,12,.7);
    backdrop-filter: blur(10px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 40px 20px;
}
.modal.open { display: flex; }
.modal-box {
    position: relative;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 100%;
    max-width: 860px;
    box-shadow: 0 40px 100px rgba(0,0,0,.7);
    overflow: hidden;
}
.modal-wide { max-width: 900px; }
.modal-video { max-width: 940px; background: #000; padding: 6px; }
.modal-close {
    position: absolute;
    top: 14px; right: 14px;
    z-index: 20;
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: rgba(12,12,20,.8);
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    transition: all .15s;
}
.modal-close svg { width: 18px; height: 18px; }
.modal-close:hover { background: var(--orange); color: #fff; }
.modal-loading, .modal-error { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 70px 20px; color: var(--muted); }
.modal-error { color: #ff6b6b; }

.detail-hero {
    position: absolute;
    inset: 0;
    height: 240px;
    background-size: cover;
    background-position: center 20%;
}
.detail-hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11,11,18,.35) 0%, var(--bg2) 82%);
}
.detail-content { position: relative; padding: 24px; }
.detail-top { display: flex; gap: 22px; align-items: flex-start; }
.detail-poster {
    width: 200px;
    flex-shrink: 0;
    aspect-ratio: 2 / 3;
    border-radius: 14px;
    overflow: hidden;
    background: #14141f;
    border: 1px solid var(--border);
    box-shadow: 0 18px 44px rgba(0,0,0,.6);
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { flex: 1; min-width: 0; }
.detail-title { font-size: 26px; font-weight: 800; line-height: 1.2; margin-bottom: 10px; }
.detail-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; color: var(--muted); font-size: 13.5px; }
.detail-meta .tag-type { position: static; }
.meta-rating {
    background: var(--yellow);
    color: #222;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 7px;
    font-size: 13px;
}
.meta-class {
    border: 1px solid var(--yellow);
    color: var(--yellow);
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 7px;
    font-size: 12.5px;
}
.detail-genres { color: var(--orange2); font-size: 13.5px; margin-bottom: 18px; }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-primary {
    background: linear-gradient(135deg, #ff9838, #ff5e00);
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 11px;
    font-size: 14.5px;
    font-weight: 700;
    transition: filter .15s, transform .12s;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: scale(.98); }
.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 12px 22px;
    border-radius: 11px;
    font-size: 14.5px;
    font-weight: 600;
    transition: all .15s;
}
.btn-secondary:hover { border-color: var(--orange); color: var(--orange2); }
.btn-secondary.disabled { opacity: .45; cursor: default; }
.btn-secondary.disabled:hover { border-color: var(--border); color: var(--text); }

.detail-synopsis { margin-top: 22px; }
.detail-synopsis h3 { font-size: 15px; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .6px; }
.detail-synopsis p { line-height: 1.6; color: #cfcfe0; font-size: 14px; }

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 20px;
}
.spec-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 11px 13px;
}
.spec-label { font-size: 11px; color: var(--muted2); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.spec-value { font-size: 13px; font-weight: 600; color: #e4e4f0; }

.trailer-frame { width: 100%; height: 520px; border: none; border-radius: 14px; }

/* ============ EPISODES ============ */
.episodes-section { margin-top: 26px; }
.episodes-section > h3 { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 14px; }
.seasons-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.season-card {
    flex-shrink: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 13px 18px;
    text-align: left;
    color: var(--text);
    min-width: 150px;
    transition: all .15s;
}
.season-card:hover { border-color: var(--orange); }
.season-card.active { border-color: var(--orange); background: rgba(255,122,0,.12); }
.season-name { display: block; font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.season-count { display: block; font-size: 12px; color: var(--muted2); }
.episodes-list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.episode-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    transition: border-color .15s;
}
.episode-card:hover { border-color: rgba(255,122,0,.5); }
.ep-num {
    width: 40px; height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #ff9838, #ff5e00);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 15px;
}
.ep-main { flex: 1; min-width: 0; }
.ep-title { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.ep-meta { display: flex; gap: 14px; font-size: 12px; color: var(--muted2); margin-bottom: 6px; }
.ep-synopsis {
    font-size: 13px;
    color: #b9b9cc;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.ep-watch { width: auto; padding: 9px 16px; margin-top: 0; flex-shrink: 0; }

/* ============ PLAYER ============ */
.player-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}
.player-overlay.open { opacity: 1; pointer-events: auto; }
.pp-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}
.player-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(180deg, rgba(0,0,0,.78), transparent);
    z-index: 5;
}
.player-title-box { flex: 1; min-width: 0; }
.player-title { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,59,59,.18);
    border: 1px solid rgba(255,59,59,.55);
    color: #ff5c5c;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 20px;
    letter-spacing: .5px;
}
.pp-live-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #ff4040;
    animation: pulse 1.3s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.pp-epg { margin-top: 6px; font-size: 12.5px; max-width: 620px; }
.pp-epg-now { color: var(--yellow); font-weight: 600; }
.pp-epg-next { color: var(--muted); }
.pp-epg-bar { height: 3px; background: rgba(255,255,255,.18); border-radius: 3px; margin: 5px 0; overflow: hidden; }
.pp-epg-bar div { height: 100%; background: linear-gradient(90deg, var(--orange), var(--yellow)); }

.player-big-play {
    position: absolute;
    z-index: 4;
    width: 84px; height: 84px;
    border-radius: 50%;
    background: rgba(255,122,0,.85);
    border: none;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    box-shadow: 0 12px 40px rgba(255,122,0,.4);
}
.player-big-play.visible { opacity: 1; pointer-events: auto; }
.player-big-play:hover { transform: scale(1.06); }
.player-big-play svg { width: 42px; height: 42px; }

.player-controls {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    z-index: 5;
    padding: 10px 18px 14px;
    background: linear-gradient(0deg, rgba(0,0,0,.85), transparent);
}
.pc-top { margin-bottom: 6px; }
.pc-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.pc-left, .pc-right { display: flex; align-items: center; gap: 8px; }

.pp-btn {
    width: 40px; height: 40px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text);
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s;
}
.pp-btn svg { width: 22px; height: 22px; }
.pp-btn:hover { background: rgba(255,255,255,.12); }
.pp-btn.active { color: var(--orange2); }
.pp-select {
    background: rgba(20,20,32,.85);
    border: 1px solid rgba(255,255,255,.14);
    color: var(--text);
    border-radius: 9px;
    padding: 7px 9px;
    font-size: 12.5px;
    outline: none;
    max-width: 140px;
    cursor: pointer;
}
.pp-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: rgba(255,255,255,.22);
    outline: none;
    cursor: pointer;
}
.pp-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--orange);
    border: none;
}
.pp-range::-moz-range-thumb {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--orange);
    border: none;
}
.pp-range.vol { width: 90px; }
.pp-time { font-size: 13px; color: #cfcfdf; font-weight: 600; margin-left: 4px; white-space: nowrap; }

.player-loading {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: rgba(0,0,0,.5);
    color: var(--muted);
    font-size: 13.5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
.player-loading.visible { opacity: 1; }
.player-loading .spinner { width: 40px; height: 40px; border-width: 3px; }

.player-error {
    position: absolute;
    inset: 0;
    z-index: 7;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    color: #ff6b6b;
    font-weight: 600;
    background: rgba(0,0,0,.7);
    opacity: 0;
    pointer-events: none;
}
.player-error.visible { opacity: 1; }

.player-toast {
    position: absolute;
    bottom: 96px; left: 50%;
    transform: translateX(-50%);
    z-index: 8;
    background: rgba(20,20,32,.92);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 13.5px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
    white-space: nowrap;
}
.player-toast.visible { opacity: 1; }

/* ============ OVERLAYS ============ */
.app-loading {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(8,8,14,.85);
    backdrop-filter: blur(6px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--muted);
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}
.app-loading.visible { opacity: 1; pointer-events: auto; }
.app-loading .spinner { width: 42px; height: 42px; border-width: 3px; }

.toast {
    position: fixed;
    bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 400;
    background: var(--panel);
    border: 1px solid var(--orange);
    color: var(--text);
    padding: 12px 22px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 16px 40px rgba(0,0,0,.5);
    opacity: 0;
    pointer-events: none;
    transition: all .25s;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .sidebar { width: 190px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}
@media (max-width: 768px) {
    .topbar { padding: 0 12px; height: 56px; flex-wrap: wrap; }
    .profile-name { display: none; }
    .nav-btn { padding: 8px 10px; font-size: 13px; }
    .nav-btn span { display: none; }
    .main { padding: 14px; }
    .content-layout { flex-direction: column; }
    .sidebar { position: static; width: 100%; max-height: 190px; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .grid.posters { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .section-controls { width: 100%; }
    .search-box { width: 100%; flex: 1; }
    .detail-top { flex-direction: column; align-items: center; }
    .detail-poster { width: 170px; }
    .detail-actions { justify-content: center; }
    .detail-info { text-align: center; }
    .detail-meta { justify-content: center; }
    .detail-genres { text-align: center; }
    .pc-right .pp-select { display: none; }
    .trailer-frame { height: 60vh; }
}
