/* Nexus LiveLink - Modern Cyber Obsidian & Violet Theme */
:root {
  --ui-opacity: 0.92;
  --ui-blur: 16px;
  --custom-wallpaper: none;

  --bg-tertiary: #0B0F19;     /* Deep obsidian server rail */
  --bg-secondary: #0F172A;    /* Slate navy channels & sidebars */
  --bg-secondary-alt: #111827;/* Bottom user status bar */
  --bg-primary: #0B0F19;      /* Deep obsidian main chat background */
  --bg-chat-input: #1E293B;   /* Elevated slate input field */
  --bg-card: rgba(30, 41, 59, 0.55); /* Glass card background */
  --bg-modifier-hover: rgba(255, 255, 255, 0.06);
  --bg-modifier-active: rgba(255, 255, 255, 0.10);
  --bg-modifier-selected: rgba(124, 58, 237, 0.22);

  --brand-color: #7C3AED;     /* Electric Neon Violet */
  --brand-hover: #6D28D9;
  --brand-gradient: linear-gradient(135deg, #6366F1, #7C3AED);
  --brand-glow: 0 0 20px rgba(124, 58, 237, 0.4);
  
  --accent-cyan: #06B6D4;     /* Neon Cyan / Turquoise */
  --online-color: #06B6D4;    /* Modern Neon Cyan active status */
  --idle-color: #F59E0B;      /* Amber */
  --offline-color: #64748B;   /* Slate Gray */
  --danger-color: #EF4444;    /* Crimson */

  --role-admin: #F59E0B;
  --role-mod: #06B6D4;
  --role-member: #8B5CF6;

  --text-normal: #E2E8F0;     /* Crisp slate white */
  --text-muted: #94A3B8;      /* Muted slate gray */
  --text-header: #F8FAFC;     /* Pure white */
  --text-interactive: #CBD5E1;

  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-glow: rgba(124, 58, 237, 0.35);
  --font-discord: 'Outfit', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Theme Variations */
body.theme-midnight-purple {
  --bg-tertiary: #120e24;
  --bg-secondary: #191432;
  --bg-secondary-alt: #16122d;
  --bg-primary: #211b42;
  --bg-chat-input: #2a2353;
  --brand-color: #7b68ee;
}

body.theme-cyberpunk {
  --bg-tertiary: #080c14;
  --bg-secondary: #0f172a;
  --bg-secondary-alt: #0a0f1d;
  --bg-primary: #131d38;
  --bg-chat-input: #1c2b52;
  --brand-color: #00f0ff;
  --brand-hover: #00bcd4;
}

body.theme-deep-space {
  --bg-tertiary: #0b132b;
  --bg-secondary: #1c2541;
  --bg-secondary-alt: #17203b;
  --bg-primary: #1e2a4a;
  --bg-chat-input: #273761;
  --brand-color: #48cae4;
}

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

.hidden {
  display: none !important;
}

body {
  font-family: var(--font-discord);
  background-color: var(--bg-primary);
  color: var(--text-normal);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
  background-image: var(--custom-wallpaper);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  transition: background 0.3s ease;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #1a1b1e;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #111214;
}

/* Main Container */
.discord-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

/* 1. Server Rail (Modern Cyber Rail) */
.server-rail {
  width: 76px;
  background-color: rgba(11, 15, 25, var(--ui-opacity));
  backdrop-filter: blur(var(--ui-blur));
  -webkit-backdrop-filter: blur(var(--ui-blur));
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  gap: 10px;
  flex-shrink: 0;
  z-index: 10;
  border-left: 1px solid var(--border-subtle);
  transition: background-color 0.3s ease;
}

.guild-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background-color: #1E293B;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.guild-icon:hover {
  border-radius: 12px;
  background: var(--brand-gradient);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: var(--brand-glow);
  color: #fff;
  transform: scale(1.05);
}

.guild-icon.active {
  border-radius: 12px;
  background: var(--brand-gradient);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: var(--brand-glow);
  color: #fff;
}

.guild-brand-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.guild-icon:hover .guild-brand-logo {
  transform: scale(1.1);
}

.guild-pill-indicator {
  position: absolute;
  right: -12px;
  top: 14px;
  width: 4px;
  height: 20px;
  background-color: #fff;
  border-radius: 0 4px 4px 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.guild-icon.active .guild-pill-indicator {
  opacity: 1;
}

.discord-logo svg {
  width: 28px;
  height: 28px;
}

.server-separator {
  width: 32px;
  height: 2px;
  background-color: var(--border-subtle);
  border-radius: 1px;
  margin: 4px 0;
}

.servers-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  align-items: center;
}

.add-guild-btn {
  background-color: #2b2d31;
  color: var(--online-color);
  font-size: 26px;
  line-height: 1;
}
.add-guild-btn:hover {
  background-color: var(--online-color);
  color: #fff;
}

.explore-guild-btn {
  background-color: #2b2d31;
  color: #5865f2;
}
.explore-guild-btn:hover {
  background-color: #5865f2;
  color: #fff;
}

/* 2. Channels Sidebar */
.sidebar-channels {
  width: 240px;
  background-color: rgba(15, 23, 42, var(--ui-opacity));
  backdrop-filter: blur(var(--ui-blur));
  -webkit-backdrop-filter: blur(var(--ui-blur));
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.3s ease;
}

.channels-view-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.channels-view-wrapper.hidden {
  display: none;
}

.room-header {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  border-bottom: 1px solid rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.header-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.room-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-header);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-code-tag {
  font-size: 11px;
  color: var(--brand-color);
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.5px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.icon-btn:hover {
  color: var(--text-normal);
  background-color: var(--bg-modifier-hover);
}

.channels-scroller {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 8px 4px 8px;
  letter-spacing: 0.5px;
}
.category-arrow {
  font-size: 10px;
}

.channel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.channel-item:hover {
  background-color: var(--bg-modifier-hover);
  color: var(--text-normal);
}

.channel-item.active {
  background-color: var(--bg-modifier-selected);
  color: var(--text-header);
}

.channel-hash {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-muted);
}

.channel-speaker {
  display: flex;
  align-items: center;
}

.channel-users-count {
  margin-right: auto;
  font-size: 11px;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 8px;
  color: var(--text-muted);
}

/* DMs View in Sidebar */
.dms-header {
  height: 48px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
}
.dms-search-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-header);
  outline: none;
  font-family: inherit;
}
.dm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}
.dm-item:hover {
  background-color: var(--bg-modifier-hover);
  color: var(--text-normal);
}
.dm-item.active {
  background-color: var(--bg-modifier-selected);
  color: var(--text-header);
}

/* Condition Card */
.live-condition-card {
  margin-top: 20px;
  background: rgba(88, 101, 242, 0.08);
  border: 1px solid rgba(88, 101, 242, 0.2);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  gap: 10px;
}
.card-icon {
  font-size: 20px;
}
.card-content h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-color);
  margin-bottom: 4px;
}
.card-content p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Voice Connected Status Panel */
.voice-status-panel {
  background-color: #111214;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.voice-status-panel.hidden {
  display: none;
}
.voice-status-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.voice-status-icon.connected {
  color: var(--online-color);
}
.voice-status-text {
  display: flex;
  flex-direction: column;
}
.voice-connection-state {
  font-size: 12px;
  font-weight: 700;
  color: var(--online-color);
}
.voice-room-name {
  font-size: 10px;
  color: var(--text-muted);
}
.voice-status-actions {
  display: flex;
  gap: 4px;
}
.screen-share-btn.active {
  color: var(--online-color);
  background-color: rgba(35, 165, 90, 0.2);
}
.disconnect-voice-btn {
  color: var(--danger-color);
}
.disconnect-voice-btn:hover {
  background-color: rgba(242, 63, 67, 0.15);
  color: var(--danger-color);
}

