/* ===== SIDCHA – Dark Brutalist Theme ===== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Space+Grotesk:wght@500;700&display=swap");

/* ── Tokens ── */
:root {
  --bg-primary: #000000;
  --bg-surface: #0a0a0a;
  --bg-surface-hover: #171717;
  --border: #262626;
  --text-primary: #ededed;
  --text-secondary: #a3a3a3;
  --accent: #ffffff;
  --accent-fg: #000000;
  --danger: #ef4444;
  --success: #10b981;
  --online: #10b981;
  --font-body: "Inter", -apple-system, sans-serif;
  --font-heading: "Space Grotesk", "Inter", sans-serif;
  --glass-bg: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.08);
  --glass-light-bg: rgba(255,255,255,0.06);
}

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

body, html {
  height: 100%;
  width: 100%;
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
body {
  display: flex;
  height: 100dvh;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}

/* ── Glass Utility Classes ── */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

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

.glass-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 6px;
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  transition: background 0.2s, border-color 0.2s;
}
.glass-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.2);
}

/* ── Hidden/Active/Show Utilities (used by JS) ── */
.hidden { display: none !important; }

/* ══════════════════════════════════════════════
   MOBILE MENU
   ══════════════════════════════════════════════ */
#mobile-menu-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 1.4rem;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

#mobile-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 9;
}
#mobile-backdrop.show { display: block; }

/* ══════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════ */
#sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#server-header {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

#channels-header, #voice-channels-header {
  padding: 24px 24px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

#add-channel-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  transition: color 0.2s;
}
#add-channel-btn:hover { color: var(--text-primary); }

#channel-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px;
  min-height: 0;
}

#voice-channel-list {
  flex-shrink: 0;
  overflow-y: auto;
  padding: 0 12px 8px;
}

.channel-item {
  padding: 10px 12px;
  margin-bottom: 4px;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 6px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s, color 0.2s;
}
.channel-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}
.channel-item.active {
  background: var(--border);
  color: var(--text-primary);
}

.channel-icon {
  margin-right: 8px;
  opacity: 0.5;
  font-family: var(--font-heading);
}

/* Voice Channel Items */
.voice-channel-item {
  padding: 10px 12px;
  margin-bottom: 4px;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 6px;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s, color 0.2s;
}
.voice-channel-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}
.voice-channel-item.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.voice-channel-item.sharing {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

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

/* ── User Section (bottom of sidebar) ── */
#user-section {
  padding: 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
  flex-shrink: 0;
}

#guest-login {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#guest-login .glass-btn {
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  text-align: center;
  font-size: 0.85rem;
}

#logged-in-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
#user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--border);
}
#user-info { flex: 1; overflow: hidden; }
#user-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#user-status {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
#logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 9999px;
  cursor: pointer;
}
#logout-btn:hover { background: var(--bg-surface-hover); color: var(--text-primary); }

/* ══════════════════════════════════════════════
   MAIN AREA
   ══════════════════════════════════════════════ */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  position: relative;
  min-width: 0;
  border-left: none;
  border-right: none;
}

/* ── Chat Mode ── */
#chat-mode {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#header {
  height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-primary);
  flex-shrink: 0;
}

#channel-name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

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

.header-btn {
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

#online-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ── Screen Share Container (inline in chat) ── */
#screen-share-container {
  display: none;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
#screen-share-container.active {
  display: flex;
}
#screen-share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  font-size: 0.9rem;
}
#screen-share-video {
  width: 100%;
  max-height: 300px;
  background: #000;
  object-fit: contain;
}

/* ── Pins Panel ── */
#pins-panel {
  display: none;
  position: absolute;
  top: 64px;
  right: 0;
  width: 360px;
  max-height: calc(100dvh - 128px);
  overflow-y: auto;
  z-index: 50;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0 0 0 8px;
}
#pins-panel.show { display: block; }

#pins-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

#pins-list {
  padding: 8px;
}

