/* ═══════ 3NCRYPTED WEB — EXACT APP REPLICA ═══════ */
/* Palette matched to Android: Theme.kt */

:root {
  --cyan: #00B4D8;
  --cyan2: #0096B7;
  --cyan-dark: #004E64;
  --red: #EF4444;
  --green: #22C55E;
  --yellow: #FBBF24;
  --surface0: #0F172A;
  --surface1: #1E293B;
  --surface2: #334155;
  --surface3: #475569;
  --text: #F1F5F9;
  --muted: #94A3B8;
  --border: rgba(148,163,184,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  background: var(--surface0);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
::selection { background: rgba(0,180,216,0.3); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ═══════ PARTICLES CANVAS ═══════ */
#particles {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}

/* ═══════ SPLASH SCREEN ═══════ */
.splash-screen {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  background: var(--surface0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.splash-screen.fade-out {
  opacity: 0; transform: scale(1.05);
  pointer-events: none;
}
.splash-logo {
  width: 120px; height: 120px;
  display: flex; align-items: center; justify-content: center;
  font-size: 64px;
  margin-bottom: 32px;
  animation: splashPulse 2s ease infinite;
}
@keyframes splashPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.splash-title {
  font-size: 36px; font-weight: 900;
  margin-bottom: 8px; letter-spacing: 2px;
}
.splash-title span {
  display: inline-block;
  animation: rainbowShift 3s linear infinite;
}
@keyframes rainbowShift {
  0% { color: #FF0000; } 11% { color: #FF7F00; } 22% { color: #FFFF00; }
  33% { color: #00FF00; } 44% { color: #0000FF; } 55% { color: #4B0082; }
  66% { color: #9400D3; } 77% { color: #FF00FF; } 88% { color: #00FFFF; }
  100% { color: #FF0000; }
}
.splash-subtitle {
  font-size: 13px; color: var(--muted);
  letter-spacing: 4px; text-transform: uppercase;
  margin-bottom: 48px;
}
.splash-progress-container {
  width: 300px; position: relative;
}
.splash-progress-bar {
  width: 100%; height: 8px;
  background: var(--surface2);
  border-radius: 4px; overflow: hidden;
}
.splash-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--cyan2));
  border-radius: 4px;
  transition: width 0.15s ease;
}
.splash-percent {
  text-align: center; margin-top: 12px;
  font-size: 16px; font-weight: 700; color: var(--cyan);
}
.splash-message {
  text-align: center; margin-top: 8px;
  font-size: 13px; color: var(--muted);
  min-height: 20px;
  transition: opacity 0.3s ease;
}
.splash-branding {
  position: absolute; bottom: 40px;
  text-align: center;
}
.splash-branding .brand-by {
  font-size: 13px; color: rgba(148,163,184,0.6);
}
.splash-branding .brand-version {
  font-size: 12px; color: rgba(0,180,216,0.5);
  margin-top: 4px;
}

/* ═══════ LOGIN SCREEN ═══════ */
.login-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface0);
}
.login-card {
  position: relative; z-index: 1;
  background: var(--surface1);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 36px 32px;
  width: 420px; max-width: 92vw;
  display: flex; flex-direction: column; align-items: center;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(0,180,216,0.05);
  overflow: hidden;
}
.login-glow {
  position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(0,180,216,0.12), transparent 70%);
  pointer-events: none;
}
.login-logo {
  position: relative; margin-bottom: 20px;
}
.logo-ring {
  width: 72px; height: 72px; border-radius: 50%;
  border: 2px solid rgba(0,180,216,0.25);
  display: flex; align-items: center; justify-content: center;
  animation: logoRotate 8s linear infinite;
}
.logo-ring-inner {
  width: 58px; height: 58px; border-radius: 50%;
  border: 2px dashed rgba(0,180,216,0.12);
  animation: logoRotate 12s linear infinite reverse;
}
@keyframes logoRotate { to { transform: rotate(360deg); } }
.logo-icon {
  position: absolute; font-size: 28px;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
}
.login-title {
  font-size: 28px; font-weight: 900; margin-bottom: 4px;
  letter-spacing: 1px;
}
.login-title span { color: var(--cyan); }
.login-sub {
  font-size: 11px; color: var(--muted); letter-spacing: 3px;
  text-transform: uppercase; margin-bottom: 28px;
}

/* QR Auth */
.qr-auth-section { width: 100%; text-align: center; }
.qr-instructions {
  font-size: 13px; color: var(--muted); margin-bottom: 16px; line-height: 1.5;
}
.qr-instructions strong { color: var(--cyan); }
.qr-container {
  width: 192px; height: 192px; margin: 0 auto 12px;
  background: #fff; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  padding: 8px;
}
.qr-loading {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.qr-timer {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 12px; color: var(--muted); margin-bottom: 8px;
}
.qr-timer.expiring { color: var(--red); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0.3; } }
.btn-refresh-qr {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; margin-top: 8px;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted); font-size: 12px; cursor: pointer;
  font-family: inherit; transition: all var(--transition);
}
.btn-refresh-qr:hover { color: var(--cyan); border-color: var(--cyan); }

/* ═══════ AUTHENTICATION ANIMATION ═══════ */
.linked-section { text-align: center; animation: authFadeIn 0.6s ease; }
@keyframes authFadeIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.auth-anim-container {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 8px 0;
}

/* Spinning orb with SVG rings */
.auth-orb {
  width: 130px; height: 130px; position: relative;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.auth-ring {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.auth-ring circle {
  fill: none; stroke-linecap: round;
  stroke-dasharray: 200 340;
}
.auth-ring-outer circle {
  stroke: var(--cyan); stroke-width: 3;
  animation: authRingSpin 1.4s linear infinite;
  filter: drop-shadow(0 0 6px rgba(0,180,216,0.5));
}
.auth-ring-inner circle {
  stroke: var(--green); stroke-width: 2; opacity: 0.7;
  animation: authRingSpin 1s linear infinite reverse;
  filter: drop-shadow(0 0 4px rgba(34,197,94,0.4));
}
@keyframes authRingSpin { to { transform: rotate(360deg); transform-origin: center; } }

.auth-orb-glow {
  position: absolute; width: 70px; height: 70px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,180,216,0.25) 0%, transparent 70%);
  animation: orbGlow 2s ease-in-out infinite;
}
@keyframes orbGlow {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.4); opacity: 1; }
}
.auth-orb-icon {
  font-size: 44px; z-index: 2; position: relative;
  animation: iconPulse 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(0,180,216,0.4));
}
@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* Complete state — stop spinning, go green */
.auth-orb.complete .auth-ring-outer circle {
  stroke: var(--green); stroke-dasharray: 340 0;
  animation: none; filter: drop-shadow(0 0 10px rgba(34,197,94,0.6));
}
.auth-orb.complete .auth-ring-inner circle { animation: none; stroke-dasharray: 280 60; }
.auth-orb.complete .auth-orb-glow {
  background: radial-gradient(circle, rgba(34,197,94,0.3) 0%, transparent 70%);
  animation: none; transform: scale(1.5); opacity: 0.8;
}
.auth-orb.complete .auth-orb-icon { animation: none; transform: scale(1.2); }

