/* ============================================
   NEXUS GAMING - MAIN CSS
   Global styles, glassmorphism, animations
   ============================================ */

/* CSS Custom Properties */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #0f0f1a;
  --bg-tertiary: #13131f;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.07);
  --surface-strong: rgba(255,255,255,0.10);
  --accent-primary: #ffd700;
  --accent-secondary: #ffa502;
  --accent-success: #00ff88;
  --accent-danger: #ff4757;
  --accent-warning: #ffa502;
  --accent-gold: #ffd700;
  --text-primary: #ffffff;
  --text-secondary: rgba(255,255,255,0.6);
  --text-muted: rgba(255,255,255,0.35);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.15);
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg: 0 16px 64px rgba(0,0,0,0.6);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --glow-purple: 0 0 20px rgba(108,99,255,0.5), 0 0 40px rgba(108,99,255,0.2);
  --glow-cyan: 0 0 20px rgba(0,212,255,0.5), 0 0 40px rgba(0,212,255,0.2);
  --glow-green: 0 0 20px rgba(0,255,136,0.5), 0 0 40px rgba(0,255,136,0.2);
  --glow-red: 0 0 20px rgba(255,71,87,0.5), 0 0 40px rgba(255,71,87,0.2);
  --glow-gold: 0 0 20px rgba(255,215,0,0.5), 0 0 40px rgba(255,215,0,0.2);
  --nav-height: 64px;
}