.pinned-message {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ── Messages ── */
#messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 16px;
  color: var(--text-secondary);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.message {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  position: relative;
}
.message:hover { background: rgba(255,255,255,0.02); border-radius: 4px; }
.message:hover .message-actions { opacity: 1; }

.message-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.message-actions .glass-btn {
  padding: 4px 8px;
  font-size: 0.75rem;
}

.message.announcement {
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid var(--danger);
  padding-left: 12px;
  border-radius: 4px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  overflow: hidden;
  font-size: 1rem;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.admin { border-left: 3px solid var(--danger); }
.avatar.roblox { border-left: 3px solid #00a2ff; }

.content { flex: 1; min-width: 0; }
.username {
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.roblox-badge, .admin-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 9999px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.roblox-badge { background: #00a2ff; color: #fff; }
.roblox-badge svg { width: 10px; height: 10px; fill: #fff; }
.admin-badge { background: var(--danger); color: #fff; }

.text {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-primary);
  word-break: break-word;
}

.text.stamp-msg {
  font-size: 2.5rem;
  line-height: 1.2;
}

.mention {
  background: rgba(88, 101, 242, 0.2);
  color: #7289da;
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 500;
}

.msg-image, .msg-video {
  max-width: 300px;
  max-height: 300px;
  border-radius: 4px;
  margin-top: 8px;
  border: 1px solid var(--border);
  cursor: zoom-in;
}

/* ── Input Area ── */
#input-area {
  padding: 12px 24px 24px;
  background: var(--bg-primary);
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  width: 100%;
  box-sizing: border-box;
}

#upload-status {
  display: none;
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
#upload-status.show { display: block; }

#media-preview {
  display: none;
  position: relative;
  margin-bottom: 12px;
  max-width: 200px;
}
#media-preview img, #media-preview video {
  max-width: 100%;
  max-height: 150px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mention-suggest {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 24px;
  right: 24px;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  z-index: 30;
}
#mention-suggest.show { display: block; }

.mention-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.mention-item:hover { background: var(--bg-surface-hover); }
.mention-item img {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
}
.status-dot.online { background: var(--online); }

#input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

#username-input {
  width: 120px;
  flex-shrink: 0;
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  border-radius: 9999px;
  font-family: var(--font-body);
  outline: none;
  font-size: 0.9rem;
}

#message-input {
  flex: 1;
  min-width: 0;
  padding: 10px 16px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  border-radius: 9999px;
  font-family: var(--font-body);
  outline: none;
  font-size: 0.9rem;
}
#username-input:focus, #message-input:focus {
  border-color: var(--accent);
}
#username-input::placeholder, #message-input::placeholder {
  color: var(--text-secondary);
}

#file-input { display: none; }

.input-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  font-size: 1rem;
  padding: 0;
}
.input-btn:hover {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

.input-btn.primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  width: auto;
  border-radius: 9999px;
  padding: 0 16px;
  height: 40px;
  white-space: nowrap;
}
.input-btn.primary:hover { opacity: 0.85; }

/* ── Stamp Panel ── */
#stamp-container {
  position: relative;
}

#stamp-panel {
  display: none;
  position: absolute;
  bottom: 100%;
  right: 0;
  width: 280px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  z-index: 30;
  padding: 12px;
}
#stamp-panel.show { display: block; }

.stamp-title {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.stamp-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.stamp-item {
  font-size: 1.5rem;
  text-align: center;
  padding: 8px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}
.stamp-item:hover { background: var(--bg-surface-hover); }

/* ══════════════════════════════════════════════
   GAMING MODE
   ══════════════════════════════════════════════ */
#gaming-mode {
  display: none;
  flex: 1;
  min-height: 0;
}
#gaming-mode.active {
  display: flex;
}

#game-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
  padding: 16px;
}

#game-room-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}

#game-room-creator {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
#game-room-creator input,
#game-room-creator select {
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 6px;
  font-family: var(--font-body);
  outline: none;
}

#game-room-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#current-game-room {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 8px 12px;
}

#game-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.game-btn {
  padding: 8px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  transition: all 0.2s;
}
.game-btn:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.game-btn.active {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent);
}

#game-container {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 0;
}

/* Game-specific styles */
#game-status {
  text-align: center;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

#reset-game {
  display: block;
  margin: 16px auto 0;
  padding: 8px 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-body);
}
#reset-game:hover { background: var(--bg-surface-hover); }