/* Title and subtitle */
.auth-title {
  font-size: 20px; font-weight: 800; color: var(--text);
  letter-spacing: 2px; text-transform: uppercase;
  transition: all 0.4s ease;
}
.auth-title.success { color: var(--green); }
.auth-subtitle {
  font-size: 13px; color: var(--muted); margin-top: -8px;
  transition: all 0.4s ease; min-height: 18px;
}

/* Progress bar */
.auth-progress-track {
  width: 100%; max-width: 220px; height: 3px;
  background: var(--surface2); border-radius: 2px;
  overflow: hidden;
}
.auth-progress-fill {
  width: 0%; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(0,180,216,0.4);
}

/* Auth steps — hidden by default, slide in */
.auth-steps {
  display: flex; flex-direction: column; gap: 10px;
  align-items: flex-start; width: 100%; max-width: 240px; margin-top: 4px;
}
.auth-step {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--muted); font-weight: 500;
  opacity: 0; transform: translateX(-16px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.auth-step.visible {
  opacity: 1; transform: translateX(0);
}
.auth-step.active { color: var(--cyan); }
.auth-step.done { color: var(--green); }

.auth-step-indicator {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--surface3); position: relative;
  transition: all 0.4s ease;
}
.auth-step.active .auth-step-indicator {
  border-color: var(--cyan);
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(0,180,216,0.6), 0 0 20px rgba(0,180,216,0.2);
  animation: stepPulse 1s ease-in-out infinite;
}
.auth-step.done .auth-step-indicator {
  border-color: var(--green);
  background: var(--green);
  box-shadow: 0 0 8px rgba(34,197,94,0.5);
  animation: none;
}
.auth-step.done .auth-step-indicator::after {
  content: '✓'; position: absolute; top: -1px; left: 1px;
  font-size: 8px; color: #fff; font-weight: 900;
}
@keyframes stepPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* User badge — slides up when shown */
.auth-user-badge {
  margin-top: 12px; padding: 12px 28px;
  background: linear-gradient(135deg, rgba(0,180,216,0.12), rgba(34,197,94,0.18));
  border: 1px solid rgba(34,197,94,0.35);
  border-radius: 28px;
  display: flex; align-items: center; gap: 10px;
  animation: badgeSlideUp 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(34,197,94,0.15);
}
@keyframes badgeSlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.auth-badge-icon { font-size: 22px; }
.auth-badge-name { font-size: 16px; font-weight: 700; color: var(--cyan); letter-spacing: 0.5px; }