/* User Profile Footer */
.user-profile-bar {
  height: 52px;
  background-color: rgba(17, 24, 39, var(--ui-opacity));
  backdrop-filter: blur(var(--ui-blur));
  -webkit-backdrop-filter: blur(var(--ui-blur));
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
  flex-shrink: 0;
  border-top: 1px solid var(--border-subtle);
  transition: background-color 0.3s ease;
}

.profile-avatar-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--brand-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.user-status-dot {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--offline-color);
  border: 2px solid var(--bg-secondary-alt);
}
.user-status-dot.online { background-color: var(--online-color); }
.user-status-dot.idle { background-color: var(--idle-color); }

.profile-names {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.profile-username {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-header);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-discriminator {
  font-size: 11px;
  color: var(--text-muted);
}

.profile-actions {
  display: flex;
  gap: 2px;
}
.profile-btn {
  background: transparent;
  border: none;
  color: var(--text-interactive);
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.profile-btn:hover {
  color: var(--text-header);
  background-color: var(--bg-modifier-hover);
}
.profile-btn.active-red {
  color: var(--danger-color);
}

/* 3. Main Chat Area */
.chat-area {
  flex: 1;
  background-color: rgba(11, 15, 25, calc(var(--ui-opacity) * 0.88));
  backdrop-filter: blur(var(--ui-blur));
  -webkit-backdrop-filter: blur(var(--ui-blur));
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  overflow: hidden;
  transition: background-color 0.3s ease;
}

.chat-header {
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  flex-shrink: 0;
  background-color: rgba(11, 15, 25, var(--ui-opacity));
  backdrop-filter: blur(var(--ui-blur));
  -webkit-backdrop-filter: blur(var(--ui-blur));
  transition: background-color 0.3s ease;
}

.chat-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.channel-name-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-header);
}
.header-divider {
  width: 1px;
  height: 16px;
  background-color: var(--border-subtle);
  margin: 0 4px;
}
.channel-description {
  font-size: 13px;
  color: var(--text-muted);
}

.peer-live-status-pill,
#peer-status-pill {
  display: none !important;
}

/* Screen Share Display Container */
.screen-share-display-wrapper {
  background-color: #000;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-bottom: 2px solid var(--brand-color);
  max-height: 280px;
  position: relative;
}
.screen-share-display-wrapper.hidden {
  display: none;
}
.screen-share-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: #fff;
  font-size: 12px;
}
.live-stream-badge {
  background: var(--danger-color);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
}
.mini-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
}
#screen-share-video {
  max-height: 220px;
  width: auto;
  border-radius: 6px;
}

/* Messages Scroller */
.messages-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
}

.chat-welcome-header {
  margin: 20px 0 30px 0;
}
.welcome-hashtag-bubble {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #404249;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 12px;
}
.welcome-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-header);
  margin-bottom: 8px;
}
.welcome-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

.messages-feed {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0 16px;
  margin-top: auto;
}

/* Natural, Fluid, Compact Chat Stream (Standard Stream) */
.message-entry {
  display: flex;
  gap: 14px;
  padding: 4px 16px 6px 16px;
  border-radius: 4px;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: background-color 0.12s ease;
  position: relative;
  margin-bottom: 0;
}
.message-entry:hover {
  background: rgba(255, 255, 255, 0.035);
  border: none;
  transform: none;
  box-shadow: none;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  cursor: pointer;
  margin-top: 2px;
}

.message-content-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.message-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
  line-height: 1.35;
}

.message-author {
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
}
.message-author:hover {
  text-decoration: underline;
}

.author-role-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
}
.author-role-badge.admin {
  background-color: rgba(241, 196, 15, 0.2);
  color: var(--role-admin);
}
.author-role-badge.mod {
  background-color: rgba(46, 204, 113, 0.2);
  color: var(--role-mod);
}

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

.message-text {
  font-size: 14.5px;
  color: var(--text-normal);
  line-height: 1.45;
  word-break: break-word;
  user-select: text;
  background: transparent;
  padding: 0;
  border-radius: 0;
  border: none;
  margin-top: 2px;
}

/* Media Attachment in Chat */
.message-media-img {
  max-width: 380px;
  max-height: 280px;
  border-radius: 8px;
  margin-top: 6px;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
}

/* Emoji Reactions on Messages */
.message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.reaction-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: #2b2d31;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.reaction-bubble:hover {
  background-color: #383a40;
  border-color: var(--brand-color);
}
.reaction-bubble.reacted {
  background-color: rgba(88, 101, 242, 0.2);
  border-color: var(--brand-color);
}

.quick-react-trigger {
  opacity: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 12px;
}
.message-entry:hover .quick-react-trigger {
  opacity: 1;
}

/* Rejected Message Notice */
.rejected-message-card {
  margin: 6px 0;
  background-color: rgba(242, 63, 67, 0.1);
  border-right: 4px solid var(--danger-color);
  padding: 10px 14px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rejected-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--danger-color);
  display: flex;
  align-items: center;
  gap: 6px;
}
.rejected-body {
  font-size: 13px;
  color: var(--text-normal);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text-muted);
  height: 24px;
}
.typing-indicator.hidden {
  opacity: 0;
  pointer-events: none;
}
.typing-dots {
  display: flex;
  gap: 3px;
}
.typing-dots span {
  width: 5px;
  height: 5px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* Attachment Preview Bar above Input */
.attachment-preview-bar {
  padding: 8px 16px 0 16px;
}
.attachment-preview-bar.hidden {
  display: none;
}
.preview-card {
  display: inline-flex;
  position: relative;
  background: #2b2d31;
  padding: 4px;
  border-radius: 6px;
}
#attachment-img-preview {
  max-width: 120px;
  max-height: 80px;
  border-radius: 4px;
}
.remove-attachment-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger-color);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

/* Chat Input Area */
.chat-input-area {
  padding: 0 16px 20px 16px;
  flex-shrink: 0;
  position: relative;
}

.chat-form {
  width: 100%;
}

.input-wrapper {
  background-color: rgba(30, 41, 59, var(--ui-opacity));
  backdrop-filter: blur(var(--ui-blur));
  -webkit-backdrop-filter: blur(var(--ui-blur));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  display: flex;
  align-items: center;
  padding: 4px 14px;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.input-wrapper:focus-within {
  border-color: var(--brand-color);
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.35);
}

.hidden-file-input {
  display: none;
}

.input-action-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.input-action-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.attach-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #E2E8F0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin-left: 6px;
  margin-right: 0;
  font-size: 17px;
}
.attach-btn:hover {
  background: var(--brand-color);
  color: #fff;
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-header);
  font-size: 15px;
  padding: 10px 8px;
  outline: none;
  font-family: inherit;
  text-align: right;
  direction: rtl;
}
.chat-input::placeholder {
  color: var(--text-muted);
}

.send-message-btn {
  background: var(--brand-color);
  border: none;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.35);
}
.send-message-btn:hover {
  background: var(--brand-hover);
  transform: scale(1.06);
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.6);
}
.send-message-btn:active {
  transform: scale(0.96);
}
.send-message-btn svg {
  transform: scaleX(-1); /* Points send arrow to the left in RTL */
  transition: transform 0.15s ease;
}

/* Floating Popovers (Emoji & GIF Pickers) */
.floating-picker {
  position: absolute;
  bottom: 80px;
  left: 20px;
  background: #2b2d31;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  padding: 12px;
  z-index: 100;
  width: 280px;
}
.floating-picker.hidden {
  display: none;
}
.picker-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  font-size: 22px;
}
.emoji-opt {
  cursor: pointer;
  text-align: center;
  border-radius: 4px;
  padding: 4px;
}
.emoji-opt:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.15);
}

