:root {
    --bg:       #0f0f0f;
    --bg-card:  #181818;
    --bg-raise: #222222;
    --accent:   #e50914;
    --accent-h: #ff1a25;
    --text-1:   #ffffff;
    --text-2:   #a8a8a8;
    --text-3:   #6b6b6b;
    --border:   rgba(255,255,255,0.08);
    --glass:    rgba(15,15,15,0.88);
    --radius:   8px;
    --shadow:   0 8px 32px rgba(0,0,0,0.6);
}

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

body {
    background: var(--bg);
    color: var(--text-1);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Auth overlay ─────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

.auth-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
}
.auth-overlay.hidden { display: none !important; }

.auth-card {
    width: 100%; max-width: 400px;
    padding: 44px 40px 40px;
    background: #161616;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7);
}

.auth-logo {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 36px; letter-spacing: 3px;
    color: var(--accent); text-align: center; margin-bottom: 4px;
}
.auth-tagline {
    text-align: center; color: var(--text-3); font-size: 13px; margin-bottom: 28px;
}

.auth-tabs {
    display: flex; gap: 4px; background: #111;
    border-radius: 8px; padding: 4px; margin-bottom: 28px;
}
.auth-tab {
    flex: 1; padding: 8px; border: none; background: transparent;
    color: var(--text-2); font-size: 13px; font-weight: 500;
    border-radius: 6px; cursor: pointer; transition: all 0.15s;
}
.auth-tab.active {
    background: #222; color: var(--text-1);
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: 0.4px; }
.auth-field input {
    background: #111; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px; padding: 10px 14px;
    color: var(--text-1); font-size: 14px; outline: none;
    transition: border-color 0.15s;
}
.auth-field input:focus { border-color: rgba(255,255,255,0.3); }
.auth-field input::placeholder { color: var(--text-3); }

.auth-pw-wrap { position: relative; display: flex; }
.auth-pw-wrap input { flex: 1; padding-right: 40px; }
.auth-pw-eye {
    position: absolute; right: 0; top: 0; bottom: 0;
    width: 38px; background: none; border: none;
    color: var(--text-3); cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    transition: color 0.15s;
}
.auth-pw-eye:hover { color: var(--text-1); }

.auth-error {
    font-size: 12px; color: #ff5555; min-height: 16px;
    padding: 0 2px;
}

.auth-submit {
    width: 100%; padding: 11px;
    background: var(--accent); color: #fff;
    border: none; border-radius: 8px;
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: background 0.15s; margin-top: 4px;
}
.auth-submit:hover { background: var(--accent-h); }

/* ── Admin panel ───────────────────────────────────────────────────────────── */
.admin-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,0.85);
    display: flex; align-items: center; justify-content: center;
}
.admin-card {
    width: 480px; max-height: 80vh;
    background: #161616; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px; padding: 24px;
    display: flex; flex-direction: column;
}
.admin-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px;
}
.admin-header h2 { font-size: 16px; font-weight: 600; }
.admin-close-btn {
    background: none; border: none; color: var(--text-2);
    font-size: 18px; cursor: pointer; padding: 4px 8px;
}
.admin-close-btn:hover { color: var(--text-1); }
.admin-codes { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.admin-code-row {
    display: flex; align-items: center; justify-content: space-between;
    background: #111; border-radius: 8px; padding: 10px 14px;
    font-size: 13px;
}
.admin-code-row .code-val {
    font-family: monospace; font-size: 14px; letter-spacing: 1px; color: var(--text-1);
}
.admin-code-row .code-status {
    font-size: 11px; font-weight: 600; padding: 2px 8px;
    border-radius: 20px;
}
.code-status.unused { background: rgba(0,200,100,0.15); color: #0c8; }
.code-status.used { background: rgba(255,255,255,0.06); color: var(--text-3); }
.admin-code-row .copy-btn {
    background: none; border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-2); border-radius: 5px; padding: 3px 10px;
    font-size: 11px; cursor: pointer;
}
.admin-code-row .copy-btn:hover { color: var(--text-1); border-color: rgba(255,255,255,0.3); }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
:root { --sb-w: 160px; }

.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 56px;
    background: #111; border-right: 1px solid rgba(255,255,255,0.06);
    z-index: 200; display: flex; flex-direction: column;
    transition: width 0.22s cubic-bezier(0.4,0,0.2,1);
    overflow-x: hidden; overflow-y: visible;
}
body.sb-open .sidebar,
body.sb-pinned .sidebar { width: var(--sb-w); }

.main-wrap {
    margin-left: 56px;
    transition: margin-left 0.22s cubic-bezier(0.4,0,0.2,1);
}
body.sb-open .main-wrap,
body.sb-pinned .main-wrap { margin-left: var(--sb-w); }

/* Keep label text visible when pinned */
body.sb-pinned .sidebar .sb-item span,
body.sb-pinned .sidebar .sb-label,
body.sb-pinned .sidebar .sb-section-label,
body.sb-pinned .sidebar .sb-search-input,
body.sb-pinned .sidebar .sb-profile-text,
body.sb-pinned .sidebar .profile-caret,
body.sb-pinned .sidebar .logo,
body.sb-pinned .sidebar .sb-collapse-btn span { max-width: 120px !important; opacity: 1 !important; }

.sb-top { padding: 18px 14px 10px; flex-shrink: 0; }

/* Scrollable body */
.sb-body {
    overflow-y: auto; overflow-x: hidden;
    padding: 4px 0; scrollbar-width: none;
}
.sb-body::-webkit-scrollbar { display: none; }

/* ── Sidebar shared transition helpers ───────────────────────────────────── */
/* All text labels fade + clip horizontally so icons never move */
.sb-label {
    overflow: hidden; white-space: nowrap;
    max-width: 120px; opacity: 1;
    transition: max-width 0.22s cubic-bezier(0.4,0,0.2,1),
                opacity   0.18s ease;
}
body:not(.sb-open) .sidebar .sb-label {
    max-width: 0; opacity: 0;
}

