/* ============================================
   Echtz — Premium Design System v6
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono&display=swap');

:root {
    --bg: #0a0a0f;
    --staff-hide: none;

    [data-staff-only] {
        display: none !important;
    }

    .staff-visible {
        display: flex !important;
    }

    --surface: #12121a;
    --surface-2: #1a1a2e;
    --surface-3: #22223a;
    --border: rgba(124, 58, 237, 0.15);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --primary-glow: rgba(124, 58, 237, 0.25);
    --accent: #06b6d4;
    --accent-glow: rgba(6, 182, 212, 0.2);
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #06b6d4;
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-inverse: #0f172a;
    --gradient: linear-gradient(135deg, #7c3aed, #06b6d4);
    --gradient-warm: linear-gradient(135deg, #f59e0b, #ef4444);
    --glass-bg: rgba(18, 18, 26, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --header-h: 56px;
    --sidebar-w: 280px;
    --font: 'Inter',
    -apple-system,
    sans-serif;
    --font-display: 'Outfit',
    sans-serif;
    --transition: 200ms ease;

    /* Highlight Defaults */
    --highlight-color: #7c3aed;
    --highlight-color-rgb: 124,
    58,
    237;
}

[data-theme="light"] {
    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #e2e8f0;
    --border: rgba(124, 58, 237, 0.12);
    --border-subtle: rgba(0, 0, 0, 0.06);
    --text: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.08);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
}

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

html,
body {
    height: 100%;
    height: 100dvh;
    width: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
    line-height: 1.5;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.hidden {
    display: none !important;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.message-highlight {
    padding: 12px;
    border-left: 4px solid var(--highlight-color);
    background: rgba(var(--highlight-color-rgb), 0.1);
    border-radius: 4px;
    margin: 8px 0;
}

img {
    max-width: 100%;
    display: block;
}

/* Glass Effects */
.modal {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

@keyframes modal-pop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-sm {
    max-width: 400px;
}

.modal-lg {
    max-width: 800px;
}

.modal-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
}

.modal-body {
    padding: 20px 24px;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.glass-surface {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--surface-2);
    color: var(--text);
}

.btn-danger {
    background: var(--error);
    color: #fff;
}

.btn-full {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-neon {
    background: linear-gradient(135deg, #7c3aed, #06b6d4);
    color: #fff;
    border: none;
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
    position: relative;
    overflow: hidden;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    height: 48px;
}

.btn-neon::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.btn-neon:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 25px rgba(124, 58, 237, 0.6);
}

.btn-neon:hover::after {
    transform: translateX(100%);
}

/* YouTube Search Panel */
.yt-search-panel {
    top: 60px;
    right: 0;
    width: 320px;
    max-height: 500px;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    z-index: 2100;
    animation: popoverFadeIn 0.2s ease-out;
    overflow: hidden;
}

.yt-results-grid {
    max-height: 380px;
    overflow-y: auto;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.yt-result-item {
    display: flex;
    gap: 10px;
    padding: 8px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    border-bottom: 1px solid var(--border-subtle);
    align-items: center;
    transition: background 0.2s;
}

.yt-result-item:hover {
    background: var(--surface-2);
}

.yt-result-thumb {
    width: 90px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.yt-result-title {
    flex: 1;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* YT Embed in Chat */
.yt-embed {
    margin: 12px 0;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16/9;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-subtle);
}

.yt-embed iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.status-mute {
    margin-left: 5px;
    font-size: 14px;
    position: relative;
    top: 1px;
    color: var(--error);
    filter: drop-shadow(0 0 2px var(--error));
}

.user-item-offline .status-dot {
    opacity: 0.5;
}

.user-item-avatar i {
    font-size: 12px;
    margin-left: 5px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    font-size: 16px;
}

.icon-btn:hover {
    background: var(--surface-2);
    color: var(--text);
}

.icon-btn-sm {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--error);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-report-alert {
    color: var(--error) !important;
    border-color: var(--error) !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    transition: border-color var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-wrapper i {
    color: var(--text-muted);
    font-size: 14px;
    flex-shrink: 0;
}

.input-wrapper input,
.input-wrapper select {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    padding: 10px 0;
    outline: none;
    width: 100%;
}

.input-wrapper input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.input-wrapper select {
    cursor: pointer;
}

.input-wrapper select option {
    background: var(--surface);
    color: var(--text);
}

/* Global modal input styling */
.modal-body input[type="text"],
.modal-body input[type="password"],
.modal-body input[type="number"],
.modal-body input[type="email"],
.modal-body select,
.modal-body textarea {
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    padding: 10px 12px;
    outline: none;
    width: 100%;
    transition: border-color var(--transition);
}

.modal-body input[type="text"]:focus,
.modal-body input[type="password"]:focus,
.modal-body input[type="number"]:focus,
.modal-body input[type="email"]:focus,
.modal-body select:focus,
.modal-body textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.modal-body input::placeholder,
.modal-body textarea::placeholder {
    color: var(--text-muted);
}

/* Modern Input — Premium & Consistent */
.modern-input,
.bio-textarea,
#dm-input {
    width: 100%;
    background: var(--surface-2) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text) !important;
    font-family: var(--font) !important;
    font-size: 14px !important;
    padding: 12px 16px !important;
    outline: none !important;
    transition: all 0.2s !important;
}

.modern-input:focus,
.bio-textarea:focus,
#dm-input:focus {
    border-color: var(--primary) !important;
    background: var(--surface-3) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
    color: var(--text) !important;
}

.modern-input::placeholder {
    color: var(--text-muted);
}

.modern-input {
    width: 100%;
    background: var(--surface-2) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text) !important;
    font-family: var(--font) !important;
    font-size: 14px !important;
    padding: 12px 16px !important;
    outline: none !important;
    transition: all 0.2s !important;
}

.modern-input:focus {
    border-color: var(--primary) !important;
    background: var(--surface-3) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

/* Custom Checkbox Styling — Modern & Premium */
.form-group-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 0;
}

.custom-checkbox {
    position: relative;
    width: 22px;
    height: 22px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lightbox-img-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

#lightbox-img,
#lightbox-video {
    max-width: 95vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    animation: lightbox-zoom 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.message-video {
    position: relative;
    max-width: 250px;
    cursor: pointer;
}

.message-video video {
    width: 100%;
    border-radius: var(--radius-sm);
    display: block;
}

.video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    backdrop-filter: blur(4px);
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-group-checkbox:hover .custom-checkbox {
    border-color: var(--primary);
    background: var(--surface-3);
}

.form-group-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.form-group-checkbox input:checked~.custom-checkbox {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.custom-checkbox::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 12px;
    color: #fff;
    display: none;
}

.form-group-checkbox input:checked~.custom-checkbox::after {
    display: block;
}

/* Voice Message UI — Premium Acrylic */
.voice-msg-player {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface-2);
    padding: 8px 14px;
    border-radius: var(--radius-full);
    margin-top: 8px;
    width: fit-content;
    min-width: 200px;
    max-width: 300px;
    border: 1px solid var(--border-subtle);
    transition: transform 0.2s;
}

.voice-msg-player:hover {
    transform: scale(1.02);
    background: var(--surface-3);
}

.voice-play-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px var(--primary-glow);
    transition: all 0.2s;
}

.voice-play-btn:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.voice-waveform {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.voice-progress {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: var(--primary);
    width: 0%;
    transition: width 0.1s linear;
}

/* Pinned Message Bar — Sticky & Elegant */
.pinned-msg-bar {
    background: var(--surface-2);
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    padding: 10px 20px;
    gap: 16px;
    z-index: 101;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: sticky;
    top: 0;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pinned-msg-icon {
    color: var(--primary);
    font-size: 16px;
    animation: pulse 2s infinite;
}

.pinned-msg-content {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

.unpin-btn {
    font-size: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    background: transparent;
    border: none;
    transition: all 0.2s;
}

.unpin-btn:hover {
    background: var(--surface-3);
    color: var(--error);
    transform: rotate(90deg);
}

.link-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    font-family: var(--font);
    transition: color var(--transition);
}

.link-btn:hover {
    color: var(--primary);
}

.link-btn strong {
    color: var(--primary);
}

/* ============================================
   AUTH SCREEN
   ============================================ */
.auth-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-background {
    position: absolute;
    inset: 0;
    background: var(--bg);
    overflow: hidden;
}

.auth-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    animation: glowFloat 8s ease-in-out infinite;
}

.auth-glow-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
}

.auth-glow-2 {
    width: 350px;
    height: 350px;
    background: var(--accent);
    bottom: -80px;
    right: -80px;
    animation-delay: -3s;
}

.auth-glow-3 {
    width: 250px;
    height: 250px;
    background: #ec4899;
    top: 50%;
    left: 50%;
    animation-delay: -5s;
}

@keyframes glowFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-card {
    padding: 32px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.auth-logo {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 35px;
}

.auth-logo-icon {
    font-size: 48px;
    margin-bottom: 8px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.1)
    }
}

