:root {
  --bg: #070b15;
  --bg2: #0c1124;
  --surface: rgba(19, 24, 43, 0.75);
  --surface-hover: rgba(25, 32, 56, 0.85);
  --primary: #667eea;
  --primary-dark: #5a6fd6;
  --primary-glow: rgba(102, 126, 234, 0.35);
  --accent: #f0b90b;
  --accent-dark: #d4a309;
  --accent-glow: rgba(240, 185, 11, 0.35);
  --success: #00c853;
  --success-glow: rgba(0, 200, 83, 0.3);
  --danger: #ff1744;
  --danger-glow: rgba(255, 23, 68, 0.3);
  --text: #e0e6f0;
  --text-muted: #7a82a0;
  --text-dim: #4a5068;
  --border: rgba(102, 126, 234, 0.1);
  --border-light: rgba(102, 126, 234, 0.06);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 0% 20%, rgba(102, 126, 234, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 80%, rgba(240, 185, 11, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(102, 126, 234, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

#particles-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
}

main { position: relative; z-index: 1; padding-top: 72px; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #3a4050; }
::selection { background: rgba(102, 126, 234, 0.3); color: #fff; }

/* ─── Glass Navbar ─── */
.navbar {
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 1rem;
  height: 60px;
  z-index: 1000;
}
.navbar-brand {
  font-weight: 800;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.5px;
}
.navbar-brand .brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #fff;
  animation: brandPulse 3s ease-in-out infinite;
}
.navbar-brand .brand-text {
  background: linear-gradient(135deg, var(--text), var(--primary) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-link {
  color: var(--text-muted) !important;
  font-weight: 500;
  font-size: 0.8rem;
  padding: 0.4rem 0.75rem !important;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  position: relative;
}
.nav-link:hover, .nav-link.active {
  color: var(--text) !important;
  background: rgba(102, 126, 234, 0.1);
}
.nav-link i { margin-right: 4px; font-size: 0.85rem; }
.navbar-toggler { border: none; color: var(--text-muted); padding: 0.25rem; cursor: pointer; }
.navbar-toggler:focus { box-shadow: none; }

/* ─── Balance Badge ─── */
.balance-badge {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.15), rgba(240, 185, 11, 0.1));
  border: 1px solid rgba(240, 185, 11, 0.2);
  border-radius: 12px;
  padding: 0.4rem 0.9rem;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--accent);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.balance-badge:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.25), rgba(240, 185, 11, 0.2));
  box-shadow: 0 0 20px rgba(240, 185, 11, 0.15);
}
.balance-badge .coin-icon { animation: coinSpin 4s linear infinite; }

/* ─── User Menu ─── */
.user-menu-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition);
}
.user-menu-btn:hover {
  background: var(--surface-hover);
  border-color: rgba(102, 126, 234, 0.3);
}
.dropdown-menu-custom {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem;
  min-width: 180px;
}
.dropdown-menu-custom .dropdown-item {
  color: var(--text);
  font-size: 0.82rem;
  border-radius: var(--radius-xs);
  padding: 0.5rem 0.75rem;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dropdown-menu-custom .dropdown-item:hover {
  background: rgba(102, 126, 234, 0.1);
  color: var(--text);
}
.dropdown-menu-custom .dropdown-divider {
  border-color: var(--border);
  margin: 0.25rem 0;
}

/* ─── Auth Buttons ─── */
.btn-auth {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.9rem;
  font-weight: 600;
  font-size: 0.78rem;
  color: #fff;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-auth:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 25px var(--primary-glow);
  color: #fff;
}
.btn-auth-reg {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-auth-reg:hover {
  border-color: var(--primary);
  color: var(--text);
  box-shadow: none;
}

/* ─── Glass Cards ─── */
.glass-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.3), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.glass-card:hover::before { opacity: 1; }
.glass-card:hover {
  transform: translateY(-2px);
  border-color: rgba(102, 126, 234, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ─── Game Cards (Lobby) ─── */
.game-card-wrap {
  perspective: 800px;
  cursor: pointer;
}
.game-card-lobby {
  background: linear-gradient(145deg, var(--surface), rgba(14, 18, 36, 0.8));
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  height: 100%;
  transform-style: preserve-3d;
}
.game-card-lobby:hover {
  transform: translateY(-6px) rotateX(4deg);
  border-color: rgba(102, 126, 234, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(102, 126, 234, 0.1);
}
.game-card-lobby::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, transparent 40%, rgba(102, 126, 234, 0.05) 100%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}
.game-card-lobby:hover::after { opacity: 1; }
.game-card-lobby .card-glow {
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), transparent, var(--accent));
  opacity: 0;
  transition: opacity var(--transition);
  z-index: -1;
  filter: blur(2px);
}
.game-card-lobby:hover .card-glow { opacity: 0.3; }
.game-card-lobby .card-icon {
  font-size: 2.8rem;
  margin-bottom: 0.75rem;
  display: inline-block;
  transition: transform var(--transition);
}
.game-card-lobby:hover .card-icon {
  transform: scale(1.15) translateY(-3px);
  animation: cardIconFloat 2s ease-in-out infinite;
}
.game-card-lobby .card-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.game-card-lobby .card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.game-card-lobby .card-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.5rem;
}
.game-card-lobby .card-badge.active { background: rgba(0, 200, 83, 0.15); color: var(--success); }
.game-card-lobby .card-badge.coming { background: rgba(255, 23, 68, 0.15); color: var(--danger); }
.game-card-lobby.disabled { opacity: 0.4; cursor: default; }
.game-card-lobby.disabled:hover { transform: none; box-shadow: none; }

