/* Profile header section */
.profile-header {
    position: relative;
}

/* ===== Story Glow Ring ===== */
.story-avatar-ring {
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    transition: all 0.3s ease;
    display: block !important;
    width: fit-content !important;
    margin: 0 auto !important;
    line-height: 0;
    overflow: visible !important;
}

/* Ensure avatar ring centers properly in profile header */
.profile-header .story-avatar-ring {
    display: block !important;
    width: fit-content !important;
    margin: 0 auto !important;
}
.story-avatar-ring.has-story .profile-pic,
.story-avatar-ring.has-story .center-banner {
    box-shadow: 0 0 8px 2px rgba(118, 75, 162, 0.6) !important;
}
.story-avatar-ring.has-unseen-story .profile-pic,
.story-avatar-ring.has-unseen-story .center-banner {
    animation: storyGlowPulse 2s ease-in-out infinite !important;
}
@keyframes storyGlowPulse {
    0%, 100% { box-shadow: 0 0 8px 2px rgba(139, 92, 246, 0.5); }
    50% { box-shadow: 0 0 14px 4px rgba(139, 92, 246, 0.8); }
}

#container {
    width: 100%;
    max-width: 1100px;
    position: relative;
}

.profile-intro-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 6, 14, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem;
}

.profile-intro-dialog {
    width: min(96vw, 1840px);
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(16, 20, 32, 0.98), rgba(10, 12, 20, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.profile-intro-media-wrap {
    position: relative;
    background: #000;
}

.profile-intro-video {
    width: 100%;
    max-height: min(84vh, 1180px);
    display: block;
    background: #000;
}

.profile-intro-gif {
    width: 100%;
    max-height: min(84vh, 1180px);
    display: block;
    background: #000;
    object-fit: contain;
}

.profile-intro-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 999px;
    background: rgba(9, 12, 20, 0.7);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
}

.profile-intro-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem 1.1rem;
}

.profile-intro-copy {
    min-width: 0;
}

.profile-intro-kicker {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
    margin-bottom: 0.3rem;
}

.profile-intro-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.profile-intro-subtitle {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.72);
    margin-top: 0.15rem;
}

.profile-intro-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.profile-intro-btn {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-weight: 600;
    padding: 0.75rem 1rem;
    cursor: pointer;
}

.profile-intro-btn--primary {
    background: #fff;
    color: #0c111b;
    border-color: transparent;
}

@media (max-width: 640px) {
    .profile-intro-dialog {
        width: 100%;
        border-radius: 12px;
    }

    .profile-intro-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-intro-actions {
        width: 100%;
        justify-content: stretch;
    }

    .profile-intro-btn {
        flex: 1 1 0;
        min-height: 44px;
    }
}

/* Profile avatar — sized via inline HTML, CSS just ensures shape */
.centered-card .profile-pic {
    border-radius: 50% !important;
    object-fit: cover !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    background: transparent !important;
    display: block;
    margin: 0 auto 1rem auto;
}
/* --- Restore classic customize profile layout --- */
body.show-customize .profile-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    min-height: 100vh;
    background: #000;
}

body.show-customize .sidebar {
    width: 220px;
    min-width: 180px;
    background: #111;
    color: #fff;
    border-right: 2px solid #222;
    height: 100vh;
    padding-top: 2rem;
    font-family: 'Courier New', Courier, monospace;
}

body.show-customize .tab-btn {
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    text-align: left;
    width: 100%;
    border-radius: 0;
    transition: background 0.2s;
}
body.show-customize .tab-btn.active, body.show-customize .tab-btn:hover {
    background: #222;
    color: #fff;
}

body.show-customize .tab-content {
    display: block;
    width: 100%;
    padding: 2rem 0 2rem 2rem;
    background: #000;
    min-height: 100vh;
}

body.show-customize .customize-section {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    padding: 2rem 2.5rem;
    margin-bottom: 2rem;
    color: #111;
    font-family: 'Courier New', Courier, monospace;
    max-width: 520px;
}

body.show-customize .customize-section label,
body.show-customize .customize-section h3 {
    color: #111;
    font-family: 'Courier New', Courier, monospace;
}

body.show-customize .customize-section input,
body.show-customize .customize-section textarea,
body.show-customize .customize-section select {
    background: #fafafa;
    color: #111;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
}

body.show-customize .customize-section .upload-btn {
    background: #111;
    color: #fff;
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    padding: 0.5rem 1.2rem;
    margin-top: 0.5rem;
}

body.show-customize .customize-section .upload-btn:hover {
    background: #222;
}

body.show-customize .customize-section .clear-btn {
    background: #ef4444;
    color: #fff;
    border-radius: 6px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    padding: 0.5rem 1.2rem;
    margin-top: 0.5rem;
}

body.show-customize .customize-section .clear-btn:hover {
    background: #b91c1c;
}
@media (max-width: 700px) {
    .centered-header {
        padding: 0 0.5rem;
    }
    .profile-banner {
        max-width: 100vw;
        height: 140px;
        aspect-ratio: auto;
        min-height: 0;
        border-radius: 12px 12px 0 0;
        margin-bottom: -50px;
    }
    .centered-card {
        padding: 1.2rem 0.5rem 1rem 0.5rem;
        max-width: 98vw;
        border-radius: 12px;
    }
    .centered-card .profile-pic {
        width: 140px !important;
        height: 140px !important;
        border-width: 3px;
    }
    .centered-card h2 {
        font-size: 1.3rem;
    }
    .centered-card .username,
    .centered-card .bio {
        font-size: 1rem;
    }
    .centered-posts {
        max-width: 100vw;
        padding: 0 0.5rem;
    }
    .post-card {
        max-width: 100vw !important;
        margin: 0.5rem 0 !important;
    }
}

/* Mobile styles for profile */
@media (max-width: 480px) {
    .centered-header {
        padding: 0 0.35rem;
    }
    .profile-banner {
        height: 120px;
        border-radius: 8px 8px 0 0;
        margin-bottom: -40px;
    }
    .centered-card {
        padding: 1rem 0.5rem 0.75rem 0.5rem;
        border-radius: 10px;
    }
    .centered-card .profile-pic {
        width: 120px !important;
        height: 120px !important;
        margin-bottom: 0.75rem;
    }
    .centered-card h2 {
        font-size: 1.2rem;
        margin-bottom: 0.35rem;
    }
    .centered-card .username {
        font-size: 0.9rem;
    }
    .centered-card .bio {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    .posts-section {
        padding: 0 0.5rem;
    }
    .post-card p {
        font-size: 0.95rem;
    }
    .post-date {
        font-size: 0.75rem;
    }
    .btn-delete {
        padding: 0.25rem 0.6rem;
        font-size: 0.8rem;
    }
    #createPostSection {
        padding: 1rem;
        border-radius: 10px;
    }
}

/* Extra small mobile devices */
@media (max-width: 360px) {
    .centered-header {
        padding: 0 0.25rem;
    }
    .profile-banner {
        height: 100px;
        margin-bottom: -35px;
    }
    .centered-card {
        padding: 0.85rem 0.4rem 0.6rem 0.4rem;
        border-radius: 8px;
    }
    .centered-card .profile-pic {
        width: 100px !important;
        height: 100px !important;
        margin-bottom: 0.6rem;
    }
    .centered-card h2 {
        font-size: 1.1rem;
    }
    .centered-card .username,
    .centered-card .bio {
        font-size: 0.85rem;
    }
    .post-card p {
        font-size: 0.9rem;
    }
    #createPostSection {
        padding: 0.75rem;
    }
}

/* Ultra small devices */
@media (max-width: 320px) {
    .centered-card .profile-pic {
        width: 80px !important;
        height: 80px !important;
    }
    .centered-card h2 {
        font-size: 1rem;
    }
    .centered-card .username,
    .centered-card .bio {
        font-size: 0.8rem;
    }
    .post-card p {
        font-size: 0.85rem;
    }
}
/* Centered profile header and card for profile page */
.centered-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.profile-banner {
    /* Removed banner feature - now using simple header */
    /* Fixed desktop height to 400px while keeping full-bleed width */
    height: 400px;
    border-radius: 0 0 18px 18px;
    margin-bottom: -70px;
    /* Allow JS to control background-size/position via inline styles */
    background-repeat: no-repeat;
    background-position: center center;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    z-index: 1;
}

.centered-card {
    background: rgb(0, 0, 0);
    border: 1px solid rgba(255,255,255,0.06);
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 24px 64px rgba(0,0,0,0.35), 0 8px 20px rgba(0,0,0,0.2);
    border-radius: 18px;
    padding: 2rem 2.5rem 1.5rem 2.5rem;
    margin-bottom: 1.5rem;
    max-width: 420px;
    width: 100%;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease;
}

.centered-card:hover {
    transform: translateY(-4px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 32px 80px rgba(0,0,0,0.4), 0 12px 28px rgba(0,0,0,0.25);
}

.profile-pic-large {
    width: 190px;
    height: 190px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-secondary);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    background: transparent;
}

.centered-card h2 {
    margin-bottom: 0.5rem;
    color: #fff;
    font-size: 2rem;
}
.centered-card .username {
    margin-bottom: 0.5rem;
    color: #ccc;
    font-size: 1.1rem;
}
.centered-card .bio {
    margin-bottom: 0.5rem;
    color: #eee;
    font-size: 1.1rem;
}

.post-card {
    background: rgba(18, 18, 28, 0.45);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    margin-bottom: 1rem;
    width: 100%;
    box-sizing: border-box;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), background 0.35s ease, box-shadow 0.35s ease;
}