/* Section labels */
.sb-section-label {
    font-size: 9px; font-weight: 700; letter-spacing: 1.2px;
    color: var(--text-3); padding: 10px 0 4px 20px;
    text-transform: uppercase; white-space: nowrap;
    overflow: hidden; max-width: 160px; opacity: 1;
    transition: max-width 0.22s cubic-bezier(0.4,0,0.2,1), opacity 0.18s ease,
                padding 0.22s ease;
}
body:not(.sb-open) .sidebar .sb-section-label { max-width: 0; opacity: 0; padding-top: 4px; padding-bottom: 2px; }

/* Search row — icon stays fixed at left, input fades in */
.sb-search-row {
    display: flex; align-items: center; gap: 8px;
    margin: 4px 8px 8px; padding: 8px 10px 8px 12px;
    background: rgba(255,255,255,0.06); border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.08);
}
.sb-search-icon { font-size: 13px; color: var(--text-2); flex-shrink: 0; cursor: pointer; }
.sb-search-input {
    background: none; border: none; outline: none;
    color: var(--text-1); font-size: 13px; font-family: 'Inter', sans-serif;
    min-width: 0; overflow: hidden; white-space: nowrap;
    max-width: 100px; opacity: 1;
    transition: max-width 0.22s cubic-bezier(0.4,0,0.2,1), opacity 0.18s ease;
}
.sb-search-input::placeholder { color: var(--text-3); }
body:not(.sb-open) .sidebar .sb-search-input { max-width: 0; opacity: 0; }

/* Nav items — fixed left padding keeps icon in place */
.sb-nav { display: flex; flex-direction: column; gap: 1px; padding: 0 8px; }
.sb-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px 9px 12px; border-radius: 8px;
    font-size: 13px; font-weight: 500; color: var(--text-2);
    cursor: pointer; white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    text-decoration: none; user-select: none;
}
.sb-item i { font-size: 14px; flex-shrink: 0; width: 16px; text-align: center; }
.sb-item span { overflow: hidden; white-space: nowrap; max-width: 120px; opacity: 1;
    transition: max-width 0.22s cubic-bezier(0.4,0,0.2,1), opacity 0.18s ease; }
body:not(.sb-open) .sidebar .sb-item span { max-width: 0; opacity: 0; }
.sb-item:hover { background: rgba(255,255,255,0.07); color: var(--text-1); }
.sb-item.active { background: rgba(255,255,255,0.1); color: var(--text-1); font-weight: 600; }
.sb-disabled { opacity: 0.45; pointer-events: none; }

/* Bottom section */
.sb-bottom {
    flex-shrink: 0; padding: 6px 0 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex; flex-direction: column; gap: 2px;
}
.sb-bottom .sb-nav { padding: 2px 8px; }
.sb-bottom .sb-item { padding: 8px 10px 8px 12px; }

/* Profile row */
.sb-profile-wrap { position: relative; }
.sb-profile-btn {
    display: flex; align-items: center; gap: 8px;
    width: 100%; padding: 10px 10px 10px 12px;
    background: none; border: none; cursor: pointer;
    border-top: 1px solid rgba(255,255,255,0.06);
    transition: background 0.15s;
}
.sb-profile-btn:hover { background: rgba(255,255,255,0.06); }
.profile-nav-avatar {
    width: 30px; height: 30px; border-radius: 6px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800; color: #fff;
    font-family: 'Inter', sans-serif;
    border: 2px solid transparent; transition: border-color 0.2s;
}
.sb-profile-btn:hover .profile-nav-avatar { border-color: rgba(255,255,255,0.5); }
.sb-profile-text {
    flex: 1; min-width: 0; text-align: left;
    overflow: hidden; max-width: 80px; opacity: 1;
    transition: max-width 0.22s cubic-bezier(0.4,0,0.2,1), opacity 0.18s ease;
}
body:not(.sb-open) .sidebar .sb-profile-text { max-width: 0; opacity: 0; }
.sb-profile-name { display: block; font-size: 13px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-profile-tier { display: block; font-size: 10px; color: var(--text-3); text-transform: lowercase; }
.profile-caret {
    font-size: 10px; color: var(--text-2); flex-shrink: 0;
    overflow: hidden; max-width: 16px; opacity: 1;
    transition: transform 0.22s, max-width 0.22s cubic-bezier(0.4,0,0.2,1), opacity 0.18s ease;
}
body:not(.sb-open) .sidebar .profile-caret { max-width: 0; opacity: 0; }
.profile-wrap.open .profile-caret { transform: rotate(180deg); }

/* Logo */
.logo {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 22px; letter-spacing: 3px;
    background: linear-gradient(135deg, var(--accent) 0%, #ff6b35 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    cursor: pointer; user-select: none;
    overflow: hidden; white-space: nowrap;
    max-width: 120px; opacity: 1;
    transition: max-width 0.22s cubic-bezier(0.4,0,0.2,1), opacity 0.18s ease;
    display: block;
}
.logo:hover { opacity: 0.85; }
body:not(.sb-open) .sidebar .logo { max-width: 0; opacity: 0; }

/* Collapse button */
.sb-collapse-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px 9px 12px; font-size: 12px; font-weight: 500; color: var(--text-3);
    cursor: pointer; white-space: nowrap; transition: color 0.15s;
    user-select: none;
}
.sb-collapse-btn:hover { color: var(--text-1); }
.sb-collapse-btn span { overflow: hidden; max-width: 100px; opacity: 1;
    transition: max-width 0.22s cubic-bezier(0.4,0,0.2,1), opacity 0.18s ease; }
body:not(.sb-open) .sidebar .sb-collapse-btn span { max-width: 0; opacity: 0; }
.sb-collapse-icon { font-size: 12px; flex-shrink: 0; }

/* ── Profile dropdown (opens upward from sidebar bottom) ─────────────────── */
.profile-wrap { position: relative; }
.profile-dropdown {
    position: absolute; bottom: calc(100% + 8px); left: 0;
    width: 220px; background: rgba(20,20,20,0.97);
    border: 1px solid rgba(255,255,255,0.14); border-radius: 10px;
    padding: 8px 0; z-index: 2000;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.9);
    opacity: 0; visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
}
.profile-wrap.open .profile-dropdown {
    opacity: 1; visibility: visible; transform: translateY(0);
}

