/* ══ PASSWORD INPUT WRAPPER ══ */
.password-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(9, 9, 15, 0.7);
    border-radius: var(--r-md);
    border: 1px solid var(--border-subtle);
    padding: 0 0.5em;
    position: relative;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.password-input-wrapper:focus-within {
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}
.password-input-wrapper input[type="password"],
.password-input-wrapper input[type="text"] {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-200);
    font-size: 1rem;
    padding: 10px 0;
}
.password-input-wrapper .password-toggle {
    background: none;
    border: none;
    color: var(--text-500);
    font-size: 1rem;
    cursor: pointer;
    margin-left: 0.5em;
    outline: none;
    display: flex;
    align-items: center;
    transition: color var(--t-fast);
}
.password-input-wrapper .password-toggle:focus,
.password-input-wrapper .password-toggle:hover {
    color: var(--brand);
}
/* ══ CUSTOM BACKGROUND CHANGER ══ */
.custom-bg-enabled {
    transition: background 0.5s cubic-bezier(.4,0,.2,1);
}
.bg-thumb {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 40px;
}
.bg-thumb.active {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px var(--brand-light);
}

/* ══ CREATE/JOIN TABS ══ */

.create-join-tabs {
    display: flex;
    gap: 4px;
    padding: var(--s-3) var(--s-6) 0;
}

.create-join-tab {
    flex: 1;
    padding: 10px var(--s-4);
    border-radius: var(--r-md);
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-500);
    background: var(--bg-deep);
    border: 1px solid var(--border-faint);
    cursor: pointer;
    transition: all var(--t-normal);
    text-align: center;
}

.create-join-tab:hover {
    color: var(--text-200);
    background: var(--bg-overlay);
}

.create-join-tab.active {
    color: white;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* 
   HIGEXT NEXA — Components v5.0 "Aurora"
   Reusable component styles — All class names preserved for JS compatibility
*/

/* ══ TOAST NOTIFICATIONS ══ */

.toast-container {
    position: fixed;
    bottom: var(--s-5);
    right: var(--s-5);
    display: flex;
    flex-direction: column-reverse;
    gap: var(--s-2);
    z-index: var(--z-toast);
    pointer-events: none;
    max-width: 380px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    background: rgba(20, 20, 32, 0.9);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s var(--ease-spring);
    pointer-events: auto;
    min-width: 280px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Left accent bar */
.toast::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--brand);
}
.toast-success::before { background: var(--success); }
.toast-error::before { background: var(--danger); }
.toast-warning::before { background: var(--warning); }
.toast-info::before { background: var(--info); }

.toast-exit {
    animation: slideOutRight 0.25s var(--ease-out) forwards;
}

@keyframes slideOutRight {
    to { transform: translateX(120%); opacity: 0; }
}

.toast-icon {
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--r-md);
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: 2px;
}
.toast-success .toast-icon { background: var(--success-bg); color: var(--success); }
.toast-error .toast-icon { background: var(--danger-bg); color: var(--danger); }
.toast-warning .toast-icon { background: var(--warning-bg); color: var(--warning); }
.toast-info .toast-icon { background: var(--info-bg); color: var(--info); }

.toast-body { flex: 1; min-width: 0; }
.toast-title {
    font-size: 0.8125rem; font-weight: 600;
    color: var(--text-100);
    margin-bottom: 2px;
}
.toast-message {
    font-size: 0.75rem;
    color: var(--text-400);
    line-height: 1.4;
}
.toast-close {
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--r-sm);
    color: var(--text-600);
    font-size: 0.65rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--t-fast);
}
.toast-close:hover { background: var(--bg-hover); color: var(--text-300); }

/* ══ PROFILE CARD ══ */

.profile-card {
    width: 340px;
    background: rgba(20, 20, 32, 0.92);
    border-radius: var(--r-xl);
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.08);
}

.profile-banner {
    height: 90px;
    background: linear-gradient(135deg, var(--brand-dark), var(--accent-sky), var(--brand));
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    position: relative;
}

.profile-avatar-section {
    position: relative;
    margin-top: -36px;
    padding: 0 var(--s-4);
}
.profile-avatar-section .avatar {
    width: 72px; height: 72px;
    font-size: 1.5rem;
    border: 4px solid var(--bg-raised);
}

.profile-info { padding: var(--s-2) var(--s-4); }
.profile-name { font-size: 1.125rem; font-weight: 800; color: var(--text-100); letter-spacing: -0.01em; }
.profile-username { font-size: 0.8125rem; color: var(--text-500); }
.profile-bio { padding: 0 var(--s-4); font-size: 0.8125rem; color: var(--text-400); line-height: 1.5; margin-top: var(--s-2); }
.profile-divider { height: 1px; background: var(--border-faint); margin: var(--s-3) var(--s-4); }

.profile-section { padding: 0 var(--s-4) var(--s-4); }
.profile-section-title {
    font-size: 0.6875rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-100); margin-bottom: var(--s-2);
}

.profile-roles { display: flex; flex-wrap: wrap; gap: 4px; }
.profile-role {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 10px; background: var(--bg-overlay);
    border-radius: var(--r-full); font-size: 0.75rem; color: var(--text-400);
}
.profile-role-dot { width: 8px; height: 8px; border-radius: var(--r-full); }

.profile-actions { padding: 0 var(--s-4) var(--s-4); display: flex; gap: 8px; }
.profile-actions .btn { flex: 1; height: 36px; font-size: 0.8125rem; }

/* ══ CONTEXT MENU ══ */

.context-menu {
    position: fixed;
    background: rgba(20, 20, 32, 0.92);
    border: 1px solid rgba(139, 92, 246, 0.08);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-xl), 0 0 20px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    padding: 4px;
    z-index: var(--z-modal);
    animation: slideInUp 0.1s var(--ease-out);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.context-menu-item {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 12px; font-size: 0.8125rem; color: var(--text-400);
    border-radius: var(--r-sm); cursor: pointer; transition: all 0.1s ease;
}
.context-menu-item:hover { background: var(--brand); color: white; }
.context-menu-item.danger:hover { background: var(--danger); }
.context-menu-item i { width: 18px; text-align: center; font-size: 0.75rem; }

.context-menu-separator { height: 1px; background: var(--border-faint); margin: 3px 8px; }
.context-menu-label { padding: 6px 12px; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-600); }

/* ══ EMOJI PICKER ══ */

.emoji-picker {
    position: absolute;
    bottom: 100%; right: 0;
    margin-bottom: 8px;
    width: 360px;
    background: var(--bg-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: slideInUp 0.2s var(--ease-spring);
    z-index: var(--z-dropdown);
}

.emoji-picker-header { padding: var(--s-3); border-bottom: 1px solid var(--border-faint); }
.emoji-picker-search {
    width: 100%; height: 34px;
    padding: 0 var(--s-3); font-size: 0.8125rem;
    background: var(--bg-deep);
    border: 1px solid var(--border-faint);
    border-radius: var(--r-md);
}

.emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px; padding: 8px;
    max-height: 260px;
    overflow-y: auto;
}

.emoji-item {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; border-radius: var(--r-sm);
    cursor: pointer; transition: all var(--t-fast);
}
.emoji-item:hover { background: var(--bg-hover); transform: scale(1.15); }