.post-card:hover {
    background: rgba(25, 25, 38, 0.55);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}

@supports not (backdrop-filter: blur(1px)) {
    .post-card { background: rgba(15,15,22,0.88); }
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 0.75rem;
    background: #666;
    object-fit: cover;
}

.post-author-info {
    flex: 1;
}

.post-author-name {
    font-weight: 600;
    margin: 0;
    font-size: 0.95rem;
}

.post-author-handle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.post-timestamp {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0;
}

.post-content {
    margin: 1rem 0;
    line-height: 1.5;
    font-size: 0.95rem;
}

.post-media {
    margin: 1rem 0;
}

.post-media img, .post-media video, .post-media audio {
    max-width: 100%;
    border-radius: 8px;
}

.post-privacy {
    display: inline-block;
    background: rgba(0, 201, 167, 0.1);
    color: #00c9a7;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.post-privacy.friends-only {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.post-privacy.private {
    background: rgba(248, 113, 113, 0.14);
    color: #f87171;
}

.post-card p {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    color: #eee;
}

.posts-section {
    max-width: 500px !important;
    margin: 2rem auto !important;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
}

.posts-list {
    width: 100%;
}

#createPostSection {
    max-width: 500px !important;
    margin: 2rem auto !important;
    padding: 1.5rem;
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
}

.post-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-delete {
    background: none;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    float: right;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: #ef4444;
    color: white;
}
.profile-container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 5rem);
    width: 100%;
}

/* Desktop: ensure layout targets 1920x1080 */
@media (min-width: 1920px) {
    #container, .header-inner {
        max-width: 1920px;
        margin: 0 auto;
        width: 100%;
    }

    /* Make banner fill 1080px height on 1920px-wide screens */
    .profile-banner {
        /* Do not force fixed height; allow image to scale without cropping */
        height: auto !important;
        min-height: 420px !important;
        max-height: none !important;
        background-position: center center !important;
        background-size: contain !important;
    }

    /* Scale centered card and posts for large displays */
    .centered-card {
        max-width: 1200px;
        padding: 3rem 4rem;
    }

    .posts-section {
        max-width: 1100px !important;
        margin: 2.5rem auto !important;
    }
}

/* When a profile container background image is set, dim behind content for readability */
#profileContainer.has-bg {
    background: linear-gradient(rgba(0,0,0,0.15), rgba(0,0,0,0.15));
    padding-top: 2rem;
    position: relative;
}

#profileContainer.has-bg .centered-card {
    background: rgb(10, 10, 20) !important;
}
#profileContainer.has-bg .posts-section {
    background: transparent !important;
}
#profileContainer.has-bg .profile-banner {
    background: rgba(10,10,10,0.7) !important;
    backdrop-filter: blur(3px);
}

/* Overlay inside the profile container to improve contrast with background images */
#profileContainer.has-bg::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    pointer-events: none;
    z-index: 1;
    border-radius: inherit;
}

/* Ensure main content sits above the overlay */
.profile-container { position: relative; z-index: 2; }

/* Glassmorphism card backgrounds */
.posts-section { background: transparent; }

/* Border themes — now in border-themes.css */

/* constrain layout on large screens and center it */
.profile-container {
    max-width: 1200px;
    margin: 0 auto;
}

#profileContent {
    width: 100%;
}

.profile-banner-wrapper {
    width: 100%;
    position: relative;
    z-index: 1;
}

/* PC Friendly Grid Layout */
.profile-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 1.5rem;
    padding: 1rem;
}

@media (min-width: 1024px) {
    .profile-grid {
        display: grid;
        grid-template-columns: 380px 1fr;
        gap: 2.5rem;
        align-items: start;
        padding: 0;
    }

    .profile-sidebar {
        position: sticky;
        top: 2rem;
    }

    .profile-banner {
        max-width: 100% !important;
        height: 350px !important;
        border-radius: 0 0 24px 24px !important;
    }

    .centered-card {
        max-width: 100% !important;
        text-align: left !important;
        align-items: flex-start !important;
        padding: 2.5rem !important;
    }

    .centered-posts {
        align-items: stretch !important;
    }

    .post-card, .post-creator {
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Desktop sidebar spacing handled via body.has-desktop-nav padding-left */
}

/* PC specific tweaks for 1920x1080 */
@media (min-width: 1440px) {
    .profile-container {
        max-width: 1400px;
    }
    
    .profile-grid {
        grid-template-columns: 420px 1fr;
        gap: 4rem;
    }
}

/* Design tokens and gentle UI smoothing */
:root {
    --radius: 12px;
    --soft-shadow: 0 12px 30px rgba(10,10,20,0.06);
    --soft-inner: 0 6px 18px rgba(10,10,20,0.03) inset;
    --transition-fast: 200ms;
}

* { box-sizing: border-box; }
html, body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

@media (max-width: 768px) {
    html, body {
        padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
    }

    .profile-container,
    .main-profile-header {
        padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    }
}

/* apply subtle transitions and rounded corners to main containers (but keep avatars circular) */
.profile-container,
.main-profile-header,
.post-item,
.customize-section,
.profile-preview,
.settings-dropdown,
.profile-banner,
.preview-banner {
    transition: box-shadow var(--transition-fast), transform var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
    border-radius: var(--radius);
}

/* softer shadows and backgrounds */
.main-profile-header,
.profile-preview,
.post-item {
    box-shadow: var(--soft-shadow);
    background-clip: padding-box;
}

/* inputs and buttons: rounded, subtle elevation and smooth hover/focus */
input, select, textarea, .upload-btn, .post-btn, .save-btn, .profile-btn, .settings-btn {
    transition: box-shadow var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast), background-color var(--transition-fast);
    border-radius: calc(var(--radius) - 4px);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    box-shadow: 0 6px 18px rgba(34,197,94,0.12);
    border-color: rgba(34,197,94,0.65);
}

.upload-btn, .post-btn, .save-btn, .profile-btn {
    box-shadow: 0 6px 14px rgba(12,12,12,0.06);
}

.upload-btn:hover, .post-btn:hover, .save-btn:hover, .profile-btn:hover, .preset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(12,12,12,0.08);
}

/* make avatar stand out with subtle ring and shadow but keep circle */
.main-avatar, .post-avatar {
    border-radius: 50% !important;
    box-shadow: 0 6px 18px rgba(10,10,20,0.06);
    border: 2px solid rgba(0,0,0,0.06);
}
/* Keep profile-pic circular but don't override story glow box-shadow */
.profile-pic {
    border-radius: 50% !important;
    border: 2px solid rgba(0,0,0,0.06);
}
.profile-pic:not(.story-avatar-ring .profile-pic) {
    box-shadow: 0 6px 18px rgba(10,10,20,0.06);
}

/* Compact, polished customize panel styles (override for modern look) */
@media (min-width:1024px) {
    /* tightened floating panel (matches earlier fixed panel) */
    #customizeSection {
        width: 360px !important;
        max-width: 42vw;
        padding: 10px !important;
        border-radius: 12px !important;
        background: linear-gradient(180deg, rgba(18,18,18,0.96), rgba(10,10,12,0.92)) !important;
        box-shadow: 0 16px 40px rgba(0,0,0,0.6) !important;
        border: 1px solid rgba(255,255,255,0.03) !important;
        color: #e8def8;
    }

    #customizeSection h3 { font-size: 1rem; margin: 0 0 8px 0; color: #f3c6ff; }

    /* two-column compact controls inside the panel */
    #customizeSection .customize-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        align-items: start;
    }

    #customizeSection .control-group {
        background: rgba(255,255,255,0.02);
        border-radius: 10px;
        padding: 8px;
        border: 1px solid rgba(255,255,255,0.02);
        box-shadow: 0 8px 18px rgba(0,0,0,0.45);
        margin: 0;
    }

    #customizeSection .control-group label { display:block; font-size:12px; color:#d9c2ff; margin-bottom:6px; font-weight:600; }
    #customizeSection .control-group input[type="text"],
    #customizeSection .control-group input[type="file"],
    #customizeSection .control-group select,
    #customizeSection .control-group textarea {
        font-size:13px; padding:6px 8px; background:rgba(0,0,0,0.45); color:#fff; border:1px solid rgba(255,255,255,0.04); border-radius:6px; width:100%;
    }

    #customizeSection .control-group textarea { min-height:56px; }

    /* Make the save button compact and full-width across columns */
    #saveChangesBtn, .btn-save, .save-btn { grid-column: 1 / -1; justify-self: end; padding:7px 12px; font-size:13px; border-radius:8px; }

    /* Reduce spacing for stacked customize sections that appear on page */
    .customize-section { padding:10px !important; margin-bottom:10px !important; }
}

/* Small-screen tweaks: slightly smaller controls */
@media (max-width:1023px) {
    #customizeSection .control-group label { font-size:13px; }
    #customizeSection .control-group input, #customizeSection .control-group textarea { font-size:14px; }
}

/* Reduce heavy borders to softer tones */
 :root {
    --border-color: rgba(15,15,15,0.08);
 }