.auth-title {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.auth-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

/* ============================================
   APP LAYOUT
   ============================================ */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
}

.app-header {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border-bottom: 1px solid var(--border-subtle);
    z-index: 100;
    flex-shrink: 0;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

.logo-icon {
    font-size: 20px;
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.current-room-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    background: var(--surface-2);
}

.room-icon {
    font-size: 16px;
}

.room-name {
    font-weight: 600;
    font-size: 14px;
}

.room-users-count {
    font-size: 12px;
    color: var(--text-muted);
}

/* Coins Display */
.coins-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-weight: 800;
    font-size: 13px;
    color: #ffcc00;
    cursor: pointer;
    background: rgba(255, 204, 0, 0.1);
    border: 1px solid rgba(255, 204, 0, 0.3);
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.1);
    transition: all var(--transition);
}

.coins-display:hover {
    background: rgba(255, 204, 0, 0.15);
    transform: translateY(-1px);
}

.coins-display i {
    color: #ffcc00;
    filter: drop-shadow(0 0 5px rgba(255, 204, 0, 0.4));
}

.avatar-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: none;
    padding: 0;
}

.avatar {
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface-3);
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-md {
    width: 48px;
    height: 48px;
}

.avatar-lg {
    width: 72px;
    height: 72px;
}

.avatar-xl {
    width: 96px;
    height: 96px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--surface);
    position: absolute;
    bottom: 0;
    right: 0;
}

.status-online {
    background: var(--success);
}

.status-away {
    background: var(--warning);
}

.status-busy {
    background: var(--error);
}

.status-invisible {
    background: var(--text-muted);
}

.status-offline {
    background: var(--text-muted);
}

.app-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ============================================
   ANNOUNCEMENTS BAR
   ============================================ */
.announcements-bar {
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(245, 158, 11, 0.05);
}

.announcements-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    cursor: pointer;
    transition: background var(--transition);
    font-size: 12px;
}

.announcements-bar-inner:hover {
    background: rgba(245, 158, 11, 0.08);
}

.announcement-latest {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.announcements-content {
    padding: 8px 16px;
    border-top: 1px solid var(--border-subtle);
    max-height: 200px;
    overflow-y: auto;
}

.announcement-item {
    padding: 12px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.2s, border-color 0.2s;
    cursor: pointer;
}

.announcement-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-bottom-color: var(--primary);
}

/* ============================================
   SIDEBARS
   ============================================ */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-subtle);
    overflow: hidden;
    transition: transform 0.3s ease, width 0.3s ease;
}

.sidebar-right {
    border-right: none;
    border-left: 1px solid var(--border-subtle);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.sidebar-header-actions {
    display: flex;
    gap: 4px;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    background: var(--surface);
    padding: 0;
}

.tab-btn {
    flex: 1;
    padding: 10px 8px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

.tab-btn:hover {
    color: var(--text);
}

.tab-content {
    display: none;
}

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

/* Room List */
.room-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.room-item:hover {
    background: var(--surface-2);
}

.room-item.badge {
    position: absolute;
    background: var(--error);
    border: 2px solid var(--bg);
    border-radius: var(--radius-full);
    min-width: 18px;
    padding: 0 4px;
    font-size: 10px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Coin Styling (No Background, Professional Gold) */
.coin-text {
    color: #ffcc00 !important;
    font-weight: 800;
    text-shadow: 0 0 5px rgba(255, 204, 0, 0.2);
    background: transparent !important;
}

.fa-coins,
.fa-gem,
.fa-crown {
    color: #ffcc00 !important;
    background: transparent !important;
}

.user-stats-item,
.coins-display {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 8px !important;
}

/* Mod-Log Card Styling */
.log-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px;
}

.log-card {
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.2s;
}

.log-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.drawing-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px;
    background: var(--surface-2);
    border-radius: 12px;
    margin-bottom: 12px;
}

.drawing-control-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.drawing-control-item label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Custom Sliders */
input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--surface-3);
    border-radius: 10px;
    outline: none;
    margin: 10px 0;
}

input[type="range"]::-moz-range-track {
    width: 100%;
    height: 8px;
    background: var(--surface-3);
    border-radius: 10px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

.log-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 8px;
    margin-bottom: 4px;
}

.log-card-body {
    font-size: 13px;
    line-height: 1.4;
}

.log-card-footer {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

.log-label {
    font-weight: 800;
    text-transform: uppercase;
    font-size: 10px;
    color: var(--primary);
    margin-right: 6px;
}

/* Universal Modal Input Styling */
.modal-body :is(input[type="text"], input[type="number"], input[type="password"], select, textarea) {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color var(--transition);
}

.modal-body :is(input, select, textarea):focus {
    border-color: var(--primary);
    outline: none;
    background: rgba(255, 255, 255, 0.08);
}

/* Mod-Action Modal Fix */
#mod-action-modal .modal {
    max-width: 480px;
    width: 92%;
}

#mod-action-modal .modal-body {
    padding: 32px;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#mod-action-modal .form-row {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
}

/* Profile Edit & Settings Tab Spacing - Removed inner padding, added Margin */
.profile-tab-pane {
    transition: all 0.3s ease;
    padding: 15px !important;
}

#profile-edit-tab,
#profile-settings-tab {
    margin: 0 !important;
    padding: 15px !important;
    max-width: 100%;
    overflow-y: auto;
}

.profile-tab-pane .form-group input,
.profile-tab-pane .form-group textarea,
.profile-tab-pane .form-group select {
    background: var(--surface-2) !important;
    border-color: var(--border-subtle) !important;
    color: var(--text) !important;
    border-radius: 8px !important;
}

@media (max-width: 768px) {

    #profile-edit-tab,
    #profile-settings-tab {
        padding: 15px !important;
    }
}

.settings-section {
    margin-bottom: 32px;
}

.room-item.active {
    background: var(--primary-glow);
    border: 1px solid var(--primary);
}

.room-item-icon {
    font-size: 20px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    overflow: hidden;
}

.room-item.active .room-item-icon {
    background: var(--primary);
}

.room-item-info {
    flex: 1;
    min-width: 0;
}