.emoji-category-label {
    grid-column: 1 / -1;
    font-size: 0.6875rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--text-600); padding: 8px 4px 4px;
}

/* ══ SEARCH PANEL ══ */

.search-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 80px;
    animation: fadeIn 0.15s var(--ease-out);
}

.search-panel {
    width: 580px; max-height: 70vh;
    background: var(--bg-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
    animation: modalSlideIn 0.25s var(--ease-spring);
}

.search-input-wrapper {
    display: flex; align-items: center;
    padding: var(--s-4) var(--s-5); gap: var(--s-3);
    border-bottom: 1px solid var(--border-faint);
}
.search-input-wrapper i { color: var(--text-500); font-size: 1rem; }
.search-input {
    flex: 1; background: none; border: none;
    font-size: 1rem; color: var(--text-200);
}
.search-input:focus { outline: none; box-shadow: none; }

.search-results { max-height: calc(70vh - 56px); overflow-y: auto; padding: var(--s-2); }
.search-result-item {
    display: flex; align-items: center; gap: var(--s-3);
    padding: var(--s-2) var(--s-3); border-radius: var(--r-md);
    cursor: pointer; transition: background var(--t-fast);
}
.search-result-item:hover { background: var(--bg-hover); }
.search-hint { text-align: center; padding: var(--s-8); color: var(--text-500); font-size: 0.8125rem; }

/* ══ CODE BLOCKS ══ */

.message-text code {
    background: var(--bg-overlay);
    padding: 2px 6px;
    border-radius: var(--r-xs);
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.85em;
    color: var(--accent-mint);
    border: 1px solid var(--border-faint);
}

.message-text pre {
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    padding: var(--s-4);
    margin: 8px 0;
    overflow-x: auto;
    position: relative;
}
.message-text pre code {
    background: none; padding: 0;
    font-size: 0.8125rem; line-height: 1.6;
    color: var(--text-300); border: none;
}

/* ══ MENTIONS ══ */

.mention {
    background: rgba(124, 58, 237, 0.12);
    color: var(--brand-light);
    padding: 0 4px;
    border-radius: var(--r-xs);
    cursor: pointer; font-weight: 500;
    transition: background var(--t-fast);
}
.mention:hover { background: rgba(124, 58, 237, 0.22); }
.channel-mention { color: var(--accent-sky); }

/* ══ SETTINGS ══ */

.settings-layout { display: flex; height: 100%; }

.settings-nav {
    width: 220px;
    background: var(--bg-base);
    padding: var(--s-4);
    overflow-y: auto;
    border-right: 1px solid var(--border-faint);
}

.settings-nav-group { margin-bottom: var(--s-4); }
.settings-nav-title {
    font-size: 0.6875rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-600); padding: 8px var(--s-3);
}

.settings-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 7px var(--s-3); border-radius: var(--r-md);
    font-size: 0.8125rem; color: var(--text-400);
    cursor: pointer; transition: all var(--t-fast);
}
.settings-nav-item:hover { background: var(--bg-hover); color: var(--text-200); }
.settings-nav-item.active { background: var(--bg-active); color: var(--text-100); }
.settings-nav-item i { width: 18px; text-align: center; }

.settings-content { flex: 1; padding: var(--s-6); overflow-y: auto; }
.settings-section { max-width: 700px; margin-bottom: var(--s-12); }
.settings-section h2 { margin-bottom: var(--s-5); font-size: 1.125rem; }

.settings-field {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--s-3) var(--s-4);
    background: var(--bg-base);
    border: 1px solid var(--border-faint);
    border-radius: var(--r-lg);
    margin-bottom: var(--s-2);
    transition: border-color var(--t-fast);
}
.settings-field:hover { border-color: var(--border-muted); }

.settings-field-info { flex: 1; }
.settings-field-label { font-weight: 500; color: var(--text-200); font-size: 0.875rem; }
.settings-field-desc { font-size: 0.75rem; color: var(--text-500); margin-top: 2px; }

.settings-member-row {
    display: flex; align-items: center; gap: var(--s-3);
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-md);
    transition: background var(--t-fast);
}
.settings-member-row:hover { background: var(--bg-hover); }

/* Toggle Switch */
.toggle-switch {
    width: 42px; height: 22px;
    background: var(--bg-highlight);
    border-radius: 11px;
    position: relative; cursor: pointer;
    transition: background var(--t-normal);
    flex-shrink: 0;
}
.toggle-switch::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    background: var(--text-400);
    border-radius: var(--r-full);
    top: 3px; left: 3px;
    transition: transform var(--t-normal), background var(--t-normal);
}
.toggle-switch.active { background: var(--brand); box-shadow: 0 0 12px rgba(139, 92, 246, 0.3); }
.toggle-switch.active::after { transform: translateX(20px); background: white; }

/* ══ CARDS ══ */

.card {
    background: rgba(20, 20, 32, 0.7);
    border: 1px solid var(--border-faint);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: all 0.3s var(--ease-out);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.card:hover {
    border-color: rgba(139, 92, 246, 0.15);
    box-shadow: var(--shadow-md), 0 0 20px rgba(139, 92, 246, 0.04);
    transform: translateY(-2px);
}

.card-header { padding: var(--s-4); border-bottom: 1px solid var(--border-faint); display: flex; align-items: center; justify-content: space-between; }
.card-body { padding: var(--s-4); }
.card-footer { padding: var(--s-4); border-top: 1px solid var(--border-faint); display: flex; justify-content: flex-end; gap: 8px; }

/* ══ INVITE BOX ══ */

.invite-box {
    display: flex; align-items: center; gap: var(--s-3);
    padding: var(--s-3); background: var(--bg-deep);
    border: 1px solid var(--border-faint);
    border-radius: var(--r-lg);
}

.invite-link {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    color: var(--accent-sky);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.invite-copy-btn {
    padding: 7px 16px;
    background: var(--brand);
    color: white;
    border-radius: var(--r-md);
    font-weight: 600; font-size: 0.8125rem;
    flex-shrink: 0;
}
.invite-copy-btn:hover { background: var(--brand-hover); }

/* ══ FILE UPLOAD ══ */

.file-upload-area {
    border: 2px dashed var(--border-visible);
    border-radius: var(--r-xl);
    padding: var(--s-8);
    text-align: center; cursor: pointer;
    transition: all var(--t-normal);
}
.file-upload-area:hover { border-color: var(--brand); background: var(--brand-subtle); }
.file-upload-area.dragover { border-color: var(--brand); background: rgba(124,58,237,0.08); }

.file-attachment {
    display: flex; align-items: center; gap: var(--s-3);
    padding: var(--s-3); background: var(--bg-overlay);
    border: 1px solid var(--border-faint);
    border-radius: var(--r-lg);
    margin-top: 6px; max-width: 420px;
    transition: border-color var(--t-fast);
}
.file-attachment:hover { border-color: var(--border-muted); }

.file-attachment-icon {
    width: 40px; height: 40px;
    background: var(--brand-subtle);
    border-radius: var(--r-md);
    display: flex; align-items: center; justify-content: center;
    color: var(--brand-light); font-size: 1rem;
}

.file-attachment-info { flex: 1; min-width: 0; }
.file-attachment-name { font-weight: 500; font-size: 0.8125rem; color: var(--accent-sky); cursor: pointer; }
.file-attachment-name:hover { text-decoration: underline; }
.file-attachment-size { font-size: 0.6875rem; color: var(--text-600); }

/* ══ PROGRESS BAR ══ */

.progress { height: 3px; background: var(--bg-float); border-radius: 2px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent-sky)); border-radius: 2px; transition: width var(--t-slow); }