.sidebar {
    width: 140px;
    border-right: 1px solid var(--border-color);
    padding: 0.8rem 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.tab-btn {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.tab-btn:hover {
    background-color: var(--bg-secondary);
}

.tab-btn.active {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.profile-main {
    flex: 1;
    padding: 0.75rem;
    max-width: 1100px;
}

/* Main profile header (shows on My Profile) */
.main-profile-header {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.9rem;
    padding: 0.75rem;
    border-radius: 0.6rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,250,250,0.98));
    border: 1px solid var(--border-color);
    position: relative;
}

.add-friend-btn {
    margin-left: auto;
    padding: 0.5rem 0.85rem;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    font-size: 0.9rem;
}

.add-friend-btn:hover {
    opacity: 0.8;
}

.add-friend-btn.is-friend {
    background-color: #10b981;
}

.avatar-wrap {
    flex: 0 0 auto;
}

.main-avatar {
    width: 84px;
    height: 84px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid var(--border-color);
    background: transparent;
}

/* Profile page main avatar sizing/position */


.profile-info h2 {
    margin: 0 0 0.25rem 0;
}

.profile-about {
    margin: 0;
    color: var(--text-secondary);
}

/* Post wall layout tweaks */
.posts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.6rem;
}

.post-item {
    padding: 0.9rem;
    border-radius: 0.6rem;
}

/* MySpace 2007 inspired layout when viewing Posts */
body.myspace-style {
    --ms-banner-height: 200px;
}

body.myspace-style .profile-banner {
    height: var(--ms-banner-height);
    background: linear-gradient(90deg,#0b1220 0%, #2b2b2b 50%, #1b1b1b 100%);
    background-size: cover;
    border-radius: 0.4rem;
    margin-bottom: 0.6rem;
}

/* banner chrome and texture */
body.myspace-style .profile-banner {
    border: 2px solid #000;
    box-shadow: inset 0 -20px 40px rgba(0,0,0,0.35);
}

body.myspace-style .main-profile-header {
    position: relative;
    margin-top: calc(-1 * var(--ms-banner-height) / 4);
    margin-left: 0.4rem;
    margin-right: 0.4rem;
    max-width: 960px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255,255,255,0.95);
}

/* avatar overlap */
body.myspace-style .avatar-wrap {
    position: relative;
    z-index: 30;
    margin-left: 12px;
}

/* left panel / chrome look */
body.myspace-style .profile-main {
    display: block;
}

body.myspace-style .sidebar {
    background: #050505;
    color: #ddd;
    border-right: 2px solid #111;
}

body.myspace-style .tab-btn {
    color: #cfcfcf;
    font-family: 'Courier New', monospace;
    padding-left: 1.25rem;
}

/* vintage buttons */
body.myspace-style .upload-btn,
body.myspace-style .post-btn,
body.myspace-style .save-btn {
    background: linear-gradient(#111, #000);
    color: #fff;
    border: 2px solid #444;
    box-shadow: 0 3px 0 rgba(0,0,0,0.6) inset;
    border-radius: 6px;
}

/* darker page background like old profiles */
body.myspace-style {
    background: #050505;
    color: #f3f3f3;
    font-family: Tahoma, Arial, sans-serif;
}

body.myspace-style .profile-info h2,
body.myspace-style .profile-about {
    color: #111;
}

/* Left profile card and right content column */
body.myspace-style .profile-main {
    padding-top: 0;
}

body.myspace-style .profile-main > .main-profile-header + .tab-content,
body.myspace-style .profile-main > .main-profile-header + .tab-content + .save-section {
    margin-top: 0.5rem;
}

/* Make posts column vertical and wide */
body.myspace-style .posts-list {
    display: block;
}

body.myspace-style .post-item {
    margin-bottom: 1rem;
    max-width: none;
}

/* Slightly larger avatar in MySpace mode */
body.myspace-style .main-avatar {
    width: 100px;
    height: 100px;
    border-radius: 999px;
}

body.myspace-style .profile-info h2 {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
}

/* posts creator sits above posts in MySpace mode */
body.myspace-style .post-creator {
    margin-bottom: 1rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* hide customize controls by default; reveal when body has .show-customize */
.tab-btn[data-tab="customize"],
.tab-content#customize {
    display: none;
}

body.show-customize .tab-btn[data-tab="customize"] {
    display: inline-block;
}

body.show-customize .tab-content#customize {
    display: block;
}

.tab-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.customize-section {
    margin: 2rem auto;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    background: rgba(25, 25, 25, 0.95);
    max-width: 800px;
    width: 95%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.customize-section h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
}

.customize-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1.5rem;
}

.control-group.full-width {
    grid-column: 1 / -1;
}

.control-group {
    margin-bottom: 1rem;
}

.control-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 500;
    font-size: 0.85rem;
}

.control-group input,
.control-group select {
    width: 100%;
    padding: 0.45rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.profile-pic-upload {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-pic {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    background-color: transparent;
}

.upload-btn,
.profile-btn,
.post-btn {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: opacity 0.2s;
}

.upload-btn:hover,
.profile-btn:hover,
.post-btn:hover {
    opacity: 0.8;
}

.clear-btn {
    background-color: #ef4444;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 1rem;
    margin-top: 0.5rem;
    transition: opacity 0.2s;
}

.clear-btn:hover {
    opacity: 0.75;
}

.post-creator {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
}

.post-creator h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.post-creator textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 1rem;
}

.post-btn {
    padding: 0.75rem 1.5rem;
    background-color: var(--accent);
    color: var(--text-primary);
    border: none;
    border-radius: 0.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.post-btn:hover {
    opacity: 0.9;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-item {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    background-color: var(--bg-primary);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.post-info {
    flex: 1;
}

.post-author {
    font-weight: 600;
    font-size: 0.95rem;
}

.post-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.post-content {
    line-height: 1.6;
    margin-bottom: 1rem;
}

.delete-btn {
    padding: 0.5rem 1rem;
    background-color: #ef4444;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.delete-btn:hover {
    opacity: 0.8;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.profile-btn {
    margin-left: 0.75rem;
    padding: 0.5rem 0.85rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.profile-btn:hover {
    opacity: 0.9;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
}

.header-controls {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 250px;
}

.search-input {
    width: 100%;
    max-width: 300px;
    padding: 0.7rem 1rem;
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: 0.8rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-input::placeholder {
    color: rgba(255,255,255,0.5);
}

.search-input:focus {
    outline: none;
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.12);
    box-shadow: 0 0 20px rgba(255,255,255,0.1);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.95);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 0.8rem;
    max-height: 320px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    backdrop-filter: blur(10px);
}

.search-results.show {
    display: block;
    animation: slideDown 0.2s ease;
}

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

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(255,255,255,0.08);
    transform: translateX(4px);
}

.search-result-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-secondary);
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.search-result-username {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.settings-wrapper {
    position: relative;
}

.settings-btn {
    padding: 0.6rem 0.8rem;
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: 0.8rem;
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.settings-btn:hover {
    background-color: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
    transform: rotate(10deg) scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.settings-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    min-width: 180px;
    background: rgba(0,0,0,0.95);
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: 0.8rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    display: none;
    z-index: 50;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.settings-dropdown.show {
    display: block;
    animation: slideUp 0.2s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(255,255,255,0.1);
    transform: translateX(4px);
    padding-left: 1.2rem;
}

.btn-primary {
    padding: 0.7rem 1.4rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.08) 100%);
    border: 1.5px solid rgba(255,255,255,0.3);
    border-radius: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0.15) 100%);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255,255,255,0.15);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 6px 15px rgba(255,255,255,0.1);
}

#userGreeting {
    font-weight: 500;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
}

.save-section {
    margin-top: 2rem;
    padding: 1.5rem;
    text-align: center;
}

.save-btn {
    padding: 1rem 2rem;
    background-color: #22c55e;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 1.125rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.save-btn:hover {
    opacity: 0.9;
}

.save-message {
    display: inline-block;
    margin-left: 1rem;
    font-weight: 600;
    color: #22c55e;
}

#borderWidthValue {
    margin-left: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.control-group input[type="range"] {
    cursor: pointer;
}

@media (max-width: 768px) {
    #container,
    .profile-container,
    .profile-main,
    .main-profile-header,
    .posts-section,
    #createPostSection {
        width: 100%;
        max-width: calc(100vw - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
        box-sizing: border-box;
    }

    .profile-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 0.75rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        flex: 1;
        min-width: 80px;
        text-align: center;
        white-space: nowrap;
        padding: 0.65rem 0.9rem;
    }

    .profile-main {
        padding: 1rem;
        min-width: 0;
    }

    .main-profile-header {
        min-width: 0;
        flex-wrap: wrap;
    }

    .profile-stats {
        gap: 0.9rem;
        flex-wrap: wrap;
    }
}

/* Mobile improvements for profile */
@media (max-width: 480px) {
    .sidebar {
        padding: 0.5rem;
        gap: 0.25rem;
    }

    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
        min-width: 70px;
    }

    .profile-main {
        padding: 0.75rem max(0.5rem, env(safe-area-inset-right, 0px)) 0.75rem max(0.5rem, env(safe-area-inset-left, 0px));
    }

    .main-profile-header {
        padding: 1rem;
    }

    .posts-section,
    #createPostSection {
        padding-left: max(0.5rem, env(safe-area-inset-left, 0px)) !important;
        padding-right: max(0.5rem, env(safe-area-inset-right, 0px)) !important;
    }

    .profile-stat {
        flex: 1 1 64px;
        min-width: 0;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .sidebar {
        padding: 0.35rem;
    }

    .tab-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-width: 60px;
    }

    .profile-main {
        padding: 0.5rem;
    }
}

/* Touch-friendly improvements for profile */
@media (pointer: coarse) {
    .tab-btn,
    .btn-delete,
    .upload-btn,
    .save-btn,
    .post-btn {
        min-height: 44px;
    }
}