.tictactoe-board {
  display: grid;
  grid-template-columns: repeat(3, 80px);
  grid-template-rows: repeat(3, 80px);
  gap: 4px;
  margin: 0 auto;
}
.tictactoe-cell {
  width: 80px;
  height: 80px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.15s;
}
.tictactoe-cell:hover { background: var(--bg-surface-hover); }

/* Piano */
.piano-scroll {
  overflow-x: auto;
  padding: 16px 0;
}
.piano {
  position: relative;
  display: flex;
  height: 180px;
  min-width: fit-content;
}
.piano-key {
  width: calc(100% / 36);
  min-width: 24px;
  height: 100%;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 0 0 4px 4px;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  position: relative;
  z-index: 1;
  transition: background 0.1s;
  user-select: none;
}
.piano-key:hover { background: #e8e8e8; }
.piano-key.active { background: #d0d0d0; }
.piano-key.black {
  position: absolute;
  width: calc(0.62 * 100% / 36);
  min-width: 16px;
  height: 65%;
  background: #222;
  border-color: #111;
  color: #fff;
  z-index: 2;
}
.piano-key.black:hover { background: #333; }
.piano-key.black.active { background: #444; }
.pk-label {
  font-size: 0.6rem;
  color: var(--text-secondary);
  pointer-events: none;
}
.piano-key.black .pk-label { color: #888; }

/* Block Blast */
.block-board {
  display: grid;
  gap: 2px;
  margin: 0 auto;
}
.block-cell {
  width: 32px;
  height: 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 2px;
}
.block-cell.filled { background: #3b82f6; border-color: #2563eb; }

/* Gaming Chat */
#gaming-chat {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--bg-surface);
}
#gaming-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  font-size: 0.85rem;
}
#gaming-input-row {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-top: 1px solid var(--border);
}
#gaming-input {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 6px;
  font-family: var(--font-body);
  outline: none;
  font-size: 0.85rem;
}

/* ══════════════════════════════════════════════
   SCREEN SHARE MODE
   ══════════════════════════════════════════════ */
#screen-share-mode {
  display: none;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}
#screen-share-mode.active {
  display: flex;
}

#screen-mode-header {
  height: 64px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-primary);
  flex-shrink: 0;
}

#screen-mode-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
}

#screen-mode-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}

#screen-room-viewers {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

#screen-mode-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#screen-video-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  min-height: 0;
}

#screen-video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-secondary);
  padding: 40px;
  text-align: center;
}
#screen-video-placeholder .icon {
  font-size: 3rem;
}

#screen-mode-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#screen-controls {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  justify-content: center;
  flex-shrink: 0;
}

.screen-btn {
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.screen-btn-start {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.screen-btn-start:hover { opacity: 0.85; }
.screen-btn-stop {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.screen-btn-stop:hover { opacity: 0.85; }
.screen-btn-back {
  background: var(--bg-surface);
  color: var(--text-primary);
}
.screen-btn-back:hover { background: var(--bg-surface-hover); }

/* ══════════════════════════════════════════════
   MEMBERS PANEL
   ══════════════════════════════════════════════ */
#members-panel {
  width: 240px;
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  padding: 24px 16px;
  display: none;
  flex-shrink: 0;
  overflow-y: auto;
}
#members-panel.show { display: block; }

#members-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}

#members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}
.member-item img {
  width: 32px; height: 32px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--border);
}

.member-avatar-wrapper {
  position: relative;
}
.member-avatar-wrapper .status-indicator {
  position: absolute;
  bottom: -2px;
  right: -2px;
}

.status-indicator {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
  border: 2px solid var(--bg-surface);
}
.status-indicator.online { background: var(--online); }

/* ══════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════ */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal.show { display: flex; animation: fadeIn 0.2s ease-out; }

/* Media Modal */
#media-modal {
  cursor: zoom-out;
}
#media-modal img, #media-modal video {
  max-width: 90vw;
  max-height: 90vh;
  border: 1px solid var(--border);
  border-radius: 4px;
  object-fit: contain;
}

/* Channel Modal */
.modal-content {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  padding: 32px;
  width: 90%;
  max-width: 400px;
  border-radius: 8px;
  position: relative;
}
.modal-content h3 {
  font-family: var(--font-heading);
  margin-bottom: 24px;
  font-size: 1.5rem;
}
.modal-content input {
  width: 100%;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  margin-bottom: 16px;
  outline: none;
  border-radius: 6px;
  font-family: var(--font-body);
}
.modal-content input:focus { border-color: var(--accent); }