/* ─── Page Title ─── */
.page-title-wrap { margin-bottom: 1.5rem; }
.page-title {
  font-weight: 900;
  font-size: 1.8rem;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--text), var(--primary) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

/* ─── Stat Cards ─── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  transition: all var(--transition);
}
.stat-card:hover {
  border-color: rgba(102, 126, 234, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.stat-value { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.stat-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.15rem;
}

/* ─── Buttons ─── */
.btn-primary-custom {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: #fff;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.btn-primary-custom::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s;
}
.btn-primary-custom:hover::after { opacity: 1; }
.btn-primary-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--primary-glow);
  color: #fff;
}
.btn-primary-custom:disabled { opacity: 0.5; transform: none; box-shadow: none; }

.btn-accent {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.4rem;
  font-weight: 700;
  font-size: 0.88rem;
  color: #0a0e1a;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.btn-accent::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.2) 100%);
  opacity: 0;
  transition: opacity 0.3s;
}
.btn-accent:hover::after { opacity: 1; }
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
  color: #0a0e1a;
}
.btn-accent:disabled { opacity: 0.5; transform: none; box-shadow: none; }

.btn-danger-custom {
  background: linear-gradient(135deg, var(--danger), #d50000);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: #fff;
  transition: all var(--transition);
}
.btn-danger-custom:hover { transform: translateY(-2px); color: #fff; }
.btn-danger-custom:disabled { opacity: 0.5; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 1.2rem;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: all var(--transition);
}
.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--text);
  background: rgba(102, 126, 234, 0.05);
}

.btn-sm-custom { padding: 0.35rem 0.75rem; font-size: 0.75rem; border-radius: var(--radius-xs); }

/* ─── Inputs ─── */
.bet-input {
  background: rgba(14, 18, 36, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
  width: 100%;
  transition: all var(--transition);
}
.bet-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
.bet-input::placeholder { color: var(--text-dim); }
select.bet-input { cursor: pointer; appearance: auto; }

.input-group-custom {
  position: relative;
}
.input-group-custom .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}
.input-group-custom .bet-input { padding-left: 2.4rem; }

/* ─── Amount Presets ─── */
.amount-preset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 18, 36, 0.8);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 0.3rem 0.6rem;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  min-width: 44px;
  min-height: 36px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.amount-preset:hover, .amount-preset.active {
  background: rgba(102, 126, 234, 0.12);
  border-color: var(--primary);
  color: var(--text);
}

/* ─── Auth Pages ─── */
.auth-page {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
}
.auth-container {
  width: 100%;
  max-width: 420px;
}
.auth-card {
  background: rgba(19, 24, 43, 0.7);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
}
.auth-card .auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.auth-card .auth-logo .logo-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  margin-bottom: 0.75rem;
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);
}
.auth-card .auth-logo h2 {
  font-weight: 800;
  font-size: 1.4rem;
  background: linear-gradient(135deg, var(--text), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-card .auth-logo p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}
.auth-card .form-group {
  margin-bottom: 1.2rem;
}
.auth-card .form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.auth-card .form-group .auth-input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(14, 18, 36, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  transition: all var(--transition);
}
.auth-card .form-group .auth-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}
.auth-card .form-group .auth-input::placeholder { color: var(--text-dim); }
.auth-card .auth-error {
  background: rgba(255, 23, 68, 0.1);
  border: 1px solid rgba(255, 23, 68, 0.2);
  border-radius: var(--radius-xs);
  padding: 0.6rem 0.8rem;
  font-size: 0.8rem;
  color: var(--danger);
  margin-bottom: 1rem;
  display: none;
}
.auth-card .auth-error.show { display: block; }
.auth-card .btn-auth-submit {
  width: 100%;
  padding: 0.9rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.auth-card .btn-auth-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255, 255, 255, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s;
}
.auth-card .btn-auth-submit:hover::after { opacity: 1; }
.auth-card .btn-auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--primary-glow);
}