/* ══ TABS ══ */

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border-faint); }
.tab {
    padding: 10px 18px; font-size: 0.8125rem; font-weight: 500; color: var(--text-500);
    cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -1px; transition: all var(--t-fast);
}
.tab:hover { color: var(--text-200); }
.tab.active { color: var(--text-100); border-bottom-color: var(--brand); }

/* ══ PILL NAV ══ */

.pill-nav { display: flex; gap: 2px; padding: 3px; background: var(--bg-deep); border-radius: var(--r-md); }
.pill-nav-item {
    padding: 7px 14px; font-size: 0.8125rem; font-weight: 500; color: var(--text-500);
    border-radius: var(--r-sm); cursor: pointer; transition: all var(--t-normal);
}
.pill-nav-item:hover { color: var(--text-200); background: var(--bg-hover); }
.pill-nav-item.active { background: var(--brand); color: white; }

/* ══ NOTIFICATION BANNER ══ */

.notification-banner {
    display: flex; align-items: center; gap: var(--s-3);
    padding: 10px var(--s-4);
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: white; font-size: 0.8125rem; font-weight: 500;
}
.notification-banner button {
    margin-left: auto; padding: 4px 14px;
    background: rgba(255,255,255,0.2); color: white;
    border-radius: var(--r-sm); font-size: 0.75rem; font-weight: 600;
}
.notification-banner button:hover { background: rgba(255,255,255,0.3); }

/* ══ COMMAND PALETTE ══ */

.command-palette {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(6px);
    display: none; align-items: flex-start; justify-content: center;
    padding-top: 20vh;
    z-index: var(--z-modal);
}
.command-palette.visible { display: flex; }

.command-palette-content {
    width: 540px; max-height: 400px;
    background: rgba(20, 20, 32, 0.92);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: var(--r-2xl);
    box-shadow: var(--shadow-2xl), 0 0 40px rgba(139, 92, 246, 0.06);
    overflow: hidden;
    animation: modalSlideIn 0.2s var(--ease-spring);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
}

.command-palette-input {
    width: 100%; padding: 16px 18px;
    background: transparent; border: none;
    border-bottom: 1px solid var(--border-faint);
    font-size: 1rem; color: var(--text-200);
    outline: none;
}
.command-palette-input::placeholder { color: var(--text-600); }

.command-palette-results { max-height: 320px; overflow-y: auto; padding: var(--s-2); }
.command-palette-item {
    display: flex; align-items: center; gap: var(--s-3);
    padding: 9px var(--s-3); border-radius: var(--r-md);
    cursor: pointer; transition: background var(--t-fast);
    color: var(--text-400); font-size: 0.8125rem;
}
.command-palette-item:hover, .command-palette-item.selected { background: var(--bg-hover); color: var(--text-200); }
.command-palette-item i { width: 20px; color: var(--text-500); text-align: center; }
.command-palette-item kbd {
    margin-left: auto;
    padding: 2px 6px;
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-xs);
    font-size: 0.6875rem;
    color: var(--text-500);
    font-family: 'JetBrains Mono', monospace;
}

/* ══ NOTIFICATION PANEL ══ */

.notification-panel {
    position: fixed; top: 52px; right: 16px;
    width: 360px; max-height: 480px;
    background: rgba(20, 20, 32, 0.92);
    border: 1px solid rgba(139, 92, 246, 0.08);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-2xl), 0 0 30px rgba(0, 0, 0, 0.3);
    z-index: var(--z-popover);
    display: none;
    animation: slideInDown 0.2s var(--ease-spring);
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.notification-panel.visible { display: block; }

.notification-panel-header {
    padding: var(--s-4);
    border-bottom: 1px solid var(--border-faint);
    display: flex; align-items: center; justify-content: space-between;
}
.notification-panel-header h3 { font-size: 0.9375rem; }

.notification-list { max-height: 380px; overflow-y: auto; padding: var(--s-2); }
.notification-item {
    display: flex; gap: var(--s-3);
    padding: var(--s-3); border-radius: var(--r-md);
    cursor: pointer; transition: background var(--t-fast);
}
.notification-item:hover { background: var(--bg-hover); }
.notification-item.unread { background: var(--brand-subtle); }
.notification-item-avatar { flex-shrink: 0; width: 36px; height: 36px; }
.notification-item-body { flex: 1; min-width: 0; }
.notification-item-title { font-weight: 500; font-size: 0.8125rem; color: var(--text-200); }
.notification-item-desc { font-size: 0.75rem; color: var(--text-500); margin-top: 2px; }
.notification-item-time { font-size: 0.6875rem; color: var(--text-600); margin-top: 4px; }

/* ══ KEYBOARD SHORTCUTS ══ */

.shortcuts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.shortcut-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px var(--s-3);
    background: var(--bg-base);
    border-radius: var(--r-md);
    border: 1px solid var(--border-faint);
}
.shortcut-label { font-size: 0.8125rem; color: var(--text-300); }
.shortcut-keys { display: flex; gap: 4px; }
.shortcut-keys kbd {
    padding: 2px 7px;
    background: var(--bg-overlay);
    border: 1px solid var(--border-visible);
    border-radius: var(--r-sm);
    font-size: 0.6875rem;
    color: var(--text-300);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    box-shadow: 0 2px 0 var(--border-subtle);
}

/* ══ SERVER EXPLORE ══ */

.explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--s-4); padding: var(--s-4);
}

.explore-card {
    background: rgba(20, 20, 32, 0.7);
    border: 1px solid var(--border-faint);
    border-radius: var(--r-xl);
    overflow: hidden; cursor: pointer;
    transition: all 0.3s var(--ease-out);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.explore-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), 0 0 24px rgba(139, 92, 246, 0.06);
    border-color: rgba(139, 92, 246, 0.15);
}

.explore-card-banner {
    height: 100px;
    background: linear-gradient(135deg, var(--brand), var(--accent-sky));
    position: relative;
}

.explore-card-info { padding: var(--s-4); }
.explore-card-name { font-weight: 700; font-size: 0.9375rem; color: var(--text-100); margin-bottom: var(--s-1); }
.explore-card-desc { font-size: 0.8125rem; color: var(--text-500); line-height: 1.4; }
.explore-card-meta { display: flex; gap: var(--s-4); margin-top: var(--s-3); font-size: 0.75rem; color: var(--text-600); align-items: center; }

/* ══ FRIENDS LIST ══ */

.friends-tabs { display: flex; gap: var(--s-2); padding: 0 var(--s-4); margin-bottom: var(--s-4); }
.friend-tab {
    padding: 6px 14px; border-radius: var(--r-md);
    font-size: 0.8125rem; font-weight: 600; color: var(--text-500);
    cursor: pointer; transition: all var(--t-fast);
}
.friend-tab:hover { background: var(--bg-hover); color: var(--text-200); }
.friend-tab.active { background: var(--bg-active); color: var(--text-100); }
.friends-tab.add-friend-tab { background: var(--brand); color: white; border: none; margin-left: auto; }
.friends-tab.add-friend-tab:hover { background: var(--brand-hover); }