/* PIN Login divider */
.pin-login-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0 16px; width: 100%;
}
.divider-line {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.divider-text {
  font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 1.5px; white-space: nowrap;
}

/* Manual login toggle */
.manual-login-toggle { margin-top: 16px; width: 100%; }
.manual-login-toggle summary {
  cursor: pointer; font-size: 11px; color: var(--surface3);
  text-align: center; padding: 8px;
  transition: color var(--transition);
}
.manual-login-toggle summary:hover { color: var(--muted); }

/* Input groups */
.login-form {
  width: 100%; display: flex; flex-direction: column; gap: 10px;
}
.input-group {
  position: relative; display: flex; align-items: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
  transition: border var(--transition), box-shadow var(--transition);
}
.input-group:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0,180,216,0.08);
}
.input-icon {
  padding: 0 0 0 14px; font-size: 20px; color: var(--muted);
  transition: color var(--transition);
}
.input-group:focus-within .input-icon { color: var(--cyan); }
.input-group input, .input-group select {
  flex: 1; padding: 14px 14px;
  background: transparent; border: none; outline: none;
  color: var(--text); font-family: inherit; font-size: 14px;
}
.input-group input::placeholder { color: var(--muted); }

/* Login status */
.login-status {
  margin-top: 6px; font-size: 13px; text-align: center;
  color: var(--muted); min-height: 20px;
  transition: color 0.2s ease;
}
.login-status.error { color: var(--red); }
.login-status.success { color: var(--green); }