.modal-buttons { display: flex; gap: 12px; justify-content: flex-end; }
.modal-buttons button {
  padding: 10px 20px;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-body);
  font-size: 0.9rem;
}
.modal-buttons .cancel {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.modal-buttons .cancel:hover { background: var(--bg-surface-hover); }
.modal-buttons .create {
  background: var(--accent);
  color: var(--accent-fg);
}
.modal-buttons .create:hover { opacity: 0.85; }

/* ── Roblox Modal ── */
.roblox-loading-container {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin-top: 24px;
}
.nodes-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
  position: relative;
}
.node-icon {
  width: 48px; height: 48px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  z-index: 2;
}
.node-icon svg { width: 24px; height: 24px; fill: var(--text-primary); }
.connection-line {
  position: absolute;
  top: 50%; left: 48px; right: 48px;
  height: 1px;
  background: var(--border);
  z-index: 1;
  overflow: hidden;
}
.connection-line::after {
  content: "";
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: var(--text-primary);
  animation: slideLine 1.5s infinite linear;
}
@keyframes slideLine { to { left: 200%; } }

#roblox-loading-text {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

.connection-line.error::after {
  animation: none;
  left: 0;
  width: 100%;
  background: #ff6b6b;
}

/* ── Roblox Auth Modal ── */
#roblox-auth-modal {
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.3s ease;
}

.roblox-glass-panel {
  position: relative;
  width: 90%;
  max-width: 440px;
  background: rgba(18, 18, 18, 0.95);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 36px 36px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}

/* Aurora background animation */
.aurora-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.aurora-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0;
  display: none;
}
.aurora-blob.blob1 {
  width: 300px; height: 300px;
  background: linear-gradient(135deg, #6c3971, #9b59b6);
  top: -100px; left: -80px;
  animation: auroraFloat1 8s ease-in-out infinite alternate;
}
.aurora-blob.blob2 {
  width: 250px; height: 250px;
  background: linear-gradient(135deg, #3498db, #2ecc71);
  bottom: -80px; right: -60px;
  animation: auroraFloat2 6s ease-in-out infinite alternate;
}
@keyframes auroraFloat1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(40px, 30px) scale(1.15); }
}
@keyframes auroraFloat2 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-30px, -20px) scale(1.1); }
}

.roblox-glass-panel > *:not(.aurora-bg) {
  position: relative;
  z-index: 1;
}

.roblox-cool-input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  margin-bottom: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.roblox-cool-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.08);
}
.roblox-cool-input::placeholder {
  color: rgba(255,255,255,0.35);
}

.roblox-cool-btn {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: var(--accent-fg);
  border: none;
  border-radius: 12px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
  letter-spacing: 0.5px;
}
.roblox-cool-btn:hover {
  transform: translateY(-1px);
  opacity: 0.85;
}
.roblox-cool-btn:active {
  transform: scale(0.98);
}

/* Roblox Date Picker overlay */
#roblox-date-picker {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3500;
}

/* ══════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

/* ══════════════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }

/* ══════════════════════════════════════════════
   MOBILE RESPONSIVE
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
  #mobile-menu-btn {
    display: flex;
  }

  #sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100dvh;
    transform: translateX(-100%);
    z-index: 100;
  }
  #sidebar.open {
    transform: translateX(0);
  }

  #header {
    padding-left: 64px;
  }

  #members-panel {
    position: fixed;
    top: 0; right: 0;
    height: 100dvh;
    z-index: 100;
  }

  #pins-panel {
    width: 100%;
    left: 0;
    right: 0;
  }

  #input-row {
    flex-wrap: wrap;
  }

  #username-input {
    width: 100%;
    margin-bottom: 4px;
  }

  #gaming-chat {
    width: 100%;
    max-height: 200px;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  #gaming-mode.active {
    flex-direction: column;
  }

  .header-buttons {
    gap: 6px;
  }

  .header-btn {
    font-size: 0.75rem;
    padding: 4px 8px;
  }

  .tictactoe-board {
    grid-template-columns: repeat(3, 60px);
    grid-template-rows: repeat(3, 60px);
  }
  .tictactoe-cell {
    width: 60px;
    height: 60px;
  }
}

@media (max-width: 480px) {
  #header {
    height: 56px;
    padding: 0 12px 0 56px;
  }
  #channel-name {
    font-size: 1rem;
  }
  #messages {
    padding: 12px;
  }
  #input-area {
    padding: 8px 12px 12px;
  }
  .message {
    gap: 10px;
  }
  .avatar {
    width: 32px;
    height: 32px;
  }
}

/* ===== Hyper-Minimalist Loader ===== */
#minimal-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  transition: opacity 1.2s cubic-bezier(0.87, 0, 0.13, 1), backdrop-filter 1.2s cubic-bezier(0.87, 0, 0.13, 1);
}