.friend-item {
    display: flex; align-items: center; gap: var(--s-3);
    padding: var(--s-2) var(--s-4);
    border-radius: var(--r-md);
    cursor: pointer; transition: background var(--t-fast);
    border-top: 1px solid var(--border-faint);
}
.friend-item:first-child { border-top: none; }
.friend-item:hover { background: var(--bg-hover); }

.friend-info { flex: 1; min-width: 0; }
.friend-name { font-weight: 500; font-size: 0.875rem; color: var(--text-200); }
.friend-status { font-size: 0.75rem; color: var(--text-500); }

.friend-actions { display: flex; gap: var(--s-1); }
.friend-actions button {
    width: 34px; height: 34px;
    background: var(--bg-overlay);
    border-radius: var(--r-full);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-500); font-size: 0.85rem;
    transition: all 0.2s ease;
}
.friend-actions button:hover { background: var(--bg-float); color: var(--text-200); }

/* ══ VOICE CARDS & VIDEO ══ */

.voice-user-card {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, border-color, box-shadow;
}
.voice-user-card:hover {
    border-color: rgba(124,58,237,0.3);
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.voice-control-btn {
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: transform;
    position: relative;
    overflow: hidden;
}
.voice-control-btn:hover {
    transform: scale(1.12);
    box-shadow: 0 0 16px rgba(139,92,246,0.15);
}
.voice-control-btn:active {
    transform: scale(0.92);
}
.voice-control-btn.danger {
    animation: shake 0.3s ease-in-out;
}

.voice-speaking-ring { transition: opacity 0.3s, height 0.3s ease; }

/* Voice panels scroll container */
.voice-panels {
    scrollbar-width: thin;
    scrollbar-color: rgba(139,92,246,0.2) transparent;
}
.voice-panels::-webkit-scrollbar { width: 4px; }
.voice-panels::-webkit-scrollbar-track { background: transparent; }
.voice-panels::-webkit-scrollbar-thumb {
    background: rgba(139,92,246,0.2);
    border-radius: 4px;
}
.voice-panels::-webkit-scrollbar-thumb:hover {
    background: rgba(139,92,246,0.4);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.2); }
}

/* Badge count */
.badge-count {
    background: var(--danger); color: white; font-size: 0.65rem; font-weight: 700;
    padding: 1px 5px; border-radius: var(--r-full); min-width: 16px; text-align: center;
    line-height: 1.3;
}

/* Compact mode */
.compact-mode .message-group { padding: 2px var(--s-4); gap: 8px; }
.compact-mode .message-avatar { width: 24px; height: 24px; font-size: 0.55rem; margin-top: 2px; }
.compact-mode .message-compact { padding: 1px var(--s-4) 1px calc(var(--s-4) + 32px); }

/* ══ PARTY GAMES ══ */

.game-panel {
    display: none; flex-direction: column;
    background: var(--bg-deep); border: 1px solid var(--border-subtle);
    border-radius: var(--r-xl); margin: var(--s-3);
    overflow: hidden; animation: gameSlideIn 0.4s var(--ease-spring);
    max-height: 70vh; overflow-y: auto;
}
@keyframes gameSlideIn { from { opacity:0; transform:translateY(-20px) scale(0.97); } to { opacity:1; transform:none; } }
.game-container { display:flex; flex-direction:column; gap:var(--s-3); }

.game-topbar {
    display:flex; align-items:center; justify-content:space-between;
    padding:var(--s-3) var(--s-4); background:var(--bg-base); border-bottom:1px solid var(--border-faint);
}
.game-topbar-left { display:flex; align-items:center; gap:var(--s-3); }
.game-topbar-right { display:flex; align-items:center; gap:var(--s-2); }
.game-badge { width:36px; height:36px; border-radius:var(--r-lg); display:flex; align-items:center; justify-content:center; font-size:0.9rem; }
.game-title { font-weight:700; color:var(--text-100); font-size:0.9375rem; display:block; }
.game-phase { font-size:0.6875rem; color:var(--text-500); font-weight:500; }
.game-turn-badge {
    background:var(--brand); color:white; font-size:0.6875rem; font-weight:700;
    padding:3px 10px; border-radius:var(--r-full); animation:turnPulse 1.5s ease infinite;
}
@keyframes turnPulse { 0%,100% { box-shadow:0 0 0 0 rgba(124,58,237,0.4); } 50% { box-shadow:0 0 0 6px rgba(124,58,237,0); } }

.game-players-bar {
    display:flex; gap:var(--s-2); padding:var(--s-2) var(--s-4);
    overflow-x:auto; background:var(--bg-base); border-bottom:1px solid var(--border-faint);
}
.game-player-chip {
    display:flex; align-items:center; gap:var(--s-2);
    background:var(--bg-raised); padding:5px 10px 5px 5px;
    border-radius:var(--r-full); border:2px solid transparent; transition:all 0.2s; flex-shrink:0;
}
.game-player-chip.active { border-color:var(--brand); background:rgba(124,58,237,0.1); }
.game-player-chip.me { border-color:var(--success); }
.game-player-avatar {
    width:26px; height:26px; border-radius:50%; display:flex; align-items:center; justify-content:center;
    color:white; font-size:0.55rem; font-weight:700; flex-shrink:0;
}
.game-player-avatar.sm { width:22px; height:22px; font-size:0.5rem; }
.game-player-name { font-size:0.75rem; font-weight:600; color:var(--text-300); white-space:nowrap; }
.game-player-score {
    font-size:0.65rem; font-weight:700; color:var(--brand-light);
    background:var(--bg-overlay); padding:1px 6px; border-radius:var(--r-full);
}