.room-item-name {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-item-desc {
    font-size: 11px;
    color: var(--text-muted);
    padding-top: 2px;
}

.room-gear-btn {
    opacity: 0;
    transition: opacity var(--transition);
    flex-shrink: 0;
}

.room-item:hover .room-gear-btn {
    opacity: 1;
}



/* User List */
.user-list-divider {
    padding: 12px 16px 4px;
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-avatar-wrapper {
    position: relative;
    flex-shrink: 0;
}

.user-avatar-wrapper .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-wrapper .status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border: 2px solid var(--surface-1);
    border-radius: 50%;
}

.status-online { background-color: #10b981; }
.status-busy { background-color: #ef4444; }
.status-away { background-color: #f59e0b; }
.status-offline { background-color: #6b7280; }

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-name-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-status-text {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Rank Badges Fix */
.role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 16px;
    padding: 0 8px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    border-radius: 20px;
    color: #fff !important;
    line-height: 16px;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    vertical-align: middle;
    gap: 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.3px;
}

.role-badge.role-owner {
    background: linear-gradient(135deg, #7c3aed, #2563eb);
}

.role-badge.role-admin {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.role-badge.role-mod {
    background: linear-gradient(135deg, #10b981, #059669);
}

.role-badge.role-vip {
    background: #d4a017;
}

/* Report Icon Alert */
.report-alert-active {
    color: var(--error) !important;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 0px var(--error));
    }

    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 5px var(--error));
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0px var(--error));
    }
}

/* Highlighted Message (Announcement Style in Chat) */
.message-highlight {
    margin: 16px 20px;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow-sm);
}

.message-highlight-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary);
}

.message-highlight-content {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
}

.badge {
    position: absolute;
    background: var(--error);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: var(--radius-full);
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
    z-index: 5;
}

.badge.hidden {
    display: none;
}

/* ============================================
   CHAT AREA
   ============================================ */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.chat-messages-inner {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 100%;
}

.load-more {
    text-align: center;
    padding: 12px;
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 10px;
    padding: 6px 0;
    animation: msgIn 0.3s ease;
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.message-avatar {
    flex-shrink: 0;
    cursor: pointer;
}

.message-body {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 2px;
}

.message-username {
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: color var(--transition);
}

.message-username:hover {
    color: var(--primary);
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
}

.message-content {
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
    color: var(--text);
}

.message-content img {
    max-width: 320px;
    max-height: 300px;
    border-radius: var(--radius-sm);
    margin-top: 4px;
    cursor: pointer;
}

.message-content a {
    color: var(--accent);
}

.coin-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    color: #f59e0b;
    font-weight: 700;
    font-size: 13px;
}

.coin-display i {
    font-size: 14px;
}

.message-reply {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    margin-bottom: 4px;
    background: var(--surface-2);
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 12px;
    color: var(--text-muted);
}

.message-actions-menu {
    display: none;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.message:hover .message-actions-menu {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Enhanced Discoverability */
.message-actions-trigger {
    opacity: 0.7;
    transition: opacity 0.2s;
}

.message-actions-trigger:hover {
    opacity: 1;
    background: var(--surface-3) !important;
}

.context-menu {
    position: fixed;
    z-index: 5000;
    min-width: 180px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-xl);
    animation: dropIn 0.15s ease;
}

.message-system-slim {
    display: block;
    width: 100%;
    text-align: center;
    margin: 4px 0;
    padding: 4px 10px;
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.8;
    font-family: inherit;
    font-weight: 500;
}

.message-system-slim span {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    padding: 2px 10px;
}

.message-system {
    display: block;
    text-align: center;
    margin: 12px 0;
    padding: 0 20px;
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}

.message-system i {
    margin-right: 4px;
}

.message-file {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    margin-top: 4px;
}

.message-file i {
    color: var(--primary);
}

.message-gif img {
    border-radius: var(--radius-sm);
    max-width: 250px;
}

/* Chat Input */
.chat-input-area {
    border-top: 1px solid var(--border-subtle);
    padding: 10px 16px;
    background: var(--bg);
    z-index: 100;
    flex-shrink: 0;
    width: 100%;
}

@media (max-width: 600px) {
    .chat-input-area {
        padding: 10px;
        padding-bottom: calc(env(safe-area-inset-bottom, 15px) + 8px);
        background: var(--bg);
        border-top: 1px solid var(--border-subtle);
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 500;
        width: 100%;
    }

    .chat-messages {
        margin-bottom: 70px;
    }
}

.chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 4px 8px;
}

.input-grow textarea {
    width: 100%;
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    padding: 12px 4px;
    outline: none;
    resize: none;
    scrollbar-width: none;
}

.input-grow textarea::placeholder {
    font-size: 13px;
    color: var(--text-muted);
    opacity: 0.7;
}

.send-btn {
    color: var(--primary) !important;
}

.send-btn:hover {
    background: var(--primary-glow) !important;
}

.gif-label {
    font-size: 11px;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.reply-preview {
    background: var(--surface-2);
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    position: relative;
    border-radius: 8px 8px 0 0;
    max-height: 36px;
}

.reply-preview-body {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reply-preview-body i {
    color: var(--primary);
    font-size: 9px;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingDot 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {

    0%,
    60%,
    100% {
        transform: translateY(0)
    }

    30% {
        transform: translateY(-6px)
    }
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

.modal {
    width: 100%;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px)
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0)
    }
}

.modal-sm {
    max-width: 300px;
}

.modal-md {
    max-width: 380px;
}

.modal-lg {
    max-width: 500px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

@media (max-width: 480px) {
    .modal {
        max-width: 95vw;
        margin: 0;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

@media (min-width: 768px) {
    .modal-body {
        padding: 32px;
    }
}

.modal-footer {
    padding: 16px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    border-top: 1px solid var(--border-subtle);
    background: var(--surface-2);
}

@media (min-width: 768px) {
    .modal-footer {
        margin: 0;
        border-bottom-left-radius: 24px;
        border-bottom-right-radius: 24px;
    }
}

/* Shop Tabs */
.shop-tabs {
    display: flex;
    gap: 8px;
    padding: 0 0 16px 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 20px;
}

.shop-tab {
    flex: 1;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shop-tab:hover {
    background: var(--surface-3);
    color: var(--text);
}


/* Shop Grid */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 4px;
}

.shop-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    gap: 8px;
    border: 1px solid var(--border-subtle);
    transition: all var(--transition);
}

.shop-item:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
}

.shop-item-icon {
    font-size: 32px;
    margin-bottom: 4px;
}

.shop-item h4 {
    font-size: 15px;
    font-weight: 700;
}

.shop-item p {
    font-size: 11px;
    color: var(--text-muted);
}

.shop-item-price {
    font-weight: 800;
    color: var(--warning);
    margin: 8px 0;
}

.shop-item.locked {
    opacity: 0.6;
    filter: grayscale(1);
    pointer-events: none;
}

/* Bio Editor */
.bio-textarea {
    width: 100%;
    height: 260px;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 12px;
    font-family: var(--font);
    font-size: 14px;
    outline: none;
    resize: none;
    margin-top: 12px;
}

.bio-textarea:focus {
    border-color: var(--primary);
}

/* Profile Grid & Achievements */
.achievement-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.achievement-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    font-size: 18px;
    color: var(--text-muted);
    transition: all 0.2s ease;
    position: relative;
}

.achievement-item.earned {
    color: var(--warning);
    background: var(--primary-glow);
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.achievement-item:hover .achievement-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-5px);
}

.achievement-tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-3);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 10;
    pointer-events: none;
    border: 1px solid var(--border);
}