#minimal-loader .loader-line {
  width: 0%;
  height: 1px;
  background: #ffffff;
  transition: width 2.4s cubic-bezier(0.76, 0, 0.24, 1);
}

#minimal-loader.loading .loader-line {
  width: clamp(200px, 25vw, 400px);
}

#minimal-loader .loader-text {
  margin-top: 24px;
  font-family: "Inter", -apple-system, sans-serif;
  font-size: clamp(0.65rem, 1.2vw, 0.9rem);
  font-weight: 500;
  letter-spacing: 0.4em;
  color: #ffffff;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.5s, transform 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.5s;
}

#minimal-loader.loading .loader-text {
  opacity: 0.6;
  transform: translateY(0);
}

#minimal-loader.reveal {
  opacity: 0;
  background: rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

#minimal-loader.reveal .loader-line,
#minimal-loader.reveal .loader-text {
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* Audio Share Toggle */
.audio-share-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-surface-hover);
  border-top: 1px solid var(--border);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-primary);
  width: 100%;
}
.audio-share-label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #555;
  transition: .4s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: ";
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(20px); }


/* Channel Modal Types */
.type-btn { background: transparent; border: 2px solid white; color: white; padding: 8px 16px; border-radius: 0; font-size: 14px; cursor: pointer; font-family: var(--font-body); }
.type-btn:hover { background: rgba(255,255,255,0.1); }
.type-btn.active { background: white; color: black; }


/* Schedule Mode */
#schedule-mode { display: none; flex: 1; flex-direction: column; }
#schedule-mode.active { display: flex; }

/* Word Wolf Mode */
#wordwolf-mode { display: none; flex: 1; flex-direction: column; padding: 20px; color: white; }
#wordwolf-mode.active { display: flex; }
.ww-panel { padding: 20px; text-align: center; margin-bottom: 20px; }
#ww-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
#ww-timer { font-size: 24px; font-weight: bold; font-family: monospace; }
.ww-btn { font-size: 16px; padding: 10px 24px; cursor: pointer; }
#ww-players { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 15px 0; }
#ww-topic { font-size: 32px; font-weight: bold; letter-spacing: 2px; margin: 10px 0; }
#ww-chat-area { flex: 1; display: flex; flex-direction: column; background: rgba(0,0,0,0.3); border-radius: 8px; overflow: hidden; margin-top: 20px; }
#ww-messages { flex: 1; overflow-y: auto; padding: 15px; text-align: left; }
.ww-chat-input-container { display: flex; padding: 10px; background: rgba(0,0,0,0.5); }
#ww-chat-input { flex: 1; padding: 10px; border: none; border-radius: 4px; outline: none; font-size: 16px; }
#ww-chat-send { padding: 10px 20px; margin-left: 10px; cursor: pointer; border: none; border-radius: 4px; background: white; color: black; font-weight: bold; }