/* Theme variants */
[data-theme="purple"] { --accent-primary: #6c63ff; --accent-secondary: #00d4ff; }
[data-theme="cyan"]   { --accent-primary: #00d4ff; --accent-secondary: #6c63ff; }
[data-theme="gold"]   { --accent-primary: #ffd700; --accent-secondary: #ffa502; }
[data-theme="red"]    { --accent-primary: #ff4757; --accent-secondary: #ff6b81; }

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; outline: none; font-family: var(--font); }
input, select, textarea { font-family: var(--font); outline: none; }
ul, ol { list-style: none; }

/* Animated gradient background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, color-mix(in srgb, var(--accent-primary) 12%, transparent) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, color-mix(in srgb, var(--accent-secondary) 8%, transparent) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 0%, var(--bg-primary) 100%);
  pointer-events: none;
  z-index: 0;
  animation: bgShift 15s ease-in-out infinite alternate;
}
@keyframes bgShift {
  0%   { background-position: 0% 0%, 100% 100%; }
  100% { background-position: 100% 100%, 0% 0%; }
}

/* Particle canvas */
#particles-canvas {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.4;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent-primary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-secondary); }

/* ============================================
   GLASSMORPHISM UTILITIES
   ============================================ */
.glass {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.glass-hover {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.glass-hover:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.glass-strong {
  background: var(--surface-strong);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
}

/* Neon glow utilities */
.glow-purple { box-shadow: var(--glow-purple); }
.glow-cyan   { box-shadow: var(--glow-cyan); }
.glow-green  { box-shadow: var(--glow-green); }
.glow-red    { box-shadow: var(--glow-red); }
.glow-gold   { box-shadow: var(--glow-gold); }
.text-glow-purple { text-shadow: 0 0 10px rgba(108,99,255,0.8), 0 0 20px rgba(108,99,255,0.4); }
.text-glow-cyan   { text-shadow: 0 0 10px rgba(0,212,255,0.8), 0 0 20px rgba(0,212,255,0.4); }
.text-glow-green  { text-shadow: 0 0 10px rgba(0,255,136,0.8), 0 0 20px rgba(0,255,136,0.4); }
.text-glow-red    { text-shadow: 0 0 10px rgba(255,71,87,0.8), 0 0 20px rgba(255,71,87,0.4); }

/* ============================================
   NAVIGATION BAR
   ============================================ */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
  z-index: 1000;
}
.navbar-logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.navbar-nav a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
  white-space: nowrap;
}
.navbar-nav a:hover, .navbar-nav a.active {
  color: var(--text-primary);
  background: var(--surface-hover);
}
.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.balance-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-success);
  cursor: pointer;
  transition: var(--transition);
}
.balance-display:hover { border-color: var(--accent-success); box-shadow: var(--glow-green); }
.balance-display .balance-icon { font-size: 1rem; }

.nav-icon-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1.1rem;
  transition: var(--transition);
  position: relative;
}
.nav-icon-btn:hover { color: var(--text-primary); border-color: var(--border-hover); background: var(--surface-hover); }
.nav-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 16px; height: 16px;
  background: var(--accent-danger);
  border-radius: 50%;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  color: white;
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}
.user-avatar:hover { border-color: var(--accent-primary); box-shadow: var(--glow-purple); }

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  width: 220px;
  height: calc(100vh - var(--nav-height));
  background: rgba(10,10,15,0.7);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  overflow-y: auto;
  z-index: 900;
  transition: var(--transition);
}
.sidebar.collapsed { width: 64px; }
.sidebar-section { margin-bottom: 24px; }
.sidebar-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 0 8px;
  margin-bottom: 8px;
}
.sidebar.collapsed .sidebar-label { display: none; }
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-item:hover { color: var(--text-primary); background: var(--surface-hover); }
.sidebar-item.active { color: var(--accent-primary); background: rgba(108,99,255,0.1); border-left: 2px solid var(--accent-primary); }
.sidebar-item .item-icon { font-size: 1.1rem; flex-shrink: 0; min-width: 20px; text-align: center; }
.sidebar.collapsed .item-text { display: none; }
.sidebar-toggle {
  position: absolute;
  bottom: 16px; right: -12px;
  width: 24px; height: 24px;
  background: var(--accent-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.7rem;
  color: white;
  box-shadow: var(--glow-purple);
}

/* Main content area */
.main-content {
  margin-left: 220px;
  margin-top: var(--nav-height);
  padding: 24px;
  min-height: calc(100vh - var(--nav-height));
  position: relative;
  z-index: 1;
  transition: var(--transition);
}
.main-content.sidebar-collapsed { margin-left: 64px; }

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: var(--transition);
}
.btn:hover::after { background: rgba(255,255,255,0.05); }
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), color-mix(in srgb, var(--accent-primary) 70%, var(--accent-secondary)));
  color: white;
  box-shadow: 0 4px 15px rgba(108,99,255,0.3);
}
.btn-primary:hover { box-shadow: var(--glow-purple); transform: translateY(-1px); }
.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--border-hover); }
.btn-danger {
  background: linear-gradient(135deg, var(--accent-danger), #ff6b81);
  color: white;
  box-shadow: 0 4px 15px rgba(255,71,87,0.3);
}
.btn-danger:hover { box-shadow: var(--glow-red); transform: translateY(-1px); }
.btn-success {
  background: linear-gradient(135deg, var(--accent-success), #00cc6a);
  color: #0a0a0f;
  box-shadow: 0 4px 15px rgba(0,255,136,0.3);
}
.btn-success:hover { box-shadow: var(--glow-green); transform: translateY(-1px); }
.btn-warning {
  background: linear-gradient(135deg, var(--accent-warning), #ff7f00);
  color: white;
  box-shadow: 0 4px 15px rgba(255,165,2,0.3);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--accent-primary); background: rgba(108,99,255,0.08); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-xl { padding: 16px 36px; font-size: 1.1rem; border-radius: var(--radius); }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--radius-sm); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* ============================================
   INPUTS
   ============================================ */
.input-group { display: flex; flex-direction: column; gap: 6px; }
.input-label { font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); }
.input {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition);
  width: 100%;
}
.input:focus { border-color: var(--accent-primary); box-shadow: 0 0 0 3px rgba(108,99,255,0.15); background: rgba(255,255,255,0.07); }
.input::placeholder { color: var(--text-muted); }
.input-with-icon { position: relative; }
.input-with-icon .input { padding-left: 40px; }
.input-with-icon .input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
select.input { cursor: pointer; }
select.input option { background: var(--bg-secondary); }
.range-input {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--surface-strong);
  border-radius: 2px;
  outline: none;
}
.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  box-shadow: var(--glow-purple);
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(20px);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 1rem; font-weight: 600; }
.card-subtitle { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }

/* Badges / Chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-primary { background: rgba(108,99,255,0.2); color: var(--accent-primary); border: 1px solid rgba(108,99,255,0.3); }
.badge-success { background: rgba(0,255,136,0.15); color: var(--accent-success); border: 1px solid rgba(0,255,136,0.3); }
.badge-danger  { background: rgba(255,71,87,0.15); color: var(--accent-danger); border: 1px solid rgba(255,71,87,0.3); }
.badge-warning { background: rgba(255,165,2,0.15); color: var(--accent-warning); border: 1px solid rgba(255,165,2,0.3); }
.badge-cyan    { background: rgba(0,212,255,0.15); color: var(--accent-secondary); border: 1px solid rgba(0,212,255,0.3); }
.badge-gold    { background: rgba(255,215,0,0.15); color: var(--accent-gold); border: 1px solid rgba(255,215,0,0.3); }

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: var(--transition);
  position: relative;
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title { font-size: 1.2rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
}
.modal-close:hover { color: var(--text-primary); background: var(--surface-hover); }

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
#toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
}
.toast.show { transform: translateX(0); }
.toast.hide { transform: translateX(120%); }
.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-title { font-size: 0.875rem; font-weight: 600; }
.toast-message { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.toast-success { border-left: 3px solid var(--accent-success); }
.toast-error   { border-left: 3px solid var(--accent-danger); }
.toast-warning { border-left: 3px solid var(--accent-warning); }
.toast-info    { border-left: 3px solid var(--accent-secondary); }
.toast-loss    { border-left: 3px solid var(--accent-danger); }
.toast-close { color: var(--text-muted); cursor: pointer; font-size: 0.9rem; padding: 2px; }
.toast-close:hover { color: var(--text-primary); }

/* ============================================
   CHAT PANEL
   ============================================ */
.chat-panel {
  position: fixed;
  top: var(--nav-height);
  right: 0;
  width: 300px;
  height: calc(100vh - var(--nav-height));
  background: rgba(10,10,15,0.9);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 800;
  transform: translateX(100%);
  transition: var(--transition);
}
.chat-panel.open { transform: translateX(0); }
.chat-toggle {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 32px;
  height: 64px;
  background: var(--accent-primary);
  border-radius: 8px 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 801;
  font-size: 0.9rem;
  color: white;
  transition: var(--transition);
  writing-mode: vertical-rl;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
}
.chat-toggle:hover { background: var(--accent-secondary); }
.chat-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: fadeIn 0.3s ease;
}
.chat-msg-header { display: flex; align-items: center; gap: 6px; }
.chat-msg-user { font-size: 0.75rem; font-weight: 600; color: var(--accent-primary); }
.chat-msg-time { font-size: 0.65rem; color: var(--text-muted); }
.chat-msg-text { font-size: 0.8rem; color: var(--text-secondary); padding-left: 4px; }
.chat-input-area {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}
.chat-input-area .input { flex: 1; padding: 8px 12px; font-size: 0.8rem; }

/* ============================================
   LEADERBOARD
   ============================================ */
