.side-menu {
    /* ... existing rules ... */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* keep panel itself fixed */
}

.side-menu-list {
    flex: 1;
    overflow-y: auto;      /* 👈 yeh line add karo agar missing hai */
    -webkit-overflow-scrolling: touch;
    padding-bottom: env(safe-area-inset-bottom, 16px);
}
:root {
    --bg: #0e0e12;
    --surface: #17171d;
    --surface-2: #1f1f27;
    --accent: #4f7cff;
    --accent-2: #ff5c8a;
    --text: #f2f2f5;
    --text-dim: #9a9aa6;
    --border: #2a2a33;
    --success: #33c26f;
    --radius: 16px;
    --nav-height: 62px;
    --topbar-height: 70px;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--text);
    height: 100%;
}
a { text-decoration: none; color: inherit; }
img, video { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; }

.app-shell {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    padding-bottom: var(--nav-height);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

/* ---------------- TOP BAR ---------------- */
.topbar {
    position: sticky; top: 0; z-index: 20;
    height: var(--topbar-height);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
    background: rgba(14,14,18,0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.topbar .brand { display: flex; align-items: center; flex-shrink: 1; min-width: 0; height: 100%; }
.brand-logo-wide {
    height: clamp(88px, 26vw, 116px); width: auto; max-width: 440px;
    object-fit: contain; display: block; flex-shrink: 1;
}
.topbar .icons { display: flex; gap: 14px; align-items: center; flex-shrink: 0; }
.topbar .icons a { position: relative; font-size: 19px; color: var(--text); flex-shrink: 0; }
.topbar-profile { display: flex; align-items: center; justify-content: center; }
.topbar-avatar {
    width: 32px; height: 32px;
    border-radius: 50%; object-fit: cover;
    border: 1.5px solid var(--border); background: var(--surface-2);
}

@media (max-width: 360px) {
    .topbar { padding: 0 10px; }
    .topbar .icons { gap: 8px; }
    .topbar .icons a { font-size: 17px; }
    .topbar-avatar { width: 28px; height: 28px; }
}

/* ---------------- MENU TOGGLE (hamburger, pink) ---------------- */
.menu-toggle {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    width: 32px; height: 32px; flex-shrink: 0;
    background: var(--accent-2); border: none; border-radius: 9px; padding: 0; cursor: pointer;
    box-shadow: 0 3px 10px rgba(255,92,138,0.35);
}
.menu-toggle span { display: block; width: 15px; height: 2px; background: #fff; border-radius: 2px; }
@media (max-width: 360px) {
    .menu-toggle { width: 28px; height: 28px; }
    .menu-toggle span { width: 13px; }
}

/* ---------------- SIDE MENU ---------------- */
.menu-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.55);
    opacity: 0; pointer-events: none; transition: opacity 0.25s ease; z-index: 49;
}
.menu-overlay.open { opacity: 1; pointer-events: auto; }
.side-menu {
    position: fixed; top: 0; right: 0; height: 100%;
    width: 78%; max-width: 300px;
    background: var(--surface); border-left: 1px solid var(--border);
    transform: translateX(100%); transition: transform 0.3s ease;
    z-index: 50; display: flex; flex-direction: column;
    box-shadow: -8px 0 24px rgba(0,0,0,0.4);
}
.side-menu.open { transform: translateX(0); }
.side-menu-header {
    display: flex; align-items: center; gap: 10px; padding: 18px 16px;
    border-bottom: 1px solid var(--border);
}
.side-menu-logo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.side-menu-title { font-weight: 800; font-size: 16px; }
.side-menu-sub { font-size: 11px; color: var(--text-dim); }
.menu-close {
    margin-left: auto; background: none; border: none; color: var(--text-dim);
    font-size: 16px; cursor: pointer; padding: 6px;
}
.side-menu-list { display: flex; flex-direction: column; padding: 8px 0; overflow-y: auto; }
.side-menu-list a {
    display: flex; align-items: center; gap: 12px; padding: 13px 18px;
    font-size: 14px; color: var(--text); position: relative;
}
.side-menu-list a:active, .side-menu-list a:hover { background: var(--surface-2); }
.menu-badge { position: static; margin-left: auto; }

/* ---------------- PRELOADER ---------------- */
.preloader {
    position: fixed; inset: 0; z-index: 999;
    background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.6s ease;
}
.preloader.preloader-hide { opacity: 0; pointer-events: none; }
.preloader-inner { display: flex; flex-direction: column; align-items: center; }
.preloader-logo {
    width: 130px; height: 130px; border-radius: 50%; object-fit: cover;
    box-shadow: 0 0 40px rgba(79,124,255,0.35);
    animation: preloaderZoomOut 1.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.preloader-welcome {
    margin-top: 18px; font-size: 16px; font-weight: 700;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    opacity: 0;
    animation: preloaderFadeUp 0.7s ease forwards;
    animation-delay: 1.2s;
}
@keyframes preloaderZoomOut {
    0%   { transform: scale(2.6); opacity: 0.4; }
    70%  { transform: scale(0.92); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes preloaderFadeUp {
    0%   { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ---------------- AUTH LOGO / ANIMATION ---------------- */
.auth-logo-wrap { text-align: center; margin-bottom: 18px; }
.auth-logo-wrap img {
    max-width: 220px; width: 100%; margin: 0 auto;
    animation: authLogoIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.auth-card { animation: authCardIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: 0.15s; }
.auth-wrap {
    background: radial-gradient(circle at 50% 0%, rgba(79,124,255,0.14), transparent 60%),
                radial-gradient(circle at 50% 100%, rgba(255,92,138,0.10), transparent 55%);
}
@keyframes authLogoIn {
    0%   { opacity: 0; transform: translateY(-14px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes authCardIn {
    0%   { opacity: 0; transform: translateY(18px); }
    100% { opacity: 1; transform: translateY(0); }
}
.field { animation: authCardIn 0.5s ease both; }
.btn:active { transform: scale(0.97); }
.btn { transition: transform 0.15s ease, box-shadow 0.2s ease; }
.btn:hover { box-shadow: 0 6px 18px rgba(79,124,255,0.35); }

/* ---------------- COIN PAGE ---------------- */
.coin-hero {
    margin: 16px; padding: 26px 20px; border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    text-align: center; color: #fff;
}
.coin-hero .coin-icon { font-size: 34px; }
.coin-hero .coin-balance { font-size: 34px; font-weight: 800; margin-top: 4px; }
.coin-hero .coin-label { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.coin-tx { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.coin-tx:last-child { border-bottom: none; }
.coin-tx .tx-type { font-size: 13px; font-weight: 600; text-transform: capitalize; }
.coin-tx .tx-date { font-size: 11px; color: var(--text-dim); }
.coin-tx .tx-amount { font-size: 14px; font-weight: 700; }
.coin-tx .tx-amount.positive { color: var(--success); }
.coin-tx .tx-amount.negative { color: var(--accent-2); }
.badge {
    position: absolute; top: -6px; right: -10px;
    background: var(--accent-2); color: #fff;
    font-size: 10px; font-weight: 700;
    border-radius: 999px; padding: 1px 5px; min-width: 16px; text-align: center;
}

/* ---------------- BOTTOM NAV ---------------- */
.bottom-nav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px;
    height: var(--nav-height);
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-around;
    z-index: 30;
}
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 10px; color: var(--text-dim);
    flex: 1; padding: 6px 0;
}
.bottom-nav a.active { color: var(--accent); }
.bottom-nav .icon { font-size: 20px; }
.bottom-nav .fab {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    width: 42px; height: 42px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 22px; margin-top: -14px;
    box-shadow: 0 6px 16px rgba(79,124,255,0.4);
}

/* ---------------- CARDS / FEED ---------------- */
.container { padding: 14px; }
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 14px;
    overflow: hidden;
}
.video-card .video-header {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
}
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.video-header .name { font-weight: 600; font-size: 14px; }
.video-header .meta { font-size: 11px; color: var(--text-dim); }
.video-card video, .video-card .thumb { width: 100%; max-height: 420px; background: #000; object-fit: cover; }
.video-actions {
    display: flex; align-items: center; gap: 18px;
    padding: 10px 12px; font-size: 13px; color: var(--text-dim);
    border-top: 1px solid var(--border);
}
.video-actions button {
    background: none; border: none; color: var(--text-dim);
    display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer;
}
.video-actions button.liked { color: var(--accent-2); }
.video-actions .spacer { flex: 1; }
.boost-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff; border: none; border-radius: 999px; padding: 6px 14px;
    font-size: 12px; font-weight: 700; cursor: pointer;
}
.video-caption { padding: 0 12px 12px; font-size: 13px; color: var(--text); }
.video-earnings {
    padding: 8px 12px; font-size: 11px; color: var(--text-dim);
    border-top: 1px dashed var(--border); display: flex; justify-content: space-between;
}

/* ---------------- FORMS ---------------- */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 24px; margin-bottom: 4px; }
.auth-card p.sub { color: var(--text-dim); font-size: 13px; margin-bottom: 24px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.field input, .field select, .field textarea {
    width: 100%; padding: 12px 14px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 14px;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.btn {
    display: inline-block; width: 100%; text-align: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff; border: none; border-radius: 10px; padding: 13px; font-size: 15px;
    font-weight: 700; cursor: pointer;
}
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.small { width: auto; padding: 8px 16px; font-size: 13px; }
.link-alt { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-dim); }
.link-alt a { color: var(--accent); font-weight: 600; }
.alert { padding: 10px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; }
.alert.error { background: rgba(255,92,138,0.12); color: var(--accent-2); border: 1px solid rgba(255,92,138,0.3); }
.alert.success { background: rgba(51,194,111,0.12); color: var(--success); border: 1px solid rgba(51,194,111,0.3); }

/* ---------------- SEARCH BAR ---------------- */
.search-bar {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 999px; padding: 6px 8px 6px 16px; margin-bottom: 16px;
}
.search-bar-icon { font-size: 15px; color: var(--text-dim); }
.search-bar input {
    flex: 1; border: none; background: transparent; color: var(--text);
    font-size: 14px; padding: 8px 0; outline: none;
}
.search-bar .btn.small { border-radius: 999px; }

/* ---------------- LIVE USERS ROW (round circles) ---------------- */
.live-users-row {
    display: flex; gap: 14px; overflow-x: auto; padding: 14px 14px 6px;
    scrollbar-width: none;
}
.live-users-row::-webkit-scrollbar { display: none; }
.live-user-item {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    flex-shrink: 0; width: 62px; text-align: center;
}
.live-user-ring {
    width: 58px; height: 58px; border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #ff5c8a, #ff8a5c);
    display: flex; align-items: center; justify-content: center;
    position: relative;
    animation: liveRingPulse 1.8s ease-in-out infinite;
}
.live-user-ring img {
    width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--bg);
}
.live-user-dot {
    position: absolute; bottom: -1px; right: -1px;
    background: var(--accent-2); color: #fff; font-size: 8px; font-weight: 800;
    border-radius: 999px; padding: 1px 5px; border: 2px solid var(--bg);
    letter-spacing: 0.3px;
}
.live-user-name { font-size: 10px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 62px; }
.live-users-empty { padding: 0 14px 6px; font-size: 12px; color: var(--text-dim); }
@keyframes liveRingPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,92,138,0.45); }
    50% { box-shadow: 0 0 0 5px rgba(255,92,138,0); }
}

/* ---------------- STAT GRID (profile stats cards) ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 4px 0 6px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 14px; text-align: center;
}
.stat-card .stat-icon { font-size: 18px; margin-bottom: 4px; }
.stat-card .stat-num { font-size: 20px; font-weight: 800; }
.stat-card .stat-label { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.profile-header { text-align: center; padding: 24px 16px; }
.profile-header .avatar-lg { width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 10px; object-fit: cover; }
.profile-stats { display: flex; justify-content: center; gap: 28px; margin-top: 14px; }
.profile-stats div { text-align: center; }
.profile-stats .num { font-size: 17px; font-weight: 700; }
.profile-stats .label { font-size: 11px; color: var(--text-dim); }
.referral-box {
    background: var(--surface); border: 1px dashed var(--accent);
    border-radius: var(--radius); padding: 16px; margin: 16px; text-align: center;
}
.referral-box img { margin: 12px auto; border-radius: 10px; }
.referral-box .link-copy {
    background: var(--surface-2); border-radius: 8px; padding: 8px 10px;
    font-size: 12px; word-break: break-all; margin-top: 8px;
}

/* ---------------- CHAT ---------------- */
.chat-list-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-bottom: 1px solid var(--border); }
.chat-list-item .name { font-weight: 600; font-size: 14px; }
.chat-list-item .preview { font-size: 12px; color: var(--text-dim); }
.chat-window { display: flex; flex-direction: column; height: calc(100vh - var(--topbar-height)); }
.messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 75%; padding: 9px 13px; border-radius: 14px; font-size: 13px; }
.msg.mine { align-self: flex-end; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.msg.theirs { align-self: flex-start; background: var(--surface-2); }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; }
.chat-input button { background: var(--accent); border: none; color: #fff; border-radius: 10px; padding: 0 18px; }

/* ---------------- BADGES / REWARDS ---------------- */
.reward-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 999px; padding: 6px 12px; font-size: 12px; margin: 4px; }

/* ---------------- MISC ---------------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-dim); }
.section-title { font-size: 13px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin: 18px 0 8px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; background: var(--surface-2); color: var(--text-dim); }
.pill.public { color: var(--success); }
.pill.friends { color: var(--accent); }

/* ---------------- FULL MOBILE RESPONSIVENESS ---------------- */
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
.app-shell { width: 100%; }

.video-actions { flex-wrap: wrap; gap: 10px 14px; }
.video-header { flex-wrap: wrap; }
.video-header .name, .video-header .meta { word-break: break-word; }

@media (max-width: 380px) {
    .video-actions { gap: 8px 10px; font-size: 12px; }
    .video-actions button { font-size: 12px; gap: 4px; }
    .boost-btn { padding: 5px 10px; font-size: 11px; }
    .container { padding: 10px; }
    .coin-hero { margin: 12px; padding: 20px 14px; }
    .coin-hero .coin-balance { font-size: 28px; }
    .stat-grid { gap: 8px; }
    .stat-card { padding: 10px; }
    .stat-card .stat-num { font-size: 17px; }
    .profile-header .avatar-lg { width: 74px; height: 74px; }
    .auth-card h1 { font-size: 20px; }
    .btn { padding: 12px; font-size: 14px; }
}

@media (max-width: 340px) {
    .field input, .field select, .field textarea { padding: 10px 12px; font-size: 13px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .live-user-item, .live-user-ring { width: 52px; height: 52px; }
}

@media (min-width: 481px) {
    .app-shell { box-shadow: 0 0 40px rgba(0,0,0,0.3); }
}