/* Name Colors / Gradients */
.name-gradient-1 {
    background: linear-gradient(to right, #7c3aed, #06b6d4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.avatar-frame-wrap .status-dot {
    z-index: 999 !important;
    pointer-events: none;
}

/* Premium Frames */
.frame-fire {
    border: 4px solid #ff4500;
    box-shadow: 0 0 15px #ff4500;
    animation: frame-pulse-glow 1.5s infinite alternate;
}

.frame-ice {
    border: 4px solid #00f2fe;
    box-shadow: 0 0 15px #00f2fe;
}

/* frame-matrix removed */
.frame-rainbow {
    border: 4px solid transparent;
    background-image: linear-gradient(var(--surface), var(--surface)), linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
    background-origin: border-box;
    background-clip: content-box, border-box;
    animation: rainbow-border 4s linear infinite;
}

.frame-pulse {
    border: 4px solid var(--primary);
    animation: frame-pulse-glow 2s infinite ease-in-out;
}

@keyframes frame-pulse-glow {
    from {
        box-shadow: 0 0 5px var(--primary);
        transform: scale(1);
    }

    to {
        box-shadow: 0 0 15px var(--primary);
        transform: scale(1.02);
    }
}

@keyframes rainbow-border {
    from {
        background-position: 0% 0%;
    }

    to {
        background-position: 200% 0%;
    }
}

/* Premium Name Colors */
.text-neon {
    color: #00f2fe;
    text-shadow: 0 0 5px #00f2fe, 0 0 10px #00f2fe;
    font-weight: 800;
}

.text-gold {
    background: linear-gradient(45deg, #bf953f, #fcf6ba, #b38728, #fbf5b7, #aa771c);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.text-lava {
    background: linear-gradient(to right, #ff4b2b, #ff416c);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-matrix {
    color: #00ff41;
    text-shadow: 0 0 5px #00ff41;
    font-family: 'Courier New', Courier, monospace;
}

.text-sunset {
    background: linear-gradient(to right, #ff512f, #dd2476);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.name-gradient-2 {
    background: linear-gradient(to right, #f59e0b, #ef4444);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.name-gradient-3 {
    background: linear-gradient(to right, #ec4899, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.name-gradient-4 {
    background: linear-gradient(to right, #10b981, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Message fading */
.message.fading {
    opacity: 0.5;
    transition: opacity 5s linear;
}

.message.expired {
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.5s ease;
}

/* ============================================
   PROFILE MODAL OVERHAUL
   ============================================ */
.profile-header {
    text-align: center;
    padding-bottom: 16px;
    position: relative;
}

.profile-cover {
    height: 100px;
    background: var(--gradient);
    border-radius: var(--radius-sm);
    margin: -20px -20px 0;
    position: relative;
}

.profile-avatar-wrap {
    position: relative;
    width: 80px;
    height: 80px;
    margin: -40px auto 10px;
    z-index: 2;
    display: flex;
    justify-content: center;
}

.profile-avatar-wrap .avatar {
    border: 3px solid var(--surface);
    width: 80px;
    height: 80px;
    background: var(--surface);
}

.profile-avatar-wrap .avatar-frame {
    width: 118% !important;
    height: 118% !important;
}

.profile-name {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 24px;
}

.profile-badges {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.profile-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.profile-info-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    width: 100%;
}

.profile-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.profile-info-item i {
    width: 12px;
    color: var(--primary);
    text-align: center;
}

.admin-section {
    margin-top: 16px;
    padding: 10px;
    background: rgba(239, 68, 68, 0.05);
    border: 1px dashed var(--error);
    border-radius: var(--radius-sm);
    text-align: left;
}

.admin-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--error);
    text-transform: uppercase;
    margin-bottom: 6px;
}

/* Bio Input in Edit Modal */
.bio-textarea-edit {
    width: 100%;
    height: 120px;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 12px;
    font-family: var(--font);
    font-size: 14px;
    outline: none;
    resize: none;
    transition: border-color var(--transition);
}

.bio-textarea-edit:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Profile 3-dot menu */
.profile-menu-dots {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.profile-menu-dots .icon-btn {
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.profile-menu-dots .icon-btn:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.05);
}

.profile-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 180px;
    padding: 6px;
    z-index: 10;
    animation: dropIn 0.15s ease;
    background: var(--surface) !important;
    backdrop-filter: none !important;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow);
}

/* Profile Tabs */
.profile-tab-toggle {
    display: flex;
    gap: 4px;
    justify-content: center;
    background: var(--surface-2);
    border-radius: var(--radius-full);
    padding: 3px;
}

.profile-tab-btn {
    flex: 1;
    padding: 6px 16px;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.profile-tab-btn.active {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.profile-tab-btn:hover:not(.active) {
    color: var(--text);
}

/* Profile likes hover */
.profile-likes-wrap:hover {
    background: var(--surface-3) !important;
    transform: scale(1.05);
}

/* ============================================
   DM LAYOUT (CodyChat Style)
   ============================================ */
.dm-layout {
    display: flex;
    height: 60vh;
    padding: 0 !important;
}

.dm-list {
    width: 240px;
    border-right: 1px solid var(--border-subtle);
    overflow-y: auto;
    flex-shrink: 0;
}

.dm-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dm-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.dm-partner-name {
    font-weight: 700;
}

.dm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dm-input-area {
    padding: 12px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg);
}

.dm-input-area .chat-input-wrapper {
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 4px 12px;
}

.dm-input-area input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text);
    padding: 10px 0;
    outline: none;
    font-size: 14px;
    line-height: 1.4;
    vertical-align: middle;
}

.dm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all var(--transition);
    border-bottom: 1px solid var(--border-subtle);
}

.dm-item:hover {
    background: var(--surface-2);
}

.dm-item.active {
    background: var(--primary-glow);
}

.dm-item-info {
    flex: 1;
    min-width: 0;
}

.dm-item-name {
    font-weight: 600;
    font-size: 13px;
}

.dm-item-preview {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.dm.user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
    border-radius: 12px;
    margin: 2px 8px;
}

.user-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.user-item-name {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-item-rank {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-item-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.dm-item-time {
    font-size: 10px;
    color: var(--text-muted);
}

.dm-item-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* DM Messages (Bubble Style) */
.dm-message {
    display: flex;
    margin-bottom: 4px;
    animation: msgIn 0.2s ease;
}

.dm-message-self {
    justify-content: flex-end;
}

.dm-message-other {
    justify-content: flex-start;
}

.dm-bubble {
    max-width: 75%;
    padding: 8px 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
}

.dm-bubble-other {
    background: var(--surface-2);
    color: var(--text);
    border-radius: 4px 16px 16px 16px;
    border: 1px solid var(--border-subtle);
}

.dm-bubble-self {
    background: var(--primary);
    color: #fff;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Blockquote in Chat */
.message-reply-quote {
    padding: 6px 12px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--primary);
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
}

.message-reply-quote:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* RPS Game Overlay */
.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-card {
    width: 90%;
    max-width: 400px;
    padding: 32px;
    text-align: center;
}

.game-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 24px;
}

.game-opt-btn {
    font-size: 40px;
    background: var(--surface-2);
    border: 2px solid transparent;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.game-opt-btn:hover {
    transform: scale(1.1);
    background: var(--surface-3);
    border-color: var(--primary);
}

.dm-message-footer {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
    margin-top: 2px;
}

.dm-message-time {
    font-size: 10px;
    opacity: 0.6;
}

.dm-receipt {
    font-size: 10px;
    opacity: 0.6;
}

.dm-receipt-read {
    color: #60a5fa !important;
    opacity: 1;
}

.dm-bubble-other .dm-receipt-read {
    color: #3b82f6 !important;
}

/* DM media */
.dm-message-media {
    margin-bottom: 4px;
}

.dm-message-media img {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* ============================================
   REPORT MODAL
   ============================================ */
.report-reasons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}

.report-reason-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 13px;
    border: 1px solid var(--border-subtle);
}

.report-reason-item:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
}

.report-reason-item input[type="radio"] {
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
}

/* Report review items */
.report-item {
    padding: 12px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border: 1px solid var(--border-subtle);
}

.report-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */
.notification-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    cursor: pointer;
}

.notif-item:hover {
    background: var(--surface-2);
}

.notif-item.unread {
    background: var(--primary-glow);
}

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    font-size: 14px;
    flex-shrink: 0;
}

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-text {
    font-size: 13px;
}