/* --- Customize UI polish (scoped to when customize is shown) --- */
body.show-customize .tab-content#customize {
    display: grid;
    grid-template-columns: 1fr 1fr 260px;
    gap: 0.7rem;
    align-items: start;
}

body.show-customize .tab-content#customize .customize-controls {
    grid-column: 1 / 3;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

body.show-customize .tab-content#customize .customize-section {
    margin: 0;
    padding: 0.7rem;
    border-radius: 0.6rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(12, 12, 12, 0.03);
}

body.show-customize .tab-content#customize .customize-section h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 0.4rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

body.show-customize .tab-content#customize .control-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* label + control inline layout for quicker scanning */
body.show-customize .tab-content#customize .control-group label {
    width: 135px;
    flex: 0 0 auto;
    margin-bottom: 0;
    font-size: 0.9rem;
}

body.show-customize .tab-content#customize .control-group input[type="text"],
body.show-customize .tab-content#customize .control-group input[type="url"],
body.show-customize .tab-content#customize .control-group input[type="color"],
body.show-customize .tab-content#customize .control-group select,
body.show-customize .tab-content#customize .control-group input[type="range"] {
    flex: 1 1 auto;
}

/* file inputs and textareas should occupy full width */
body.show-customize .tab-content#customize .control-group input[type="file"],
body.show-customize .tab-content#customize .control-group textarea,
body.show-customize .tab-content#customize .control-group .banner-presets {
    display: block;
    width: 100%;
}

/* make preset buttons more compact and consistent */
body.show-customize .tab-content#customize .preset-btn {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

body.show-customize .tab-content#customize .profile-pic-upload {
    display: flex;
    gap: 1rem;
    align-items: center;
}

body.show-customize .tab-content#customize .profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--border-color);
    background-color: var(--bg-secondary);
}

body.show-customize .tab-content#customize .upload-btn {
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 0.5rem;
    font-weight: 700;
    transition: opacity 0.2s;
}

body.show-customize .tab-content#customize .upload-btn:hover {
    opacity: 0.8;
}

body.show-customize .tab-content#customize .save-section {
    grid-column: 1 / 3;
    margin: 0;
    padding: 0.5rem 0;
    text-align: center;
}

body.show-customize .tab-content#customize .save-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
}

body.show-customize .tab-content#customize .preview-section {
    grid-column: 3 / 4;
    grid-row: 1 / 4;
    position: sticky;
    top: 0.5rem;
}

body.show-customize .tab-content#customize .profile-preview {
    padding: 0.6rem;
    border-radius: 0.6rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    box-shadow: 0 4px 12px rgba(12,12,12,0.04);
}

body.show-customize .tab-content#customize .profile-preview h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
}

body.show-customize .tab-content#customize .profile-preview p {
    margin: 0.25rem 0 0 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

body.show-customize .tab-content#customize .music-iframe {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    border: none;
}

/* preview banner + presets */
.profile-preview .preview-banner,
.profile-preview .preview-bg {
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(0,0,0,0.08);
    margin-bottom: 0.3rem;
}

.banner-presets { display:flex; gap:0.5rem; margin-top:0.5rem; flex-wrap:wrap }
.preset-btn { 
    padding: 0.35rem 0.5rem; 
    font-size: 0.85rem; 
    cursor: pointer; 
    border-radius: 4px; 
    border: 1px solid var(--border-color); 
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: opacity 0.2s;
}
.preset-btn:hover { 
    opacity: 0.8;
    transform: scale(1.02);
}

/* make customize area single-column on small screens */
@media (max-width: 1400px) {
    body.show-customize .tab-content#customize {
        grid-template-columns: 1fr 240px;
    }
    body.show-customize .tab-content#customize .customize-controls {
        grid-column: 1 / 2;
        grid-template-columns: 1fr;
    }
    body.show-customize .tab-content#customize .save-section {
        grid-column: 1 / 2;
    }
}

@media (max-width: 900px) {
    body.show-customize .tab-content#customize {
        display: block;
    }
    body.show-customize .tab-content#customize .customize-controls {
        display: block;
    }
    body.show-customize .tab-content#customize .preview-section {
        position: static;
        margin-top: 0.75rem;
    }
}

/* Hide main profile header and posts while in Customize mode */
body.show-customize .main-profile-header {
    display: none;
}

body.show-customize .tab-content#posts {
    display: none !important;
}

/* hide the 'My Posts' tab button while customizing to avoid confusion */
body.show-customize .tab-btn[data-tab="posts"] {
    display: none !important;
}
/* Music Volume Slider Styles */
#musicVolumeSlider,
#scVolumeSlider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #555, #777);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

#musicVolumeSlider::-webkit-slider-thumb,
#scVolumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ff5500;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.2s;
}

#musicVolumeSlider::-webkit-slider-thumb:hover,
#scVolumeSlider::-webkit-slider-thumb:hover {
    width: 18px;
    height: 18px;
    background: #ff7722;
    box-shadow: 0 2px 6px rgba(255,85,0,0.4);
}

#musicVolumeSlider::-moz-range-thumb,
#scVolumeSlider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ff5500;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.2s;
}

#musicVolumeSlider::-moz-range-thumb:hover,
#scVolumeSlider::-moz-range-thumb:hover {
    width: 18px;
    height: 18px;
    background: #ff7722;
    box-shadow: 0 2px 6px rgba(255,85,0,0.4);
}

#musicVolumeSlider::-moz-range-track,
#scVolumeSlider::-moz-range-track {
    background: transparent;
    border: none;
}

/* Profile SoundCloud player volume control specific styles */
.sc-volume-control {
    user-select: none;
}

#scVolIcon {
    min-width: 20px;
}

/* Mobile adjustments for volume slider */
@media (max-width: 480px) {
    #musicVolumeSlider {
        height: 5px;
    }

    #musicVolumeSlider::-webkit-slider-thumb {
        width: 14px;
        height: 14px;
    }

    #musicVolumeSlider::-webkit-slider-thumb:hover {
        width: 16px;
        height: 16px;
    }

    #musicVolumeSlider::-moz-range-thumb {
        width: 14px;
        height: 14px;
    }

    #musicVolumeSlider::-moz-range-thumb:hover {
        width: 16px;
        height: 16px;
    }
}

/* =================================================================
   PROFILE PAGE OVERHAUL — Entrance Animations, Glassmorphism, Flair
   ================================================================= */

/* ── Entrance Animation Keyframes ── */
@keyframes profileScaleIn {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes profileFadeInUp {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}
@keyframes profilePopIn {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.profile-animate {
    opacity: 0;
}
.profile-animate.in {
    animation-fill-mode: forwards;
    animation-duration: 0.5s;
    animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}
.profile-animate.in.anim-scale { animation-name: profileScaleIn; }
.profile-animate.in.anim-fade-up { animation-name: profileFadeInUp; animation-timing-function: ease-out; }
.profile-animate.in.anim-pop { animation-name: profilePopIn; }

#storyAvatarWrapper.profile-animate.in {
    animation: none !important;
    opacity: 1 !important;
}

@media (prefers-reduced-motion: reduce) {
    .profile-animate {
        opacity: 1 !important;
        animation: none !important;
    }
    .post-card-animate {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .centered-card,
    .centered-card:hover {
        transition: none !important;
        transform: none !important;
    }
    .post-card,
    .post-card:hover {
        transition: none !important;
        transform: none !important;
    }
    .badge::after {
        animation: none !important;
    }
}

/* ── Avatar Hover Effect ── */
.story-avatar-ring {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.story-avatar-ring:hover {
    transform: scale(1.06);
}

/* ── Post Scroll-Entrance Animation ── */
.post-card-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.post-card-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Post Media Enhancement ── */
.post-card img:not(.post-avatar):not(.comment-avatar):not(.emoji) {
    border-radius: 12px;
    transition: transform 0.3s ease;
}
.post-card img:not(.post-avatar):not(.comment-avatar):not(.emoji):hover {
    transform: scale(1.015);
}

/* ── Post Action Micro-Interactions ── */
.post-card .comment-submit-btn:active,
.post-card .btn-delete:active,
.post-card .egp-trigger-btn:active {
    transform: scale(0.9);
}

/* ── Bio Card ── */
.profile-bio-card {
    position: relative;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.06);
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
}
.profile-bio-card .bio {
    font-style: italic;
    line-height: 1.6;
    margin: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.profile-bio-card .bio.clamped {
    max-height: 4.8em;
}
.profile-bio-card .bio-read-more {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--accent-color, #00c9a7);
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    border: none;
    background: none;
    padding: 0;
}
.profile-bio-card .bio-read-more:hover {
    opacity: 1;
}

/* ── Profile Stats Bar ── */
.profile-stats {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin: 0.5rem 0;
    padding: 0.5rem 0;
}
.profile-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}
.profile-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--profile-text-color, var(--text-color));
}
.profile-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.5;
    color: var(--profile-text-color, var(--text-color));
}

@media (max-width: 480px) {
    .profile-stats {
        gap: 1rem;
    }
    .profile-stat-value {
        font-size: 1.1rem;
    }
}

@media (max-width: 320px) {
    .profile-stats {
        gap: 0.65rem;
        flex-wrap: wrap;
    }
    .profile-stat-value {
        font-size: 1rem;
    }
    .profile-stat-label {
        font-size: 0.65rem;
    }
}

/* ── Empty Posts State ── */
.empty-posts-state {
    text-align: center;
    padding: 3rem 1.5rem;
    opacity: 0.6;
}
.empty-posts-state .empty-emoji {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.75rem;
}
.empty-posts-state h4 {
    margin: 0 0 0.35rem 0;
    font-size: 1.15rem;
    color: var(--profile-text-color, var(--text-color));
}
.empty-posts-state p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.7;
    color: var(--profile-text-color, var(--text-color));
}