.auth-card .auth-footer {
  text-align: center;
  margin-top: 1.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.auth-card .auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}
.auth-card .auth-footer a:hover { color: var(--accent); }

/* ─── History ─── */
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.8rem;
  transition: background 0.15s;
}
.history-item:hover { background: rgba(102, 126, 234, 0.04); }
.history-item:last-child { border-bottom: none; }
.history-game { font-weight: 600; min-width: 60px; }
.history-amount { color: var(--text-muted); }
.history-result { font-weight: 600; }
.history-time { color: var(--text-muted); font-size: 0.72rem; }
.badge-win { background: rgba(0, 200, 83, 0.15); color: var(--success); padding: 0.15rem 0.45rem; border-radius: 6px; font-size: 0.7rem; font-weight: 600; }
.badge-loss { background: rgba(255, 23, 68, 0.15); color: var(--danger); padding: 0.15rem 0.45rem; border-radius: 6px; font-size: 0.7rem; font-weight: 600; }

/* ─── Modal ─── */
.modal-content-custom {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.modal-header-custom {
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
}
.modal-header-custom .btn-close { filter: invert(1); }
.modal-content-custom .modal-title { font-weight: 700; }

/* ─── Toast ─── */
.toast-container {
  position: fixed;
  top: 72px;
  right: 16px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 360px;
  pointer-events: none;
}
.flexbet-toast {
  background: var(--surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem 0.75rem 2.4rem;
  color: var(--text);
  font-size: 0.82rem;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  animation: toastSlideIn 0.35s ease, toastGlow 2s ease-in-out;
  position: relative;
  line-height: 1.4;
  word-break: break-word;
  pointer-events: auto;
  min-width: 280px;
}
.flexbet-toast .toast-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
}
.flexbet-toast .toast-close {
  position: absolute;
  right: 8px;
  top: 6px;
  cursor: pointer;
  opacity: 0.4;
  font-size: 0.7rem;
  transition: opacity 0.15s;
}
.flexbet-toast .toast-close:hover { opacity: 1; }
.flexbet-toast.toast-success { border-left: 3px solid var(--success); }
.flexbet-toast.toast-error { border-left: 3px solid var(--danger); }
.flexbet-toast.toast-info { border-left: 3px solid var(--primary); }
.flexbet-toast.toast-win {
  border-left: 3px solid var(--accent);
  background: linear-gradient(135deg, var(--surface), rgba(240, 185, 11, 0.08));
}

/* ─── Loading ─── */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(102, 126, 234, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
#loadingOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 14, 26, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
#loadingOverlay.d-none { display: none !important; }
#loadingOverlay .loader-content {
  text-align: center;
}
#loadingOverlay .loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(102, 126, 234, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 1rem;
}
#loadingOverlay .loader-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

/* ─── Footer ─── */
footer {
  border-top: 1px solid var(--border-light);
  padding: 1.5rem 0;
  margin-top: 3rem;
  position: relative;
  z-index: 1;
}
footer .text-muted { color: var(--text-dim) !important; font-size: 0.75rem; }

/* ─── Roulette ─── */
.roulette-num {
  transition: all 0.15s;
  cursor: pointer;
}
.roulette-num:hover { filter: brightness(1.3); transform: scale(1.05); }
.roulette-num:active { transform: scale(0.95); }

/* ─── Mine Cell ─── */
.mine-cell {
  aspect-ratio: 1;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.mine-cell:hover { border-color: rgba(102, 126, 234, 0.3); background: var(--surface-hover); }
.mine-cell:active { transform: scale(0.95); }

/* ─── Slot Cell ─── */
.slot-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  transition: all 0.15s;
}