.game-board { padding:var(--s-4); min-height:200px; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.game-actions { display:flex; gap:var(--s-3); justify-content:center; padding:var(--s-4); flex-wrap:wrap; }
.game-message {
    text-align:center; padding:var(--s-2) var(--s-4); font-size:0.8125rem; font-weight:600;
    color:var(--text-400); background:var(--bg-base); border-top:1px solid var(--border-faint);
}
.game-lobby-actions { text-align:center; padding:var(--s-6); }
.game-wait-text { color:var(--text-500); font-size:0.8125rem; }

.game-finished { text-align:center; padding:var(--s-6); }
.game-finished-trophy { font-size:3rem; margin-bottom:var(--s-3); animation:trophyBounce 0.6s ease; }
@keyframes trophyBounce { 0% { transform:scale(0); } 60% { transform:scale(1.3); } 100% { transform:scale(1); } }
.game-finished h3 { color:var(--text-100); font-size:1.25rem; margin-bottom:var(--s-4); }
.game-finished-actions { display:flex; gap:var(--s-3); justify-content:center; margin-top:var(--s-4); }

.game-scoreboard { width:100%; max-width:360px; margin:0 auto; }
.game-scoreboard-row {
    display:flex; align-items:center; gap:var(--s-3); padding:var(--s-2) var(--s-3);
    border-radius:var(--r-md); margin-bottom:4px;
}
.game-scoreboard-row.winner { background:rgba(124,58,237,0.1); border:1px solid rgba(124,58,237,0.2); }
.game-sb-medal { font-size:1.1rem; width:28px; text-align:center; }
.game-sb-name { flex:1; font-weight:600; color:var(--text-100); font-size:0.875rem; }
.game-sb-score { font-size:0.8rem; font-weight:700; color:var(--brand-light); font-family:'JetBrains Mono',monospace; }

/* Playing Cards */
.playing-card {
    width:72px; height:100px; background:var(--card-bg,#F8F8FA); border-radius:8px;
    border:2px solid rgba(0,0,0,0.1); position:relative; display:inline-flex;
    align-items:center; justify-content:center; flex-shrink:0;
    box-shadow:0 2px 8px rgba(0,0,0,0.15); transition:transform 0.2s; user-select:none;
}
.playing-card.small { width:52px; height:72px; }
.playing-card:hover { transform:translateY(-4px); }
.playing-card-corner { position:absolute; font-size:0.65rem; font-weight:700; color:var(--card-color,#1E1E2E); line-height:1.1; text-align:center; }
.playing-card-corner.top { top:5px; left:6px; }
.playing-card-corner.bottom { bottom:5px; right:6px; transform:rotate(180deg); }
.playing-card-center { font-size:1.8rem; color:var(--card-color,#1E1E2E); opacity:0.8; }
.playing-card.small .playing-card-center { font-size:1.2rem; }
.playing-card.small .playing-card-corner { font-size:0.5rem; }
.card-back { background:linear-gradient(135deg,var(--brand),#EF4444) !important; border-color:rgba(0,0,0,0.2) !important; }
.card-back-design { color:white; font-size:1.4rem; font-weight:900; text-shadow:0 1px 3px rgba(0,0,0,0.3); }
.card-placeholder { width:72px; height:100px; border-radius:8px; border:2px dashed var(--border-visible); display:inline-flex; align-items:center; justify-content:center; color:var(--text-600); }

/* UNO Cards */
.uno-card {
    width:66px; height:96px; background:var(--uno-bg,#888); border-radius:10px;
    border:4px solid rgba(255,255,255,0.3); display:inline-flex; flex-direction:column;
    align-items:center; justify-content:center; color:white; font-weight:900;
    box-shadow:0 3px 10px rgba(0,0,0,0.25); flex-shrink:0; transition:transform 0.2s;
}
.uno-card-value { font-size:1.6rem; text-shadow:0 2px 4px rgba(0,0,0,0.3); }
.uno-card-wild { font-size:0.5rem; letter-spacing:0.08em; text-transform:uppercase; opacity:0.8; margin-top:2px; }

.uno-table { width:100%; display:flex; flex-direction:column; gap:var(--s-4); }
.uno-opponents { display:flex; gap:var(--s-2); flex-wrap:wrap; justify-content:center; }
.uno-opponent {
    display:flex; align-items:center; gap:var(--s-2); background:var(--bg-raised);
    padding:4px 10px 4px 4px; border-radius:var(--r-full); border:2px solid transparent;
    font-size:0.75rem; color:var(--text-300);
}
.uno-opponent.active { border-color:var(--brand); }
.uno-card-count { font-family:'JetBrains Mono',monospace; font-size:0.65rem; color:var(--text-500); }
.uno-called { color:#EF4444; font-weight:800; font-size:0.6875rem; }
.uno-center { display:flex; align-items:center; justify-content:center; gap:var(--s-6); }
.uno-discard,.uno-deck-pile { display:flex; flex-direction:column; align-items:center; gap:var(--s-2); }
.uno-color-indicator { padding:3px 10px; border-radius:var(--r-full); color:white; font-size:0.65rem; font-weight:700; }
.uno-draw-label { font-size:0.65rem; color:var(--text-500); }
.uno-hand { display:flex; justify-content:center; padding:var(--s-2) var(--s-4); flex-wrap:wrap; }
.uno-hand-card { transition:transform 0.2s; cursor:default; margin-left:-8px; }
.uno-hand-card:first-child { margin-left:0; }
.uno-hand-card.playable { cursor:pointer; }
.uno-hand-card.playable:hover { transform:translateY(-12px) scale(1.1); z-index:10; }
.uno-hand-card:not(.playable) .uno-card { opacity:0.5; filter:grayscale(0.5); }
.uno-call-btn { border-radius:var(--r-full) !important; padding:12px 32px !important; }

.uno-color-picker {
    position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.6);
    display:flex; align-items:center; justify-content:center; flex-direction:column;
    z-index:10000; opacity:0; transition:opacity 0.2s;
}
.uno-color-picker.visible { opacity:1; }
.uno-color-picker-title { color:white; font-size:1rem; font-weight:700; margin-bottom:var(--s-4); }
.uno-color-options { display:flex; gap:var(--s-4); }
.uno-color-btn {
    width:52px; height:52px; border-radius:50%; border:4px solid white;
    cursor:pointer; transition:all 0.2s; box-shadow:0 4px 12px rgba(0,0,0,0.3);
}
.uno-color-btn:hover { transform:scale(1.2); }

/* Blackjack */
.bj-table { width:100%; display:flex; flex-direction:column; align-items:center; gap:var(--s-4); }
.bj-dealer,.bj-player { text-align:center; }
.bj-label { font-size:0.75rem; font-weight:600; color:var(--text-500); margin-bottom:var(--s-2); text-transform:uppercase; letter-spacing:0.04em; }
.bj-cards { display:flex; gap:var(--s-2); justify-content:center; flex-wrap:wrap; }
.bj-divider { width:80%; height:1px; background:var(--border-visible); position:relative; }
.bj-divider::after { content:'VS'; position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); background:var(--bg-deep); padding:0 var(--s-3); font-size:0.65rem; font-weight:700; color:var(--text-600); }
.bj-results { margin-top:var(--s-3); }
.bj-result { padding:var(--s-2) var(--s-4); border-radius:var(--r-md); font-size:0.8125rem; font-weight:600; margin-bottom:4px; color:var(--text-100); }
.bj-result.win { background:rgba(34,197,94,0.1); }
.bj-result.lose,.bj-result.bust { background:rgba(239,68,68,0.1); }
.bj-result.push { background:rgba(59,130,246,0.1); }

/* Trivia */
.trivia-board { width:100%; max-width:560px; margin:0 auto; }
.trivia-progress { width:100%; height:5px; background:var(--bg-float); border-radius:3px; position:relative; margin-bottom:var(--s-4); }
.trivia-progress-bar { height:100%; background:linear-gradient(90deg,var(--brand),var(--accent-sky)); border-radius:3px; transition:width 0.5s; }
.trivia-progress-text { position:absolute; right:0; top:-18px; font-size:0.65rem; color:var(--text-500); }
.trivia-category { display:flex; gap:var(--s-2); margin-bottom:var(--s-3); align-items:center; }
.trivia-cat-badge { background:var(--bg-raised); padding:3px 10px; border-radius:var(--r-full); font-size:0.6875rem; font-weight:600; color:var(--text-300); }
.trivia-diff-badge { font-size:0.65rem; font-weight:700; }
.trivia-question { font-size:1.0625rem; font-weight:700; color:var(--text-100); margin-bottom:var(--s-4); line-height:1.5; text-align:center; }
.trivia-answers { display:grid; grid-template-columns:1fr 1fr; gap:var(--s-2); }
.trivia-answer-btn {
    background:var(--bg-raised); border:2px solid var(--border-subtle); border-radius:var(--r-lg);
    padding:var(--s-3) var(--s-4); color:var(--text-100); font-size:0.875rem; font-weight:600;
    cursor:pointer; transition:all 0.2s; font-family:inherit; text-align:center;
}
.trivia-answer-btn:hover:not(.disabled) { border-color:var(--brand); background:rgba(124,58,237,0.1); transform:scale(1.02); }
.trivia-answer-btn.disabled { opacity:0.5; cursor:default; pointer-events:none; }
.trivia-answered { text-align:center; color:var(--success); font-size:0.8125rem; font-weight:600; margin-top:var(--s-3); }

/* Higher/Lower */
.hl-board { display:flex; align-items:center; justify-content:center; gap:var(--s-6); width:100%; }
.hl-previous { display:flex; gap:var(--s-1); opacity:0.5; }
.hl-prev-card { transform:scale(0.7); }
.hl-current { text-align:center; }
.hl-current-label,.hl-next-label { font-size:0.6875rem; font-weight:600; color:var(--text-500); margin-bottom:var(--s-2); text-transform:uppercase; }
.hl-next { text-align:center; }
.hl-result { margin-top:var(--s-2); font-size:0.75rem; font-weight:700; padding:3px 12px; border-radius:var(--r-full); }
.hl-result.correct { color:var(--success); background:rgba(34,197,94,0.1); }
.hl-result.wrong { color:var(--danger); background:rgba(239,68,68,0.1); }
.hl-streak { text-align:center; font-size:0.8125rem; color:var(--text-300); margin-top:var(--s-2); }
.hl-btn-higher { background:var(--success) !important; }
.hl-btn-lower { background:var(--danger) !important; color:white !important; }

/* Game Launcher Modal */
.game-launcher-grid { display:flex; flex-direction:column; gap:var(--s-3); }
.game-launcher-card {
    display:flex; align-items:center; gap:var(--s-4); padding:var(--s-4);
    border-radius:var(--r-xl); background:var(--bg-base); border:1px solid var(--border-subtle);
    cursor:pointer; transition:all 0.2s;
}
.game-launcher-card:hover { border-color:var(--game-color,var(--brand)); transform:translateX(4px); background:var(--bg-hover); }
.game-launcher-icon { width:44px; height:44px; border-radius:var(--r-lg); display:flex; align-items:center; justify-content:center; font-size:1.1rem; flex-shrink:0; }
.game-launcher-info { flex:1; }
.game-launcher-info h3 { font-size:0.9375rem; font-weight:700; color:var(--text-100); }
.game-launcher-info p { font-size:0.75rem; color:var(--text-500); margin-top:2px; }
.game-launcher-arrow { color:var(--text-600); font-size:0.75rem; }

/* Leaderboard */
.leaderboard-list { display:flex; flex-direction:column; gap:6px; }
.leaderboard-row { display:flex; align-items:center; gap:var(--s-3); padding:var(--s-2) var(--s-3); border-radius:var(--r-md); background:var(--bg-raised); }
.leaderboard-row.top { background:rgba(124,58,237,0.08); }
.lb-rank { width:28px; text-align:center; font-size:1rem; }
.lb-name { flex:1; font-weight:600; color:var(--text-100); font-size:0.875rem; }
.lb-stats { display:flex; gap:var(--s-2); font-size:0.6875rem; font-family:'JetBrains Mono',monospace; }
.lb-wins { color:var(--success); font-weight:600; }
.lb-losses { color:var(--danger); font-weight:600; }
.lb-score { color:var(--brand-light); font-weight:700; }

.game-start-btn {
    background:linear-gradient(135deg,var(--brand),var(--accent-sky)); color:white; border:none;
    border-radius:var(--r-full); padding:8px 16px; font-size:0.75rem; font-weight:700;
    cursor:pointer; transition:all 0.2s; display:flex; align-items:center; gap:6px;
}
.game-start-btn:hover { transform:scale(1.05); box-shadow:0 4px 12px rgba(124,58,237,0.3); }

/* ══ REPLY PREVIEW BAR ══ */

.reply-preview {
    display: flex; align-items: center; gap: 10px;
    padding: 8px var(--s-3);
    background: var(--bg-overlay);
    border-left: 3px solid var(--brand);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    margin: 0 var(--s-4);
    animation: slideInUp 0.2s var(--ease-spring);
}

.reply-preview-content {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; gap: 2px;
}
.reply-preview-content strong {
    font-size: 0.75rem;
    color: var(--brand-light);
    font-weight: 700;
}
.reply-preview-text {
    font-size: 0.75rem;
    color: var(--text-500);
    white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
    max-width: 500px;
}
.reply-preview-close {
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--r-full);
    color: var(--text-600); font-size: 0.7rem;
    flex-shrink: 0; cursor: pointer;
    transition: all var(--t-fast);
}
.reply-preview-close:hover { background: var(--bg-hover); color: var(--text-200); }

/* ══ FILE PREVIEW BAR ══ */

.file-preview {
    display: flex; align-items: center; gap: var(--s-3);
    padding: var(--s-3);
    background: var(--bg-overlay);
    border-left: 3px solid var(--accent-mint);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    margin: 0 var(--s-4);
    animation: slideInUp 0.2s var(--ease-spring);
}

.file-preview-image {
    width: 44px; height: 44px;
    border-radius: var(--r-md);
    object-fit: cover;
    border: 1px solid var(--border-faint);
}

.file-preview-icon {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-raised);
    border-radius: var(--r-md);
    color: var(--text-500); font-size: 1.1rem;
    flex-shrink: 0;
}

.file-preview-info { flex: 1; min-width: 0; }
.file-preview-info div:first-child {
    font-size: 0.8125rem; font-weight: 600; color: var(--text-200);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.file-preview-info div:last-child {
    font-size: 0.6875rem; color: var(--text-500); margin-top: 2px;
}

.file-preview-close {
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--r-full);
    color: var(--text-600); font-size: 0.7rem;
    flex-shrink: 0; cursor: pointer;
    transition: all var(--t-fast);
}
.file-preview-close:hover { background: var(--bg-hover); color: var(--danger); }

/* ══ GIF PICKER ══ */

.gif-picker {
    position: absolute; bottom: 100%; right: 40px;
    margin-bottom: 8px; width: 380px; max-height: 400px;
    background: var(--bg-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: slideInUp 0.2s var(--ease-spring);
    z-index: var(--z-dropdown);
    display: flex; flex-direction: column;
}

.gif-picker-header {
    padding: var(--s-3);
    border-bottom: 1px solid var(--border-faint);
    display: flex; align-items: center; justify-content: space-between;
}
.gif-picker-header h4 { font-size: 0.8125rem; font-weight: 700; color: var(--text-200); }

.gif-picker-search {
    width: 100%; height: 34px;
    padding: 0 var(--s-3); font-size: 0.8125rem;
    background: var(--bg-deep);
    border: 1px solid var(--border-faint);
    border-radius: var(--r-md);
    color: var(--text-200); margin-top: 8px;
}
.gif-picker-search:focus { border-color: var(--brand); outline: none; }

.gif-picker-grid {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 4px; padding: var(--s-2);
    overflow-y: auto; max-height: 300px; flex: 1;
}
.gif-item {
    border-radius: var(--r-md); overflow: hidden;
    cursor: pointer; transition: all var(--t-fast);
    position: relative;
    width: 100%; height: 110px; object-fit: cover; display: block;
}
.gif-item:hover { transform: scale(1.02); box-shadow: var(--shadow-sm); }

/* ══ INLINE MESSAGE EDIT ══ */

.inline-edit { margin-top: 4px; }
.inline-edit-input {
    width: 100%; min-height: 36px;
    padding: 8px var(--s-3);
    background: var(--bg-deep);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    color: var(--text-200);
    font-size: 0.875rem;
    font-family: inherit;
    resize: none; line-height: 1.4;
}
.inline-edit-input:focus {
    border-color: var(--brand);
    outline: none;
    box-shadow: 0 0 0 2px rgba(124,58,237,0.12);
}
.inline-edit-actions { display: flex; gap: 6px; margin-top: 6px; }
.inline-edit-hint { font-size: 0.6875rem; color: var(--text-600); margin-top: 4px; }

/* ══ MESSAGE ATTACHMENTS ══ */

.message-attachments {
    display: flex; flex-direction: column;
    gap: 8px; margin-top: 8px;
}
.attachment-image {
    max-width: 400px; max-height: 300px;
    border-radius: var(--r-lg);
    cursor: pointer;
    transition: all var(--t-fast);
    border: 1px solid var(--border-faint);
}
.attachment-image:hover { box-shadow: var(--shadow-md); }

.attachment-file {
    display: inline-flex; align-items: center; gap: 10px;
    padding: var(--s-3);
    background: var(--bg-overlay);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    max-width: 360px;
    transition: all var(--t-fast);
}
.attachment-file:hover { border-color: var(--brand); background: var(--bg-hover); }
.attachment-file i { color: var(--text-500); font-size: 1.2rem; }
.attachment-file a { color: var(--accent-sky); font-weight: 600; font-size: 0.8125rem; text-decoration: none; }
.attachment-file a:hover { text-decoration: underline; }
.att-size { font-size: 0.6875rem; color: var(--text-600); margin-left: auto; }

/* ══ MESSAGE EDITED TAG ══ */

.msg-edited-tag {
    font-size: 0.65rem; color: var(--text-600);
    margin-left: 4px; font-style: italic;
}

/* ══ MESSAGE HIGHLIGHT ══ */

.message-highlight { animation: messageHighlight 2s ease-out; }
@keyframes messageHighlight {
    0% { background: rgba(124, 58, 237, 0.15); }
    100% { background: transparent; }
}

/* ══ PINNED MESSAGES ══ */

.pinned-messages-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--s-4) var(--s-5);
    border-bottom: 1px solid var(--border-faint);
}
.pinned-messages-header h3 { font-size: 0.9375rem; font-weight: 700; color: var(--text-100); }

.pinned-message-item {
    padding: var(--s-3) var(--s-5);
    border-bottom: 1px solid var(--border-faint);
    transition: background var(--t-fast);
    cursor: default;
}
.pinned-message-item:hover { background: var(--bg-hover); }
.pinned-message-item:last-child { border-bottom: none; }
.pinned-message-item strong { font-size: 0.75rem; color: var(--text-200); }
.pinned-message-item p { font-size: 0.8125rem; color: var(--text-400); margin-top: 4px; line-height: 1.4; }
.pinned-message-item small { font-size: 0.6875rem; color: var(--text-600); }

/* ══ SEARCH PANEL (in-chat) ══ */

.search-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--s-4) var(--s-5);
    border-bottom: 1px solid var(--border-faint);
}
.search-panel-header h3 { font-size: 0.9375rem; font-weight: 700; color: var(--text-100); }

.search-panel-form {
    padding: var(--s-3) var(--s-5);
    border-bottom: 1px solid var(--border-faint);
    display: flex; flex-direction: column; gap: 8px;
}

.search-filters {
    display: flex; align-items: center; gap: var(--s-3);
    font-size: 0.75rem; color: var(--text-500);
}
.search-filters label { display: flex; align-items: center; gap: 5px; cursor: pointer; }

/* ══ POLLS ══ */

.poll-option-input {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 6px;
}
.poll-option-input input { flex: 1; }
.poll-option-input button {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--r-full);
    color: var(--text-600); font-size: 0.6875rem;
}
.poll-option-input button:hover { background: var(--danger-bg); color: var(--danger); }

/* ══ XP LEADERBOARD ══ */

.leaderboard-item {
    display: flex; align-items: center; gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-lg);
    background: var(--bg-raised);
    margin-bottom: 6px;
    transition: background var(--t-fast);
}
.leaderboard-item:hover { background: var(--bg-hover); }

.leaderboard-rank {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: 800; color: var(--text-500);
    flex-shrink: 0;
}
.leaderboard-item:nth-child(1) .leaderboard-rank { color: var(--accent-gold); font-size: 1.2rem; }
.leaderboard-item:nth-child(2) .leaderboard-rank { color: var(--text-400); font-size: 1.1rem; }
.leaderboard-item:nth-child(3) .leaderboard-rank { color: #CD7F32; font-size: 1.05rem; }
.leaderboard-item .lb-name { flex: 1; font-weight: 600; color: var(--text-200); font-size: 0.875rem; }

/* ══ XP BARS ══ */

.xp-bar-mini {
    width: 100%; height: 5px;
    background: var(--bg-deep);
    border-radius: var(--r-full);
    overflow: hidden; margin-top: 4px;
}
.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--accent-sky));
    border-radius: var(--r-full);
    transition: width 0.5s var(--ease-spring);
    min-width: 2px;
}