/* Connect button */
.btn-connect {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--cyan), var(--cyan2));
  border: none; border-radius: var(--radius-sm);
  color: #fff; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: all var(--transition); overflow: hidden;
}
.btn-connect:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-connect:active { transform: translateY(0); }
.btn-connect.loading .btn-text,
.btn-connect.loading .btn-arrow { opacity: 0; }
.btn-connect.loading .btn-loader { opacity: 1; }
.btn-loader {
  position: absolute; width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.8s linear infinite; opacity: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Login footer */
.login-footer {
  display: flex; align-items: center; gap: 6px;
  margin-top: 24px; font-size: 11px; color: var(--surface3);
}

/* ═══════ MAIN APPLICATION ═══════ */
.main-app {
  display: flex; height: 100vh; width: 100vw;
}

/* ── SIDEBAR ── */
.sidebar {
  width: 280px; min-width: 280px;
  background: var(--surface1);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: transform 0.3s ease;
  z-index: 50;
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand {
  display: flex; align-items: center; gap: 8px;
}
.brand-logo {
  display: flex; align-items: baseline;
  font-size: 20px; font-weight: 800; letter-spacing: -0.5px;
}
.brand-logo-3 {
  color: var(--cyan); font-size: 24px; font-weight: 900;
  text-shadow: 0 0 12px rgba(0,180,216,0.5);
}
.brand-logo-rest { color: var(--text); }
.brand-badge {
  font-size: 9px; font-weight: 800; letter-spacing: 1px;
  background: var(--cyan); color: #000;
  padding: 2px 6px; border-radius: 4px; margin-left: 6px;
}
.sidebar-actions { display: flex; gap: 4px; }

/* Connection status */
.conn-status {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  font-size: 12px; font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.conn-dot {
  width: 8px; height: 8px; border-radius: 50%;
  transition: background 0.3s ease;
}
.conn-status.connected .conn-dot { background: var(--green); box-shadow: 0 0 8px var(--green); }
.conn-status.connecting .conn-dot { background: var(--yellow); animation: blink 1s ease infinite; }
.conn-status.disconnected .conn-dot { background: var(--red); }
.conn-status.connected .conn-text { color: var(--green); }
.conn-status.connecting .conn-text { color: var(--yellow); }
.conn-status.disconnected .conn-text { color: var(--red); }

/* Tabs */
.sidebar-tabs {
  display: flex; border-bottom: 1px solid var(--border);
}
.tab-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 10px 4px; position: relative;
  background: none; border: none;
  color: var(--muted); font-size: 12px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  transition: all var(--transition);
}
.tab-btn .material-icons-round { font-size: 18px; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--cyan);
}
.tab-btn.active::after {
  content: ''; position: absolute; bottom: 0; left: 16px; right: 16px;
  height: 2px; background: var(--cyan); border-radius: 2px 2px 0 0;
}
.tab-badge {
  font-size: 10px; font-weight: 700;
  background: var(--cyan); color: #000;
  padding: 1px 5px; border-radius: 10px; margin-left: 2px;
}

/* Sidebar panels */
.sidebar-panel { display: none; flex: 1; overflow-y: auto; }
.sidebar-panel.active { display: block; }
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px 8px;
}
.panel-header h3 {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted);
}

/* Channel list */
.channel-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; cursor: pointer;
  transition: background var(--transition);
  border-left: 3px solid transparent;
}
.channel-item:hover { background: rgba(255,255,255,0.03); }
.channel-item.active {
  background: rgba(0,180,216,0.08);
  border-left-color: var(--cyan);
}
.channel-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2); border-radius: var(--radius-sm);
}
.channel-icon .material-icons-round { font-size: 18px; color: var(--cyan); }
.channel-info { flex: 1; min-width: 0; }
.channel-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-meta { font-size: 11px; color: var(--muted); }
.channel-lock { font-size: 14px; color: var(--yellow); }
.channel-badge {
  font-size: 10px; font-weight: 700;
  background: var(--cyan); color: #000;
  padding: 2px 7px; border-radius: 10px;
}

/* Friend list */
.friend-list, .friend-requests { padding: 0 8px; }
.friend-item, .global-user-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background var(--transition);
}
.friend-item:hover, .global-user-item:hover { background: rgba(255,255,255,0.03); }
.friend-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--cyan);
}
.friend-name { font-size: 13px; font-weight: 600; }
.global-user-channel { font-size: 11px; color: var(--muted); }
.global-user-role {
  font-size: 9px; font-weight: 800; padding: 2px 6px;
  border-radius: 4px; letter-spacing: 0.5px;
}
.role-super { background: rgba(255,215,0,0.2); color: #FFD700; }
.role-admin { background: rgba(0,180,216,0.2); color: var(--cyan); }

/* Sidebar footer (user info + PTT) */
.sidebar-footer {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface0);
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--cyan2));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: #fff;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 700; display: block; }
.user-status { font-size: 11px; color: var(--green); }