.notif-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============================================
   DROPDOWNS & PICKERS
   ============================================ */
.dropdown-menu {
    position: fixed;
    z-index: 600;
    width: 260px;
    padding: 8px;
    animation: dropIn 0.2s ease;
}

@keyframes dropIn {
    from {
        opacity: 0;
        transform: translateY(-4px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

.dropdown-header-info {
    min-width: 0;
}

.dropdown-name {
    font-weight: 700;
    font-size: 14px;
}

.dropdown-level {
    font-size: 11px;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 4px 0;
}

.dropdown-section-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 8px 12px 4px;
    letter-spacing: 0.5px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    width: 100%;
    border: none;
    background: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.dropdown-item:hover {
    background: var(--surface-2);
}

.dropdown-item i {
    width: 16px;
    color: var(--text-muted);
}

.dropdown-item .status-dot {
    position: static;
    border: none;
    width: 8px;
    height: 8px;
}

.dropdown-item-danger {
    color: var(--error);
}

.dropdown-item-danger i {
    color: var(--error);
}

/* Context Menu */
.context-menu {
    position: fixed;
    z-index: 700;
    min-width: 180px;
    padding: 6px;
    animation: dropIn 0.15s ease;
}

/* Picker */
.picker-panel {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 360px;
    max-height: 380px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.2s ease;
}

.picker-header {
    padding: 10px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.picker-search {
    width: 100%;
    padding: 8px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    outline: none;
}

.picker-search:focus {
    border-color: var(--primary);
}

.picker-grid {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
}

.emoji-item {
    font-size: 22px;
    padding: 4px;
    text-align: center;
    cursor: pointer;
    border-radius: 6px;
    transition: background var(--transition);
    border: none;
    background: none;
}

.emoji-item:hover {
    background: var(--surface-2);
    transform: scale(1.2);
}

.gif-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.gif-item {
    cursor: pointer;
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: transform var(--transition);
}

.gif-item:hover {
    transform: scale(1.03);
}

.gif-item img {
    width: 100%;
    height: auto;
    display: block;
}

.picker-footer {
    padding: 6px 10px;
    text-align: right;
    border-top: 1px solid var(--border-subtle);
}

.picker-credit {
    font-size: 10px;
    color: var(--text-muted);
}

/* ============================================
   TOASTS
   ============================================ */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 22px;
    background: var(--surface-3);
    /* Solid background */
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    min-width: 280px;
    max-width: 400px;
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: toastIn 0.3s ease-out;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Settings Tab Content */
.settings-tab-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.settings-section {
    padding: 15px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
}

/* Muted Input Overlay */
.muted-input-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--error);
    font-weight: 700;
    font-size: 14px;
    z-index: 10;
    border-radius: var(--radius);
}

/* Premium Solid Colors */
.toast-success {
    background: #065f46;
    border: 1px solid #10b981;
}

.toast-error {
    background: #991b1b;
    border: 1px solid #ef4444;
}

.toast-warning {
    background: #92400e;
    border: 1px solid #f59e0b;
}

.toast-info {
    background: #3730a3;
    border: 1px solid #6366f1;
}

.toast-purple {
    background: #5b21b6;
    border: 1px solid #8b5cf6;
}

.toast i {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-success i {
    color: #34d399;
}

.toast-error i {
    color: #f87171;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
}

.toast-warning i {
    color: #fbbf24;
}

.toast-info i {
    color: #818cf8;
}

.toast-purple i {
    color: #a78bfa;
}

/* Upload Progress */
.upload-progress {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    min-width: 240px;
}

.upload-progress-bar {
    height: 4px;
    background: var(--surface-3);
    border-radius: 2px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.upload-progress-text {
    display: block;
    text-align: center;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

input,
textarea {
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 10px 14px;
    outline: none;
    transition: all var(--transition);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.4;
    vertical-align: middle;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

input:focus,
textarea:focus {
    border-color: var(--primary);
    background: var(--surface-3) !important;
    color: var(--text) !important;
    outline: none;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text) !important;
    -webkit-box-shadow: 0 0 0px 1000px var(--surface-2) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.shop-tab.active {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .sidebar-right {
        position: fixed;
        top: var(--header-h);
        right: 0;
        bottom: 0;
        z-index: 200;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .sidebar-right.open {
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .sidebar-left {
        position: fixed;
        top: var(--header-h);
        left: 0;
        bottom: 0;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar-left.open {
        transform: translateX(0);
    }

    .header-center {
        display: none;
    }

    .header-logo .logo-text {
        display: none;
    }

    .picker-panel {
        width: calc(100vw - 24px);
        bottom: 60px;
    }

    .dm-layout {
        flex-direction: column;
    }

    .dm-list {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        max-height: 200px;
    }

    .modal {
        margin: 0 12px;
    }

    /* Mobile chat fix: proper flex layout instead of position:fixed */
    .app-body {
        height: calc(100% - var(--header-h));
    }

    .chat-area {
        height: 100%;
        display: flex;
        flex-direction: column;
        position: relative;
        overflow: hidden;
    }

    .chat-messages {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .chat-input-area {
        flex-shrink: 0;
        padding: 10px 12px env(safe-area-inset-bottom, 10px);
        background: var(--surface);
        border-top: 1px solid var(--border-subtle);
        position: relative;
        z-index: 50;
    }

    /* Ensure input is visible when keyboard is up */
    .chat-input-wrapper {
        padding: 4px 8px;
    }

    .dm-layout {
        height: 80vh;
    }
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    :root {
        --sidebar-w: 100vw;
    }

    /* Media queries and other styles */
    .settings-section {
        padding: 15px;
    }

    .profile-edit-wrapper,
    .profile-settings-wrapper {
        padding: 15px;
    }

    .header-logo .logo-icon {
        font-size: 18px;
    }

    /* Better spacing for sections in modals */
    .admin-section {
        padding: 12px;
        margin: 10px 0;
    }

    .settings-section {
        padding: 15px;
    }

    /* Standardized to 15px */
    .message-content img {
        max-width: 100%;
        height: auto;
    }

    .profile-info-grid {
        font-size: 11px;
    }
}

/* Muted UI Overlay */
.muted-input-overlay {
    position: absolute;
    inset: 0;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    z-index: 10;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    gap: 8px;
    border: 1px solid var(--border-subtle);
}

/* Blocked / Kicked Screen CSS */
.blocked-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.5s ease;
    background-image: radial-gradient(circle at 20% 30%, rgba(124, 58, 237, 0.08) 0%, transparent 50%), radial-gradient(circle at 80% 70%, rgba(239, 68, 68, 0.06) 0%, transparent 50%);
}

.blocked-card {
    max-width: 440px;
    width: 100%;
    padding: 40px 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.blocked-icon {
    font-size: 56px;
    filter: drop-shadow(0 0 20px rgba(239, 68, 68, 0.3));
}

.blocked-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    color: var(--error);
    letter-spacing: -0.5px;
}

.blocked-reason {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 14px;
    background: var(--surface-2);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--error);
    width: 100%;
    text-align: left;
}

.blocked-timer {
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--surface-2);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    width: 100%;
    border: 1px solid var(--border-subtle);
}

.timer-countdown {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    display: block;
    margin-top: 4px;
}

.blocked-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 8px;
}

.blocked-actions .btn {
    flex: 1;
}

.blocked-appeal-section {
    width: 100%;
    margin-top: 8px;
    border-top: 1px solid var(--border-subtle);
    padding-top: 16px;
}

.blocked-appeal-section h4 {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 700;
}

.blocked-appeal-response {
    background: var(--surface-2);
    border-left: 3px solid var(--primary);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text);
    margin-bottom: 12px;
    text-align: left;
}

.blocked-appeal-response .response-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 4px;
    display: block;
}

.kick-timer {
    font-size: 14px;
    font-weight: 600;
    color: var(--warning);
}

#kick-countdown {
    font-size: 20px;
    font-weight: 800;
}

/* Notification close fix */
#notif-modal .modal-header-actions {
    margin-right: -8px;
}

/* DM CodyChat Style Overhaul */
.dm-popover {
    position: absolute;
    top: 70px;
    right: 20px;
    width: 340px;
    max-height: 500px;
    background: var(--surface) !important;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    z-index: 2000;
    animation: popoverFadeIn 0.2s ease-out;
    overflow: hidden;
    backdrop-filter: none !important;
}

.dm-popover-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-2);
    font-weight: 700;
}