/* ── Badge Flair ── */
.profile-badges .badge {
    position: relative;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
}
.profile-badges .badge:hover {
    transform: scale(1.12);
    box-shadow: 0 0 12px rgba(255,255,255,0.15);
}
.profile-badges .badge::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: badgeShine 3s ease-in-out infinite;
    animation-delay: var(--shine-delay, 0s);
    pointer-events: none;
}
@keyframes badgeShine {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

/* ── Connection Badges Upgrade ── */
.connection-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 0.85rem;
    font-weight: 600;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
    color: inherit;
}
.connection-badge:hover {
    transform: translateY(-2px) scale(1.04);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.connection-badge svg {
    transition: transform 0.3s ease;
}
.connection-badge:hover svg {
    transform: scale(1.1);
}

/* ── Music Player Wrapper ── */
.music-player-card {
    background: rgba(15, 15, 25, 0.55);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 0.75rem 1rem;
    margin: 0.75rem auto;
    max-width: 420px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.music-player-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.5;
    color: var(--profile-text-color, var(--text-color));
}

/* Right-column music controls: align slider + report/link and improve contrast */
#rsSoundCloudPlayer.rs-soundcloud-player .sc-sidebar-controls-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 12px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(6, 12, 36, 0.75);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#rsSoundCloudPlayer.rs-soundcloud-player .sc-sidebar-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    padding: 0;
}

#rsSoundCloudPlayer.rs-soundcloud-player .sc-vol-icon {
    color: #ff5500;
    font-size: 17px;
    flex-shrink: 0;
}

#rsSoundCloudPlayer.rs-soundcloud-player .sc-sidebar-controls input[type="range"] {
    flex: 1;
    min-width: 0;
    margin: 0;
    height: 8px;
    border-radius: 4px;
}

#rsSoundCloudPlayer.rs-soundcloud-player .sc-vol-label {
    color: #ffffff;
    font-size: 0.8rem;
    min-width: 34px;
    font-weight: 600;
    text-align: right;
}

#rsSoundCloudPlayer.rs-soundcloud-player .sc-sidebar-btn-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    justify-content: flex-end;
    flex-shrink: 0;
}

#rsSoundCloudPlayer.rs-soundcloud-player .sc-sidebar-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.8);
    width: 30px;
    height: 30px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    line-height: 1;
    transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

#rsSoundCloudPlayer.rs-soundcloud-player .sc-sidebar-btn:hover {
    background: rgba(255, 85, 0, 0.22);
    border-color: rgba(255, 85, 0, 0.45);
    color: #ffb07c;
    transform: translateY(-1px);
}

@media (max-width: 380px) {
    #rsSoundCloudPlayer.rs-soundcloud-player .sc-sidebar-controls-wrap {
        gap: 8px;
        padding: 7px 8px;
    }

    #rsSoundCloudPlayer.rs-soundcloud-player .sc-sidebar-btn {
        width: 28px;
        height: 28px;
    }
}

/* ── Equalizer Bars ── */
.equalizer {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}
.equalizer .eq-bar {
    width: 3px;
    background: var(--accent-color, #00c9a7);
    border-radius: 1px;
    animation: eqBounce 0.8s ease-in-out infinite;
}
.equalizer .eq-bar:nth-child(1) { height: 60%; animation-delay: 0s; }
.equalizer .eq-bar:nth-child(2) { height: 100%; animation-delay: 0.15s; }
.equalizer .eq-bar:nth-child(3) { height: 40%; animation-delay: 0.3s; }
.equalizer.paused .eq-bar {
    animation-play-state: paused;
    height: 30% !important;
}
@keyframes eqBounce {
    0%, 100% { transform: scaleY(0.4); }
    50% { transform: scaleY(1); }
}

/* ── Name Effects ── */
.name-effect-glow {
    text-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 40px currentColor;
}
@keyframes nameShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}
.name-effect-shimmer {
    background: linear-gradient(90deg, currentColor 0%, rgba(255,255,255,0.9) 50%, currentColor 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: nameShimmer 3s linear infinite;
}
@keyframes nameGlitch {
    0%, 90%, 100% { transform: translate(0); }
    92% { transform: translate(-2px, 1px); }
    94% { transform: translate(2px, -1px); }
    96% { transform: translate(-1px, -1px); }
    98% { transform: translate(1px, 1px); }
}
.name-effect-glitch {
    animation: nameGlitch 4s ease-in-out infinite;
}
@keyframes nameRainbow {
    0% { color: #ff6b6b; }
    16% { color: #ffd93d; }
    33% { color: #6bcb77; }
    50% { color: #4d96ff; }
    66% { color: #9b59b6; }
    83% { color: #ff6b9d; }
    100% { color: #ff6b6b; }
}
.name-effect-rainbow {
    animation: nameRainbow 4s linear infinite;
}
@keyframes nameBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
.name-effect-bounce {
    display: inline-block;
    animation: nameBounce 1.5s ease-in-out infinite;
}
.name-effect-typewriter {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid currentColor;
    animation: typewriterBlink 0.7s step-end infinite;
    display: inline-block;
    max-width: 100%;
}
@keyframes typewriterBlink {
    0%, 100% { border-color: currentColor; }
    50% { border-color: transparent; }
}

/* ── Layout Variants ── */
.layout-wide .profile-container {
    max-width: 1400px;
}
@media (min-width: 1024px) {
    .layout-wide #profileContent {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
        align-items: start;
    }
    .layout-wide .centered-header {
        grid-column: 1 / -1;
    }
    .layout-wide .centered-card {
        max-width: 100%;
    }
    .layout-wide .posts-section {
        grid-column: 1 / -1;
    }
}
.layout-minimal .profile-banner {
    display: none !important;
}
.layout-minimal .centered-card {
    margin-top: 2rem;
}

/* ── Profile Effects Canvas ── */
#profileEffectsCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* ── Mobile: reduce expensive backdrop-filter effects for smooth scrolling ──
   blur(16-24px) + saturate() on every card creates heavy compositor work on
   mobile GPUs. On small screens use a cheaper blur and drop the saturate(). */
@media (max-width: 768px) {
    .post-card {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .music-player-card {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
}

/* =================================================================
   PROFILE CYBER DASHBOARD LAYOUT
   ================================================================= */

#container.profile-cyber {
    --cyber-border: rgba(126, 139, 255, 0.23);
    --cyber-card: rgba(7, 9, 24, 0.86);
    --cyber-soft: rgba(22, 24, 51, 0.75);
    --cyber-text: #ebefff;
    background:
        radial-gradient(circle at 12% 16%, rgba(40, 156, 255, 0.18), transparent 34%),
        radial-gradient(circle at 89% 9%, rgba(255, 51, 170, 0.15), transparent 32%),
        radial-gradient(circle at 46% 92%, rgba(114, 59, 255, 0.18), transparent 42%),
        #03040a;
    border-radius: 18px;
    padding: 0 8px 18px;
    max-width: 1600px;
    margin: 0 auto;
}

#container.profile-cyber,
#container.profile-cyber * {
    box-sizing: border-box;
}

#container.profile-cyber .profile-cyber-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 2.12fr) minmax(270px, 0.68fr);
}

#container.profile-cyber .profile-main-column,
#container.profile-cyber .profile-side-column {
    min-width: 0;
}

#container.profile-cyber .profile-main-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#container.profile-cyber .profile-side-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-self: start;
    position: sticky;
    top: 82px;
}

#container.profile-cyber .profile-side-column > .profile-card,
#container.profile-cyber .profile-side-column > .profile-panel,
#container.profile-cyber .profile-side-scroll > .profile-card,
#container.profile-cyber .profile-side-scroll > .profile-panel {
    width: 100%;
}

#container.profile-cyber .profile-card,
#container.profile-cyber .profile-panel,
#container.profile-cyber .profile-hero-card,
#container.profile-cyber .profile-bottom-actions {
    border-radius: 14px;
    border: 0.5px solid rgba(126, 139, 255, 0.2);
    background: var(--cyber-card);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.42), inset 0 0 0 0.5px rgba(255, 255, 255, 0.03);
}

#container.profile-cyber .profile-card,
#container.profile-cyber .profile-panel {
    overflow: hidden;
}

#container.profile-cyber .profile-hero-card {
    position: relative;
    overflow: hidden;
    padding: 14px;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

#container.profile-cyber .profile-hero-content {
    position: relative;
    padding: 0;
    margin-top: 0;
}

#container.profile-cyber .profile-hero-head {
    display: grid;
    gap: 14px;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: end;
}

#container.profile-cyber #storyAvatarWrapper {
    margin: 0 !important;
}

#container.profile-cyber #storyAvatarWrapper .profile-pic,
#container.profile-cyber #storyAvatarWrapper .center-banner {
    width: clamp(120px, 15vw, 190px) !important;
    height: clamp(120px, 15vw, 190px) !important;
}

#container.profile-cyber .profile-identity-block {
    margin: 0 !important;
    padding: 0 !important;
    border-top: 0 !important;
    text-align: left !important;
}

#container.profile-cyber #profileDisplayName {
    margin: 0;
    color: #f6f7ff;
    font-size: clamp(1.4rem, 2.25vw, 2rem);
    letter-spacing: 0.03em;
    font-family: 'Orbitron', 'Montserrat', sans-serif;
    text-shadow: 0 0 18px rgba(140, 127, 255, 0.55);
}

