:root {
  --bg: #0a0b0f;
  --bg2: #111318;
  --bg3: #1a1d26;
  --bg4: #22263a;
  --border: #2a2f45;
  --text: #e8eaf6;
  --text2: #9099c0;
  --text3: #5c6490;
  --accent: #6c63ff;
  --accent2: #4ade80;
  --gold: #f5c842;
  --red: #ef4444;
  --orange: #f97316;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== LAYOUT ===== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
}

.main { margin-left: 220px; flex: 1; display: flex; flex-direction: column; }

.topbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.content { padding: 24px; flex: 1; }

/* ===== LOGO ===== */
.logo {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo-icon { font-size: 24px; }
.logo-text { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.logo-text span { color: var(--accent); }

/* ===== NAV ===== */
.nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-section { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text3); padding: 16px 8px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text2);
  font-size: 14px;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { background: var(--bg4); color: var(--text); }
.nav-item .icon { font-size: 18px; width: 20px; text-align: center; }
.nav-badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 20px; font-weight: 600; }

/* ===== BALANCE BAR ===== */
.balance-bar { padding: 12px 8px; border-top: 1px solid var(--border); }
.balance-currency {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
}
.balance-currency:hover { background: var(--bg4); }
.bal-label { font-size: 12px; color: var(--text2); }
.bal-amount { font-size: 13px; font-weight: 600; color: var(--text); }
.bal-usd { font-size: 10px; color: var(--text3); }

/* ===== TOPBAR ELEMENTS ===== */
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.page-title { font-size: 18px; font-weight: 600; }

.btn {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #5a52e0; }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg4); }
.btn-success { background: var(--accent2); color: #000; }
.btn-success:hover { background: #3dba6a; }
.btn-danger { background: var(--red); color: #fff; }
.btn-lg { padding: 12px 28px; font-size: 15px; border-radius: var(--radius); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== CARDS ===== */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-title { font-size: 14px; color: var(--text2); margin-bottom: 4px; }
.card-value { font-size: 24px; font-weight: 700; }

/* ===== GAME CARDS (lobby) ===== */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.game-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  text-decoration: none;
  display: block;
}
.game-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.game-card-thumb {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
}
.game-card-info { padding: 14px; }
.game-card-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.game-card-desc { font-size: 12px; color: var(--text2); }
.game-card-rtp { font-size: 11px; color: var(--accent2); margin-top: 6px; }

/* ===== CRASH COLORS ===== */
.gc-crash { background: linear-gradient(135deg, #1a0a2e 0%, #2d1060 100%); }
.gc-mines { background: linear-gradient(135deg, #0a1a0a 0%, #0d3d1a 100%); }
.gc-dice  { background: linear-gradient(135deg, #0a0f1a 0%, #102040 100%); }
.gc-slots { background: linear-gradient(135deg, #1a0a0a 0%, #3d1010 100%); }

/* ===== INPUTS ===== */
.input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font);
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus { border-color: var(--accent); }
.input-group { position: relative; }
.input-suffix {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text2); font-size: 13px;
}
.label { font-size: 12px; color: var(--text2); margin-bottom: 6px; display: block; }

/* ===== SELECT ===== */
.select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  cursor: pointer;
  width: 100%;
}

/* ===== TABLES ===== */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--text2); padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 500; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); }
.table tr:last-child td { border-bottom: none; }
.table .win { color: var(--accent2); }
.table .loss { color: var(--red); }

/* ===== CHIPS ===== */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.chip-win { background: rgba(74, 222, 128, 0.15); color: var(--accent2); }
.chip-loss { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.chip-pending { background: rgba(245, 200, 66, 0.15); color: var(--gold); }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 90%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.modal-close { float: right; cursor: pointer; color: var(--text2); font-size: 20px; }

/* ===== TOAST ===== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 13px;
  min-width: 220px;
  animation: slideIn 0.2s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.success { border-color: var(--accent2); }
.toast.error { border-color: var(--red); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== LIVE TICKER ===== */
.live-ticker {
  display: flex; align-items: center; gap: 6px;
  overflow: hidden;
  height: 32px;
  flex: 1;
  margin: 0 16px;
}
.ticker-item {
  background: var(--bg3);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.ticker-item.high { color: var(--accent2); }
.ticker-item.low { color: var(--text2); }
.ticker-item.mid { color: var(--gold); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar .logo-text,
  .sidebar .nav-item span,
  .sidebar .balance-bar,
  .sidebar .nav-section { display: none; }
  .main { margin-left: 60px; }
  .games-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== UTILS ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text2); }
.text-success { color: var(--accent2); }
.text-danger { color: var(--red); }
.text-gold { color: var(--gold); }
.font-bold { font-weight: 700; }
.hidden { display: none; }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