/* ===== Ban System UI ===== */
@keyframes glitch {
  0% { text-shadow: 0.05em 0 0 #ff0000, -0.05em -0.025em 0 #00ff00, 0.025em 0.05em 0 #0000ff; }
  14% { text-shadow: 0.05em 0 0 #ff0000, -0.05em -0.025em 0 #00ff00, 0.025em 0.05em 0 #0000ff; }
  15% { text-shadow: -0.05em -0.025em 0 #ff0000, 0.025em 0.025em 0 #00ff00, -0.05em -0.05em 0 #0000ff; }
  49% { text-shadow: -0.05em -0.025em 0 #ff0000, 0.025em 0.025em 0 #00ff00, -0.05em -0.05em 0 #0000ff; }
  50% { text-shadow: 0.025em 0.05em 0 #ff0000, 0.05em 0 0 #00ff00, 0 -0.05em 0 #0000ff; }
  99% { text-shadow: 0.025em 0.05em 0 #ff0000, 0.05em 0 0 #00ff00, 0 -0.05em 0 #0000ff; }
  100% { text-shadow: -0.025em 0 0 #ff0000, -0.025em -0.025em 0 #00ff00, -0.025em -0.05em 0 #0000ff; }
}
.glitch-active {
  animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
  color: #ff3333 !important;
  font-weight: 900;
  letter-spacing: 2px;
}

#ban-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: #ffffff; /* White background as requested */
  z-index: 99999; display: flex; justify-content: center; align-items: center; padding: 20px;
}
#ban-overlay.hidden { display: none; }
.ban-card {
  background: #ffffff;
  border: 4px solid #000000;
  border-radius: 0; padding: 40px; max-width: 600px; width: 100%;
  color: #000000; text-align: left;
}
.ban-card h1 { color: #000000; margin-bottom: 20px; font-size: 24px; font-weight: bold; }
.ban-card p { font-size: 16px; margin-bottom: 10px; color: #000000; }

#ban-reason-box {
  background: #ffffff; padding: 15px; border: 3px solid #000000; 
  margin-bottom: 20px; text-align: left;
}
#ban-reason-title { color: #000000; display: inline-block; font-size: 16px; font-weight: bold; }
#ban-reason-text { font-size: 16px; font-weight: bold; display: inline-block; }

.ban-subtext { font-size: 12px !important; color: #333 !important; margin-bottom: 0 !important; }

#btn-show-appeal {
  background: none; border: none; cursor: pointer; font-size: 20px; padding: 0;
  text-decoration: underline; margin-bottom: 20px; margin-top: 10px;
  display: block; text-align: center; width: 100%;
}
#btn-show-appeal:disabled { color: #888 !important; cursor: not-allowed; text-decoration: none; }

.ban-footer { margin-top: 25px; font-size: 12px; color: #333; line-height: 1.4; }

/* 3-chat layout */
.ban-action-row {
  display: flex; align-items: center; justify-content: flex-start; gap: 15px;
}
#btn-chat-3times {
  background: #ffffff; border: 3px solid #000000; color: #000000;
  padding: 10px 15px; font-size: 14px; font-weight: bold; cursor: pointer;
  text-align: left; line-height: 1.3;
}
#btn-chat-3times span { display: block; font-size: 10px; color: #333; margin-top: 5px; font-weight: normal; }
.ban-action-note {
  font-size: 12px; color: #000; flex: 1;
}

#appeal-modal {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
  z-index: 100000; display: flex; justify-content: center; align-items: center; padding: 20px;
}
#appeal-modal.hidden { display: none; }
.appeal-card {
  background: #ffffff; border: 3px solid #000000;
  border-radius: 0; padding: 30px; max-width: 500px; width: 100%; color: #000000;
}
.appeal-card h2 { margin-bottom: 5px; color: #000; }
.appeal-card p { margin-bottom: 20px; color: #333; font-size: 14px; }
.appeal-card textarea {
  width: 100%; min-height: 120px; padding: 15px; border-radius: 0;
  background: #ffffff; border: 2px solid #000000;
  color: #000; font-size: 15px; resize: vertical; margin-bottom: 20px; outline: none;
}
.appeal-card textarea:focus { border-color: #3498db; }
.appeal-actions { display: flex; gap: 15px; justify-content: flex-end; }
.appeal-actions button { padding: 10px 20px; border-radius: 0; cursor: pointer; font-weight: bold; border: 2px solid #000; }
#btn-cancel-appeal { background: #f0f0f0; color: #000; }
#btn-submit-appeal { background: #000; color: #fff; }

.monitor-notice {
  background: rgba(230, 126, 34, 0.2); border: 1px solid #e67e22;
  color: #f39c12; padding: 10px; text-align: center; font-size: 13px; font-weight: bold;
  border-radius: 8px; margin-bottom: 10px;
}