#container.profile-cyber #profileUsername {
    margin: 2px 0 0;
    color: rgba(221, 231, 255, 0.72);
}

#container.profile-cyber .profile-identity-meta {
    margin: 4px 0 0;
    color: rgba(218, 227, 255, 0.56);
    font-size: 0.8rem;
}

#container.profile-cyber .profile-quick-tags {
    margin-top: 8px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

#container.profile-cyber .profile-tag-chip,
#container.profile-cyber .profile-tag-add-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(126, 139, 255, 0.26);
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 0.74rem;
    color: #c4ceff;
    background: rgba(26, 29, 63, 0.65);
}

#container.profile-cyber .profile-tag-chip {
    justify-content: center;
    text-align: center;
    padding: 3px 10px;
    min-width: 0;
    overflow: visible;
}

#container.profile-cyber .profile-tag-label {
    display: block;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    line-height: 1;
}

#container.profile-cyber .profile-tag-add-btn {
    position: static;
    width: 20px;
    justify-content: center;
    padding: 3px 0;
    margin-left: 2px;
    color: #9ce8ff;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

#container.profile-cyber .profile-quick-tags:hover .profile-tag-add-btn {
    opacity: 1;
    transform: translateY(-1px);
    border-color: rgba(156, 232, 255, 0.45);
    background: rgba(21, 41, 63, 0.72);
}

#container.profile-cyber .profile-tag-remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(255, 120, 160, 0.35);
    background: rgba(31, 14, 32, 0.92);
    color: #ff9ab7;
    font-size: 0.78rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.75);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

#container.profile-cyber .profile-tag-chip:hover .profile-tag-remove-btn {
    opacity: 1;
    transform: scale(1);
}

#container.profile-cyber .profile-tag-chip:hover {
    border-color: rgba(156, 232, 255, 0.42);
    background: rgba(33, 38, 78, 0.86);
}

#container.profile-cyber .profile-meta-bio {
    margin-top: 8px;
    color: rgba(220, 230, 255, 0.86);
    line-height: 1.45;
    max-width: 76ch;
}

#container.profile-cyber .profile-meta-bio.clamped {
    max-height: 4.5em;
    overflow: hidden;
}

#container.profile-cyber #bioReadMore {
    margin-top: 6px;
    border: none;
    background: transparent;
    color: #8bd7ff;
    font-size: 0.78rem;
    cursor: pointer;
    padding: 0;
}

#container.profile-cyber .profile-badges {
    margin-top: 8px;
    justify-content: flex-start;
}

#container.profile-cyber .profile-stats {
    margin-top: 12px;
    border-radius: 12px;
    background: rgba(9, 11, 30, 0.9);
    border: 0.5px solid rgba(126, 139, 255, 0.16);
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

#container.profile-cyber .profile-stat {
    border-radius: 9px;
    border: 0.5px solid rgba(126, 139, 255, 0.12);
    padding: 8px 5px;
    background: rgba(23, 26, 52, 0.62);
}

#container.profile-cyber .profile-stat-value {
    color: #f1f4ff;
    font-size: 1.04rem;
}

#container.profile-cyber .profile-stat-label {
    color: rgba(206, 218, 255, 0.6);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
}

#container.profile-cyber #createPostSection {
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

#container.profile-cyber .profile-card,
#container.profile-cyber .profile-panel {
    padding: 12px;
}

#container.profile-cyber .profile-card-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

#container.profile-cyber .profile-card-title-row h3 {
    margin: 0;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #ff62ca;
    font-family: 'Orbitron', 'Montserrat', sans-serif;
}

#container.profile-cyber .profile-card-subtitle {
    font-size: 0.72rem;
    color: rgba(211, 222, 255, 0.62);
}

#container.profile-cyber .profile-now-playing-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-areas:
        "art meta"
        "recent recent";
    align-items: start;
}

#container.profile-cyber .profile-cover-art {
    grid-area: art;
    width: 96px;
    height: 96px;
    border-radius: 16px;
    border: 1px solid rgba(138, 150, 255, 0.2);
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 98, 202, 0.16), transparent 55%),
        radial-gradient(circle at 68% 70%, rgba(86, 168, 255, 0.18), transparent 58%),
        linear-gradient(145deg, rgba(15, 18, 48, 0.98), rgba(10, 12, 28, 0.98));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 8px 22px rgba(0,0,0,0.2);
}

#container.profile-cyber .profile-track-meta h4 {
    margin: 0;
    color: var(--cyber-text);
    font-size: 0.95rem;
    line-height: 1;
    letter-spacing: 0.01em;
    max-width: 16ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#container.profile-cyber .profile-track-meta {
    grid-area: meta;
}

#container.profile-cyber .profile-track-meta p {
    margin: 4px 0 8px;
    color: rgba(207, 220, 255, 0.62);
    font-size: 0.82rem;
}

#container.profile-cyber .profile-now-playing-progress-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 10px;
}

#container.profile-cyber .profile-now-playing-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

#container.profile-cyber .profile-now-playing-volume-btn {
    align-self: auto;
    border: 1px solid rgba(126, 139, 255, 0.24);
    border-radius: 999px;
    background: rgba(22, 26, 57, 0.72);
    color: #e9ecff;
    font-size: 0.72rem;
    padding: 5px 10px;
    cursor: pointer;
    white-space: nowrap;
}

#container.profile-cyber .profile-now-playing-volume-panel {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(260px, 100%);
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(126, 139, 255, 0.18);
    background: rgba(13, 16, 34, 0.94);
    box-shadow: 0 16px 32px rgba(0,0,0,0.35);
}

#container.profile-cyber .profile-now-playing-volume-panel[hidden] {
    display: none;
}

#container.profile-cyber .profile-now-playing-volume-panel input[type="range"] {
    flex: 1;
    min-width: 0;
    accent-color: #905fff;
}

#container.profile-cyber .profile-now-playing-volume-panel span {
    min-width: 38px;
    text-align: right;
    color: rgba(233, 236, 255, 0.8);
    font-size: 0.72rem;
}

#container.profile-cyber .profile-now-playing-progress {
    height: 5px;
    border-radius: 999px;
    background: rgba(18, 23, 54, 0.92);
    border: 1px solid rgba(126, 139, 255, 0.18);
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

#container.profile-cyber .profile-now-playing-progress.is-active {
    box-shadow: 0 0 0 1px rgba(144, 95, 255, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

#container.profile-cyber .profile-now-playing-progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #b17bff, #5aa8ff);
    transition: width 0.08s linear;
}

#container.profile-cyber .profile-now-playing-time-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: rgba(207, 220, 255, 0.68);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
}

#container.profile-cyber .profile-now-playing-time-row span {
    white-space: nowrap;
}

#container.profile-cyber .profile-player-controls {
    display: flex;
    gap: 8px;
    margin-top: 0;
}

#container.profile-cyber .profile-player-controls button {
    border: 1px solid rgba(126, 139, 255, 0.33);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    background: rgba(22, 26, 57, 0.84);
    color: #e9ecff;
}

#container.profile-cyber .profile-player-controls button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

#container.profile-cyber .profile-player-controls button.is-primary {
    background: radial-gradient(circle at 40% 30%, #905fff, #4b2dcb);
}

#container.profile-cyber .profile-recent-tracks {
    grid-area: recent;
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-wrap: wrap;
}

#container.profile-cyber .profile-recent-tracks div {
    flex: 1 1 180px;
    border-radius: 12px;
    border: 1px solid rgba(126, 139, 255, 0.14);
    background: rgba(21, 24, 50, 0.48);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
}

#container.profile-cyber .profile-recent-tracks strong {
    color: #eef2ff;
    font-size: 0.73rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#container.profile-cyber .profile-recent-tracks span {
    color: rgba(208, 220, 255, 0.58);
    font-size: 0.68rem;
}

#container.profile-cyber .profile-side-column .profile-now-playing-card {
    padding: 10px;
}

#container.profile-cyber .profile-side-column .profile-now-playing-grid {
    grid-template-columns: 84px minmax(0, 1fr);
    grid-template-areas:
        "art meta"
        "recent recent";
}

#container.profile-cyber .profile-side-column .profile-cover-art {
    grid-area: art;
    width: 84px;
    height: 84px;
}

#container.profile-cyber .profile-side-column .profile-track-meta h4 {
    font-size: 1rem;
}

#container.profile-cyber .profile-side-column .profile-player-controls {
    justify-content: center;
}

#container.profile-cyber .profile-side-column .profile-now-playing-toolbar {
    flex-wrap: nowrap;
}

#container.profile-cyber .profile-side-column .profile-now-playing-volume-panel {
    width: min(240px, 100%);
}

#container.profile-cyber .profile-side-column .profile-recent-tracks {
    margin-top: 6px;
    flex-direction: column;
}

#container.profile-cyber .profile-side-column .profile-recent-tracks div {
    flex: 0 0 auto;
}

#container.profile-cyber .profile-content-split {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

#container.profile-cyber .profile-mini-tabs {
    display: inline-flex;
    gap: 8px;
}

#container.profile-cyber .profile-mini-tabs span {
    font-size: 0.7rem;
    color: rgba(210, 220, 255, 0.62);
}

#container.profile-cyber .profile-mini-tabs .active {
    color: #f1f4ff;
}

#container.profile-cyber .profile-activity-card .posts-section {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

#container.profile-cyber .profile-activity-card {
    padding: 0 !important;
}

#container.profile-cyber .profile-activity-card .profile-card-title-row {
    padding: 12px 12px 0 12px;
}