/* ─── Keyframes ─── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(102, 126, 234, 0.2); }
  50% { box-shadow: 0 0 24px rgba(102, 126, 234, 0.4); }
}
@keyframes brandPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(102, 126, 234, 0.3); }
  50% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.5), 0 0 40px rgba(240, 185, 11, 0.2); }
}
@keyframes coinSpin {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}
@keyframes cardIconFloat {
  0%, 100% { transform: translateY(0) scale(1.15); }
  50% { transform: translateY(-4px) scale(1.15); }
}
@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toastGlow {
  0%, 100% { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); }
  50% { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(102, 126, 234, 0.1); }
}
@keyframes numberCount {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.anim-fade-up { animation: fadeInUp 0.5s ease both; }
.anim-fade-up-1 { animation-delay: 0.05s; }
.anim-fade-up-2 { animation-delay: 0.1s; }
.anim-fade-up-3 { animation-delay: 0.15s; }
.anim-fade-up-4 { animation-delay: 0.2s; }
.anim-fade-up-5 { animation-delay: 0.25s; }
.anim-scale { animation: scaleIn 0.4s ease both; }
.anim-scale-1 { animation-delay: 0.05s; }
.anim-scale-2 { animation-delay: 0.1s; }
.anim-scale-3 { animation-delay: 0.15s; }

/* ─── Skeleton Loading ─── */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 12px; }
.skeleton-card { height: 140px; border-radius: var(--radius); }

/* ─── Win Celebration ─── */
.win-flash {
  animation: winFlash 0.6s ease;
}
@keyframes winFlash {
  0% { box-shadow: 0 0 0 rgba(240, 185, 11, 0); }
  50% { box-shadow: 0 0 40px rgba(240, 185, 11, 0.3), 0 0 80px rgba(240, 185, 11, 0.1); }
  100% { box-shadow: 0 0 0 rgba(240, 185, 11, 0); }
}

/* ─── Dropdown ─── */
.dropdown-item { transition: background 0.15s; }
.dropdown-item:hover { background: rgba(102, 126, 234, 0.1) !important; }
.dropdown-item i { width: 18px; text-align: center; }

/* ─── Responsive ─── */
@media (max-width: 992px) {
  .navbar { padding: 0.4rem 0.75rem; }
  .nav-link { font-size: 0.78rem; padding: 0.35rem 0.6rem !important; }
  .navbar-collapse {
    background: rgba(10, 14, 26, 0.98);
    backdrop-filter: blur(24px);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 0.5rem;
    margin-top: 0.5rem;
    max-height: 80vh;
    overflow-y: auto;
  }
  .navbar-nav .nav-item { margin: 0 !important; }
}

@media (max-width: 768px) {
  html { font-size: 15px; }
  main { padding-top: 66px; }
  .page-title { font-size: 1.4rem; }
  .game-card-lobby { padding: 1rem; }
  .game-card-lobby .card-icon { font-size: 2.2rem; }
  .balance-badge { font-size: 0.72rem; padding: 0.25rem 0.6rem; }
  .stat-card { padding: 0.7rem; }
  .stat-value { font-size: 1rem; }
  .toast-container { right: 8px; left: 8px; max-width: none; }
  .btn-primary-custom, .btn-accent { padding: 0.55rem 1.1rem; font-size: 0.82rem; }
  .navbar .container { padding-left: 0; padding-right: 0; }
  .amount-preset { min-width: 42px; min-height: 34px; padding: 0.25rem 0.5rem; }
  .game-card-lobby { cursor: default; }
  .game-card-lobby:active { transform: scale(0.98); }
  .roulette-num { font-size: 0.65rem !important; }
  .auth-card { padding: 1.5rem; }
  .modal-dialog { margin: 0.5rem; }
}

@media (max-width: 576px) {
  html { font-size: 14px; }
  .container { padding-left: 10px; padding-right: 10px; }
  .page-title { font-size: 1.2rem; }
  .game-card-lobby { padding: 0.75rem; }
  .game-card-lobby .card-icon { font-size: 1.8rem; }
  .amount-preset { min-width: 38px; min-height: 32px; padding: 0.2rem 0.45rem; font-size: 0.68rem; }
  .nav-label { font-size: 0.78rem; }
  .balance-badge { font-size: 0.68rem; padding: 0.2rem 0.5rem; }
  .toast-container { left: 8px; right: 8px; top: 64px; }
  .stat-card { padding: 0.5rem; }
  .stat-value { font-size: 0.9rem; }
  .stat-label { font-size: 0.62rem; }
  footer .text-muted { font-size: 0.68rem; }
}

@media (max-width: 400px) {
  html { font-size: 13px; }
  .page-title { font-size: 1rem; }
  .game-card-lobby { padding: 0.6rem; }
  .game-card-lobby .card-icon { font-size: 1.5rem; }
  .nav-link { font-size: 0.72rem; padding: 0.3rem 0.5rem !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
