/* =========================================
   CHORD — Discord-like Messenger UI
   ========================================= */

   *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  :root {
    --bg-darkest:   #1a1c20;
    --bg-dark:      #22252b;
    --bg-mid:       #2c2f36;
    --bg-light:     #36393f;
    --bg-hover:     #3d4148;
    --bg-active:    #44474f;
    --accent:       #5865f2;
    --accent-hover: #4752c4;
    --text-primary: #dcddde;
    --text-secondary: #96989d;
    --text-muted:   #72767d;
    --teal:         #4fa3c4;
    --green:        #3ba55c;
    --online:       #3ba55c;
    --radius:       8px;
    --transition:   0.15s ease;
  }
  
  html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-darkest);
  }
  
  body {
    display: flex;
    height: 100vh;
  }
  
  /* ====== SCROLLBAR ====== */
  ::-webkit-scrollbar { width: 4px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 4px; }
  
  /* ====== SERVERS ====== */
  .servers {
    width: 72px;
    min-width: 72px;
    background: var(--bg-darkest);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    gap: 8px;
    overflow-y: auto;
    z-index: 10;
  }
  
  .server-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 13px;
    transition: border-radius var(--transition), background var(--transition), color var(--transition);
    position: relative;
    user-select: none;
  }
  
  .server-icon::before {
    content: '';
    position: absolute;
    left: -16px;
    width: 4px;
    height: 0;
    background: var(--text-primary);
    border-radius: 0 4px 4px 0;
    transition: height var(--transition);
  }
  
  .server-icon:hover {
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
  }
  
  .server-icon:hover::before {
    height: 20px;
  }
  
  .server-icon.active {
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
  }
  
  .server-icon.active::before {
    height: 40px;
  }
  
  .server-icon.add {
    background: var(--bg-mid);
    color: var(--green);
  }
  
  .server-icon.add:hover {
    background: var(--green);
    color: #fff;
  }
  
  .server-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    margin-top: auto;
    font-size: 16px;
  }
  
  .divider {
    width: 32px;
    height: 2px;
    background: var(--bg-light);
    border-radius: 1px;
    margin: 4px 0;
  }
  
  /* ====== CHANNELS SIDEBAR ====== */
  .channels {
    width: 240px;
    min-width: 240px;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  
  .channels-top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 12px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  
  .btn-add-track {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-mid);
    border: none;
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    transition: background var(--transition);
  }
  
  .btn-add-track:hover {
    background: var(--bg-light);
  }
  
  .search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 12px;
    background: var(--bg-mid);
    border-radius: var(--radius);
    padding: 7px 10px;
    color: var(--text-muted);
  }
  
  .search-bar input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
  }
  
  .search-bar input::placeholder { color: var(--text-muted); }
  
  .channel-nav {
    display: flex;
    flex-direction: column;
    padding: 0 8px;
    gap: 2px;
  }
  
  .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
  }
  
  .nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
  }
  
  .nav-item.active {
    background: var(--bg-active);
    color: var(--text-primary);
  }
  
  /* DM Section */
  .dm-section {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
  }
  
  .dm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px 4px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  
  .dm-list {
    padding: 0;
    padding-left: 8px;
    position: relative;
  }
  .dm-list::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 8px;
    width: 2px;
    background: rgba(255,255,255,0.08);
    border-radius: 1px;
  }
  
  .dm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 12px;
    margin: 0;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    position: relative;
  }
  .dm-item::before {
    content: '';
    display: block;
    width: 8px;
    height: 2px;
    background: rgba(255,255,255,0.12);
    flex-shrink: 0;
    border-radius: 1px;
    margin-right: -2px;
  }
  .dm-item:hover { background: rgba(255,255,255,0.04); }
  .dm-item:hover::before { background: rgba(255,255,255,0.3); }
  .dm-item.active { background: rgba(88,101,242,0.15); }
  .dm-item.active::before { background: var(--accent); }
  
  .dm-info { display: flex; flex-direction: column; }
  .dm-name { font-weight: 600; font-size: 13px; }
  
  /* User panel */
  .user-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--bg-darkest);
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  
  .user-info { display: flex; align-items: center; gap: 8px; }
  
  .user-text {
    display: flex;
    flex-direction: column;
  }
  
  .user-name { font-weight: 700; font-size: 13px; }
  .user-status { font-size: 11px; color: var(--green); }
  
  .user-actions { display: flex; gap: 4px; }
  
  /* ====== AVATAR ====== */
  .avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    color: #fff;
    user-select: none;
  }
  
  .avatar-teal { background: var(--teal); }
  .avatar-yd { background: linear-gradient(135deg, #1a1a2e, #3d3d5c); border: 2px solid #666; }
  .avatar-green { background: var(--green); }
  .avatar-purple { background: #9b59b6; }
  
  .user-avatar { width: 32px; height: 32px; min-width: 32px; font-size: 12px; }
  
  /* ====== BUTTONS ====== */
  .btn-icon {
    background: var(--bg-light);
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
  }
  
  .btn-icon:hover { background: var(--bg-active); color: var(--text-primary); }
  
  .btn-icon-sm {
    background: none;
    border: none;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
  }
  
  .btn-icon-sm:hover { background: var(--bg-hover); color: var(--text-primary); }
  
  /* ====== MAIN CHAT ====== */
  .chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-mid);
    overflow: hidden;
    position: relative;
  }
  
  /* Chat header */
  .chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 56px;
    min-height: 56px;
    background: var(--bg-mid);
    border-bottom: 1px solid rgba(0,0,0,0.2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 5;
  }
  
  .chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .chat-title {
    font-weight: 700;
    font-size: 15px;
  }
  
  .chat-header-right {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  
  .search-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-dark);
    border-radius: var(--radius);
    padding: 5px 10px;
    color: var(--text-muted);
    margin: 0 4px;
  }
  
  .search-inline input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    width: 120px;
  }
  
  .search-inline input::placeholder { color: var(--text-muted); }
  
  /* Messages */
  .messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  
  .msg-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 4px 8px;
    border-radius: var(--radius);
    transition: background var(--transition);
    opacity: 0;
    transform: translateY(6px);
    animation: fadeInUp 0.25s ease forwards;
  }
  
  .msg-group:nth-child(1) { animation-delay: 0.05s; }
  .msg-group:nth-child(2) { animation-delay: 0.10s; }
  .msg-group:nth-child(3) { animation-delay: 0.15s; }
  .msg-group:nth-child(4) { animation-delay: 0.20s; }
  .msg-group:nth-child(5) { animation-delay: 0.25s; }
  .msg-group:nth-child(6) { animation-delay: 0.30s; }
  .msg-group:nth-child(7) { animation-delay: 0.35s; }
  
  @keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
  }
  
  .msg-group:hover { background: rgba(0,0,0,0.1); }
  
  .msg-content { display: flex; flex-direction: column; gap: 2px; }
  
  .msg-meta {
    display: flex;
    align-items: baseline;
    gap: 8px;
  }
  
  .msg-author {
    font-weight: 700;
    font-size: 14px;
  }
  
  .msg-time {
    font-size: 11px;
    color: var(--text-muted);
  }
  
  .msg-text {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
  }
  
  /* Chat input */
  .chat-input-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 16px;
    background: var(--bg-light);
    border-radius: var(--radius);
    overflow: hidden;
  }
  
  .btn-attach {
    background: none;
    border: none;
    color: var(--text-muted);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color var(--transition);
    flex-shrink: 0;
  }
  
  .btn-attach:hover { color: var(--text-primary); }
  
  .chat-input-inner {
    flex: 1;
  }
  
  .chat-input-inner input {
    width: 100%;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    padding: 12px 0;
  }
  
  .chat-input-inner input::placeholder { color: var(--text-muted); }
  
  .chat-input-actions {
    display: flex;
    align-items: center;
    padding-right: 8px;
    gap: 2px;
  }
  
  .chat-input-actions .btn-icon-sm {
    color: var(--text-muted);
  }
  
  /* ====== PROFILE SIDEBAR ====== */
  .profile {
    width: 260px;
    min-width: 260px;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    transition: width 0.25s cubic-bezier(.4,0,.2,1), min-width 0.25s cubic-bezier(.4,0,.2,1);
  }
  
  .profile.hidden {
    width: 0;
    min-width: 0;
  }
  
  .profile-banner {
    height: 80px;
    background: linear-gradient(135deg, #1a1a3e 0%, #2d2d5e 50%, #1a3a2e 100%);
    flex-shrink: 0;
  }
  
  .profile-header {
    position: relative;
    padding: 0 12px 12px;
    flex-shrink: 0;
  }
  
  .profile-actions {
    position: absolute;
    top: 8px;
    right: 12px;
    display: flex;
    gap: 4px;
  }
  
  .profile-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-top: -24px;
  }
  
  .profile-big-avatar {
    width: 72px !important;
    height: 72px !important;
    min-width: 72px !important;
    font-size: 22px !important;
    border: 4px solid var(--bg-dark);
  }
  
  .online-dot {
    position: absolute;
    bottom: 4px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: var(--online);
    border-radius: 50%;
    border: 3px solid var(--bg-dark);
  }
  
  .profile-body {
    padding: 0 12px 12px;
  }
  
  .profile-username {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 2px;
  }
  
  .profile-tag {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
  }
  
  .profile-card {
    background: var(--bg-mid);
    border-radius: var(--radius);
    overflow: hidden;
  }
  
  .mt-8 { margin-top: 8px; }
  
  .profile-card-section {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }
  
  .profile-card-section:last-child { border-bottom: none; }
  
  .profile-card-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    margin-bottom: 4px;
  }
  
  .profile-card-value {
    font-size: 13px;
    color: var(--text-primary);
  }
  
  .games-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
  }
  
  .game-icon {
    width: 44px;
    height: 44px;
    background: var(--bg-light);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    color: var(--text-muted);
    cursor: pointer;
    transition: background var(--transition);
  }
  
  .game-icon:hover { background: var(--bg-active); }
  
  /* ====== RESPONSIVE / MISC ====== */
  @media (max-width: 900px) {
    .profile { display: none; }
  }
  
  @media (max-width: 650px) {
    .channels { display: none; }
  }
  
  /* ====== PROFILE OVERLAY ====== */
  .clickable {
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 6px;
    margin-left: -6px;
    transition: background var(--transition), color var(--transition);
  }
  .clickable:hover {
    background: var(--bg-hover);
    color: #fff;
  }
  
  .profile-overlay {
    position: absolute;
    inset: 0;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  
  .profile-overlay.open {
    opacity: 1;
    pointer-events: all;
  }
  
  .profile-overlay-backdrop {
    display: none;
  }
  
  .profile-overlay-inner {
    position: absolute;
    inset: 0;
    background: var(--bg-mid);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transform: translateY(10px);
    transition: transform 0.2s ease;
  }
  
  .profile-overlay.open .profile-overlay-inner {
    transform: translateY(0);
  }
  
  .profile-overlay-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--bg-active);
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
  }
  
  .profile-overlay-close:hover { background: #ed4245; color: #fff; }
  
  .profile-overlay-banner {
    height: 160px;
    background: linear-gradient(135deg, #1a1a3e 0%, #2d2d5e 50%, #1a3a2e 100%);
    flex-shrink: 0;
  }
  
  .profile-overlay-header {
    padding: 0 32px 0;
    position: relative;
    flex-shrink: 0;
  }
  
  .profile-overlay-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-top: -48px;
  }
  
  .profile-overlay-avatar {
    width: 96px !important;
    height: 96px !important;
    min-width: 96px !important;
    font-size: 28px !important;
    border: 6px solid var(--bg-mid);
  }
  
  .profile-overlay .online-dot {
    width: 20px;
    height: 20px;
    bottom: 6px;
    right: 4px;
    border-width: 4px;
  }
  
  .profile-overlay-body {
    padding: 16px 32px 40px;
    max-width: 520px;
  }
  
  .profile-overlay-name {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
  }
  
  .profile-overlay-tag {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 6px;
  }
  
  .profile-overlay-status {
    font-size: 13px;
    color: var(--green);
    font-weight: 600;
    margin-bottom: 20px;
  }
  
  .profile-overlay-status.idle { color: #faa81a; }
  .profile-overlay-status.offline { color: var(--text-muted); }
  
  .profile-overlay-divider {
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin-bottom: 20px;
  }
  
  .profile-overlay-section {
    margin-bottom: 20px;
  }
  
  .profile-overlay-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    margin-bottom: 6px;
  }
  
  .profile-overlay-value {
    font-size: 14px;
    color: var(--text-primary);
  }
  
  .btn-send-msg {
    margin-top: 8px;
    background: var(--accent);
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
  }
  
  .btn-send-msg:hover { background: var(--accent-hover); }
  
  /* Toggle profile button active state */
  #toggleProfileBtn.active {
    background: var(--bg-active);
    color: var(--text-primary);
  }
  
  /* Profile sidebar close button */
  .profile-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
    background: var(--bg-active);
    border: none;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
  }
  .profile-close-btn:hover { background: #ed4245; color: #fff; }
  
  /* ====== DEPRESSION STATUS ====== */
  .status-depression { color: #9b59b6 !important; }
  .status-online { color: var(--green); }
  .status-idle { color: #faa81a; }
  .status-offline { color: var(--text-muted); }
  
  /* ====== OVERLAY BIO ====== */
  .profile-overlay-bio {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
  }
  
  /* ====== EDIT PROFILE BUTTON ====== */
  .btn-edit-profile {
    margin-top: 8px;
    background: var(--bg-active);
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
    width: 100%;
  }
  .btn-edit-profile:hover { background: var(--bg-hover); }
  
  /* ====== EDIT PROFILE MODAL ====== */
  .edit-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  
  .edit-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%);
    width: 440px;
    max-width: 95vw;
    max-height: 90vh;
    background: var(--bg-dark);
    border-radius: 12px;
    z-index: 201;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    overflow: hidden;
  }
  
  .edit-modal.open,
  .edit-modal.open ~ .edit-modal-backdrop,
  .edit-modal-backdrop:has(~ .edit-modal.open) {
    opacity: 1;
    pointer-events: all;
  }
  
  /* Simpler approach — control backdrop via JS class on body */
  .edit-modal.open { opacity: 1; pointer-events: all; transform: translate(-50%, -50%); }
  .edit-modal.open + * { opacity: 1; }
  
  .edit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
  }
  
  .edit-modal-body {
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  
  .edit-avatar-section {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  
  .edit-avatar-preview {
    width: 72px !important;
    height: 72px !important;
    min-width: 72px !important;
    font-size: 22px !important;
    flex-shrink: 0;
  }
  
  .edit-avatar-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .btn-upload {
    background: var(--accent);
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
  }
  .btn-upload:hover { background: var(--accent-hover); }
  
  .btn-remove-photo {
    background: none;
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition);
  }
  .btn-remove-photo:hover { border-color: #ed4245; color: #ed4245; }
  
  .edit-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  
  .edit-field label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
  }
  
  .edit-field input,
  .edit-field textarea {
    background: var(--bg-mid);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    padding: 9px 12px;
    outline: none;
    transition: border-color var(--transition);
    resize: none;
  }
  
  .edit-field input:focus,
  .edit-field textarea:focus {
    border-color: var(--accent);
  }
  
  /* Status radio options */
  .status-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .status-option {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-mid);
    border: 2px solid transparent;
    border-radius: var(--radius);
    padding: 7px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: border-color var(--transition), color var(--transition);
  }
  
  .status-option input[type="radio"] { display: none; }
  
  .status-option:has(input:checked) {
    border-color: var(--accent);
    color: var(--text-primary);
  }
  
  .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
  }
  
  .edit-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
  }
  
  .btn-cancel {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: color var(--transition);
  }
  .btn-cancel:hover { color: var(--text-primary); }
  
  .btn-save {
    background: var(--accent);
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    padding: 9px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
  }
  .btn-save:hover { background: var(--accent-hover); }
  
  /* ====== SHOP ====== */
  .shop-section {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
  }
  
  .shop-coins {
    font-size: 12px;
    font-weight: 700;
    color: #f0c040;
    background: rgba(240,192,64,0.12);
    padding: 3px 8px;
    border-radius: 12px;
  }
  
  .shop-list {
    display: flex;
    flex-direction: column;
    padding: 4px 8px 16px;
    gap: 4px;
  }
  
  .shop-category {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 12px 8px 4px;
  }
  
  .shop-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius);
    background: var(--bg-mid);
    transition: background var(--transition);
    cursor: default;
  }
  
  .shop-item:hover { background: var(--bg-light); }
  
  .shop-item-preview {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .shop-avatar-demo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a2e, #3d3d5c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: #aaa;
  }
  
  /* Border previews */
  .border-galaxy-preview {
    background: conic-gradient(#a78bfa, #60a5fa, #34d399, #a78bfa);
    padding: 3px;
  }
  .border-galaxy-preview .shop-avatar-demo { width: 100%; height: 100%; }
  
  .border-fire-preview {
    background: conic-gradient(#ef4444, #f97316, #fbbf24, #ef4444);
    padding: 3px;
  }
  .border-fire-preview .shop-avatar-demo { width: 100%; height: 100%; }
  
  .border-rainbow-preview {
    background: conic-gradient(#f43f5e,#f97316,#eab308,#22c55e,#3b82f6,#a855f7,#f43f5e);
    padding: 3px;
    animation: spin 3s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  .border-rainbow-preview .shop-avatar-demo {
    animation: spin-reverse 3s linear infinite;
  }
  @keyframes spin-reverse { to { transform: rotate(-360deg); } }
  
  /* Pet previews */
  .pet-preview {
    background: var(--bg-light);
    font-size: 22px;
  }
  .shop-pet-emoji { line-height: 1; }
  
  .shop-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }
  
  .shop-item-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
  }
  
  .shop-item-desc {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .shop-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
  }
  
  .shop-item-price {
    font-size: 11px;
    font-weight: 700;
    color: #f0c040;
  }
  
  .btn-buy {
    background: var(--accent);
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition);
    white-space: nowrap;
  }
  .btn-buy:hover { background: var(--accent-hover); }
  .btn-buy.owned {
    background: var(--bg-active);
    color: var(--text-muted);
    cursor: default;
  }
  .btn-buy.owned:hover { background: var(--bg-active); }
  
  /* Toast notification */
  .shop-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #23a55a;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 20px;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    white-space: nowrap;
  }
  .shop-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  .shop-toast.error { background: #ed4245; }
  
  /* ====== EQUIP GRID IN EDIT MODAL ====== */
  .equip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
  }
  
  .equip-item {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color var(--transition), transform var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }
  
  .equip-item:hover { transform: scale(1.08); }
  .equip-item.active { border-color: var(--accent); }
  
  .equip-none {
    background: var(--bg-light);
    border-style: dashed;
    border-color: var(--text-muted);
  }
  .equip-none.active { border-color: var(--accent); border-style: solid; }
  
  .equip-preview-none {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
  }
  
  /* Border previews in equip grid */
  .equip-border-wrap {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
  }
  .equip-border-galaxy { background: conic-gradient(#a78bfa,#60a5fa,#34d399,#a78bfa); }
  .equip-border-fire    { background: conic-gradient(#ef4444,#f97316,#fbbf24,#ef4444); }
  .equip-border-rainbow { background: conic-gradient(#f43f5e,#f97316,#eab308,#22c55e,#3b82f6,#a855f7,#f43f5e); animation: spin 3s linear infinite; }
  
  .equip-border-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg,#1a1a2e,#3d3d5c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    color: #aaa;
    animation: spin-reverse 3s linear infinite;
  }
  .equip-border-galaxy .equip-border-inner,
  .equip-border-fire   .equip-border-inner { animation: none; }
  
  /* Pet previews in equip grid */
  .equip-pet-wrap {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
  }
  
  .equip-empty {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    display: none;
  }
  
  /* Active equipped border on real avatars */
  .avatar-border-galaxy { box-shadow: 0 0 0 3px transparent; background-clip: padding-box; outline: 3px solid; outline-offset: 2px; border-radius: 50%; animation: rainbow-border 3s linear infinite; }
  @keyframes rainbow-border {
    0%   { outline-color: #a78bfa; }
    33%  { outline-color: #60a5fa; }
    66%  { outline-color: #34d399; }
    100% { outline-color: #a78bfa; }
  }
  .avatar-border-fire { outline: 3px solid #f97316; outline-offset: 2px; border-radius: 50%; }
  .avatar-border-rainbow { outline: 3px solid transparent; outline-offset: 2px; border-radius: 50%; animation: rainbow-border 1s linear infinite; }
  
  /* Pet badge on avatar */
  .avatar-wrap { position: relative; display: inline-flex; }
  .avatar-pet-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 14px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
  }
  
  /* ====== HOME SCREEN ====== */
  .home-screen {
    position: absolute;
    inset: 0;
    z-index: 50;
    background: var(--bg-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
  }
  
  .home-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 24px;
    max-width: 480px;
    width: 100%;
    animation: fadeInUp 0.3s ease forwards;
  }
  
  .home-logo {
    font-size: 64px;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 16px rgba(88,101,242,0.4));
    animation: float 3s ease-in-out infinite;
  }
  
  @keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
  }
  
  .home-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
  }
  
  .home-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 28px;
    line-height: 1.5;
  }
  
  .home-divider {
    width: 100%;
    height: 1px;
    background: rgba(255,255,255,0.07);
    margin-bottom: 20px;
  }
  
  .home-friends-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 12px;
    align-self: flex-start;
  }
  
  .home-friend-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-bottom: 24px;
  }
  
  .home-friend-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-dark);
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    border: 1px solid rgba(255,255,255,0.05);
  }
  
  .home-friend-card:hover {
    background: var(--bg-light);
    transform: translateX(4px);
  }
  
  .home-friend-avatar-wrap {
    position: relative;
    flex-shrink: 0;
  }
  
  .home-friend-avatar {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    font-size: 14px !important;
  }
  
  .home-friend-avatar-wrap .online-dot {
    position: absolute;
    bottom: -2px;
    right: -2px;
  }
  
  .home-friend-avatar-wrap .avatar-pet-badge {
    position: absolute;
    bottom: -6px;
    right: -6px;
  }
  
  .home-friend-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  
  .home-friend-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
  }
  
  .home-friend-status {
    font-size: 12px;
    font-weight: 600;
  }
  .home-friend-status.online  { color: var(--green); }
  .home-friend-status.idle    { color: #faa81a; }
  .home-friend-status.offline { color: var(--text-muted); }
  .home-friend-status.depression { color: #9b59b6; }
  
  .home-friend-btn {
    background: var(--accent);
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 7px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
  }
  .home-friend-btn:hover { background: var(--accent-hover); }
  
  .home-tip {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-dark);
    border-radius: var(--radius);
    padding: 10px 16px;
    line-height: 1.5;
    border: 1px solid rgba(255,255,255,0.05);
  }
  
  /* ====== DM LIST UPGRADES ====== */
  .dm-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
  }
  .dm-status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
  }
  .dm-status-text {
    font-size: 11px;
    font-weight: 500;
  }
  .dm-status-text.online     { color: var(--green); }
  .dm-status-text.idle       { color: #faa81a; }
  .dm-status-text.offline    { color: var(--text-muted); }
  .dm-status-text.depression { color: #9b59b6; }
  
  /* ====== SERVER PANEL ====== */
  .server-panel {
    display: flex;
    background: var(--bg-dark);
    border-right: 1px solid rgba(0,0,0,0.2);
  }
  
  .server-panel-channels {
    width: 220px;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,0.04);
  }
  
  .server-name-header {
    padding: 16px 16px 12px;
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .channel-category {
    padding: 12px 0 2px 12px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
  }
  
  /* Vertical line container for channels under this category */
  .channel-group {
    position: relative;
    padding-left: 20px;
    margin-bottom: 4px;
  }
  .channel-group::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 8px;
    width: 2px;
    background: rgba(255,255,255,0.08);
    border-radius: 1px;
  }
  
  .channel-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 12px;
    margin: 0;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    transition: color var(--transition), background var(--transition);
    position: relative;
    border-radius: 0 6px 6px 0;
  }
  .channel-item:hover  { color: var(--text-secondary); background: rgba(255,255,255,0.04); }
  .channel-item.active { color: var(--text-primary); background: rgba(88,101,242,0.15); }
  
  /* The ─ connector */
  .channel-item::before {
    content: '';
    display: block;
    width: 8px;
    height: 2px;
    background: rgba(255,255,255,0.15);
    flex-shrink: 0;
    border-radius: 1px;
  }
  .channel-item:hover::before  { background: rgba(255,255,255,0.3); }
  .channel-item.active::before { background: var(--accent); }
  
  .channel-hash { display: none; }
  .channel-item.voice .channel-hash { display: none; }
  
  /* Members sidebar */
  .server-panel-members {
    width: 200px;
    min-width: 200px;
    overflow-y: auto;
    padding-bottom: 16px;
  }
  
  .members-header {
    padding: 16px 12px 8px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
  }
  
  .member-category {
    padding: 8px 12px 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
  }
  
  .member-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 8px;
    margin: 1px 4px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition);
  }
  .member-item:hover { background: var(--bg-hover); }
  
  .member-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
  }
  
  .member-avatar {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    font-size: 11px !important;
  }
  
  .member-status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
  }
  
  .member-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
  .member-name { font-size: 13px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .member-item:hover .member-name { color: var(--text-primary); }
  .member-role { font-size: 10px; color: var(--text-muted); }
  
  /* ====== VOICE CHANNEL SCREEN ====== */
  .voice-screen {
    position: absolute;
    inset: 0;
    z-index: 40;
    background: var(--bg-mid);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 32px;
  }
  
  .voice-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
  }
  
  .voice-icon { font-size: 28px; }
  .voice-title { color: var(--text-primary); }
  
  .voice-members-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    max-width: 600px;
  }
  
  .voice-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  
  .voice-avatar-wrap {
    position: relative;
    display: inline-flex;
  }
  
  .voice-avatar {
    width: 72px !important;
    height: 72px !important;
    min-width: 72px !important;
    font-size: 20px !important;
  }
  
  .voice-speaking-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 3px solid var(--green);
    opacity: 0;
    animation: speaking-pulse 2s ease-in-out infinite;
  }
  
  .voice-member:nth-child(odd) .voice-speaking-ring  { animation-delay: 0s; opacity: 0.7; }
  .voice-member:nth-child(even) .voice-speaking-ring { animation-delay: 1s; }
  
  @keyframes speaking-pulse {
    0%, 100% { opacity: 0; transform: scale(1); }
    50%       { opacity: 0.7; transform: scale(1.05); }
  }
  
  .voice-member-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
  }
  
  .voice-mic-icon { font-size: 14px; }
  
  .voice-controls {
    display: flex;
    gap: 12px;
  }
  
  .voice-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--bg-light);
    font-size: 22px;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .voice-btn:hover { background: var(--bg-active); transform: scale(1.1); }
  .voice-btn.muted { background: #ed424533; }
  .voice-btn.leave { background: #ed424533; }
  .voice-btn.leave:hover { background: #ed4245; }
  
  /* ====== VOICE CHANNEL IN LIST ====== */
  .channel-item.voice {
    flex-wrap: wrap;
    gap: 4px 8px;
  }
  
  .channel-name-text { flex: 1; }
  
  .vc-mini-avatars {
    display: flex;
    margin-left: auto;
  }
  
  .vc-mini-avatar {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    font-size: 7px !important;
    margin-left: -4px;
    border: 1px solid var(--bg-dark);
  }
  
  .vc-count {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
  }
  
  /* ====== MEMBERS PANEL UPGRADES ====== */
  .members-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 12px 8px;
  }
  
  .btn-toggle-members {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color var(--transition), background var(--transition);
    display: flex;
    align-items: center;
  }
  .btn-toggle-members:hover { color: var(--text-primary); background: var(--bg-hover); }
  
  .collapsible { user-select: none; }
  .member-cat-arrow { font-size: 10px; margin-right: 4px; }
  .offline-member { opacity: 0.5; }
  .member-group { margin-bottom: 4px; }
  .members-group-list { transition: none; }
  
  /* ====== MUSIC SEARCH PANEL ====== */
  .music-search-panel {
    margin: 0 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  
  .music-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-mid);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 7px 10px;
    animation: fadeInUp 0.15s ease;
  }
  
  .music-search-bar input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    min-width: 0;
  }
  .music-search-bar input::placeholder { color: var(--text-muted); }
  
  .music-search-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: color var(--transition);
    flex-shrink: 0;
  }
  .music-search-close:hover { color: #ed4245; }
  
  .music-results {
    background: var(--bg-mid);
    border-radius: var(--radius);
    overflow: hidden;
    max-height: 260px;
    overflow-y: auto;
  }
  
  .music-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }
  .music-result-item:last-child { border-bottom: none; }
  .music-result-item:hover { background: var(--bg-light); }
  
  .music-result-cover {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--bg-active);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
  }
  
  .music-result-info { flex: 1; min-width: 0; }
  .music-result-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .music-result-artist {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .music-result-add {
    background: var(--accent);
    border: none;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition);
  }
  .music-result-add:hover { background: var(--accent-hover); }
  
  .music-searching {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
  }
  
  /* ====== NOW PLAYING BAR ====== */
  .now-playing-bar {
    margin: 0 8px 8px;
    background: linear-gradient(135deg, #1e1e3a, #2a1a2e);
    border-radius: var(--radius);
    padding: 8px 10px;
    border: 1px solid rgba(88,101,242,0.3);
    animation: fadeInUp 0.2s ease;
  }
  
  .now-playing-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }
  
  .now-playing-cover {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--bg-active);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    animation: spin 4s linear infinite paused;
  }
  .now-playing-bar.playing .now-playing-cover { animation-play-state: running; }
  
  .now-playing-text { flex: 1; min-width: 0; }
  .now-playing-title {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .now-playing-artist {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .now-playing-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
  }
  
  .np-btn {
    background: rgba(255,255,255,0.08);
    border: none;
    color: var(--text-primary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), transform var(--transition);
  }
  .np-btn:hover { background: rgba(255,255,255,0.15); transform: scale(1.1); }
  .np-play {
    width: 34px;
    height: 34px;
    background: var(--accent);
    font-size: 13px;
  }
  .np-play:hover { background: var(--accent-hover); }
  
  /* ============================
     SETTINGS MODAL
     ============================ */
  .settings-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 300;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .settings-modal {
    position: fixed; inset: 0;
    z-index: 301;
    display: flex;
    opacity: 0; pointer-events: none;
    transform: scale(0.97);
    transition: opacity 0.2s ease, transform 0.2s ease;
    background: var(--bg-darkest);
  }
  .settings-modal.open,
  .settings-modal.open ~ .settings-backdrop { opacity: 1; pointer-events: all; }
  .settings-modal.open { transform: scale(1); }
  .settings-backdrop.open { opacity: 1; pointer-events: all; }
  
  /* Nav */
  .settings-nav {
    width: 220px;
    min-width: 220px;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    padding: 24px 12px 24px;
    gap: 2px;
    border-right: 1px solid rgba(255,255,255,0.06);
    overflow-y: auto;
  }
  .settings-nav-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding: 0 8px 12px;
  }
  .settings-nav-section {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 12px 8px 4px;
  }
  .settings-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    text-align: left;
    width: 100%;
  }
  .settings-nav-item:hover  { background: var(--bg-hover); color: var(--text-primary); }
  .settings-nav-item.active { background: var(--bg-active); color: var(--text-primary); }
  .settings-nav-icon { font-size: 16px; flex-shrink: 0; }
  .settings-close-btn {
    margin-top: auto;
    padding: 8px 10px;
    background: none;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition);
  }
  .settings-close-btn:hover { border-color: #ed4245; color: #ed4245; }
  
  /* Content area */
  .settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px 40px;
    max-width: 680px;
  }
  .settings-tab { display: none; }
  .settings-tab.active { display: block; animation: fadeInUp 0.15s ease; }
  
  .settings-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 20px;
  }
  
  /* Cards */
  .settings-card {
    background: var(--bg-dark);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(255,255,255,0.05);
  }
  .settings-card-header {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }
  
  /* Rows */
  .settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }
  .settings-row:last-child { border-bottom: none; padding-bottom: 0; }
  .settings-row-info { flex: 1; min-width: 0; }
  .settings-row-label { display: block; font-size: 14px; font-weight: 600; color: var(--text-primary); }
  .settings-row-desc  { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
  
  /* Toggle */
  .toggle { position: relative; flex-shrink: 0; cursor: pointer; }
  .toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
  .toggle-track {
    display: block;
    width: 40px; height: 22px;
    background: var(--bg-mid);
    border-radius: 11px;
    transition: background 0.2s;
    position: relative;
  }
  .toggle input:checked + .toggle-track { background: var(--accent); }
  .toggle-thumb {
    position: absolute;
    left: 3px; top: 3px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  }
  .toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(18px); }
  
  /* Select */
  .settings-select {
    background: var(--bg-mid);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 6px 10px;
    outline: none;
    cursor: pointer;
    flex-shrink: 0;
  }
  .settings-select:focus { border-color: var(--accent); }
  
  /* Sliders */
  .settings-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
  }
  .settings-slider-label { font-size: 13px; color: var(--text-secondary); width: 100px; flex-shrink: 0; }
  .settings-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    border-radius: 2px;
    background: var(--bg-mid);
    outline: none;
    cursor: pointer;
  }
  .settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(88,101,242,0.2);
    transition: box-shadow 0.15s;
  }
  .settings-slider::-webkit-slider-thumb:hover { box-shadow: 0 0 0 5px rgba(88,101,242,0.3); }
  .settings-slider-val { font-size: 12px; font-weight: 700; color: var(--text-muted); width: 36px; text-align: right; flex-shrink: 0; }
  
  /* Time inputs */
  .settings-time-range { display: flex; align-items: center; gap: 8px; }
  .settings-time-input {
    background: var(--bg-mid);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    padding: 5px 8px;
    outline: none;
    width: 80px;
  }
  .settings-time-input:focus { border-color: var(--accent); }
  /* Chrome time picker fix */
  input[type="time"]::-webkit-calendar-picker-indicator { filter: invert(0.7); }
  
  /* Cache bar */
  .settings-cache-info { margin-bottom: 8px; }
  .cache-bar-wrap {
    width: 100%;
    height: 8px;
    background: var(--bg-mid);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
  }
  .cache-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #eb459e);
    border-radius: 4px;
    transition: width 0.5s ease;
  }
  .cache-bar-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
  
  /* Buttons */
  .settings-btn-outline {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    cursor: pointer;
    transition: border-color var(--transition), color var(--transition);
    flex-shrink: 0;
  }
  .settings-btn-outline:hover { border-color: var(--accent); color: var(--accent); }
  
  .settings-btn-danger {
    display: block;
    margin-top: 12px;
    background: rgba(237,66,69,0.1);
    border: 1px solid rgba(237,66,69,0.3);
    border-radius: var(--radius);
    color: #ed4245;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 16px;
    cursor: pointer;
    transition: background var(--transition);
  }
  .settings-btn-danger:hover { background: rgba(237,66,69,0.2); }
  
  /* Font preview */
  .font-preview {
    background: var(--bg-mid);
    border-radius: var(--radius);
    padding: 12px 14px;
    color: var(--text-secondary);
    margin-top: 12px;
    line-height: 1.6;
    transition: font-size 0.15s ease;
  }
  
  /* Accent swatches */
  .accent-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  .accent-swatch {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
  }
  .accent-swatch:hover { transform: scale(1.15); }
  .accent-swatch.active { border-color: #fff; transform: scale(1.1); }
  
  .accent-custom-input {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 2px dashed rgba(255,255,255,0.3);
    background: none;
    cursor: pointer;
    padding: 0;
    overflow: hidden;
  }
  .accent-custom-input::-webkit-color-swatch-wrapper { padding: 0; border-radius: 50%; }
  .accent-custom-input::-webkit-color-swatch { border: none; border-radius: 50%; }
/* ===== CREATE SERVER / CHANNEL MODALS ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1100;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }

.create-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -48%) scale(0.96);
  width: 440px;
  background: var(--bg-secondary);
  border-radius: 16px;
  z-index: 1101;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.create-modal.open {
  opacity: 1; pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.create-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 0;
  font-size: 18px; font-weight: 700; color: var(--text-primary);
}

.create-modal-body { padding: 16px 20px; }

.create-modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 0 20px 20px;
}

/* Server emoji picker */
.server-emoji-picker {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin-bottom: 4px;
}
.server-emoji-btn {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--bg-tertiary);
  border: 2px dashed rgba(255,255,255,0.15);
  font-size: 36px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.server-emoji-btn:hover { background: var(--bg-hover); border-color: var(--accent); }
.server-emoji-hint { font-size: 12px; color: var(--text-muted); }

.emoji-grid {
  display: grid; grid-template-columns: repeat(8, 1fr);
  gap: 4px; margin-top: 8px;
  background: var(--bg-tertiary);
  border-radius: 10px; padding: 8px;
}
.emoji-option {
  font-size: 22px; padding: 4px; border-radius: 6px;
  cursor: pointer; background: none; border: none;
  transition: background 0.1s; text-align: center;
}
.emoji-option:hover { background: var(--bg-hover); }
.emoji-option.selected { background: var(--accent); }

/* Channel type selector */
.channel-type-selector { display: flex; flex-direction: column; gap: 8px; }
.channel-type-option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  background: var(--bg-tertiary);
  border: 2px solid transparent;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.channel-type-option:hover { background: var(--bg-hover); }
.channel-type-option.active { border-color: var(--accent); background: var(--bg-hover); }
.channel-type-icon {
  font-size: 20px; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-secondary); border-radius: 8px;
  font-weight: 700; color: var(--text-muted);
}
.channel-type-name { font-size: 14px; font-weight: 600; color: var(--text-primary); display: block; }
.channel-type-desc { font-size: 12px; color: var(--text-muted); display: block; margin-top: 2px; }

/* Server name in channel list header */
.server-name-header {
  padding: 12px 16px 8px;
  font-size: 15px; font-weight: 700;
  color: var(--text-primary);
  display: flex; align-items: center; justify-content: space-between;
}
.server-name-header .btn-add-channel {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  padding: 2px; border-radius: 4px;
  transition: color 0.15s;
  font-size: 20px; line-height: 1;
}
.server-name-header .btn-add-channel:hover { color: var(--text-primary); }