.dm-popover-list {
    overflow-y: auto;
    flex: 1;
    max-height: 400px;
}

.dm-sidepanel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    height: 100dvh;
    background: var(--surface);
    border-left: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 2100;
    box-shadow: -15px 0 45px rgba(0, 0, 0, 0.6);
    transition: right 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.dm-sidepanel.open {
    right: 0;
}

@media (max-width: 600px) {
    .dm-sidepanel {
        width: 100%;
        right: -100%;
    }

    .dm-sidepanel.open {
        right: 0;
    }
}

.dm-sidepanel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface-2);
}

.dm-sidepanel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--bg);
}

.dm-sidepanel-input {
    padding: 20px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg);
}

@keyframes modal-pop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-actions,
.modal-footer {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 16px 24px !important;
    background: rgba(0, 0, 0, 0.03);
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.modal-body {
    max-height: 75vh;
    overflow-y: auto;
    padding: 15px;
    flex: 1;
    min-width: 0;
}

.profile-save-btn {
    padding: 8px 20px !important;
    min-width: 120px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#drawing-modal .modal-body {
    background: #1a1a1a !important;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#drawing-canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

@keyframes popoverFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.dm-preview-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border-subtle);
}

.dm-preview-item:hover {
    background: var(--surface-3);
}

.dm-preview-item:last-child {
    border-bottom: none;
}

.dm-preview-info {
    flex: 1;
    min-width: 0;
}

.dm-preview-name {
    font-weight: 600;
    font-size: 13px;
}

.dm-preview-text {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-preview-badge {
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
}

/* Sidebar Tabs */
.sidebar-tabs {
    display: flex;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.sidebar-tabs .tab-btn {
    flex: 1;
    padding: 12px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: all 0.2s;
    border: none;
    background: transparent !important;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all;
    overflow-wrap: anywhere;
}

.sidebar-tabs .tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.sidebar-tabs .tab-btn:hover:not(.active) {
    color: var(--text);
}

.sidebar-tab-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.sidebar-tab-content.hidden {
    display: none;
}

/* Utility Dropdown */
.utility-dropdown {
    position: absolute;
    bottom: 80px;
    left: 20px;
    width: 240px;
    background: var(--surface) !important;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    padding: 8px;
    animation: popoverFadeIn 0.2s ease-out;
}

.utility-dropdown .dropdown-header-sm {
    padding: 8px 12px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.utility-dropdown .dropdown-item {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.utility-dropdown .dropdown-item:hover {
    background: var(--surface-3);
    color: var(--primary);
    transform: translateX(4px);
}

.utility-dropdown .dropdown-item i {
    width: 16px;
    text-align: center;
}

.announcement-item {
    border: 1px solid var(--border-subtle);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.announcement-item:hover {
    transform: translateY(-2px);
    outline: 2px solid var(--primary);
    box-shadow: 0 5px 20px rgba(124, 58, 237, 0.25);
}

/* ============================================
   IMAGE LIGHTBOX
   ============================================ */
#lightbox-modal {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000005;
    transition: opacity 0.3s ease;
}

#lightbox-modal.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

#lightbox-modal .modal {
    max-width: 95vw;
    max-height: 90vh;
    background: transparent;
    border: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 12px;
    overflow: visible;
    padding: 0;
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox-img-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

#lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    cursor: zoom-out;
}

.lightbox-controls {
    position: absolute;
    top: -48px;
    right: 0;
    display: flex;
    gap: 12px;
    z-index: 10;
}

.lightbox-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   AVATAR FRAMES
   ============================================ */
.avatar-frame-wrap {
    position: relative;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    border-radius: 50% !important;
    /* Ensure the container is round too */
}

.avatar-frame {
    position: absolute;
    top: 50% !important;
    left: 50% !important;
    width: 115% !important;
    height: 115% !important;
    transform: translate(-50%, -50%) !important;
    border-radius: 50% !important;
    /* FORCE ALL TO BE ROUND */
    user-select: none;
    pointer-events: none;
    z-index: 10;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    box-sizing: border-box;
}

.avatar-frame-wrap img.avatar {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    /* Keep it round! */
    object-fit: cover;
    z-index: 5;
    box-shadow: 0 0 0 2px var(--surface-3);
    /* Slight border for separation */
}

/* Neon Frame (Electric Blue) */
.frame-neon {
    border: 5px solid #00f2ff;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.6);
    background: transparent !important;
}

/* Neon Frame Alt (Cyber Cyan) */
.frame-neon-alt {
    border: 5px solid #00ffcc;
    box-shadow: 0 0 15px rgba(0, 255, 204, 0.6);
    background: transparent !important;
    filter: hue-rotate(45deg);
}

/* Gold Frame - Classy Glow */
.frame-gold {
    border: 5px solid #ffd700;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
    background: transparent !important;
}

/* Gold Frame - Fixed Sizing and Visibility - No Inset Glow */
.frame-gold {
    border: 5px solid #ffd700;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
    background: transparent !important;
}

/* Sparkle Frame - No Inset Glow - Transparent Center */
.frame-sparkle {
    border: 5px solid #ff00ff;
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.7);
    background: transparent !important;
}


/* Profile Gradient Names (Standard) */
.text-neon {
    background: linear-gradient(45deg, #00f2ff, #00d2ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gold {
    background: linear-gradient(45deg, #ffd700, #ffec8b, #ffd700);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-sparkle {
    background: linear-gradient(45deg, #ff00ff, #8b5cf6, #ff00ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Status Dot Fix (Prevent Frame Overlap tinting) */
.status-dot {
    z-index: 20 !important;
}

/* Additional Cosmos Categories */
.frame-fire-alt {
    border: 5px solid #ff4500;
    box-shadow: 0 0 20px rgba(255, 69, 0, 0.6);
}

.text-sunset {
    background: linear-gradient(90deg, #ff4e50 0%, #f9d423 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-matrix {
    background: linear-gradient(90deg, #0f9b0f 0%, #00ff00 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}


.lightbox-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* ============================================
   STAFF REPORTS GRID
   ============================================ */
.report-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
    margin-top: 10px;
}

.report-actions-grid .btn {
    height: 34px;
    font-size: 11px;
    padding: 0 4px;
    background: var(--surface-3);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s;
}

.report-actions-grid .btn:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
}

.report-actions-grid .btn-primary {
    background: var(--primary);
    border: none;
}

.report-actions-grid .btn-primary:hover {
    filter: brightness(1.1);
}

/* ============================================
   CMD INFO CARDS — Premium Grid
   ============================================ */
.cmd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    padding: 4px;
    max-height: 60vh;
    overflow-y: auto;
}

.cmd-card {
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.cmd-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.15);
}

.cmd-card.locked {
    opacity: 0.55;
    pointer-events: none;
    user-select: none;
}

.cmd-card.locked::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(135deg,
            transparent,
            transparent 8px,
            rgba(255, 255, 255, 0.02) 8px,
            rgba(255, 255, 255, 0.02) 16px);
    pointer-events: none;
}

.cmd-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cmd-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.cmd-icon.cmd-user {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.cmd-icon.cmd-mod {
    background: rgba(37, 99, 235, 0.15);
    color: #2563eb;
}

.cmd-icon.cmd-admin {
    background: rgba(124, 58, 237, 0.15);
    color: var(--primary);
}

.cmd-name {
    font-weight: 800;
    font-size: 15px;
    font-family: var(--font);
    color: var(--text);
    letter-spacing: -0.3px;
}

.cmd-role-badge {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    color: #fff;
}

.cmd-role-badge.badge-user {
    background: var(--success);
}

.cmd-role-badge.badge-mod {
    background: #2563eb;
}

.cmd-role-badge.badge-admin {
    background: var(--primary);
}

.cmd-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.cmd-syntax {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--surface-3);
    padding: 6px 10px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace, var(--font);
}

.cmd-syntax code {
    color: var(--accent);
    font-weight: 600;
}

.cmd-access-denied {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--error);
    margin-top: 2px;
}

/* ============================================
   EMOJI PICKER — Premium Styling
   ============================================ */
.picker-panel {
    position: absolute;
    bottom: 56px;
    right: 60px;
    width: 320px;
    max-height: 360px;
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 2000;
    animation: popoverFadeIn 0.2s ease-out;
    overflow: hidden;
}

.picker-header {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--surface-2);
}

.picker-search {
    width: 100%;
    background: var(--surface-3) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text) !important;
    font-family: var(--font) !important;
    font-size: 13px !important;
    padding: 8px 12px !important;
    outline: none;
}

.picker-search:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

.picker-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 10px;
    overflow-y: auto;
    flex: 1;
}