#container.profile-cyber .profile-activity-card #postsList {
    max-width: none;
}

#container.profile-cyber .profile-game-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#container.profile-cyber .profile-game-list li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(126, 139, 255, 0.14);
    background: rgba(22, 26, 53, 0.6);
}

#container.profile-cyber .profile-game-list li span {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#container.profile-cyber .profile-game-card {
    align-self: stretch;
    padding: 10px;
}

#container.profile-cyber .profile-game-card .profile-card-title-row {
    margin-bottom: 8px;
}

#container.profile-cyber .profile-game-list .profile-game-hidden {
    justify-content: center;
    color: rgba(210, 220, 255, 0.7);
    font-size: 0.85rem;
}

#container.profile-cyber .profile-game-controls {
    display: grid;
    gap: 6px;
    margin-bottom: 6px;
    padding: 6px;
    border: 1px solid rgba(126, 139, 255, 0.18);
    border-radius: 8px;
    background: rgba(15, 20, 48, 0.6);
}

#container.profile-cyber .profile-game-list {
    max-height: 160px;
    overflow: auto;
}

#container.profile-cyber .profile-game-visibility-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(225, 233, 255, 0.84);
    font-size: 0.8rem;
}

#container.profile-cyber .profile-game-add-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

#container.profile-cyber .profile-game-add-row input {
    border: 1px solid rgba(126, 139, 255, 0.3);
    background: rgba(7, 10, 26, 0.9);
    color: #eef3ff;
    border-radius: 8px;
    padding: 8px 10px;
}

#container.profile-cyber .profile-game-add-row button,
#container.profile-cyber .profile-game-remove-btn {
    border: 1px solid rgba(126, 139, 255, 0.35);
    background: rgba(26, 31, 66, 0.9);
    color: #ecf1ff;
    border-radius: 8px;
    padding: 7px 10px;
    cursor: pointer;
    font-size: 0.75rem;
}

#container.profile-cyber .profile-game-remove-btn {
    margin-left: auto;
}

#container.profile-cyber .profile-game-list span {
    color: #e8edff;
}

#container.profile-cyber .profile-game-list em {
    color: #76ffab;
    font-style: normal;
    font-size: 0.7rem;
}

#container.profile-cyber .profile-game-list .profile-game-more {
    justify-content: center;
    color: rgba(214, 225, 255, 0.78);
    font-size: 0.76rem;
    border-style: dashed;
}

#container.profile-cyber .profile-feature-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#container.profile-cyber .profile-feature-card p {
    margin: 0;
    color: rgba(211, 222, 255, 0.77);
    font-size: 0.9rem;
}

#container.profile-cyber .profile-bottom-actions {
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
    background: rgba(8, 10, 24, 0.95);
}

#container.profile-cyber .profile-action-btn {
    border: 1px solid rgba(126, 139, 255, 0.24);
    border-radius: 10px;
    background: rgba(24, 28, 58, 0.88);
    color: #edf1ff;
    padding: 10px 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#container.profile-cyber .profile-action-link:hover {
    border-color: rgba(158, 183, 255, 0.5);
    background: rgba(36, 42, 82, 0.95);
}

#container.profile-cyber #friendBtnContainer {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

#container.profile-cyber .profile-identity-block #friendBtnContainer {
    margin-top: 10px;
}

/* Own profile has no friend actions; collapse the reserved space. */
#container.profile-cyber #friendBtnContainer:empty {
    display: none;
    min-height: 0;
    margin-top: 0;
}

#container.profile-cyber .profile-identity-block #friendBtnContainer .profile-social-actions {
    justify-content: flex-start;
}

#container.profile-cyber #friendBtnContainer .btn-friend,
#container.profile-cyber #friendBtnContainer .btn-report {
    border-radius: 10px;
    border: 1px solid rgba(126, 139, 255, 0.25);
    min-height: 40px;
}

#container.profile-cyber .profile-panel-kicker {
    margin: 0 0 6px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #ff67cb;
    font-weight: 700;
}

#container.profile-cyber .profile-vibe-panel h4 {
    margin: 0;
    color: #f0f3ff;
    font-size: 1.04rem;
}

#container.profile-cyber .profile-vibe-panel p {
    margin: 5px 0 0;
    color: rgba(210, 223, 255, 0.72);
}

#container.profile-cyber .profile-join-room-btn {
    margin-top: 10px;
    width: 100%;
    border: 1px solid rgba(126, 139, 255, 0.45);
    border-radius: 9px;
    padding: 9px 11px;
    color: #f7f8ff;
    background: linear-gradient(90deg, #5b30d4, #774dff);
    font-weight: 700;
    opacity: 0.84;
}

#container.profile-cyber .profile-bio-section {
    margin: 0;
    text-align: left;
    padding: 12px;
}

#container.profile-cyber .profile-bio-card {
    background: var(--cyber-soft);
    border: 1px solid rgba(126, 139, 255, 0.2);
    border-radius: 10px;
    padding: 10px;
}

#container.profile-cyber .profile-bio-card .bio {
    margin: 0;
    color: rgba(227, 236, 255, 0.9);
    font-style: normal;
    line-height: 1.55;
}

#container.profile-cyber .profile-handle-chip {
    margin-top: 10px;
    display: inline-flex;
    border: 1px solid rgba(126, 139, 255, 0.3);
    border-radius: 999px;
    padding: 4px 10px;
    color: #9ce8ff;
    font-size: 0.76rem;
    font-weight: 700;
}

#container.profile-cyber .profile-connections-rail,
#container.profile-cyber .profile-badge-rail {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

#container.profile-cyber .profile-visitors-rail {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

#container.profile-cyber .profile-visitor-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 6px 8px;
    border-radius: 999px;
    border: 1px solid rgba(126, 139, 255, 0.3);
    background: linear-gradient(145deg, rgba(255, 99, 201, 0.18), rgba(91, 166, 255, 0.18));
}

#container.profile-cyber .profile-visitor-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex: 0 0 28px;
    background: linear-gradient(145deg, rgba(255, 99, 201, 0.35), rgba(91, 166, 255, 0.3));
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

#container.profile-cyber .profile-visitor-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

#container.profile-cyber .profile-visitor-meta strong {
    color: #eef2ff;
    font-size: 0.78rem;
    line-height: 1.1;
}

#container.profile-cyber .profile-visitor-meta span {
    color: rgba(208, 220, 255, 0.58);
    font-size: 0.65rem;
    line-height: 1.1;
}

#container.profile-cyber .profile-empty-copy {
    margin: 0;
    color: rgba(209, 220, 255, 0.62);
    font-size: 0.84rem;
}

@media (max-width: 1140px) {
    #container.profile-cyber .profile-cyber-grid {
        grid-template-columns: 1fr;
    }

    #container.profile-cyber .profile-side-column {
        position: static;
        top: auto;
    }
}

@media (max-width: 900px) {
    #container.profile-cyber .profile-content-split,
    #container.profile-cyber .profile-feature-row {
        grid-template-columns: 1fr;
    }

    #container.profile-cyber .profile-now-playing-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "art"
            "meta"
            "recent";
    }

    #container.profile-cyber .profile-recent-tracks {
        grid-column: 1 / -1;
    }

    #container.profile-cyber .profile-cover-art {
        width: 100%;
        max-width: 180px;
        height: 110px;
        margin: 0 auto;
    }

    #container.profile-cyber .profile-now-playing-toolbar {
        flex-wrap: wrap;
    }

    #container.profile-cyber .profile-recent-tracks {
        flex-direction: column;
    }

    #container.profile-cyber .profile-bottom-actions {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {
    #container.profile-cyber {
        border-radius: 0;
        padding: 0 6px 14px;
    }

    #container.profile-cyber .profile-hero-content {
        margin-top: 0;
        padding: 0;
    }

    #container.profile-cyber .profile-hero-head {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    #container.profile-cyber .profile-identity-block,
    #container.profile-cyber .profile-badges,
    #container.profile-cyber .profile-quick-tags {
        justify-content: center;
        text-align: center !important;
    }

    #container.profile-cyber .profile-identity-block #friendBtnContainer {
        justify-content: center;
    }

    #container.profile-cyber .profile-identity-block #friendBtnContainer .profile-social-actions {
        justify-content: center;
    }

    #container.profile-cyber #storyAvatarWrapper .profile-pic,
    #container.profile-cyber #storyAvatarWrapper .center-banner {
        width: 118px !important;
        height: 118px !important;
    }

    #container.profile-cyber .profile-stats {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(58px, 1fr);
        grid-template-columns: none;
        gap: 5px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    #container.profile-cyber .profile-stats::-webkit-scrollbar {
        display: none;
    }

    #container.profile-cyber .profile-stat {
        min-width: 0;
        padding: 5px 3px;
        text-align: center;
        border-width: 0.5px;
        overflow: hidden;
    }

    #container.profile-cyber .profile-stat-value {
        font-size: 0.85rem;
        line-height: 1;
    }

    #container.profile-cyber .profile-stat-label {
        font-size: 0.46rem;
        line-height: 1.05;
        letter-spacing: 0.02em;
        white-space: nowrap;
        word-break: normal;
        text-align: center;
    }

    @media (max-width: 360px) {
        #container.profile-cyber .profile-stats {
            grid-auto-columns: minmax(54px, 1fr);
        }
    }

    #container.profile-cyber .profile-side-column {
        position: static;
        top: auto;
    }

    #container.profile-cyber .profile-card,
    #container.profile-cyber .profile-panel,
    #container.profile-cyber .profile-bottom-actions {
        border-radius: 12px;
    }

    #container.profile-cyber .profile-now-playing-grid {
        grid-template-columns: 1fr;
    }

    #container.profile-cyber .profile-recent-tracks {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #container.profile-cyber .profile-bottom-actions {
        grid-template-columns: 1fr 1fr;
    }

    #container.profile-cyber .profile-action-btn {
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    #container.profile-cyber .profile-visitors-rail span {
        width: 28px;
        height: 28px;
    }

    #container.profile-cyber .profile-quick-tags {
        justify-content: center;
        gap: 4px;
    }

    #container.profile-cyber .profile-quick-tags:not(.is-editing) {
        padding-right: 0;
    }

    #container.profile-cyber .profile-tag-add-btn {
        position: static;
        opacity: 1;
        transform: none;
        width: 22px;
        margin-left: 2px;
    }

    #container.profile-cyber .profile-quick-tags:not(.is-editing) .profile-tag-add-btn {
        display: none;
    }

    #container.profile-cyber .profile-tag-chip {
        padding: 3px 9px;
    }

    #container.profile-cyber .profile-tag-remove-btn {
        opacity: 0;
        transform: scale(0.75);
        top: -4px;
        right: -4px;
    }

    #container.profile-cyber .profile-quick-tags.is-editing .profile-tag-remove-btn {
        opacity: 1;
        transform: scale(1);
    }

    #container.profile-cyber .profile-tag-edit-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid rgba(126, 139, 255, 0.26);
        border-radius: 999px;
        padding: 3px 10px;
        font-size: 0.74rem;
        color: #9ce8ff;
        background: rgba(26, 29, 63, 0.65);
        cursor: pointer;
    }

    #container.profile-cyber .profile-quick-tags.is-editing .profile-tag-edit-toggle {
        border-color: rgba(156, 232, 255, 0.45);
    }

    #container.profile-cyber .profile-feature-row {
        grid-template-columns: 1fr;
    }

        #container.profile-cyber .profile-bottom-actions {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
        }
}