/* ══ PROFILE USER NOTE ══ */

.profile-note-input {
    width: 100%; min-height: 56px;
    padding: 8px var(--s-3);
    background: var(--bg-deep);
    border: 1px solid var(--border-faint);
    border-radius: var(--r-md);
    color: var(--text-300);
    font-size: 0.8125rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color var(--t-fast);
}
.profile-note-input:focus { border-color: var(--brand); outline: none; }
.profile-note-input::placeholder { color: var(--text-600); }

/* ══ DRAG & DROP OVERLAY ══ */

.drag-over { position: relative; }
.drag-over::after {
    content: 'Drop file to upload';
    position: absolute; inset: 0;
    background: rgba(124, 58, 237, 0.12);
    border: 2px dashed var(--brand);
    border-radius: var(--r-xl);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.125rem; font-weight: 700;
    color: var(--brand-light);
    z-index: 100;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

/* ══ LOADING SPINNER (component) ══ */

.loading-spinner {
    display: flex; align-items: center; justify-content: center;
    padding: var(--s-8);
    color: var(--text-500);
    font-size: 1.5rem;
    animation: spin 1s linear infinite;
}

/* ══════════════════════════════════════════════ */
/*  GAME COMPONENTS                               */
/* ══════════════════════════════════════════════ */

.game-panel {
    padding: var(--s-4);
    background: rgba(10, 10, 18, 0.9);
    border-bottom: 1px solid var(--border-faint);
    backdrop-filter: blur(12px);
}

.game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--s-4);
    border-radius: var(--r-xl);
    background: rgba(12, 12, 20, 0.8);
    border: 1px solid var(--border-subtle);
}