/* PTT button */
.ptt-btn {
  width: 42px !important; height: 42px !important;
  border-radius: 50% !important;
  background: var(--surface2) !important;
  transition: all 0.15s ease !important;
  position: relative;
}
.ptt-btn:hover { background: var(--surface3) !important; }
.ptt-btn.active {
  background: var(--red) !important;
  box-shadow: 0 0 20px rgba(239,68,68,0.4) !important;
  animation: pttPulse 0.6s ease infinite alternate;
}
@keyframes pttPulse {
  from { box-shadow: 0 0 20px rgba(239,68,68,0.4); }
  to { box-shadow: 0 0 30px rgba(239,68,68,0.6); }
}

/* ── CHAT AREA ── */
.chat-area {
  flex: 1; display: flex; flex-direction: column;
  background: var(--surface0); min-width: 0;
}
.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface1);
}
.chat-header-info {
  flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0;
}
.chat-header-icon { font-size: 24px; color: var(--cyan); }
.chat-header-info h2 { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-subtitle { font-size: 12px; color: var(--muted); }
.chat-header-actions { display: flex; gap: 4px; }

/* Panic banner */
.panic-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(90deg, rgba(239,68,68,0.15), rgba(239,68,68,0.05));
  border-bottom: 1px solid rgba(239,68,68,0.2);
  color: var(--red); font-weight: 700; font-size: 13px;
  animation: panicFlash 2s ease infinite;
}
.panic-dismiss-btn {
  margin-left: auto; background: none; border: 1px solid rgba(239,68,68,0.3);
  color: var(--red); border-radius: 4px; cursor: pointer; padding: 2px;
  display: flex; align-items: center; transition: all 0.2s;
}
.panic-dismiss-btn:hover { background: rgba(239,68,68,0.2); }
.panic-dismiss-btn .material-icons-round { font-size: 16px; }
@keyframes panicFlash {
  0%, 100% { background-color: rgba(239,68,68,0.05); }
  50% { background-color: rgba(239,68,68,0.15); }
}

/* Messages area */
.messages-area {
  flex: 1; overflow-y: auto; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 4px;
}
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex: 1; opacity: 0.5;
}
.empty-state h3 { font-size: 18px; margin: 12px 0 4px; }
.empty-state p { font-size: 13px; color: var(--muted); }

/* Messages */
.message {
  display: flex; gap: 10px; padding: 6px 0;
  animation: msgIn 0.25s ease;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } }
.message.own { flex-direction: row-reverse; }
.msg-avatar {
  width: 32px; height: 32px; min-width: 32px; border-radius: 50%;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: var(--cyan);
}
.message.own .msg-avatar { background: var(--cyan-dark); color: var(--cyan); }
.msg-bubble {
  max-width: 65%; padding: 8px 14px;
  background: var(--surface1);
  border-radius: 16px 16px 16px 4px;
  border: 1px solid var(--border);
}
.message.own .msg-bubble {
  background: rgba(0,180,216,0.08);
  border-color: rgba(0,180,216,0.15);
  border-radius: 16px 16px 4px 16px;
}
.msg-header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.msg-username { font-size: 12px; font-weight: 700; color: var(--cyan); }
.message.own .msg-username { color: var(--green); }
.msg-time { font-size: 10px; color: var(--muted); }
.msg-text { font-size: 14px; line-height: 1.5; word-break: break-word; }

/* System messages */
.msg-system {
  text-align: center; padding: 6px 16px; margin: 4px 0;
  font-size: 12px; color: var(--muted);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
}
.msg-system.panic {
  background: rgba(239,68,68,0.1); color: var(--red);
  font-weight: 700;
}