/* Mobile swipe drawer for profile side column */
@media (max-width: 760px) {
    #container.profile-cyber {
        --profile-drawer-top-offset: calc(8px + env(safe-area-inset-top, 0px));
        --profile-drawer-bottom-offset: calc(72px + env(safe-area-inset-bottom, 0px));
        overflow-x: clip;
    }

    #container.profile-cyber .profile-side-column {
        position: fixed !important;
        top: var(--profile-drawer-top-offset);
        right: -420px;
        bottom: var(--profile-drawer-bottom-offset);
        height: calc(100dvh - var(--profile-drawer-top-offset) - var(--profile-drawer-bottom-offset));
        max-height: calc(100dvh - var(--profile-drawer-top-offset) - var(--profile-drawer-bottom-offset));
        width: calc(100vw - 16px);
        max-width: 390px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 8px 6px calc(24px + env(safe-area-inset-bottom, 0px));
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        background: rgba(4, 8, 26, 0.96);
        border-left: 1px solid rgba(94, 140, 225, 0.28);
        border-radius: 12px 0 0 12px;
        box-shadow: -16px 0 32px rgba(0, 0, 0, 0.42);
        transition: right 0.24s ease;
        z-index: 1605;
        pointer-events: none;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    #container.profile-cyber .profile-side-scroll {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        gap: 10px;
        min-height: 0;
        padding: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        touch-action: pan-y;
    }

    #container.profile-cyber .profile-side-column .profile-now-playing-card {
        display: none !important;
    }

    #container.profile-cyber.profile-side-drawer-open .profile-side-column {
        right: 8px;
        pointer-events: auto;
    }

    #container.profile-cyber .profile-side-scroll > .profile-panel,
    #container.profile-cyber .profile-side-scroll > .profile-card {
        min-width: 0;
        overflow: visible;
        height: auto;
        min-height: max-content;
    }

    #container.profile-cyber .profile-bio-section,
    #container.profile-cyber .profile-bio-card {
        overflow: visible;
    }

    #container.profile-cyber #profileAboutBio {
        margin: 0;
        line-height: 1.45;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    #container.profile-cyber .profile-badge-rail {
        align-items: center;
    }

    #container.profile-cyber .profile-badge-rail .badge-clickable {
        display: inline-flex !important;
        align-items: center;
    }

    #container.profile-cyber .profile-badge-rail .badge-clickable img {
        display: block !important;
        height: 50px !important;
        width: auto !important;
        max-width: 100% !important;
        object-fit: contain !important;
    }

    #container.profile-cyber .profile-visitors-rail,
    #container.profile-cyber .profile-connections-rail,
    #container.profile-cyber .profile-badge-rail {
        width: 100%;
        min-width: 0;
    }

    #container.profile-cyber .profile-visitor-chip {
        flex: 1 1 140px;
        max-width: 100%;
        min-width: 0;
    }

    #container.profile-cyber .profile-visitor-meta {
        flex: 1 1 auto;
        max-width: 100%;
        min-width: 0;
    }

    #container.profile-cyber .profile-visitor-meta strong,
    #container.profile-cyber .profile-visitor-meta span {
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .profile-side-drawer-overlay {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 56px;
        left: 0;
        background: rgba(0, 0, 0, 0.38);
        opacity: 0;
        pointer-events: none;
        touch-action: none;
        overscroll-behavior: contain;
        transition: opacity 0.2s ease;
        z-index: 1600;
    }

    body.profile-side-drawer-open .profile-side-drawer-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    body.profile-side-drawer-open {
        overflow-x: clip;
        overscroll-behavior-y: contain;
    }
}

/* =================================================================
   PROFILE CYBER SIDEBAR VISUAL RESTORE
   Re-applies the darker card stack + neon accents shown in the reference.
   ================================================================= */

#container.profile-cyber .profile-side-column {
    gap: 10px;
}

#container.profile-cyber .profile-side-scroll {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

#container.profile-cyber .profile-game-card,
#container.profile-cyber .profile-visitors-card {
    display: none !important;
}

#container.profile-cyber .profile-side-column > .profile-panel,
#container.profile-cyber .profile-side-column > .profile-card,
#container.profile-cyber .profile-side-scroll > .profile-panel,
#container.profile-cyber .profile-side-scroll > .profile-card {
    background: linear-gradient(165deg, rgba(8, 13, 38, 0.96), rgba(7, 16, 48, 0.92));
    border: 1px solid rgba(94, 140, 225, 0.28);
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(2, 8, 28, 0.6), inset 0 0 0 1px rgba(125, 170, 255, 0.08);
}

#container.profile-cyber .profile-panel-kicker,
#container.profile-cyber .profile-card-title-row h3 {
    color: #ff5bc4;
    text-shadow: 0 0 8px rgba(255, 91, 196, 0.3);
}

#container.profile-cyber .profile-bio-card {
    background: rgba(10, 18, 49, 0.72);
    border: 1px solid rgba(110, 155, 235, 0.22);
}

#container.profile-cyber .profile-about-text,
#container.profile-cyber #profileAboutBio {
    color: #ff3f3f;
    font-family: 'Permanent Marker', 'Orbitron', sans-serif;
    letter-spacing: 0.01em;
}

#container.profile-cyber .profile-handle-chip {
    border-color: rgba(126, 169, 255, 0.4);
    background: rgba(13, 23, 60, 0.8);
    color: #d5e5ff;
}

#container.profile-cyber .profile-cover-art {
    border: 1px solid rgba(100, 140, 225, 0.36);
    box-shadow: 0 0 0 1px rgba(145, 185, 255, 0.14), 0 10px 24px rgba(0, 0, 0, 0.35);
}

#container.profile-cyber .profile-now-playing-progress {
    background: rgba(10, 18, 54, 0.95);
    border-color: rgba(112, 150, 230, 0.35);
}

#container.profile-cyber .profile-now-playing-progress-fill {
    background: linear-gradient(90deg, #7eb3ff, #8f5dff);
}

#container.profile-cyber .profile-player-controls button {
    border-color: rgba(108, 148, 235, 0.36);
    background: rgba(17, 28, 70, 0.88);
}

#container.profile-cyber .profile-player-controls button.is-primary {
    background: radial-gradient(circle at 38% 32%, #a075ff, #5a35d4);
    box-shadow: 0 0 14px rgba(132, 92, 255, 0.35);
}

#container.profile-cyber .profile-connections-rail .connection-badge {
    border-radius: 999px;
    padding: 5px 10px;
    border: 1px solid rgba(116, 158, 236, 0.26);
    background: rgba(13, 23, 60, 0.65);
    box-shadow: inset 0 0 0 1px rgba(142, 179, 245, 0.08);
}

#container.profile-cyber .profile-connections-rail .connection-badge:hover {
    transform: translateY(-1px);
    background: rgba(20, 34, 82, 0.82);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

#container.profile-cyber .profile-visitor-chip {
    border-color: rgba(112, 153, 230, 0.3);
    background: linear-gradient(145deg, rgba(20, 37, 88, 0.78), rgba(11, 24, 63, 0.8));
}

@media (max-width: 420px) {
    #container.profile-cyber .profile-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #container.profile-cyber .profile-quick-tags span {
        font-size: 0.64rem;
    }

    #container.profile-cyber .profile-tag-add-btn {
        width: 20px;
    }

    #container.profile-cyber .profile-card-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    #container.profile-cyber .profile-card-title-row h3 {
        font-size: 0.8rem;
    }

    #container.profile-cyber .profile-visitors-rail {
        flex-wrap: wrap;
    }
}