.game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--s-3);
    border-bottom: 1px solid var(--border-faint);
    margin-bottom: var(--s-4);
}

.game-header h3 { color: var(--text-100); font-size: 1rem; }

.game-status {
    font-size: 0.8rem;
    color: var(--text-400);
    padding: 4px 12px;
    border-radius: var(--r-full);
    background: var(--bg-overlay);
}

/* Playing Cards */
.playing-card {
    width: 70px;
    height: 100px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    border: 2px solid var(--border-muted);
    background: var(--bg-raised);
    color: var(--text-100);
    flex-shrink: 0;
    transition: transform 0.2s var(--ease-spring);
    cursor: pointer;
    position: relative;
}

.playing-card:hover { transform: translateY(-4px); }
.playing-card.red { color: #EF4444; }
.playing-card.black { color: var(--text-200); }
.playing-card.face-down {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: white;
    font-size: 1.5rem;
}

.card-hand {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    padding: var(--s-3) 0;
}

/* Blackjack Table */
.bj-table {
    text-align: center;
    padding: var(--s-4);
}

.bj-dealer, .bj-player {
    margin-bottom: var(--s-4);
}

.bj-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-500);
    margin-bottom: var(--s-2);
}

.bj-total {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-100);
    margin-top: var(--s-2);
}