/* Message bar */
.message-bar {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface1);
}
.message-input-wrapper {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 24px; padding: 4px;
}
.message-input-wrapper:focus-within {
  border-color: var(--cyan);
}
#messageInput {
  flex: 1; padding: 10px 12px;
  background: transparent; border: none; outline: none;
  color: var(--text); font-family: inherit; font-size: 14px;
}
#messageInput::placeholder { color: var(--muted); }
.send-btn {
  background: var(--cyan) !important;
  border-radius: 50% !important;
  width: 36px !important; height: 36px !important;
}
.send-btn .material-icons-round { font-size: 18px; color: #000 !important; }

/* ── MEMBERS PANEL ── */
.members-panel {
  width: 0; overflow: hidden;
  background: var(--surface1);
  border-left: 1px solid var(--border);
  transition: width 0.3s ease;
}
.members-panel.visible { width: 240px; min-width: 240px; }
.member-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  transition: background var(--transition);
}
.member-item:hover { background: rgba(255,255,255,0.03); }
.member-item.member-talking {
  background: rgba(34,197,94,0.08);
}
.member-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--cyan);
}
.member-name { font-size: 13px; flex: 1; }

/* ═══════ ICON BUTTONS ═══════ */
.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: var(--radius-sm);
  color: var(--muted); cursor: pointer;
  transition: all var(--transition);
}
.icon-btn:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.icon-btn.small { width: 28px; height: 28px; }
.icon-btn.small .material-icons-round { font-size: 18px; }
.icon-btn.danger:hover { color: var(--red); }
.mobile-menu { display: none; }

/* ═══════ MODALS ═══════ */
.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.modal-card {
  position: relative; z-index: 1;
  background: var(--surface1);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 28px;
  width: 380px; max-width: 90vw;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(8px); } }
.modal-card.wide { width: 480px; }
.modal-card h3 {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; font-weight: 700; margin-bottom: 16px;
}
.modal-desc { font-size: 13px; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px;
}
.btn-ghost {
  padding: 10px 20px; background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--muted);
  font-family: inherit; font-size: 14px; cursor: pointer;
  transition: all var(--transition);
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-primary {
  padding: 10px 24px; background: var(--cyan); border: none;
  border-radius: var(--radius-sm); color: #000;
  font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all var(--transition);
}
.btn-primary:hover { filter: brightness(1.1); }
.checkbox-group {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; cursor: pointer; padding: 4px 0;
}
.settings-group { margin-bottom: 16px; }
.settings-group label { font-size: 12px; color: var(--muted); margin-bottom: 6px; display: block; }
.settings-group input, .settings-group select {
  width: 100%; padding: 10px 12px;
  background: var(--surface0); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-family: inherit; font-size: 14px; outline: none;
}
.settings-group input:focus { border-color: var(--cyan); }

/* ═══════ TOASTS ═══════ */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 300;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px;
  background: var(--surface1); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  font-size: 13px; pointer-events: auto;
  animation: toastIn 0.3s ease;
  max-width: 380px;
}
.toast.removing { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px) scale(0.95); } }
.toast.info { border-left: 3px solid var(--cyan); }
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.warning { border-left: 3px solid var(--yellow); }
.toast-icon { font-size: 20px; }
.toast.info .toast-icon { color: var(--cyan); }
.toast.success .toast-icon { color: var(--green); }
.toast.error .toast-icon { color: var(--red); }
.toast.warning .toast-icon { color: var(--yellow); }