.pd-divider {
    height: 1px; background: rgba(255,255,255,0.1); margin: 6px 0;
}
.pd-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 9px 16px; background: none; border: none;
    color: rgba(255,255,255,0.75); font-size: 13px; font-weight: 500;
    font-family: 'Inter', sans-serif; cursor: pointer; text-align: left;
    transition: background 0.15s, color 0.15s;
}
.pd-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.pd-item i { width: 16px; text-align: center; opacity: 0.7; }
.pd-signout-btn { color: rgba(255,255,255,0.5); }
.pd-signout-btn:hover { color: var(--accent); }

/* Profile switch rows inside dropdown */
.pd-switch-row {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 8px 16px; background: none; border: none;
    cursor: pointer; transition: background 0.15s;
}
.pd-switch-row:hover { background: rgba(255,255,255,0.08); }
.pd-switch-avatar {
    width: 36px; height: 36px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 800; color: #fff;
    flex-shrink: 0; border: 2px solid transparent;
    transition: border-color 0.15s;
}
.pd-switch-row.active-profile .pd-switch-avatar { border-color: #fff; }
.pd-switch-name {
    font-size: 13px; color: rgba(255,255,255,0.8); font-weight: 500;
    font-family: 'Inter', sans-serif;
}
.pd-switch-row.active-profile .pd-switch-name { color: #fff; font-weight: 700; }
.pd-add-row { color: rgba(255,255,255,0.5); }
.pd-add-row:hover { color: rgba(255,255,255,0.9); }

/* ── Profile Manager overlay ───────────────────────────────────────────────── */
.profile-manager {
    position: fixed; inset: 0; z-index: 3000;
    background: #141414;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}
.profile-manager.active { opacity: 1; visibility: visible; }
.pm-content { text-align: center; }
.pm-title {
    font-family: 'Inter', sans-serif; font-size: 3.2rem; font-weight: 400;
    color: #fff; margin-bottom: 48px; letter-spacing: -0.5px;
}
.pm-grid {
    display: flex; gap: 24px; justify-content: center; flex-wrap: wrap;
    margin-bottom: 48px;
}
.pm-profile-card {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    cursor: pointer; width: 100px;
    transition: transform 0.2s;
}
.pm-profile-card:hover { transform: scale(1.05); }
.pm-avatar {
    width: 100px; height: 100px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 44px; font-weight: 900; color: #fff;
    border: 3px solid transparent;
    transition: border-color 0.2s;
    position: relative;
}
.pm-profile-card:hover .pm-avatar { border-color: #fff; }
.pm-avatar-active { border-color: #fff !important; }
.pm-edit-overlay {
    position: absolute; inset: 0; border-radius: 6px;
    background: rgba(0,0,0,0.55); opacity: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff;
    transition: opacity 0.2s;
}
.pm-profile-card:hover .pm-edit-overlay { opacity: 1; }
.pm-name {
    font-size: 14px; color: rgba(255,255,255,0.65); font-weight: 500;
    font-family: 'Inter', sans-serif;
}
.pm-profile-card:hover .pm-name,
.pm-profile-card.is-active .pm-name { color: #fff; }
.pm-add-card .pm-avatar {
    background: rgba(255,255,255,0.1); border: 3px solid rgba(255,255,255,0.3);
}
.pm-add-card:hover .pm-avatar { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.6); }
.pm-actions { display: flex; gap: 12px; justify-content: center; }
.pm-manage-btn {
    background: transparent; border: 1px solid rgba(255,255,255,0.5);
    color: rgba(255,255,255,0.65); padding: 12px 32px;
    font-size: 15px; font-weight: 600; letter-spacing: 1.5px;
    text-transform: uppercase; border-radius: 3px; cursor: pointer;
    font-family: 'Inter', sans-serif; transition: all 0.2s;
}
.pm-manage-btn:hover { border-color: #fff; color: #fff; }
.pm-done-btn {
    background: transparent; border: 1px solid rgba(255,255,255,0.5);
    color: rgba(255,255,255,0.65); padding: 12px 32px;
    font-size: 15px; font-weight: 600; letter-spacing: 1.5px;
    text-transform: uppercase; border-radius: 3px; cursor: pointer;
    font-family: 'Inter', sans-serif; transition: all 0.2s;
}
.pm-done-btn:hover { border-color: #fff; color: #fff; }

/* ── Edit Profile modal ────────────────────────────────────────────────────── */
.edit-profile-modal {
    position: fixed; inset: 0; z-index: 3100;
    background: rgba(0,0,0,0.75); display: flex;
    align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.edit-profile-modal.active { opacity: 1; visibility: visible; }
.ep-modal-box {
    background: #1e1e1e; border-radius: 18px;
    padding: 32px 28px 28px; width: 420px; max-width: 94vw;
    max-height: 90vh; overflow-y: auto; scrollbar-width: none;
    box-shadow: 0 40px 100px rgba(0,0,0,0.95);
    position: relative; display: flex; flex-direction: column; gap: 14px;
}
.ep-modal-box::-webkit-scrollbar { display: none; }
.ep-close-btn {
    position: absolute; top: 16px; right: 16px;
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,0.1); border: none;
    color: #fff; font-size: 14px; cursor: pointer; display: flex;
    align-items: center; justify-content: center; transition: background 0.15s;
}
.ep-close-btn:hover { background: rgba(255,255,255,0.2); }
.ep-modal-box h2 { font-size: 20px; font-weight: 700; color: #fff; text-align: center; margin: 0; }
.ep-subtitle { font-size: 13px; color: var(--text-3); text-align: center; margin: 0; }

/* Avatar grid — image cards */
.ep-avatar-grid {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
}
.ep-avatar-opt {
    aspect-ratio: 1; border-radius: 10px; overflow: hidden;
    cursor: pointer; border: 3px solid transparent;
    transition: border-color 0.15s, transform 0.15s;
    background: rgba(255,255,255,0.07);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
}
.ep-avatar-opt img { width: 100%; height: 100%; object-fit: cover; }
.ep-avatar-opt:hover { transform: scale(1.06); border-color: rgba(255,255,255,0.5); }
.ep-avatar-opt.selected { border-color: #fff; }

/* Upload button */
.ep-upload-btn {
    width: 100%; padding: 11px; background: transparent;
    border: 1.5px dashed rgba(255,255,255,0.2); border-radius: 10px;
    color: var(--text-2); font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.15s; display: flex;
    align-items: center; justify-content: center; gap: 8px;
}
.ep-upload-btn:hover { border-color: rgba(255,255,255,0.5); color: #fff; }

/* Name input */
.ep-name-input {
    width: 100%; background: rgba(255,255,255,0.07);
    border: 1.5px solid rgba(255,255,255,0.12);
    color: #fff; padding: 12px 16px; border-radius: 10px;
    font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 500;
    outline: none; transition: border-color 0.2s; box-sizing: border-box;
}
.ep-name-input:focus { border-color: rgba(255,255,255,0.4); }
.ep-name-input::placeholder { color: var(--text-3); }

/* Kids toggle row */
.ep-kids-row {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; padding: 12px 14px;
}
.ep-kids-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-1); }
.ep-kids-sub { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.ep-kids-toggle { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.ep-kids-toggle input { opacity: 0; width: 0; height: 0; }
.ep-kids-slider {
    position: absolute; inset: 0; background: rgba(255,255,255,0.12);
    border-radius: 24px; cursor: pointer; transition: background 0.2s;
}
.ep-kids-slider::before {
    content: ''; position: absolute; width: 18px; height: 18px;
    left: 3px; top: 3px; background: #fff; border-radius: 50%;
    transition: transform 0.2s;
}
.ep-kids-toggle input:checked + .ep-kids-slider { background: #0071eb; }
.ep-kids-toggle input:checked + .ep-kids-slider::before { transform: translateX(20px); }

/* Save button */
.ep-save-btn {
    width: 100%; padding: 13px; background: #fff; color: #111;
    border: none; border-radius: 10px; font-size: 15px; font-weight: 700;
    cursor: pointer; transition: background 0.15s; font-family: 'Inter', sans-serif;
}
.ep-save-btn:hover { background: #e0e0e0; }

/* Profile order */
.ep-order-section { display: flex; flex-direction: column; gap: 10px; }
.ep-order-label { font-size: 11px; font-weight: 700; color: var(--text-3); letter-spacing: 0.8px; text-align: center; }
.ep-order-list { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.ep-order-item { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ep-order-avatar {
    width: 54px; height: 54px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; overflow: hidden; flex-shrink: 0;
}
.ep-order-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ep-order-name { font-size: 11px; color: var(--text-2); max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-order-arrows { display: flex; gap: 4px; }
.ep-order-arrows button {
    width: 22px; height: 22px; background: rgba(255,255,255,0.1);
    border: none; color: #fff; border-radius: 4px; cursor: pointer;
    font-size: 11px; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.ep-order-arrows button:hover { background: rgba(255,255,255,0.25); }
.ep-order-arrows button:disabled { opacity: 0.25; cursor: default; }
.ep-order-hint { font-size: 11px; color: var(--text-3); text-align: center; margin: 0; }

/* Delete button */
.ep-delete-btn {
    width: 100%; padding: 13px; font-size: 14px; background: transparent;
    border: 1.5px solid rgba(229,9,20,0.5); color: rgba(229,9,20,0.85);
    border-radius: 10px; cursor: pointer; font-family: 'Inter', sans-serif;
    font-weight: 600; transition: all 0.2s;
}
.ep-delete-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(229,9,20,0.08); }

/* ── Managing mode ─────────────────────────────────────────────────────────── */
.pm-profile-card.manage-mode .pm-edit-overlay { opacity: 1; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
    height: 92vh; min-height: 600px;
    background-size: cover; background-position: center 20%;
    position: relative; display: flex; align-items: flex-end;
    padding: 0 48px 80px;
    transition: opacity 0.5s ease;
}
.hero-overlay {
    position: absolute; inset: 0;
    background:
        linear-gradient(to right,  rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 45%, transparent 75%),
        linear-gradient(to top,    rgba(0,0,0,0.9)  0%, rgba(0,0,0,0.1) 40%, transparent 70%);
}
.hero-fade {
    position: absolute; bottom: 0; width: 100%; height: 22vh;
    background: linear-gradient(to top, var(--bg) 0%, transparent 100%); z-index: 1;
}
.hero-content { max-width: 600px; z-index: 2; }
.hero-meta {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 14px; font-size: 13px; font-weight: 600;
}
.match-score {
    color: #4ade80; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; gap: 5px;
}
.match-score::before { content: '✦'; font-size: 9px; }
.year, .rating {
    color: var(--text-2); border: 1px solid rgba(255,255,255,0.25);
    padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 600;
    letter-spacing: 0.5px; text-transform: uppercase;
}
.hero-title {
    font-family: 'Bebas Neue', sans-serif; font-size: clamp(3.5rem, 7vw, 5.5rem);
    line-height: 0.95; letter-spacing: 1px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.5);
    margin-bottom: 18px;
}
.hero-description {
    font-size: 1rem; line-height: 1.7; margin-bottom: 28px;
    color: rgba(255,255,255,0.85);
    display: -webkit-box; -webkit-line-clamp: 3;
    -webkit-box-orient: vertical; overflow: hidden;
    max-width: 520px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}
.hero-buttons { display: flex; align-items: center; gap: 12px; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    padding: 11px 28px; border: none; border-radius: 6px;
    font-size: 15px; font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: 9px;
    transition: all 0.2s ease; font-family: 'Inter', sans-serif;
    letter-spacing: 0.2px; white-space: nowrap;
}
.btn-play {
    background: var(--text-1); color: #000;
}
.btn-play:hover { background: rgba(255,255,255,0.88); transform: scale(1.03); }
.btn-play:active { transform: scale(0.98); }
.btn-info {
    background: rgba(255,255,255,0.14); color: var(--text-1);
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    margin-left: 0;
}
.btn-info:hover { background: rgba(255,255,255,0.22); transform: scale(1.03); }
.btn-info:active { transform: scale(0.98); }

/* ── Content rows ─────────────────────────────────────────────────────────── */
.content { padding: 0 0 100px; margin-top: -40px; position: relative; z-index: 3; }
.row { margin-bottom: 48px; padding: 0 48px; }
.row-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.row-title {
    font-size: 1.1rem; font-weight: 700; color: var(--text-1);
    letter-spacing: 0.3px;
}
.row-title::before {
    content: ''; display: inline-block;
    width: 3px; height: 1em; background: var(--accent);
    border-radius: 2px; margin-right: 10px; vertical-align: middle;
}
#continue-watching-section .row-title::before { display: none; }
.row-nav { display: flex; gap: 4px; }
.row-nav-btn {
    background: rgba(255,255,255,0.07); border: 1px solid var(--border);
    color: var(--text-2); width: 30px; height: 30px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 11px; transition: all 0.2s;
}
.row-nav-btn:hover { background: rgba(255,255,255,0.15); color: var(--text-1); }

.row-posters {
    display: flex; overflow-x: auto; overflow-y: visible;
    gap: 12px; padding: 16px 4px 20px; scroll-behavior: smooth;
    scrollbar-width: none;
}
.row-posters::-webkit-scrollbar { display: none; }

/* ── Continue watching cards ─────────────────────────────────────────────── */
.continue-card {
    flex-shrink: 0; width: 220px; cursor: pointer; position: relative;
}
.cc-thumb {
    width: 220px; height: 124px;
    background-size: cover; background-position: center top;
    border-radius: 6px; position: relative; overflow: hidden;
    transition: transform 0.22s, box-shadow 0.22s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.continue-card:hover .cc-thumb {
    transform: scale(1.06) translateY(-4px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.8), 0 0 0 1px rgba(255,255,255,0.1);
}
.cc-play-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.45); opacity: 0; transition: opacity 0.2s;
}
.continue-card:hover .cc-play-overlay { opacity: 1; }
.cc-play-overlay i { font-size: 28px; color: #fff; drop-shadow: 0 2px 8px rgba(0,0,0,0.8); }
.cc-ep-label {
    position: absolute; top: 7px; left: 7px;
    font-size: 10px; font-weight: 800; color: rgba(255,255,255,0.9);
    background: rgba(0,0,0,0.65); padding: 2px 7px; border-radius: 3px;
    letter-spacing: 0.3px;
}
.cc-time-label {
    position: absolute; bottom: 12px; right: 7px;
    font-size: 10px; color: rgba(255,255,255,0.65);
    background: rgba(0,0,0,0.6); padding: 2px 6px; border-radius: 3px;
}
.cc-progress-bar {
    position: absolute; bottom: 0; left: 0; right: 0; height: 4px;
    background: rgba(255,255,255,0.18);
}
.cc-progress-fill {
    height: 100%; background: var(--accent);
    border-radius: 0 2px 2px 0;
}
.cc-info { padding: 6px 2px 0; }
.cc-title {
    font-size: 12px; font-weight: 600; color: var(--text-1);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cc-sub {
    font-size: 11px; color: var(--text-3); margin-top: 2px;
}

/* ── Poster cards ─────────────────────────────────────────────────────────── */
.poster-card {
    position: relative; width: 185px; height: 278px; flex-shrink: 0;
    border-radius: var(--radius); overflow: hidden; cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94),
                box-shadow 0.35s ease, outline 0.2s;
    outline: 2px solid transparent;
}
.poster-card:hover {
    transform: scale(1.1) translateY(-8px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.85), 0 0 0 1px rgba(255,255,255,0.1);
    z-index: 10; outline-color: rgba(255,255,255,0.12);
}
.poster-card img {
    width: 100%; height: 100%; object-fit: cover;
    transition: filter 0.3s;
}
.poster-card:hover img { filter: brightness(0.75); }

.p-play {
    opacity: 0; position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.5) 0%, transparent 70%);
    transition: opacity 0.25s;
}
.poster-card:hover .p-play { opacity: 1; }
.p-play svg {
    width: 52px; height: 52px; fill: white;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.7));
    transform: scale(0.85); transition: transform 0.25s;
}
.poster-card:hover .p-play svg { transform: scale(1); }

.poster-label {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 50%, transparent 100%);
    color: var(--text-1); font-size: 11px; font-weight: 600;
    padding: 32px 10px 10px; line-height: 1.3;
    opacity: 0; transition: opacity 0.25s; pointer-events: none;
}
.poster-card:hover .poster-label { opacity: 1; }

/* Skeleton */
@keyframes shimmer {
    0%   { background-position: -800px 0; }
    100% { background-position:  800px 0; }
}
.poster-skeleton {
    width: 185px; height: 278px; flex-shrink: 0; border-radius: var(--radius);
    background: linear-gradient(90deg, #1a1a1a 25%, #242424 50%, #1a1a1a 75%);
    background-size: 800px 100%;
    animation: shimmer 1.6s infinite linear;
}

/* Broken poster */
.poster-card.no-poster {
    background: #1a1a1a;
    display: flex; align-items: center; justify-content: center;
}
.poster-card.no-poster img { opacity: 0; }
.poster-card.no-poster::after {
    content: '\f03d'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
    font-size: 28px; color: var(--text-3);
}

/* ── Search ───────────────────────────────────────────────────────────────── */
.search-results-section { padding: 120px 80px 60px; min-height: 100vh; }
.search-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 32px; padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}
.search-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 16px;
}
.no-results {
    color: var(--text-2); font-size: 1rem; padding: 60px 0;
    grid-column: 1/-1; text-align: center; line-height: 1.6;
}
.no-results strong { color: var(--text-1); }

/* ── Episode picker ───────────────────────────────────────────────────────── */
.episode-picker {
    position: fixed; inset: 0; z-index: 900;
    background: rgba(0,0,0,0.85); backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.episode-picker.active { opacity: 1; visibility: visible; }

.ep-box {
    background: #181818; border-radius: 10px;
    width: 780px; max-width: 96vw; max-height: 88vh;
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: 0 32px 80px rgba(0,0,0,0.95), 0 0 0 1px rgba(255,255,255,0.07);
    transform: translateY(16px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.25,0.46,0.45,0.94);
}
.episode-picker.active .ep-box { transform: translateY(0) scale(1); }

/* Header */
.ep-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 16px; flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.ep-header-left {}
.ep-episodes-label {
    font-size: 10px; font-weight: 700; color: var(--text-3);
    text-transform: uppercase; letter-spacing: 1.5px;
    display: block; margin-bottom: 4px;
}
.ep-box h3 {
    font-family: 'Inter', sans-serif; font-size: 1.3rem;
    font-weight: 700; letter-spacing: 0; line-height: 1.2;
}
.ep-header-right {
    display: flex; align-items: center; gap: 10px;
}
.ep-close-btn {
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-2); width: 32px; height: 32px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 13px; flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
.ep-close-btn:hover { background: rgba(255,255,255,0.16); color: var(--text-1); }

/* Season dropdown */
.ep-season-dropdown { position: relative; }
.ep-season-btn {
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-1); padding: 7px 14px; border-radius: 6px;
    cursor: pointer; font-size: 13px; font-weight: 600;
    font-family: 'Inter', sans-serif;
    display: flex; align-items: center; gap: 8px;
    transition: background 0.2s; white-space: nowrap;
}
.ep-season-btn:hover { background: rgba(255,255,255,0.14); }
.ep-season-btn i { font-size: 10px; opacity: 0.7; }
.ep-season-menu {
    position: absolute; top: calc(100% + 6px); right: 0;
    background: #252525; border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px; min-width: 130px; z-index: 10;
    box-shadow: 0 8px 24px rgba(0,0,0,0.7);
    display: none; overflow: hidden;
}
.ep-season-menu.open { display: block; }
.ep-season-option {
    padding: 10px 16px; cursor: pointer; font-size: 13px;
    color: var(--text-2); font-family: 'Inter', sans-serif;
    transition: background 0.15s;
}
.ep-season-option:hover { background: rgba(255,255,255,0.08); color: var(--text-1); }
.ep-season-option.active { color: var(--text-1); font-weight: 700; }

/* Info line */
.ep-info-line {
    padding: 9px 24px;
    font-size: 11px; color: var(--text-3);
    font-weight: 700; letter-spacing: 0.8px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

/* Episode grid */
.ep-episode-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 16px 24px 20px;
    overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.ep-episode-grid::-webkit-scrollbar { width: 4px; }
.ep-episode-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

/* Episode card */
.ep-grid-card {
    cursor: pointer;
    border-radius: 4px;
    overflow: visible;
    transition: transform 0.2s;
}
.ep-grid-card:hover { transform: scale(1.05); }
.ep-thumb {
    position: relative; aspect-ratio: 16/9;
    background: #2a2a2a; border-radius: 4px; overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}
.ep-grid-card.now .ep-thumb { border-color: rgba(255,255,255,0.9); }
.ep-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-thumb-fallback {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: rgba(255,255,255,0.12);
}
.ep-meta-overlay {
    position: absolute; bottom: 0; left: 0; right: 0;
    padding: 18px 7px 5px;
    background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, transparent 100%);
    display: flex; justify-content: space-between; align-items: flex-end;
}
.ep-num-label {
    font-size: 10px; font-weight: 800; color: rgba(255,255,255,0.92);
    font-family: 'Inter', sans-serif;
}
.ep-dur-label {
    font-size: 10px; color: rgba(255,255,255,0.5);
    font-family: 'Inter', sans-serif;
}
.ep-now-badge {
    position: absolute; top: 5px; left: 5px;
    background: rgba(255,255,255,0.96); color: #000;
    font-size: 8px; font-weight: 900; letter-spacing: 0.3px;
    padding: 2px 6px; border-radius: 3px;
    font-family: 'Inter', sans-serif;
}
.ep-grid-title {
    font-size: 11px; color: rgba(255,255,255,0.6);
    padding: 5px 1px 0;
    line-height: 1.35; font-weight: 500;
    font-family: 'Inter', sans-serif;
    display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ep-grid-card:hover .ep-grid-title { color: rgba(255,255,255,0.9); }
.ep-grid-card.now .ep-grid-title { color: rgba(255,255,255,0.95); font-weight: 600; }

.ep-loading {
    grid-column: 1 / -1;
    padding: 40px; color: var(--text-3); font-size: 13px; text-align: center;
}

@media (max-width: 600px) {
    .ep-episode-grid { grid-template-columns: repeat(3, 1fr); padding: 12px 16px 16px; }
    .ep-box { border-radius: 8px; }
}

/* ── Video modal ──────────────────────────────────────────────────────────── */
.video-modal {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,0.88); backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.video-modal.active { opacity: 1; visibility: visible; }

.modal-content {
    background: var(--bg-card); width: 88%; max-width: 1120px;
    border-radius: 14px; overflow: hidden; position: relative;
    box-shadow: 0 32px 80px rgba(0,0,0,0.95), 0 0 0 1px var(--border);
    transform: translateY(40px) scale(0.98);
    transition: transform 0.35s cubic-bezier(0.25,0.46,0.45,0.94);
    max-height: 92vh; overflow-y: auto;
}
.video-modal.active .modal-content { transform: translateY(0) scale(1); }

/* Hide scrollbar on modal-content */
.modal-content::-webkit-scrollbar { display: none; }
.modal-content { scrollbar-width: none; }

.iframe-wrapper {
    position: relative; overflow: hidden; width: 100%; height: 630px;
}
.iframe-wrapper:fullscreen,
.iframe-wrapper:-webkit-full-screen {
    width: 100vw; height: 100vh; background: #000;
}
.iframe-wrapper:fullscreen #video-player,
.iframe-wrapper:-webkit-full-screen #video-player {
    width: 100%; height: 100%; margin-top: 0;
}
.iframe-wrapper:fullscreen::before,
.iframe-wrapper:fullscreen::after,
.iframe-wrapper:-webkit-full-screen::before,
.iframe-wrapper:-webkit-full-screen::after { display: none; }
.iframe-wrapper::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 60px;
    background: #000; z-index: 5; pointer-events: none;
}
#video-player {
    width: 100%; height: calc(100% + 60px); margin-top: -60px;
    background: #000; border: none; display: block;
}


.modal-top-btns {
    position: absolute; top: 14px; right: 14px; z-index: 50;
    display: flex; gap: 8px;
    opacity: 0; transition: opacity 0.3s ease;
    pointer-events: none;
}
.modal-top-btns.visible { opacity: 1; pointer-events: auto; }
.modal-icon-btn {
    background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.9); width: 36px; height: 36px;
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; backdrop-filter: blur(8px);
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.modal-icon-btn:hover { background: rgba(255,255,255,0.18); color: #fff; transform: scale(1.08); }
.modal-close-btn:hover { background: rgba(229,9,20,0.85) !important; border-color: transparent !important; }


/* ── Modal chrome (source bar + info) — hidden until hover ───────────────── */
.modal-chrome {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.modal-chrome.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── Source switcher ──────────────────────────────────────────────────────── */
.source-switcher {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px;
    background: #111; height: 52px;
    border-top: 1px solid rgba(255,255,255,0.06);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.source-left {
    display: flex; align-items: center; gap: 10px;
}
.source-label {
    font-size: 10px; font-weight: 800; color: var(--text-3);
    text-transform: uppercase; letter-spacing: 1.2px;
}
.source-btns {
    display: flex; gap: 6px;
}
.source-btn {
    background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-2); width: 34px; height: 30px; border-radius: 6px;
    cursor: pointer; font-size: 12px; font-weight: 700;
    font-family: 'Inter', sans-serif; transition: all 0.18s;
}
.source-btn:hover { background: rgba(255,255,255,0.14); color: var(--text-1); border-color: rgba(255,255,255,0.22); }
.source-btn.active { background: var(--accent); color: #fff; border-color: transparent; }
.source-hint {
    font-size: 11px; color: rgba(255,255,255,0.28);
    padding-left: 4px;
}
.fs-btn {
    display: flex; align-items: center; gap: 7px;
    background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.8); padding: 7px 14px; border-radius: 7px;
    cursor: pointer; font-size: 12px; font-weight: 600;
    font-family: 'Inter', sans-serif; transition: all 0.18s;
}
.fs-btn:hover { background: rgba(255,255,255,0.14); color: #fff; border-color: rgba(255,255,255,0.25); }
.fs-btn i { font-size: 13px; }

.modal-info { padding: 26px 32px 32px; }
#modal-title {
    font-family: 'Bebas Neue', sans-serif; font-size: 2.2rem;
    margin-bottom: 10px; letter-spacing: 1px; line-height: 1;
}
.modal-meta-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.modal-tag {
    background: rgba(255,255,255,0.07); border: 1px solid var(--border);
    color: var(--text-2); font-size: 11px; font-weight: 600;
    padding: 3px 10px; border-radius: 20px; letter-spacing: 0.3px;
}
#modal-desc {
    color: var(--text-2); line-height: 1.7; font-size: 0.9rem;
    max-width: 760px;
}

/* ── Toast ────────────────────────────────────────────────────────────────── */
.toast {
    position: fixed; bottom: 36px; left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: var(--bg-raise); color: var(--text-1);
    padding: 12px 24px; border-radius: 8px; font-size: 13px; font-weight: 600;
    border: 1px solid var(--border);
    opacity: 0; pointer-events: none; z-index: 9999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    transition: opacity 0.25s, transform 0.25s;
    white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Pages ────────────────────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }

/* ── Page hero (sub-pages) ────────────────────────────────────────────────── */
.page-hero {
    height: 38vh; min-height: 280px;
    background: #0d0d0d;
    background-size: cover; background-position: center 30%;
    position: relative; display: flex; align-items: flex-end;
    padding: 0 48px 50px;
}
.page-hero-overlay {
    position: absolute; inset: 0;
    background:
        linear-gradient(to right, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 60%, transparent 100%),
        linear-gradient(to top,   rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.55) 100%);
}
.page-hero-content { position: relative; z-index: 2; }
.page-hero-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(229,9,20,0.15); border: 1px solid rgba(229,9,20,0.4);
    color: var(--accent); font-size: 11px; font-weight: 700;
    letter-spacing: 1.5px; text-transform: uppercase;
    padding: 4px 12px; border-radius: 20px; margin-bottom: 12px;
}
.page-hero-title {
    font-family: 'Bebas Neue', sans-serif; font-size: clamp(2.8rem, 5vw, 4.5rem);
    letter-spacing: 2px; line-height: 1; margin-bottom: 10px;
}
.page-hero-sub {
    color: var(--text-2); font-size: 0.95rem; font-weight: 500;
}

/* Gradient fade at bottom of page-hero into content */
.page-hero::after {
    content: ''; position: absolute; bottom: 0; width: 100%; height: 80px;
    background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
    z-index: 1;
}

/* ── Content page (sub-pages) ─────────────────────────────────────────────── */
.content-page {
    margin-top: -60px; position: relative; z-index: 3;
    padding-bottom: 100px;
}

/* ── 3-dot card menu ──────────────────────────────────────────────────────── */
.card-dots-btn {
    position: absolute; top: 7px; right: 7px;
    width: 28px; height: 28px;
    background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.85); border-radius: 50%;
    display: none; align-items: center; justify-content: center;
    cursor: pointer; font-size: 13px;
    transition: background 0.15s, transform 0.15s;
    backdrop-filter: blur(4px); z-index: 5;
}
.poster-card:hover .card-dots-btn { display: flex; }
.card-dots-btn:hover { background: rgba(255,255,255,0.18); transform: scale(1.08); }

.card-context-menu {
    position: absolute; top: 40px; right: 7px;
    background: rgba(18,18,18,0.96);
    border: 1px solid rgba(255,255,255,0.12); border-radius: 12px;
    padding: 6px; z-index: 20; min-width: 168px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.85);
    backdrop-filter: blur(16px);
    display: none; flex-direction: column; gap: 2px;
    opacity: 0; transform: scale(0.92) translateY(-4px);
    transition: opacity 0.15s, transform 0.15s;
    transform-origin: top right;
}
.card-context-menu.open {
    display: flex; opacity: 1; transform: scale(1) translateY(0);
}
.ccm-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 8px;
    background: none; border: none;
    color: rgba(255,255,255,0.85); font-size: 13px; font-weight: 500;
    font-family: 'Inter', sans-serif; cursor: pointer; text-align: left;
    transition: background 0.12s, color 0.12s; white-space: nowrap;
}
.ccm-item i { width: 14px; text-align: center; opacity: 0.7; }
.ccm-item:hover { background: rgba(255,255,255,0.09); color: #fff; }

/* ── Kids mode banner ─────────────────────────────────────────────────────── */
body.kids-mode .main-wrap::before {
    content: '🐼 Kids Mode';
    position: fixed; top: 12px; right: 20px; z-index: 150;
    background: #0071eb; color: #fff;
    font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
    padding: 4px 10px; border-radius: 20px;
    pointer-events: none;
}

/* ── CAM quality badge ────────────────────────────────────────────────────── */
.cam-badge {
    position: absolute; top: 7px; left: 7px;
    background: #e50914; color: #fff;
    font-size: 9px; font-weight: 900; letter-spacing: 0.8px;
    padding: 3px 6px; border-radius: 4px;
    text-transform: uppercase; z-index: 5;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

/* ── My List page ─────────────────────────────────────────────────────────── */
.mylist-page-hero { background: #0a0a0a; }

.mylist-empty {
    padding: 80px 80px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center; gap: 16px; color: var(--text-2);
}
.mylist-empty-icon {
    width: 80px; height: 80px; border-radius: 50%;
    background: rgba(229,9,20,0.1); border: 1px solid rgba(229,9,20,0.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: var(--accent); margin-bottom: 8px;
}
.mylist-empty h3 { font-size: 1.4rem; font-weight: 700; color: var(--text-1); }
.mylist-empty p { font-size: 0.95rem; line-height: 1.6; max-width: 340px; }
.mylist-empty p strong { color: var(--text-1); }
.mylist-empty .btn { margin-top: 8px; }

/* ── Profile Page ─────────────────────────────────────────────────────────── */
.profile-page-wrap {
    max-width: 860px; margin: 0 auto; padding: 60px 24px 100px;
    display: flex; flex-direction: column; gap: 32px;
}
.pp-card {
    background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px; padding: 32px; backdrop-filter: blur(8px);
}
.pp-card-inner { display: flex; align-items: flex-start; gap: 28px; }
.pp-avatar-wrap {
    flex-shrink: 0; width: 88px; height: 88px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 44px; box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.pp-info { flex: 1; min-width: 0; }
.pp-name-row { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.pp-name { font-size: 1.8rem; font-weight: 800; color: var(--text-1); }
.pp-badge {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(229,9,20,0.15); border: 1px solid rgba(229,9,20,0.35);
    color: #e50914; font-size: 10px; font-weight: 800; letter-spacing: 1px;
    padding: 3px 10px; border-radius: 20px; text-transform: uppercase;
}
.pp-since { font-size: 13px; color: var(--text-2); margin-bottom: 20px; }
.pp-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.pp-stat {
    display: flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px; padding: 5px 14px; font-size: 13px;
}
.pp-stat-num { font-weight: 700; color: var(--text-1); }
.pp-stat-lbl { color: var(--text-2); }

.pp-section {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
    border-radius: 16px; padding: 24px;
}
.pp-section-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.pp-section-title {
    font-size: 1rem; font-weight: 700; color: var(--text-1);
    display: flex; align-items: center; gap: 10px;
}
.pp-section-title i { color: var(--accent); font-size: 14px; }
.pp-clear-btn, .pp-view-btn {
    background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-2); font-size: 12px; font-weight: 600; padding: 6px 14px;
    border-radius: 8px; cursor: pointer; transition: all 0.2s;
}
.pp-clear-btn:hover { background: rgba(229,9,20,0.2); border-color: rgba(229,9,20,0.4); color: #e50914; }
.pp-view-btn:hover { background: rgba(255,255,255,0.14); color: var(--text-1); }

.pp-history-list { display: flex; flex-direction: column; gap: 10px; }
.pp-history-row {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 12px; border-radius: 10px; cursor: pointer;
    transition: background 0.15s;
}
.pp-history-row:hover { background: rgba(255,255,255,0.06); }
.pp-history-thumb {
    width: 96px; height: 54px; border-radius: 6px; flex-shrink: 0;
    background-size: cover; background-position: center; background-color: #1e1e1e;
    position: relative; overflow: hidden;
}
.pp-history-thumb-icon {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: rgba(255,255,255,0.2);
}
.pp-history-info { flex: 1; min-width: 0; }
.pp-history-title { font-size: 14px; font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-history-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.pp-history-progress { margin-top: 6px; height: 3px; background: rgba(255,255,255,0.12); border-radius: 2px; }
.pp-history-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; }
.pp-history-time { font-size: 11px; color: var(--text-2); flex-shrink: 0; }

.pp-list-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px;
}
.pp-list-item { border-radius: 8px; overflow: hidden; cursor: pointer; transition: transform 0.2s; }
.pp-list-item:hover { transform: scale(1.05); }
.pp-list-item img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; }
.pp-empty { color: var(--text-2); font-size: 14px; padding: 12px 0; }

/* ── Animations ───────────────────────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero-content { animation: fadeInUp 0.9s cubic-bezier(0.25,0.46,0.45,0.94) both; }