.gif-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}
.gif-thumb {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
}
.gif-thumb:hover {
  opacity: 0.8;
}

/* 4. Members Sidebar */
.members-sidebar {
  width: 240px;
  background-color: rgba(15, 23, 42, var(--ui-opacity));
  backdrop-filter: blur(var(--ui-blur));
  -webkit-backdrop-filter: blur(var(--ui-blur));
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  flex-shrink: 0;
  transition: background-color 0.3s ease;
}

.members-scroller {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px 10px 12px;
  display: flex;
  flex-direction: column;
}

.members-sidebar-footer {
  height: 52px;
  background-color: rgba(17, 24, 39, var(--ui-opacity));
  backdrop-filter: blur(var(--ui-blur));
  -webkit-backdrop-filter: blur(var(--ui-blur));
  display: flex;
  align-items: center;
  padding: 0 10px;
  flex-shrink: 0;
  border-top: 1px solid var(--border-subtle);
  transition: background-color 0.3s ease;
}

.sidebar-pwa-install-btn {
  width: 100%;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.28) 0%, rgba(124, 58, 237, 0.28) 100%);
  border: 1px solid rgba(124, 58, 237, 0.45);
  border-radius: 8px;
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.sidebar-pwa-install-btn:hover {
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.5) 0%, rgba(124, 58, 237, 0.5) 100%);
  border-color: rgba(124, 58, 237, 0.85);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}
.sidebar-pwa-install-btn:active {
  transform: scale(0.98);
}
.sidebar-pwa-install-btn .pwa-btn-icon {
  font-size: 15px;
  line-height: 1;
}
.sidebar-pwa-install-btn .pwa-btn-text {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

body.is-electron #members-sidebar-footer,
body.is-electron #pwa-install-btn,
body.is-electron .sidebar-pwa-install-btn,
body.is-electron .pwa-install-header-btn,
body.is-standalone #members-sidebar-footer,
body.is-standalone #pwa-install-btn,
body.is-standalone .sidebar-pwa-install-btn {
  display: none !important;
}

.members-section-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.role-admin-header { color: var(--role-admin); }
.role-mod-header { color: var(--role-mod); }
.role-member-header { color: var(--brand-color); }

.members-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.member-item:hover {
  background-color: var(--bg-modifier-hover);
}

.member-avatar-wrap {
  position: relative;
  width: 32px;
  height: 32px;
}
.member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.member-status-dot {
  position: absolute;
  bottom: -2px;
  left: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--offline-color);
  border: 2px solid var(--bg-secondary);
}
.member-status-dot.online { background-color: var(--online-color); }
.member-status-dot.idle { background-color: var(--idle-color); }

.member-info {
  display: flex;
  flex-direction: column;
}
.member-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-normal);
}
.member-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   Avatar Decorations & Expressive Keyframe Animations
   ========================================================================== */
.avatar-deco-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.avatar-deco-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  transition: all 0.3s ease;
}