/* ═══════ SETTINGS SECTIONS ═══════ */
.settings-section {
  border-bottom: 1px solid var(--border); padding-bottom: 16px; margin-bottom: 16px;
}
.settings-section:last-of-type { border-bottom: none; margin-bottom: 8px; }
.settings-section h4 {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; color: var(--cyan);
  margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px;
}
.settings-section h4 .material-icons-round { font-size: 18px; }
.settings-readonly {
  padding: 10px 14px; background: var(--surface0); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-weight: 600; font-size: 14px;
}
.settings-pin-change {
  display: flex; gap: 8px; align-items: center;
}
.settings-pin-change input {
  flex: 1; padding: 8px 12px; background: var(--surface0); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 13px;
}
.settings-pin-change input:focus { border-color: var(--cyan); outline: none; }
.btn-sm {
  padding: 8px 16px; background: var(--cyan); color: #000; border: none;
  border-radius: var(--radius-sm); font-weight: 700; font-size: 12px;
  cursor: pointer; white-space: nowrap; transition: all 0.2s;
}
.btn-sm:hover { filter: brightness(1.15); }
.settings-status {
  font-size: 12px; margin-top: 6px; min-height: 16px;
}
.settings-status.success { color: var(--green); }
.settings-status.error { color: var(--red); }

/* Volume slider */
.volume-slider-row {
  display: flex; align-items: center; gap: 8px;
}
.volume-slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; background: var(--surface2); border-radius: 2px; outline: none;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--cyan); cursor: pointer;
  box-shadow: 0 0 6px rgba(0,180,216,0.4);
}
.volume-slider::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--cyan); cursor: pointer; border: none;
}
.volume-value {
  font-size: 12px; color: var(--muted); min-width: 32px; text-align: right;
}

/* ═══════ 18+ AGE GATE ═══════ */
.age-gate {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
}
.age-gate-card {
  background: var(--surface1); border: 1px solid var(--border);
  border-radius: 20px; padding: 40px 36px; text-align: center;
  max-width: 440px; width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: authFadeIn 0.5s ease;
}
.age-gate-icon { font-size: 56px; display: block; margin-bottom: 16px; }
.age-gate-card h2 {
  font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 12px;
}
.age-gate-card p {
  font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 24px;
}
.age-gate-card strong { color: var(--yellow); }
.age-gate-actions { display: flex; flex-direction: column; gap: 10px; }
.age-confirm {
  padding: 14px 24px; font-size: 15px; font-weight: 700;
  background: var(--cyan); color: #000; border: none;
  border-radius: var(--radius); cursor: pointer; transition: all 0.2s;
}
.age-confirm:hover { filter: brightness(1.15); transform: translateY(-1px); }
.age-deny {
  padding: 12px 24px; font-size: 13px; border: 1px solid var(--surface3);
  background: none; color: var(--muted); border-radius: var(--radius); cursor: pointer;
}
.age-deny:hover { border-color: var(--red); color: var(--red); }

/* Main lobby no-messaging notice */
.lobby-notice {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px; color: var(--muted); font-size: 13px;
  background: var(--surface1); border-top: 1px solid var(--border);
}
.lobby-notice .material-icons-round { font-size: 18px; color: var(--surface3); }

/* ═══════ ADMIN CONTEXT MENU ═══════ */
.context-menu {
  position: fixed; z-index: 500;
  min-width: 180px;
  background: var(--surface1);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  padding: 4px 0;
  opacity: 0; transform: scale(0.92);
  transition: all 0.15s cubic-bezier(0.2, 0, 0.2, 1);
  backdrop-filter: blur(12px);
}
.context-menu.visible { opacity: 1; transform: scale(1); }
.ctx-header {
  padding: 10px 14px; font-size: 12px; font-weight: 700;
  color: var(--cyan); text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.ctx-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; font-size: 13px; color: var(--text);
  cursor: pointer; transition: background 0.15s;
}
.ctx-item:hover { background: rgba(0,180,216,0.1); }
.ctx-item .material-icons-round { font-size: 17px; color: var(--muted); }
.ctx-item:hover .material-icons-round { color: var(--cyan); }
.ctx-item.ctx-danger { color: var(--red); }
.ctx-item.ctx-danger:hover { background: rgba(239,68,68,0.1); }
.ctx-item.ctx-danger .material-icons-round { color: var(--red); }
.ctx-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    transform: translateX(-100%); z-index: 100;
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: flex; }
  .members-panel.visible { width: 200px; min-width: 200px; }
  .settings-pin-change { flex-direction: column; }
}