.bj-actions {
    display: flex;
    gap: var(--s-2);
    justify-content: center;
    margin-top: var(--s-3);
}

/* UNO Table */
.uno-table {
    text-align: center;
    padding: var(--s-4);
}

.uno-pile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-4);
    margin-bottom: var(--s-4);
}

.uno-card {
    width: 70px;
    height: 100px;
    border-radius: var(--r-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.4rem;
    border: 2px solid rgba(255,255,255,0.15);
    cursor: pointer;
    transition: transform 0.2s var(--ease-spring);
    flex-shrink: 0;
}

.uno-card:hover { transform: translateY(-6px) scale(1.05); }
.uno-card.red { background: #DC2626; color: white; }
.uno-card.blue { background: #2563EB; color: white; }
.uno-card.green { background: #16A34A; color: white; }
.uno-card.yellow { background: #D97706; color: white; }
.uno-card.wild { background: linear-gradient(135deg, #DC2626, #2563EB, #16A34A, #D97706); color: white; }

.uno-color-picker {
    display: flex;
    gap: var(--s-2);
    justify-content: center;
    margin-top: var(--s-3);
}

.uno-color-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--r-full);
    border: 2px solid rgba(255,255,255,0.2);
    cursor: pointer;
    transition: transform 0.15s;
}

.uno-color-btn:hover { transform: scale(1.2); }

/* Trivia Board */
.trivia-board {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--s-4);
}

.trivia-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-100);
    text-align: center;
    margin-bottom: var(--s-5);
    line-height: 1.5;
}

.trivia-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-3);
}

.trivia-option {
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-raised);
    color: var(--text-300);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.trivia-option:hover {
    border-color: var(--brand);
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-100);
}

.trivia-option.correct {
    border-color: var(--success);
    background: var(--success-bg);
    color: var(--success);
}

.trivia-option.incorrect {
    border-color: var(--danger);
    background: var(--danger-bg);
    color: var(--danger);
}

.trivia-progress {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-bottom: var(--s-4);
}

.trivia-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--r-full);
    background: var(--bg-overlay);
}

.trivia-dot.answered { background: var(--brand); }
.trivia-dot.current { background: var(--brand-light); box-shadow: 0 0 6px var(--brand-glow); }

/* Higher/Lower Board */
.hl-board {
    text-align: center;
    padding: var(--s-5);
}

.hl-cards {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-6);
    margin-bottom: var(--s-5);
}

.hl-vs {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-500);
}

.hl-actions {
    display: flex;
    gap: var(--s-3);
    justify-content: center;
}

.hl-score {
    font-size: 2rem;
    font-weight: 900;
    color: var(--brand-light);
    margin-bottom: var(--s-2);
}

.hl-streak {
    font-size: 0.85rem;
    color: var(--text-400);
}

/* Game Launcher Grid */
.game-launcher-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-3);
}

.game-launcher-card {
    padding: var(--s-4);
    border-radius: var(--r-xl);
    border: 1px solid var(--border-subtle);
    background: var(--bg-raised);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.game-launcher-card:hover {
    border-color: var(--brand);
    background: rgba(139, 92, 246, 0.08);
    transform: translateY(-2px);
}

.game-launcher-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--s-3);
    font-size: 1.3rem;
    color: white;
}

.game-launcher-name {
    font-weight: 700;
    color: var(--text-100);
    margin-bottom: 4px;
}

.game-launcher-desc {
    font-size: 0.75rem;
    color: var(--text-500);
}

/* Game Scoreboard */
.game-scoreboard {
    display: flex;
    gap: var(--s-3);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--s-4);
    padding-top: var(--s-3);
    border-top: 1px solid var(--border-faint);
}

.game-score-item {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    padding: 4px 12px;
    border-radius: var(--r-full);
    background: var(--bg-overlay);
    font-size: 0.8rem;
}

.game-score-name { color: var(--text-300); font-weight: 600; }
.game-score-value { color: var(--brand-light); font-weight: 800; }

/* ══════════════════════════════════════════════ */
/*  EMOJI PICKER ENHANCEMENTS                     */
/* ══════════════════════════════════════════════ */

.emoji-picker-tabs {
    display: flex;
    gap: 2px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-faint);
    background: var(--bg-deepest);
}

.emoji-tab {
    flex: 1;
    padding: 6px;
    border: none;
    border-radius: var(--r-md);
    background: transparent;
    color: var(--text-500);
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.15s;
}

.emoji-tab:hover { background: var(--bg-overlay); color: var(--text-300); }
.emoji-tab.active { background: var(--brand); color: white; }

.custom-emote img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    image-rendering: auto;
}

.sticker-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    padding: 8px !important;
}

.sticker-item {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--r-lg);
    border: 1px solid var(--border-faint);
    background: var(--bg-raised);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.15s, border-color 0.15s;
}

.sticker-item:hover {
    transform: scale(1.05);
    border-color: var(--brand);
}

.sticker-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Emote management in server settings */
.emote-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: var(--s-3);
}

.emote-card {
    position: relative;
    padding: var(--s-3);
    border-radius: var(--r-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-raised);
    text-align: center;
    transition: border-color 0.15s;
}

.emote-card:hover { border-color: var(--brand); }

.emote-card img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 4px;
}

.emote-card .emote-name {
    font-size: 0.7rem;
    color: var(--text-500);
    word-break: break-all;
}

.emote-card .emote-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    border-radius: var(--r-full);
    background: var(--danger);
    color: white;
    border: none;
    font-size: 0.6rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.emote-card:hover .emote-delete { display: flex; }