/* 1. Flame & Ember (لهب النيران) */
.deco-flame .avatar-deco-ring {
  border: 3px solid transparent;
  background: linear-gradient(#111214, #111214) padding-box,
              linear-gradient(135deg, #ff4500, #ff8c00, #ffd700, #ff1493) border-box;
  box-shadow: 0 0 14px rgba(255, 69, 0, 0.75), inset 0 0 8px rgba(255, 140, 0, 0.5);
  animation: decoPulseFire 2.2s infinite alternate ease-in-out;
}
@keyframes decoPulseFire {
  0% { transform: scale(0.98); filter: drop-shadow(0 0 4px #ff4500) hue-rotate(0deg); }
  100% { transform: scale(1.04); filter: drop-shadow(0 0 10px #ff8c00) hue-rotate(20deg); }
}

/* 2. Cyber Neon (نيون سايبر) */
.deco-neon .avatar-deco-ring {
  border: 3px solid transparent;
  background: linear-gradient(#111214, #111214) padding-box,
              linear-gradient(135deg, #00f0ff, #7928ca, #ff0080) border-box;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.8), inset 0 0 6px rgba(255, 0, 128, 0.6);
  animation: decoPulseNeon 3s infinite linear;
}
@keyframes decoPulseNeon {
  0% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(180deg) brightness(1.2); }
  100% { filter: hue-rotate(360deg); }
}

/* 3. Sakura Blossom (أزهار الساكورا) */
.deco-sakura .avatar-deco-ring {
  border: 3px solid transparent;
  background: linear-gradient(#111214, #111214) padding-box,
              linear-gradient(135deg, #ff9a9e, #fecfef, #f687b3) border-box;
  box-shadow: 0 0 14px rgba(255, 154, 158, 0.8), inset 0 0 8px rgba(254, 207, 239, 0.5);
  animation: decoPulseSakura 3.5s infinite alternate ease-in-out;
}
@keyframes decoPulseSakura {
  0% { transform: scale(1); filter: drop-shadow(0 0 4px #ff9a9e); }
  100% { transform: scale(1.03); filter: drop-shadow(0 0 8px #f687b3); }
}

/* 4. 8-Bit Retro Arcade (ريترو بكسل) */
.deco-retro .avatar-deco-ring {
  border: 3px dashed #57f287;
  box-shadow: 0 0 12px rgba(87, 242, 135, 0.8), inset 0 0 6px rgba(87, 242, 135, 0.4);
  image-rendering: pixelated;
  animation: decoRotateDashed 16s infinite linear;
}
@keyframes decoRotateDashed {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 5. Cosmic Galaxy (مجرة فضائية) */
.deco-galaxy .avatar-deco-ring {
  border: 3px solid transparent;
  background: linear-gradient(#111214, #111214) padding-box,
              linear-gradient(135deg, #8a2be2, #410093, #00d2ff, #e056fd) border-box;
  box-shadow: 0 0 18px rgba(138, 43, 226, 0.8), inset 0 0 8px rgba(0, 210, 255, 0.5);
  animation: decoPulseGalaxy 4s infinite alternate ease-in-out;
}
@keyframes decoPulseGalaxy {
  0% { transform: scale(0.99); filter: hue-rotate(0deg); }
  100% { transform: scale(1.03); filter: hue-rotate(60deg) brightness(1.25); }
}

/* 6. Golden Royal Crown (تاج الملوك) */
.deco-crown .avatar-deco-ring {
  border: 3px solid transparent;
  background: linear-gradient(#111214, #111214) padding-box,
              linear-gradient(135deg, #f1c40f, #e67e22, #fff7a9, #d35400) border-box;
  box-shadow: 0 0 16px rgba(241, 196, 15, 0.85), inset 0 0 6px rgba(241, 196, 15, 0.5);
  animation: decoShineCrown 3s infinite alternate ease-in-out;
}
@keyframes decoShineCrown {
  0% { filter: drop-shadow(0 0 4px #f1c40f); }
  100% { filter: drop-shadow(0 0 10px #ffeaa7) brightness(1.2); }
}

/* ==========================================================================
   User Profile Popover Card (Modern Discord Interactive Popout)
   ========================================================================== */
.user-profile-popover {
  position: fixed;
  width: 320px;
  background: linear-gradient(180deg, var(--theme-primary, #1e1f22) 0%, var(--theme-accent, #111214) 100%);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 2000;
  animation: modal-pop 0.18s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  direction: rtl;
}

.user-profile-popover.hidden {
  display: none !important;
}

.popover-banner {
  height: 105px;
  background-color: var(--brand-color);
  background-size: cover;
  background-position: center;
  position: relative;
}

.popover-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.5) 100%);
}

.popover-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 16px;
  margin-top: -38px;
  position: relative;
  z-index: 3;
}

.popover-avatar-wrap {
  position: relative;
  width: 72px;
  height: 72px;
}

.popover-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--brand-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  border: 4px solid var(--theme-primary, #1e1f22);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.popover-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.popover-status-dot {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--online-color);
  border: 3px solid var(--theme-primary, #1e1f22);
  z-index: 3;
}

.popover-status-dot.idle { background-color: var(--idle-color); }
.popover-status-dot.dnd { background-color: var(--dnd-color); }
.popover-status-dot.offline { background-color: var(--offline-color); }

.popover-badges-row {
  display: flex;
  gap: 5px;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 15px;
  min-height: 28px;
}

.badge-popout-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: transform 0.15s;
}
.badge-popout-icon:hover {
  transform: scale(1.2);
}

.popover-body {
  padding: 10px 16px 16px 16px;
}

.popover-name-section {
  margin-bottom: 6px;
}

.popover-username {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-header);
  line-height: 1.2;
}

.popover-tag {
  font-size: 12px;
  color: var(--text-muted);
}

/* Popover Navigation Tabs */
.popover-nav-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin: 10px 0 12px 0;
  padding-bottom: 2px;
}

.popover-tab-btn {
  flex: 1;
  padding: 6px 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: all 0.15s;
}

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

.popover-tab-btn.active {
  color: #fff;
  border-bottom-color: var(--brand-color);
}

.popover-tab-pane {
  display: block;
}
.popover-tab-pane.hidden {
  display: none !important;
}

.popover-role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  background: rgba(241, 196, 15, 0.15);
  color: var(--role-admin);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.popover-bio-box {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 10px;
}

.popover-subhead {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
}

.popover-bio-text {
  font-size: 12px;
  color: var(--text-normal);
  line-height: 1.4;
  margin: 0;
  word-break: break-word;
  white-space: pre-wrap;
}

.popover-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 10px 0;
}

.popover-status-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.popover-dm-btn {
  width: 100%;
  background-color: var(--brand-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
}

.popover-dm-btn:hover {
  background-color: var(--brand-hover);
  transform: translateY(-1px);
}

/* Gaming Board in Popout */
.popover-board-section {
  margin-bottom: 12px;
}

.board-section-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.popover-rotation-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 170px;
  overflow-y: auto;
}

.rotation-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.rotation-card-poster {
  width: 32px;
  height: 44px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: #232428;
}

.rotation-card-info {
  flex: 1;
  min-width: 0;
}

.rotation-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.status-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 3px;
}

.tag-main {
  background: rgba(88, 101, 242, 0.25);
  color: #5865F2;
  border: 1px solid rgba(88, 101, 242, 0.4);
}
.tag-obsessed {
  background: rgba(235, 69, 158, 0.25);
  color: #eb459e;
  border: 1px solid rgba(235, 69, 158, 0.4);
}
.tag-casual {
  background: rgba(87, 242, 135, 0.25);
  color: #57f287;
  border: 1px solid rgba(87, 242, 135, 0.4);
}
.tag-open {
  background: rgba(254, 231, 92, 0.25);
  color: #fee75c;
  border: 1px solid rgba(254, 231, 92, 0.4);
}
.tag-grinding {
  background: rgba(230, 126, 34, 0.25);
  color: #e67e22;
  border: 1px solid rgba(230, 126, 34, 0.4);
}

.popover-posters-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.strip-poster-wrap {
  flex-shrink: 0;
}

.strip-poster {
  width: 52px;
  height: 72px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.15s, border-color 0.15s;
}

.strip-poster:hover {
  transform: scale(1.06);
  border-color: var(--brand-color);
}

.board-empty-state {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
}

/* ==========================================================================
   Profile Studio (Settings Tab: تخصيص البروفايل)
   ========================================================================== */
.profile-studio-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.studio-preview-section {
  background: #111214;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.studio-preview-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.studio-profile-card-preview {
  max-width: 320px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--preview-primary, #1e1f22) 0%, var(--preview-accent, #111214) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: right;
  direction: rtl;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
}

.preview-banner {
  height: 85px;
  background-color: #5865F2;
  background-size: cover;
  background-position: center;
  position: relative;
}

.preview-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 14px;
  margin-top: -34px;
  position: relative;
  z-index: 3;
}

.preview-avatar-wrap {
  position: relative;
  width: 64px;
  height: 64px;
}

.preview-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--brand-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  border: 4px solid var(--preview-primary, #1e1f22);
  overflow: hidden;
}

.preview-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.preview-status-dot {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--online-color);
  border: 3px solid var(--preview-primary, #1e1f22);
  z-index: 3;
}

.preview-badges-row {
  display: flex;
  gap: 4px;
  align-items: center;
  background: rgba(0, 0, 0, 0.45);
  padding: 3px 6px;
  border-radius: 6px;
  font-size: 14px;
  min-height: 24px;
}

.preview-info-body {
  padding: 10px 14px 14px 14px;
}

.preview-name-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.preview-username {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

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

.preview-role-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--role-admin);
  background: rgba(241, 196, 15, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  margin: 6px 0;
}

.preview-bio-box {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 4px;
}

.preview-bio-label {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  display: block;
  margin-bottom: 2px;
}

.preview-bio-text {
  font-size: 11px;
  color: var(--text-normal);
  line-height: 1.3;
  margin: 0;
}

/* Studio Controls */
.studio-controls-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.studio-control-card {
  background: #1e1f22;
  border-radius: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.control-card-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

.decorations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.deco-choice {
  background: #2b2d31;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 10px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 11px;
  color: var(--text-muted);
}

.deco-choice:hover {
  background: #313338;
  color: #fff;
}

.deco-choice.active {
  border-color: var(--brand-color);
  background: rgba(88, 101, 242, 0.15);
  color: #fff;
  font-weight: 700;
}

.deco-preview-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  margin: 0 auto 6px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: #1e1f22;
  border: 2px solid #35373c;
}

.deco-flame-sample { border-color: #ff4500; box-shadow: 0 0 8px rgba(255, 69, 0, 0.6); }
.deco-neon-sample { border-color: #00f0ff; box-shadow: 0 0 8px rgba(0, 240, 255, 0.6); }
.deco-sakura-sample { border-color: #ff9a9e; box-shadow: 0 0 8px rgba(255, 154, 158, 0.6); }
.deco-retro-sample { border: 2px dashed #57f287; }
.deco-galaxy-sample { border-color: #8a2be2; box-shadow: 0 0 8px rgba(138, 43, 226, 0.6); }
.deco-crown-sample { border-color: #f1c40f; box-shadow: 0 0 8px rgba(241, 196, 15, 0.6); }

.gradient-pickers-row {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.color-field label {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.color-field-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.color-picker-input {
  width: 44px;
  height: 34px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
}

.gradient-presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.preset-pill {
  background: #2b2d31;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-normal);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.preset-pill:hover {
  background: #35373c;
  color: #fff;
  border-color: var(--brand-color);
}

.badges-selector-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.badge-checkbox-label {
  cursor: pointer;
}

.badge-toggle-input {
  display: none;
}

.badge-chip {
  display: inline-block;
  background: #2b2d31;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  transition: all 0.15s;
}

.badge-toggle-input:checked + .badge-chip {
  background: rgba(88, 101, 242, 0.25);
  border-color: var(--brand-color);
  color: #fff;
  font-weight: 700;
}

.studio-footer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

/* ==========================================================================
   Gaming Board Manager (Settings Tab: لوحة ألعابي)
   ========================================================================== */
.gaming-board-manager-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.board-mgmt-card {
  background: #1e1f22;
  border-radius: 10px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.board-mgmt-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

.board-mgmt-card-top h4 {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 4px 0;
}

.rotation-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rotation-mgmt-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #2b2d31;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.rotation-mgmt-poster {
  width: 36px;
  height: 50px;
  border-radius: 4px;
  object-fit: cover;
  background: #111214;
  flex-shrink: 0;
}

.rotation-mgmt-info {
  flex: 1;
  min-width: 0;
}

.rotation-mgmt-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rotation-status-select {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 4px;
  background: #1e1f22;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: inherit;
}

.btn-del-rotation {
  background: transparent;
  color: #ed4245;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.15s;
}
.btn-del-rotation:hover {
  background: rgba(237, 66, 69, 0.15);
}

.posters-mgmt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
  gap: 10px;
}

.poster-mgmt-card {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 2/3;
  background: #2b2d31;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.poster-mgmt-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster-mgmt-del {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.75);
  color: #ed4245;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.poster-mgmt-del:hover {
  transform: scale(1.15);
  background: #ed4245;
  color: #fff;
}

.board-footer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

/* ==========================================================================
   Game Picker Modal (مكتبة اختيار الألعاب السريعة)
   ========================================================================== */
.game-picker-modal-card {
  width: 680px;
  max-width: 95vw;
}

.picker-config-bar {
  display: flex;
  gap: 14px;
}

.game-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 12px;
  max-height: 350px;
  overflow-y: auto;
  padding: 4px;
}

.game-library-card {
  background: #2b2d31;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s ease-out;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
}

.game-library-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-color);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.game-library-card img {
  width: 100%;
  height: 145px;
  object-fit: cover;
  background: #111214;
}

.game-library-card .game-title {
  padding: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-game-accordion {
  margin-top: 16px;
  background: #2b2d31;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.custom-game-header {
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.custom-game-header:hover {
  color: #fff;
}

.custom-game-fields {
  padding: 14px;
  background: #1e1f22;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background-color: var(--bg-primary);
  width: 440px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-subtle);
  animation: modal-pop 0.2s ease-out;
}
.wide-modal {
  width: 600px;
  max-width: 90vw;
}

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

.modal-header {
  padding: 16px 20px;
  background-color: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}
.modal-close-x {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}
.modal-close-x:hover {
  color: #fff;
}
.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-header);
}

.modal-body {
  padding: 20px;
}
.settings-body-scroll {
  max-height: 70vh;
  overflow-y: auto;
}

.settings-section {
  margin-bottom: 24px;
}
.settings-section h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-header);
  margin-bottom: 8px;
}
.section-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

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

.form-group {
  margin-bottom: 12px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.modal-input, .modal-select, .modal-textarea {
  width: 100%;
  background-color: #1e1f22;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-header);
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-input:focus, .modal-select:focus, .modal-textarea:focus {
  border-color: var(--brand-color);
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.25);
}

.modal-textarea {
  resize: vertical;
}

.themes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.theme-card {
  background: #1e1f22;
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}
.theme-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}
.theme-card.active {
  border-color: var(--brand-color);
  background: rgba(88, 101, 242, 0.1);
}
.theme-preview {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}
.dark-classic { background: #313338; }
.midnight { background: #7b68ee; }
.cyberpunk { background: #00f0ff; }
.deep-space { background: #1c2541; }

/* OTA Section in Settings */
.ota-section {
  background: rgba(88, 101, 242, 0.08);
  border: 1px solid rgba(88, 101, 242, 0.25);
  border-radius: 8px;
  padding: 16px;
}
.ota-badge {
  display: inline-block;
  background: var(--brand-color);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  margin-bottom: 8px;
}
.ota-btn {
  background-color: var(--brand-color);
  margin-top: 10px;
}

.discord-primary-btn {
  width: 100%;
  background-color: var(--brand-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s ease, transform 0.1s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.discord-primary-btn:hover {
  background-color: var(--brand-hover);
}

/* Explore Servers Modal Grid */
.explore-servers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.explore-card {
  background: #2b2d31;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s;
}
.explore-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-color);
}
.explore-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.explore-card-icon {
  font-size: 28px;
}
.explore-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-header);
}
.explore-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1;
}
.explore-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.explore-card-count {
  font-size: 11px;
  color: var(--online-color);
  font-weight: 600;
}
.explore-join-btn {
  background: var(--brand-color);
  color: #fff;
  border: none;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* OTA Popup Banner (Over-The-Air Update Banner) */
.ota-update-popup-banner {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e1f22;
  border: 2px solid var(--brand-color);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  border-radius: 12px;
  padding: 14px 20px;
  z-index: 9999;
  animation: slide-down 0.3s ease-out;
  max-width: 500px;
  width: 90%;
}
.ota-update-popup-banner.hidden {
  display: none;
}
@keyframes slide-down {
  from { transform: translate(-50%, -40px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
.ota-popup-content {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ota-popup-icon {
  font-size: 32px;
}
.ota-popup-info {
  flex: 1;
}
.ota-popup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.badge-live {
  background: var(--danger-color);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}
.ota-popup-info strong {
  font-size: 14px;
  color: var(--text-header);
}
.ota-popup-info p {
  font-size: 12px;
  color: var(--text-muted);
}
.ota-popup-dismiss-btn {
  background: var(--brand-color);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* Modal Tabs */
.modal-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 6px;
  padding: 4px;
  margin-bottom: 16px;
  gap: 4px;
}
.tab-btn {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.tab-btn.active {
  background: var(--brand-color);
  color: #fff;
}
.tab-content.hidden {
  display: none;
}

.modal-error {
  margin-top: 12px;
  padding: 8px 12px;
  background-color: rgba(242, 63, 67, 0.15);
  border: 1px solid var(--danger-color);
  border-radius: 6px;
  color: #ff999b;
  font-size: 12px;
  text-align: center;
}
.modal-error.hidden {
  display: none;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}
.toast {
  background-color: #111214;
  color: var(--text-header);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slide-in 0.2s ease-out;
}
.toast.success { border-right: 4px solid var(--online-color); }
.toast.warning { border-right: 4px solid var(--idle-color); }
.toast.error { border-right: 4px solid var(--danger-color); }

@keyframes slide-in {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (max-width: 900px) {
  .members-sidebar {
    display: none;
  }
}

/* Host-Only Sections Strict Protection */
body:not(.is-host) .host-only-section,
.host-only-section.hidden {
  display: none !important;
}

/* HDD Master Server Card & Public Tunnel */
.hdd-server-card {
  margin-top: 14px;
  background: rgba(35, 165, 90, 0.08);
  border: 1px solid rgba(35, 165, 90, 0.25);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hdd-server-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--online-color);
  font-size: 13px;
}
.hdd-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--online-color);
  box-shadow: 0 0 6px var(--online-color);
  animation: pulse-speaking 1.5s infinite alternate;
}
.hdd-server-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}
.hdd-stats-pills {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 8px;
  border-radius: 6px;
}
.hdd-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 10px;
  color: var(--text-muted);
}
.hdd-pill b {
  color: var(--text-header);
  font-size: 12px;
  margin-top: 2px;
}
.tunnel-share-box {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tunnel-share-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-color);
}
.tunnel-input-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-tertiary);
  padding: 5px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.tunnel-url-text {
  font-family: monospace;
  font-size: 11px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  direction: ltr;
}

.host-badge-tag {
  margin-right: auto;
  font-size: 10px;
  font-weight: 700;
  background: rgba(241, 196, 15, 0.2);
  color: #f1c40f;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(241, 196, 15, 0.4);
}

/* PWA Install Button in Header */
.pwa-install-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
  color: #ffffff;
  border: none;
  border-radius: 16px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(88, 101, 242, 0.4);
  transition: all 0.2s ease;
  animation: pulse-install 2.5s infinite;
}
.pwa-install-header-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.6);
  background: #5865f2;
}
.pwa-install-header-btn:active {
  transform: scale(0.96);
}
.pwa-install-header-btn .pwa-icon {
  font-size: 14px;
}

@keyframes pulse-install {
  0% { box-shadow: 0 0 0 0 rgba(88, 101, 242, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(88, 101, 242, 0); }
  100% { box-shadow: 0 0 0 0 rgba(88, 101, 242, 0); }
}

/* PWA Settings Card */
.pwa-settings-section {
  border-left: 3px solid #5865f2;
  background: rgba(88, 101, 242, 0.05);
  padding: 14px;
  border-radius: 8px;
}
.pwa-badge-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #5865f2;
  background: rgba(88, 101, 242, 0.15);
  padding: 2px 8px;
  border-radius: 12px;
  margin-bottom: 6px;
}
.pwa-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.pwa-install-status {
  font-size: 12px;
  color: var(--online-color);
  font-weight: 500;
}

/* Permanent Tunnel Configuration Styling */
.tunnel-settings-section {
  border-left: 3px solid #23a55a;
  background: rgba(35, 165, 90, 0.05);
  padding: 14px;
  border-radius: 8px;
}
.mini-static-link-btn {
  background: rgba(35, 165, 90, 0.2);
  color: #23a55a;
  border: 1px solid rgba(35, 165, 90, 0.4);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  cursor: pointer;
  margin-right: auto;
  transition: all 0.2s;
}
.mini-static-link-btn:hover {
  background: #23a55a;
  color: #fff;
}
.field-help {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Strict Host-Only Access Rules */
.host-only-section.hidden,
.host-only-element.hidden,
#hdd-server-card.hidden,
#tunnel-settings-section.hidden,
#ota-settings-section.hidden {
  display: none !important;
}

/* ===================================================
   AUTHENTICATION & DISCORD LOGIN CARD AESTHETIC
   =================================================== */
.discord-login-card {
  width: 480px;
  max-width: 92%;
  background: #313338;
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.05);
  color: #dbdee1;
  animation: modal-slide-in 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  margin: auto;
  box-sizing: border-box;
}

.discord-login-header {
  text-align: center;
  margin-bottom: 24px;
}

.discord-login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #5865f2;
  color: #ffffff;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.35);
}

.discord-login-title {
  font-size: 24px;
  font-weight: 700;
  color: #f2f3f5;
  margin: 0 0 8px;
  font-family: inherit;
}

.discord-login-subtitle {
  font-size: 14px;
  color: #b5bac1;
  line-height: 1.4;
  margin: 0;
  font-family: inherit;
}

.discord-login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.discord-login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
}

.discord-login-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #b5bac1;
  user-select: none;
}

.login-req-star {
  color: #fa777c;
  font-size: 14px;
}

.discord-login-input {
  background: #1e1f22 !important;
  border: 1px solid #1e1f22 !important;
  border-radius: 4px !important;
  height: 44px !important;
  padding: 10px 12px !important;
  font-size: 15px !important;
  color: #dbdee1 !important;
  font-family: inherit !important;
  outline: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.discord-login-input:focus {
  border-color: #5865f2 !important;
  box-shadow: 0 0 0 2px rgba(88, 101, 242, 0.25) !important;
}

.discord-login-pin {
  letter-spacing: 12px;
  text-align: center;
  font-size: 22px !important;
  font-weight: 700;
  font-family: monospace, sans-serif !important;
}

.discord-login-submit-btn {
  background: #5865f2;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  height: 44px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-family: inherit;
  margin-top: 4px;
  transition: background-color 0.17s ease, transform 0.1s ease;
}

.discord-login-submit-btn:hover {
  background: #4752c4;
}

.discord-login-submit-btn:active {
  background: #3c45a5;
  transform: scale(0.99);
}

.auth-error-banner {
  background: rgba(242, 63, 67, 0.15);
  border: 1px solid var(--danger-color);
  color: #ff7b72;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  font-weight: 600;
  animation: shake 0.35s ease;
}

/* ===================================================
   SETTINGS TABS REORGANIZATION
   =================================================== */
.settings-tabbed-card {
  max-width: 640px;
  width: 95%;
}

.settings-nav-bar {
  display: flex;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 16px;
  gap: 8px;
}

.settings-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-nav-item:hover {
  color: var(--text-header);
  background: var(--bg-modifier-hover);
}

.settings-nav-item.active {
  color: #fff;
  border-bottom-color: var(--brand-color);
  background: rgba(88, 101, 242, 0.1);
}

.settings-nav-item .tab-icon {
  font-size: 16px;
}

.settings-tab-pane {
  display: block;
  animation: fadeIn 0.2s ease;
}

.settings-tab-pane.hidden {
  display: none !important;
}

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

/* ===================================================
   AVATAR UPLOAD & IMAGE DISPLAY
   =================================================== */
.discord-avatar-card,
.avatar-edit-box {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-tertiary);
  padding: 16px 20px;
  border-radius: 10px;
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.avatar-preview-circle,
.avatar-edit-preview-wrapper {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  overflow: hidden;
  background-color: var(--brand-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  position: relative;
  user-select: none;
}

.avatar-preview-initial,
.avatar-preview-display {
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background-color: var(--brand-color);
}

.avatar-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.avatar-preview-img.hidden {
  display: none !important;
}

.avatar-edit-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.upload-avatar-btn,
.upload-avatar-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  background: var(--brand-color);
  color: #fff;
  border: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
  max-width: 220px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.upload-avatar-btn:hover,
.upload-avatar-label:hover {
  background: var(--brand-hover);
}

.upload-avatar-btn:active,
.upload-avatar-label:active {
  transform: scale(0.98);
}

.hidden-file-input {
  display: none !important;
}

.mini-btn {
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  text-align: right;
  transition: all 0.2s;
  max-width: fit-content;
}

.text-danger {
  color: var(--danger-color);
}

.text-danger:hover {
  background: rgba(242, 63, 67, 0.15);
}

/* Avatar Images across the chat */
.message-avatar-img,
.member-avatar-img,
.my-avatar-img,
.popover-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.message-avatar.has-avatar-img,
.member-avatar.has-avatar-img,
.user-avatar.has-avatar-img,
.popover-avatar.has-avatar-img {
  background: transparent !important;
}

/* Danger Zone / Logout Card */
.settings-logout-card {
  border: 1px solid rgba(242, 63, 67, 0.3);
  background: rgba(242, 63, 67, 0.05);
  border-radius: 8px;
  padding: 16px;
  margin-top: 24px;
}

.settings-logout-card h4 {
  color: var(--danger-color);
  margin-bottom: 4px;
}

.discord-danger-btn {
  background: var(--danger-color);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 600;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s ease;
}

.discord-danger-btn:hover {
  background: #da373c;
  box-shadow: 0 2px 8px rgba(242, 63, 67, 0.4);
}

/* Branding Badge Pill */
.branding-badge-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #f1c40f;
  background: rgba(241, 196, 15, 0.15);
  padding: 2px 8px;
  border-radius: 12px;
  margin-bottom: 6px;
}

/* =======================================================
   DISCORD PROFILE CARD & MY ACCOUNT REDESIGN
   ======================================================= */
.discord-profile-card {
  background-color: #232428;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* 1. Profile Top Banner */
.profile-card-banner {
  height: 120px;
  background: linear-gradient(135deg, #1b1e2c 0%, #232738 45%, #5865F2 100%);
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 12px 16px;
}

.profile-banner-avatar-btn {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  transition: background 0.2s ease, transform 0.1s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-banner-avatar-btn:hover {
  background: rgba(0, 0, 0, 0.75);
  transform: translateY(-1px);
}

/* 2. Profile Header (Overlapping Avatar & User Identifiers) */
.profile-card-header {
  padding: 0 20px 16px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-avatar-overlap-wrapper {
  position: relative;
  margin-top: -46px;
  width: 88px;
  height: 88px;
  flex-shrink: 0;
}

.profile-avatar-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 6px solid #232428;
  background-color: #5865F2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.profile-avatar-initial {
  font-size: 36px;
  font-weight: 700;
  color: #ffffff;
  text-transform: uppercase;
  user-select: none;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* Status indicator dot in bottom corner of avatar */
.profile-avatar-status-badge {
  position: absolute;
  bottom: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 4px solid #232428;
  box-sizing: content-box;
  background-color: #23a55a;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.profile-avatar-status-badge.online { background-color: #23a55a; }
.profile-avatar-status-badge.idle { background-color: #f0b232; }
.profile-avatar-status-badge.dnd { background-color: #f23f43; }
.profile-avatar-status-badge.offline { background-color: #80848e; }

.profile-card-ident {
  flex: 1;
  min-width: 180px;
  padding-top: 6px;
}

.profile-display-name-title {
  font-size: 20px;
  font-weight: 800;
  color: #f2f3f5;
  line-height: 1.25;
  letter-spacing: -0.2px;
}

.profile-discriminator-sub {
  font-size: 13px;
  color: #949ba4;
  font-weight: 500;
  margin-top: 4px;
}

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

/* 3. Inner Box (#1e1f22) for Profile Rows */
.profile-card-inner-box {
  background-color: #1e1f22;
  margin: 16px 20px;
  border-radius: 8px;
  padding: 6px 18px;
}

.profile-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  gap: 16px;
}

.profile-info-row:last-child {
  border-bottom: none;
}

.info-row-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.info-row-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #b5bac1;
  letter-spacing: 0.3px;
}

.info-row-value {
  font-size: 14px;
  color: #dbdee1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.info-row-value.text-muted {
  color: #949ba4;
}

/* Discord Secondary Gray Button (#4e5058 -> #6d6f78) */
.discord-btn-secondary {
  background-color: #4e5058;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.17s ease, transform 0.1s ease;
  white-space: nowrap;
  user-select: none;
}

.discord-btn-secondary:hover {
  background-color: #6d6f78;
}

.discord-btn-secondary:active {
  transform: scale(0.97);
}

/* 4. Danger / Logout Footer */
.profile-card-footer {
  padding: 4px 20px 20px;
  display: flex;
  justify-content: flex-start;
}

.discord-danger-btn {
  background: #da373c;
  color: #ffffff;
  border: none;
  padding: 8px 18px;
  border-radius: 4px;
  font-weight: 600;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.17s ease, box-shadow 0.2s ease;
}

.discord-danger-btn:hover {
  background: #c03135;
  box-shadow: 0 2px 10px rgba(218, 55, 60, 0.4);
}

/* Sub-modal (Quick Edit Modal) */
.quick-edit-modal-card {
  background-color: #313338;
  border-radius: 8px;
  width: 440px;
  max-width: 95%;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.quick-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

/* ===================================================
   NEXUS CYBER AUTHENTICATION CARD
   =================================================== */
#auth-modal.modal-overlay {
  background: rgba(11, 15, 25, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
}

.nexus-login-card, .discord-login-card {
  background: linear-gradient(180deg, #111827 0%, #0B0F19 100%);
  width: 480px;
  max-width: 92vw;
  padding: 36px 32px 38px;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(124, 58, 237, 0.18);
  border: 1px solid rgba(124, 58, 237, 0.35);
  color: var(--text-normal);
  display: flex;
  flex-direction: column;
  animation: modalScaleIn 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.nexus-login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #06B6D4, #7C3AED, transparent);
}

.nexus-login-header, .discord-login-header {
  text-align: center;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.nexus-login-logo, .discord-login-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, #1E293B, #0F172A);
  border: 1px solid rgba(124, 58, 237, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.35);
}

.login-brand-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.nexus-login-title, .discord-login-title {
  font-size: 24px;
  font-weight: 800;
  color: #F8FAFC;
  margin: 0 0 8px;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, #F8FAFC 60%, #CBD5E1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nexus-login-subtitle, .discord-login-subtitle {
  font-size: 13px;
  color: #94A3B8;
  margin: 0;
  line-height: 1.5;
}

.discord-login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.discord-login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: right;
}

.discord-login-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #CBD5E1;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.discord-login-label .login-sublabel {
  font-size: 10px;
  color: #64748B;
  font-weight: 600;
}

.discord-login-label .login-req-star {
  color: #EF4444;
  margin-right: 2px;
}

.discord-login-input {
  width: 100%;
  padding: 11px 14px;
  height: 44px;
  background-color: #0F172A;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #F8FAFC;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.discord-login-input:hover {
  background-color: #131E33;
  border-color: rgba(255, 255, 255, 0.15);
}

.discord-login-input:focus {
  border-color: #7C3AED;
  background-color: #0F172A;
  box-shadow: 0 0 14px rgba(124, 58, 237, 0.35);
}

.discord-login-input::placeholder {
  color: #64748B;
}

.discord-login-pin {
  text-align: center;
  font-size: 22px;
  letter-spacing: 10px;
  font-weight: 800;
  color: #06B6D4;
}

.auth-error-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #F87171;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: right;
}

.auth-error-banner.hidden {
  display: none !important;
}

.discord-login-submit-btn, .nexus-glow-btn {
  width: 100%;
  height: 46px;
  background: linear-gradient(135deg, #6366F1 0%, #7C3AED 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.4);
  margin-top: 6px;
  letter-spacing: 0.2px;
}

.discord-login-submit-btn:hover, .nexus-glow-btn:hover {
  background: linear-gradient(135deg, #4F46E5 0%, #6D28D9 100%);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.55);
  transform: translateY(-1px);
}

.discord-login-submit-btn:active, .nexus-glow-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.35);
}

.discord-login-submit-btn:disabled, .nexus-glow-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==========================================================================
   Nexus Glassmorphism & Custom Wallpaper Engine Controls
   ========================================================================== */
.glassmorphism-controls-card, .wallpaper-engine-card {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}

.branding-badge-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #06B6D4;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.slider-badge {
  background: var(--brand-color);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.4);
}

.nexus-range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #1E293B;
  outline: none;
  transition: all 0.2s;
  cursor: pointer;
}
.nexus-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1, #7C3AED);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.6);
  border: 2px solid #ffffff;
  transition: transform 0.15s ease;
}
.nexus-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.preset-wallpapers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.preset-wall-card {
  background: #1E293B;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  padding-bottom: 6px;
}
.preset-wall-card:hover {
  border-color: var(--brand-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
}
.preset-wall-card.active {
  border-color: #06B6D4;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}
.preset-wall-thumb {
  width: 100%;
  height: 70px;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.preset-wall-card span {
  display: block;
  font-size: 11px;
  color: var(--text-normal);
  margin-top: 5px;
  font-weight: 600;
}

/* ==========================================================================
   Server Roles & Permissions Styles
   ========================================================================== */
.roles-manager-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.create-role-card {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
}
.create-role-card h4 {
  font-size: 14px;
  color: var(--text-header);
  margin-bottom: 12px;
}
.create-role-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.color-picker-input {
  -webkit-appearance: none;
  border: none;
  width: 40px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
}
.color-picker-input::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-picker-input::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}
.perms-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}
.perm-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  color: var(--text-normal);
  cursor: pointer;
  transition: background 0.15s;
}
.perm-check-item:hover {
  background: rgba(30, 41, 59, 0.8);
}
.perm-check-item input[type="checkbox"] {
  accent-color: var(--brand-color);
  width: 16px;
  height: 16px;
}

.roles-list-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.role-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 14px;
}
.role-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.role-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
}
.role-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-header);
}
.role-card-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
}
.role-colored-name {
  font-weight: 700;
  transition: color 0.2s;
}

/* ==========================================================================
   Server Invites & Connection Codes
   ========================================================================== */
.server-code-display-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.code-label {
  font-size: 12px;
  color: #94A3B8;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.code-number-banner {
  font-size: 32px;
  font-weight: 900;
  color: #06B6D4;
  letter-spacing: 6px;
  margin: 12px 0;
  font-family: 'Outfit', monospace;
  text-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
  user-select: all;
}

/* ==========================================================================
   Server Creation Modal & Emoji Selector
   ========================================================================== */
.server-icon-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.preset-emojis {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.emoji-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: #1E293B;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.emoji-chip:hover {
  background: rgba(124, 58, 237, 0.2);
  border-color: var(--brand-color);
  transform: scale(1.1);
}
.emoji-chip.active {
  background: var(--brand-color);
  border-color: #fff;
  transform: scale(1.1);
}

/* ==========================================================================
   Member Context Menu (RTL Context Menu)
   ========================================================================== */
.nexus-context-menu {
  position: fixed;
  background: #1E293B;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  padding: 6px;
  min-width: 190px;
  z-index: 9999;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: contextMenuPop 0.12s ease-out;
}
@keyframes contextMenuPop {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

.context-menu-header {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-bottom: 4px;
}
.context-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-normal);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.context-menu-item:hover {
  background: var(--brand-color);
  color: #fff;
}
.context-menu-item.text-danger:hover {
  background: var(--danger-color);
  color: #fff;
}
.context-menu-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 4px 0;
}
.context-menu-submenu-wrapper {
  position: relative;
}
.context-submenu {
  position: absolute;
  right: 100%;
  top: 0;
  background: #1E293B;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  padding: 6px;
  min-width: 160px;
  z-index: 10000;
}
.submenu-role-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-normal);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.submenu-role-item:hover {
  background: rgba(255, 255, 255, 0.1);
}
.submenu-role-item.active-role {
  background: rgba(124, 58, 237, 0.25);
  border: 1px solid var(--brand-color);
}

/* ==========================================================================
   Mobile Responsive Experience (الهواتف الذكية والأجهزة اللوحية)
   ========================================================================== */

/* Hidden on Desktop by default */
.mobile-toggle-btn {
  display: none;
}
.mobile-drawer-backdrop {
  display: none;
}
.mobile-install-banner {
  display: none;
}

@media (max-width: 768px) {
  /* Prevent horizontal scroll on mobile body */
  html, body {
    overflow-x: hidden;
    width: 100%;
    height: 100%;
    overscroll-behavior: none;
  }

  .discord-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }

  /* 1. Mobile Toggle Buttons */
  .mobile-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-normal);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
    padding: 0;
  }
  .mobile-toggle-btn:active {
    transform: scale(0.92);
    background: rgba(124, 58, 237, 0.3);
    color: #fff;
    border-color: var(--brand-color);
  }

  /* 2. Backdrop Overlay */
  .mobile-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  }
  body.mobile-nav-open .mobile-drawer-backdrop,
  body.mobile-members-open .mobile-drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* 3. Server Rail & Channels Sliding Drawer (RTL Start = Right Side) */
  .server-rail {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 68px;
    height: 100%;
    height: 100dvh;
    z-index: 1110;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.33, 1, 0.68, 1);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .sidebar-channels {
    position: fixed;
    top: 0;
    right: 68px;
    bottom: 0;
    width: calc(100vw - 68px);
    max-width: 290px;
    height: 100%;
    height: 100dvh;
    z-index: 1105;
    transform: translateX(calc(100% + 68px));
    transition: transform 0.28s cubic-bezier(0.33, 1, 0.68, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
  }
  .sidebar-channels .user-profile-bar {
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  body.mobile-nav-open .server-rail {
    transform: translateX(0);
  }
  body.mobile-nav-open .sidebar-channels {
    transform: translateX(0);
  }

  /* 4. Members Sidebar Sliding Drawer (RTL End = Left Side) */
  .members-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 86vw;
    height: 100%;
    height: 100dvh;
    z-index: 1110;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.33, 1, 0.68, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
    display: flex !important;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  body.mobile-members-open .members-sidebar {
    transform: translateX(0);
  }

  /* 5. Chat Area (Full Screen on Mobile) */
  .chat-area {
    width: 100vw;
    max-width: 100vw;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
  }

  .chat-header {
    height: 52px;
    padding: 0 10px;
    gap: 8px;
    justify-content: space-between;
  }
  .chat-header-title {
    flex: 1;
    min-width: 0;
    gap: 6px;
    overflow: hidden;
  }
  .channel-name-title {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
  }
  .channel-description,
  .header-divider {
    display: none !important;
  }
  .chat-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  /* 6. Mobile PWA Install Banner */
  .mobile-install-banner:not(.hidden) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(6, 182, 212, 0.25));
    border: 1px solid rgba(124, 58, 237, 0.45);
    border-radius: 12px;
    margin: 6px 10px 4px;
    padding: 8px 12px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: slideDownMobile 0.25s ease-out;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  }
  @keyframes slideDownMobile {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .mobile-install-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }
  .mobile-install-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .mobile-install-texts {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .mobile-install-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
  }
  .mobile-install-subtitle {
    font-size: 11px;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-install-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }
  .mobile-install-action-btn {
    background: #7C3AED;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
    transition: background 0.15s;
  }
  .mobile-install-action-btn:hover {
    background: #6D28D9;
  }
  .mobile-install-close-btn {
    background: transparent;
    color: #94a3b8;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* 7. Chat Messages on Mobile */
  .messages-container {
    padding: 8px 10px;
  }
  .chat-message {
    padding: 4px 6px;
    margin-bottom: 4px;
  }
  .message-avatar-wrap {
    width: 36px;
    height: 36px;
  }
  .message-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
  .message-text {
    font-size: 14px;
    line-height: 1.5;
  }

  /* 8. Chat Input on Mobile (Prevent iOS zoom & support on-screen keyboard) */
  .chat-input-area {
    padding: 6px 10px calc(8px + env(safe-area-inset-bottom, 8px));
  }
  .chat-input-box {
    min-height: 44px;
    padding: 0 6px;
    border-radius: 12px;
    gap: 4px;
  }
  .chat-input {
    font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
    padding: 8px 6px;
  }
  .input-action-btn {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }
  .send-message-btn {
    width: 36px;
    height: 36px;
  }

  /* 9. Floating Emoji & GIF Pickers on Mobile */
  .floating-picker {
    position: fixed !important;
    left: 10px !important;
    right: 10px !important;
    bottom: calc(62px + env(safe-area-inset-bottom, 8px)) !important;
    width: auto !important;
    max-height: 250px !important;
    border-radius: 14px;
    z-index: 1050;
  }

  /* 10. Modals & Dialogs on Mobile */
  .modal-overlay {
    padding: 12px;
    align-items: center;
  }
  .modal-card,
  .login-modal-box,
  .settings-modal-card {
    width: calc(100vw - 24px) !important;
    max-width: 400px !important;
    max-height: 88vh !important;
    padding: 20px 16px !important;
    border-radius: 16px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .login-inputs {
    gap: 12px;
  }
  .login-input {
    font-size: 16px !important;
    height: 44px;
  }
  .login-submit-btn {
    height: 46px;
    font-size: 15px;
  }
}