.emoji-btn {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

.emoji-btn:hover {
    background: var(--surface-3);
    transform: scale(1.2);
}

@media (max-width: 600px) {
    .picker-panel {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 50px;
    }

    .picker-grid {
        grid-template-columns: repeat(7, 1fr);
    }
}

/* ============================================
   ROYAL FRAME — VIP Exclusive (Correction)
   ============================================ */
/* Royal Frame - VIP Exclusive (Animated Gold Thicker) */
/* Nebula Frame - Cosmic Dark Purple (Animated) */
.frame-nebula {
    background: none !important;
    border: none !important;
}

.frame-nebula::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    padding: 5px;
    background: linear-gradient(135deg, #2d004d, #4b0082, #8a2be2, #4b0082, #2d004d) border-box;
    background-size: 250% 250%;
    animation: nebula-flow 5s ease infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.4);
}

@keyframes nebula-flow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Royal Frame - VIP Exclusive (Animated Pure Gold) */
.frame-royal {
    background: none !important;
    border: none !important;
}

.frame-royal::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    padding: 5px;
    background: linear-gradient(45deg, #ffd700, #ffec8b, #ffe14d, #ffec8b, #ffd700) border-box;
    background-size: 200% auto;
    animation: legendary-shine 3s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}




/* ============================================
   DM BUBBLE ACTIONS — Repositioned
   ============================================ */
.dm-bubble {
    position: relative;
}

.dm-bubble-actions {
    position: absolute;
    top: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 5;
}

.dm-bubble-self .dm-bubble-actions {
    left: -30px;
}

.dm-bubble-other .dm-bubble-actions {
    right: -30px;
}

.dm-bubble:hover .dm-bubble-actions {
    opacity: 1;
}

.dm-action-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.dm-action-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ============================================
   PREMIUM COSMETICS & COLORS
   ============================================ */

/* Name Colors */
.text-phantom {
    color: #a1a1aa;
    text-shadow: 0 0 8px rgba(161, 161, 170, 0.4);
}

.text-ocean {
    color: #0ea5e9;
    text-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
}

.text-lava {
    background: linear-gradient(to right, #f97316, #ef4444);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.text-galaxy {
    background: linear-gradient(to right, #8b5cf6, #ec4899, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    background-size: 200% auto;
    animation: textShimmer 3s linear infinite;
}

.text-sunset {
    background: linear-gradient(to right, #f59e0b, #f97316);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.text-toxic {
    color: #22c55e;
    text-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
    font-weight: 800;
}

.text-emerald {
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

@keyframes textShimmer {
    to {
        background-position: 200% center;
    }
}

/* Avatar Frames */
.frame-phantom {
    border: 5px solid #a1a1aa;
    box-shadow: 0 0 20px rgba(161, 161, 170, 0.5);
}

.frame-ocean {
    border: 5px solid #0ea5e9;
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.5);
}

.frame-inferno {
    border: 5px solid #ef4444;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.6);
    animation: pulse-frame 2s infinite;
}

/* frame-stardust removed */
.frame-emerald {
    border: 5px solid #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

/* Ghostly Frame - visible ghostly glow fix - No Inset Glow */
.frame-ghostly {
    border: 5px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.4);
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
}

@keyframes pulse-frame {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

@keyframes rotate-frame {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* VIP Badge & Cmds */
.badge-vip {
    background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.cmd-vip {
    background: rgba(245, 158, 11, 0.15) !important;
    color: #f59e0b !important;
}

/* Rules Container */
.rules-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
    padding: 10px 0;
}

.rule-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.rule-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 4px 10px var(--primary-glow);
}

.rule-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 2px;
}

.rule-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Command List Card Polish */
.cmd-card.locked {
    opacity: 0.7;
    filter: grayscale(0.5);
}

.cmd-access-denied {
    margin-top: 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--error);
    display: flex;
    align-items: center;
    gap: 4px;
}

.cmd-card.locked .cmd-name {
    color: var(--text-muted);
}

/* Poll Styling */
.message-poll-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin: 12px 0;
    max-width: 400px;
    box-shadow: var(--shadow-sm);
}

.poll-question {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.poll-question i {
    color: var(--primary);
}

.poll-options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.poll-option-btn {
    position: relative;
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    overflow: hidden;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}

.poll-option-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--primary);
}

.poll-option-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: var(--primary-glow);
    width: 0%;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: -1;
}

.poll-option-text {
    font-weight: 600;
}

.poll-option-count {
    font-size: 11px;
    font-weight: 800;
    color: var(--primary);
}

.poll-footer {
    margin-top: 14px;
    font-size: 10px;
    color: var(--text-muted);
    text-align: right;
    font-style: italic;
}

/* DM Reply & Highlighting */
.dm-reply-context {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 10px;
    border-left: 3px solid var(--primary);
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-reply-context:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
}

.message-highlight-flash {
    animation: flash-highlight 2s ease-out;
}

@keyframes flash-highlight {
    0% {
        background: rgba(124, 58, 237, 0.4);
    }

    100% {
        background: transparent;
    }
}

.dm-message-media img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-bottom: 4px;
}