.leaderboard-table { width: 100%; border-collapse: collapse; }
.leaderboard-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.leaderboard-table td { padding: 10px 12px; font-size: 0.875rem; border-bottom: 1px solid rgba(255,255,255,0.04); }
.leaderboard-table tr:hover td { background: var(--surface-hover); }
.rank-badge {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}
.rank-1 { background: linear-gradient(135deg, #ffd700, #ffaa00); color: #0a0a0f; }
.rank-2 { background: linear-gradient(135deg, #c0c0c0, #a0a0a0); color: #0a0a0f; }
.rank-3 { background: linear-gradient(135deg, #cd7f32, #a0522d); color: white; }
.rank-other { background: var(--surface-strong); color: var(--text-secondary); }

/* ============================================
   ACHIEVEMENTS
   ============================================ */
.achievement-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.achievement-badge.unlocked { border-color: rgba(255,215,0,0.3); background: rgba(255,215,0,0.05); }
.achievement-badge:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.achievement-icon { font-size: 1.8rem; }
.achievement-info .achievement-name { font-size: 0.875rem; font-weight: 600; }
.achievement-info .achievement-desc { font-size: 0.75rem; color: var(--text-secondary); }
.achievement-locked { opacity: 0.4; filter: grayscale(1); }

/* ============================================
   LOADING SPINNER
   ============================================ */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-sm { width: 18px; height: 18px; border-width: 2px; }
.spinner-lg { width: 48px; height: 48px; border-width: 4px; }

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1 { font-size: 2.5rem; font-weight: 800; line-height: 1.2; }
h2 { font-size: 2rem; font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.5rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 1.25rem; font-weight: 600; }
h5 { font-size: 1rem; font-weight: 600; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 2rem; }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-success); }
.text-danger  { color: var(--accent-danger); }
.text-warning { color: var(--accent-warning); }
.text-purple  { color: var(--accent-primary); }
.text-cyan    { color: var(--accent-secondary); }
.text-gold    { color: var(--accent-gold); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.p-8  { padding: 8px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-hidden { overflow: hidden; }
.rounded { border-radius: var(--radius); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-full { border-radius: 9999px; }
.border { border: 1px solid var(--border); }
.hidden { display: none !important; }
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Animated counter */
.anim-counter { font-variant-numeric: tabular-nums; }

/* XP Bar */
.xp-bar-container { background: var(--surface-strong); border-radius: 4px; height: 6px; overflow: hidden; }
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 4px;
  transition: width 1s ease;
  position: relative;
}
.xp-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
  animation: shimmer 2s infinite;
}
@keyframes shimmer { 0%,100% { opacity: 0; } 50% { opacity: 1; } }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.divider-text {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.divider-text::before, .divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes glow { 0%,100% { box-shadow: var(--glow-purple); } 50% { box-shadow: 0 0 40px rgba(108,99,255,0.8); } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
@keyframes bounce {
  0%,100% { transform: translateY(0); animation-timing-function: cubic-bezier(0.8,0,1,1); }
  50% { transform: translateY(-12px); animation-timing-function: cubic-bezier(0,0,0.2,1); }
}
@keyframes winPop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes coinSpin { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animate-fadeIn { animation: fadeIn 0.4s ease; }
.animate-fadeInUp { animation: fadeInUp 0.4s ease; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-bounce { animation: bounce 1s infinite; }
.animate-shake { animation: shake 0.5s ease; }
.animate-glow { animation: glow 2s ease-in-out infinite; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .sidebar { width: 64px; }
  .sidebar .sidebar-label, .sidebar .item-text { display: none; }
  .main-content { margin-left: 64px; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); width: 220px; }
  .sidebar.mobile-open .sidebar-label, .sidebar.mobile-open .item-text { display: block; }
  .main-content { margin-left: 0; padding: 16px; }
  .navbar-nav { display: none; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.5rem; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .chat-panel { width: 100%; }
}
@media (max-width: 480px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .main-content { padding: 12px; }
}

/* Live feed */
.live-feed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  animation: fadeInUp 0.3s ease;
}
.live-feed-item.win { border-left: 2px solid var(--accent-success); }
.live-feed-item.loss { border-left: 2px solid var(--accent-danger); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-success); animation: pulse 1.5s infinite; }

/* Profile level badge */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-text-gold {
  background: linear-gradient(135deg, #ffd700, #ffa502);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   ADDITIONAL POLISH & MISSING STYLES
   ============================================ */

/* Sidebar profile section */
.sidebar-profile {
  padding: 16px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-profile-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.875rem;
  flex-shrink: 0;
}
.sidebar-profile-info { overflow: hidden; }
.sidebar-profile-name { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-profile-level { font-size: 0.65rem; color: var(--text-muted); }
.sidebar.collapsed .sidebar-profile-info { display: none; }

/* Hover tooltip for collapsed sidebar */
.sidebar.collapsed .sidebar-item { position: relative; }
.sidebar.collapsed .sidebar-item:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.8rem;
  white-space: nowrap;
  z-index: 1000;
  margin-left: 8px;
  pointer-events: none;
}

/* Smooth number transitions */
.tabular-nums { font-variant-numeric: tabular-nums; }

/* Glow border animation */
@keyframes borderGlow {
  0%, 100% { border-color: rgba(108,99,255,0.3); }
  50% { border-color: rgba(108,99,255,0.8); box-shadow: 0 0 20px rgba(108,99,255,0.3); }
}
.border-glow { animation: borderGlow 2s ease-in-out infinite; }

/* Win/Loss flash overlay */
.flash-win {
  animation: flashWin 0.6s ease;
}
.flash-loss {
  animation: flashLoss 0.6s ease;
}
@keyframes flashWin {
  0%, 100% { background: transparent; }
  50% { background: rgba(0,255,136,0.08); }
}
@keyframes flashLoss {
  0%, 100% { background: transparent; }
  50% { background: rgba(255,71,87,0.08); }
}

/* Chip stack animation */
@keyframes chipDrop {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.chip-drop { animation: chipDrop 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

/* Number roll animation */
@keyframes numberRoll {
  0% { transform: translateY(-100%); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.number-roll { animation: numberRoll 0.3s ease; }

/* Confetti-like win effect */
@keyframes confetti {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(-100px) rotate(720deg); opacity: 0; }
}

/* Neon text pulse */
@keyframes neonPulse {
  0%, 100% { text-shadow: 0 0 10px rgba(108,99,255,0.8), 0 0 20px rgba(108,99,255,0.4); }
  50% { text-shadow: 0 0 20px rgba(108,99,255,1), 0 0 40px rgba(108,99,255,0.6), 0 0 60px rgba(108,99,255,0.3); }
}
.neon-pulse { animation: neonPulse 2s ease-in-out infinite; }

/* Gradient border */
.gradient-border {
  position: relative;
  border-radius: var(--radius);
}
.gradient-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius) + 1px);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  z-index: -1;
}

/* Scrollable container */
.scroll-x { overflow-x: auto; }
.scroll-y { overflow-y: auto; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Tooltip */
[data-tip] { position: relative; cursor: help; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 1000;
  margin-bottom: 6px;
  pointer-events: none;
  color: var(--text-primary);
}

/* Progress bar */
.progress-bar {
  height: 6px;
  background: var(--surface-strong);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 3px;
  transition: width 0.5s ease;
}
.progress-fill.success { background: linear-gradient(90deg, var(--accent-success), #00cc6a); }
.progress-fill.danger { background: linear-gradient(90deg, var(--accent-danger), #ff6b81); }
.progress-fill.warning { background: linear-gradient(90deg, var(--accent-warning), #ff7f00); }

/* Divider with label */
.section-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.section-divider::before, .section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Floating action button */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--glow-purple), var(--shadow-lg);
  transition: var(--transition);
  z-index: 500;
  border: none;
  color: white;
}
.fab:hover { transform: scale(1.1) translateY(-2px); }
.fab:active { transform: scale(0.95); }

/* Responsive table */
.table-responsive { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; }
table.data-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data-table td {
  padding: 12px 16px;
  font-size: 0.875rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
table.data-table tr:hover td { background: var(--surface-hover); }
table.data-table tr:last-child td { border-bottom: none; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state-title { font-size: 1rem; font-weight: 600; margin-bottom: 8px; color: var(--text-secondary); }
.empty-state-desc { font-size: 0.875rem; }

/* Pulse ring */
@keyframes pulseRing {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}
.pulse-ring {
  position: relative;
}
.pulse-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--accent-success);
  animation: pulseRing 1.5s ease-out infinite;
}

/* Coin flip */
@keyframes coinFlip {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}
.coin-flip { animation: coinFlip 0.6s ease; }

/* Slide panel */
.slide-panel {
  position: fixed;
  top: var(--nav-height);
  right: 0;
  width: 360px;
  height: calc(100vh - var(--nav-height));
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: 900;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  padding: 20px;
}
.slide-panel.open { transform: translateX(0); }

/* Mobile hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}
.hamburger span {
  width: 22px; height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: var(--transition);
}
@media (max-width: 768px) {
  .hamburger { display: flex; }
}

/* Keyboard shortcut badge */
.kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: monospace;
  color: var(--text-secondary);
}

/* Status indicator */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.online { background: var(--accent-success); box-shadow: 0 0 6px var(--accent-success); }
.status-dot.offline { background: var(--text-muted); }
.status-dot.busy { background: var(--accent-warning); }

/* Glassmorphism card variants */
.card-glow-purple { box-shadow: 0 0 30px rgba(108,99,255,0.15); border-color: rgba(108,99,255,0.2); }
.card-glow-cyan { box-shadow: 0 0 30px rgba(0,212,255,0.15); border-color: rgba(0,212,255,0.2); }
.card-glow-green { box-shadow: 0 0 30px rgba(0,255,136,0.15); border-color: rgba(0,255,136,0.2); }
.card-glow-red { box-shadow: 0 0 30px rgba(255,71,87,0.15); border-color: rgba(255,71,87,0.2); }

/* Animated background gradient for special cards */
.card-animated-bg {
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}

/* Number input arrows hidden */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .navbar, .sidebar, .chat-panel, .chat-toggle, #toast-container, #particles-canvas { display: none !important; }
  .main-content { margin: 0 !important; padding: 20px !important; }
  body { background: white !important; color: black !important; }
}