/* ============================================
   Poll Visuals (v24)
   ============================================ */
.message-poll {
    margin: 10px auto 45px auto !important;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    padding: 16px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    position: relative;
}

.poll-header {
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    margin-bottom: 15px;
    color: var(--primary);
}

.poll-option-row {
    margin-bottom: 20px;
}

/* Shop Sub Tabs */
.shop-sub-tabs {
    display: flex;
    gap: 8px;
    padding: 10px 0;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 15px;
}

.shop-sub-tab {
    padding: 6px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    color: var(--text-muted);
}

.shop-sub-tab:hover {
    background: var(--surface-3);
    color: var(--text);
}

.shop-sub-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Legendary Name Animation */
@keyframes legendary-shine {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.name-legendary {
    background: linear-gradient(90deg, #ff00ea, #00d2ff, #ffec00, #ff00ea) !important;
    background-size: 300% auto !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    animation: legendary-shine 4s linear infinite !important;
    font-weight: 900 !important;
    text-shadow: 0 0 10px rgba(255, 0, 234, 0.3);
}

.poll-option-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 6px;
    color: var(--text);
    font-family: var(--font);
}

.poll-option-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.poll-bar-container {
    height: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.poll-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.poll-bar-percent {
    position: absolute;
    right: 0;
    font-size: 9px;
    color: var(--text-muted);
    padding-right: 4px;
    pointer-events: none;
}

.poll-footer {
    margin-top: 12px;
    font-size: 10px;
    color: var(--text-muted);
    text-align: right;
}

/* ============================================
   Mention System (v24)
   ============================================ */
.chat-mention {
    background: rgba(124, 58, 237, 0.2);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    border: 1px solid rgba(124, 58, 237, 0.3);
    cursor: pointer;
}

/* Custom Fonts removed from Echtz */

/* ============================================
   Gifting UI (v24)
   ============================================ */
.profile-gifting-section {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    border: 1px dashed var(--border-subtle);
}


/* ============================================
   v32.0 Style-Studio & Rarity Updates
   ============================================ */

/* Rarity Colors */
:root {
    --rarity-basic: #94a3b8;
    --rarity-rare: #3b82f6;
    --rarity-epic: #a855f7;
    --rarity-legendary: #fbbf24;
}

.rarity-basic {
    border-color: var(--rarity-basic) !important;
}

.rarity-rare {
    border-color: var(--rarity-rare) !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.rarity-epic {
    border-color: var(--rarity-epic) !important;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

.rarity-legendary {
    border-color: var(--rarity-legendary) !important;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), transparent) !important;
}

.rarity-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 8px;
    text-transform: uppercase;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    color: #fff;
    letter-spacing: 0.5px;
}

.rarity-legendary .rarity-badge {
    background: var(--rarity-legendary);
    color: #000;
}

/* Style Studio Items */
.style-item {
    position: relative;
    border-radius: 12px;
    background: var(--surface-2);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.style-item:hover {
    transform: translateY(-2px);
    background: var(--surface-3);
}

.style-item.active {
    border-color: var(--primary) !important;
    background: rgba(124, 58, 237, 0.1);
}

/* Mystery Box */
@keyframes bounce {

    0%,
    100% {
        transform: translateY(0) rotate(0);
    }

    50% {
        transform: translateY(-10px) rotate(5deg);
    }
}

.mystery-box-anim {
    display: inline-block;
    filter: drop-shadow(0 0 15px var(--rarity-legendary));
}

/* Chat Bubbles */
.message-body {
    position: relative;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--surface-2);
}

/* Custom Bubble: Rainbow */
.bubble-rainbow {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(168, 85, 247, 0.1), rgba(59, 130, 246, 0.1)) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Custom Bubble: Dark Void */
.bubble-void {
    background: #050505 !important;
    border: 1px solid #333;
    box-shadow: inset 0 0 10px rgba(124, 58, 237, 0.2);
}

/* Custom Bubble: Gold */
.bubble-gold {
    background: linear-gradient(135deg, #2a2210, #1a1508) !important;
    border: 1px solid var(--rarity-legendary);
    color: #fff !important;
}

/* Custom Bubble: Blue */
.bubble-blue {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(29, 78, 216, 0.05)) !important;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

/* Custom Bubble: Pink */
.bubble-pink {
    background: linear-gradient(135deg, rgba(219, 39, 119, 0.15), rgba(190, 24, 93, 0.05)) !important;
    border: 1px solid rgba(236, 72, 153, 0.4);
}

/* Custom Bubble: Neon Night */
.bubble-neon {
    background: linear-gradient(135deg, #09090b, #18181b) !important;
    border: 1px solid #06b6d4;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.5), inset 0 0 8px rgba(6, 182, 212, 0.2);
    color: #cffafe !important;
}

/* Rainbow Frame - Fixed Visibility */
.frame-rainbow {
    background: none !important;
    border: none !important;
}

.frame-rainbow::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 5px;
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8f00ff) border-box;
    animation: rotate-gradient 3s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}


@keyframes rotate-gradient {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(360deg);
    }
}

.frame-fire {
    border: 5px solid #ff4500;
    box-shadow: 0 0 15px #ff4500;
    background: transparent !important;
}

/* frame-void - Fixed visibility inside & No Inset Glow & Fixed Size */
.frame-void {
    border: 5px solid #000 !important;
    box-shadow: 0 0 15px #7c3aed !important;
    width: 115% !important;
    height: 115% !important;
    background: transparent !important;
    outline: 1px solid rgba(124, 58, 237, 0.3);
}

/* frame-rainbow-glow - Fixed Visibility & Sizing */
.frame-rainbow-glow {
    background: none !important;
    border: none !important;
}

.frame-rainbow-glow::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 5px;
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8f00ff) border-box;
    animation: rotate-gradient 2s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}


/* frame-ghostly - Improved Visibility */
.frame-ghostly {
    border: 4px solid rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.6) !important;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5)) !important;
    background: transparent !important;
}

/* New: frame-nebula (Legendary Gradient Animation) */
/* frame-nebula (Legendary Gradient Animation) */
/* frame-nebula (Legendary White Iridescent Shimmer) */
.frame-nebula {
    background: none !important;
    border: none !important;
}

.frame-nebula::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    padding: 5px;
    background: linear-gradient(135deg,
            #ffffff,
            #f8fafc,
            #ffffff,
            #e0f2fe,
            #ffffff,
            #faf5ff,
            #ffffff,
            #f1f5f9) border-box;
    background-size: 400% auto;
    animation: nebula-shimmer 2.5s ease-in-out infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.9),
        0 0 15px rgba(255, 255, 255, 1),
        inset 0 0 10px rgba(255, 255, 255, 0.5);
    filter: brightness(1.5) drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

@keyframes nebula-shimmer {
    0% {
        background-position: 0% 50%;
        opacity: 0.9;
    }

    50% {
        background-position: 100% 50%;
        opacity: 1;
        transform: scale(1.03);
    }

    100% {
        background-position: 0% 50%;
        opacity: 0.9;
    }
}



@keyframes nebula-move {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* PWA Optimizations */
@media (display-mode: standalone) {
    .app-header {
        padding-top: env(safe-area-inset-top);
        height: calc(var(--header-h) + env(safe-area-inset-top));
    }

    .chat-input-area {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Pending Friend Request Styling */
.pending-request-item {
    background: rgba(245, 158, 11, 0.05);
    border: 1px dashed var(--warning);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    padding: 8px;
    border-left: 3px solid var(--warning);
}

.pending-request-item .user-item-name {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 4px;
}

.pending-request-item .btn-xs {
    padding: 2px 8px;
    font-size: 10px;
}