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

:root {
  --bg: #0c0f14;
  --bg-card: #161a24;
  --border: #2a2f3e;
  --border-gold: rgba(212, 175, 55, 0.3);
  --text: #e8e6e3;
  --text-dim: #7a8194;
  --gold: #d4af37;
  --gold-light: #f0d060;
  --gold-glow: rgba(212, 175, 55, 0.15);
  --green: #2ecc71;
  --green-dim: rgba(46, 204, 113, 0.15);
  --red: #e74c3c;
  --red-dim: rgba(231, 76, 60, 0.15);
  --blue: #3498db;
  --purple: #9b59b6;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: linear-gradient(135deg, #0c0f14 0%, #111a11 50%, #0c0f14 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(212, 175, 55, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(46, 204, 113, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(139, 26, 26, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ===== LOGIN ===== */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.login-video-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.login-video-bg video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw; /* 16:9 */
  min-height: 100vh;
  min-width: 177.78vh; /* 16:9 */
  transform: translate(-50%, -50%);
  object-fit: cover;
}

.login-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1;
}

.login-audio-controls {
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.login-volume-slider {
  width: 0;
  opacity: 0;
  transition: width 0.3s ease, opacity 0.3s ease;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(212, 175, 55, 0.3);
  outline: none;
  cursor: pointer;
}
.login-audio-controls:hover .login-volume-slider,
.login-audio-controls .login-volume-slider.visible {
  width: 90px;
  opacity: 1;
}
.login-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.4);
}
.login-volume-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.4);
}

.login-music-btn {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gold);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.login-music-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold);
  transform: scale(1.1);
}
.login-music-btn.playing {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}

.login-container {
  background: linear-gradient(145deg, rgba(22, 26, 36, 0.85), rgba(12, 15, 20, 0.9));
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(212, 175, 55, 0.1);
  text-align: center;
  position: relative;
  z-index: 2;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.login-logo {
  font-size: 2rem;
  letter-spacing: 8px;
  color: var(--gold);
  margin-bottom: 1rem;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.3rem;
}

.login-subtitle {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}

.login-error {
  background: var(--red-dim);
  color: var(--red);
  padding: 0.6rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border: 1px solid rgba(231, 76, 60, 0.2);
}

/* ===== NAV ===== */
#navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 68px;
  background: linear-gradient(180deg, rgba(22, 26, 36, 0.98), rgba(12, 15, 20, 0.95));
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

#navbar::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.4;
}

.nav-brand {
  font-size: 1.2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold-light), var(--gold), #c9952e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: pointer;
}

.nav-icon { font-size: 1.4rem; margin-right: 6px; }
.nav-links { display: flex; gap: 0.25rem; }

.nav-link {
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.25s;
}

.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-link.active { color: var(--gold); background: var(--gold-glow); }

.nav-add {
  background: linear-gradient(135deg, var(--gold), #c9952e) !important;
  color: #000 !important;
  font-weight: 700;
  margin-left: 0.5rem;
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.3);
}

.nav-add:hover { box-shadow: 0 4px 20px rgba(212, 175, 55, 0.5); transform: translateY(-1px); }

.nav-admin {
  color: var(--red) !important;
  font-weight: 600;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.nav-user span { font-weight: 600; color: var(--gold); }

.btn-logout {
  background: rgba(231, 76, 60, 0.1);
  color: var(--red);
  border: 1px solid rgba(231, 76, 60, 0.2);
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-logout:hover { background: rgba(231, 76, 60, 0.2); }

/* ===== MAIN ===== */
#app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 1;
}

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: linear-gradient(145deg, var(--bg-card), rgba(22, 26, 36, 0.8));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.stat-card:hover { transform: translateY(-3px); border-color: var(--border-gold); box-shadow: 0 8px 32px rgba(212, 175, 55, 0.08); }
.stat-card:hover::before { opacity: 1; }

.stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.stat-value { font-size: 1.75rem; font-weight: 800; letter-spacing: -1px; }
.stat-sub { font-size: 0.78rem; color: var(--text-dim); margin-top: 0.25rem; }

.positive { color: var(--green); }
.negative { color: var(--red); }
.neutral { color: var(--text-dim); }

/* ===== SECTIONS ===== */
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.section-title span { color: var(--gold); }

/* ===== TABLE ===== */
.table-wrap {
  background: linear-gradient(145deg, var(--bg-card), rgba(22, 26, 36, 0.7));
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
  margin-bottom: 2rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

table { width: 100%; border-collapse: collapse; min-width: 500px; }

thead th {
  background: rgba(212, 175, 55, 0.04);
  padding: 0.8rem 1rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  border-bottom: 1px solid var(--border);
}

tbody td { padding: 0.75rem 1rem; font-size: 0.875rem; border-bottom: 1px solid rgba(42, 47, 62, 0.4); }
tbody tr { transition: background 0.2s; }
tbody tr:hover { background: rgba(212, 175, 55, 0.03); }
tbody tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-green { background: var(--green-dim); color: var(--green); border: 1px solid rgba(46, 204, 113, 0.2); }
.badge-red { background: var(--red-dim); color: var(--red); border: 1px solid rgba(231, 76, 60, 0.2); }
.badge-neutral { background: rgba(255,255,255,0.05); color: var(--text-dim); border: 1px solid rgba(255,255,255,0.05); }

.badge-currency {
  background: rgba(52, 152, 219, 0.12);
  color: var(--blue);
  border: 1px solid rgba(52, 152, 219, 0.2);
  font-size: 0.65rem;
  padding: 0.15rem 0.4rem;
  margin-left: 0.3rem;
}

/* ===== CHARTS ===== */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.chart-card {
  background: linear-gradient(145deg, var(--bg-card), rgba(22, 26, 36, 0.7));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.chart-card h3 { font-size: 0.85rem; font-weight: 600; margin-bottom: 0; color: var(--gold); }
.chart-card canvas { max-height: 300px; }
.chart-header { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.multi-select { position: relative; }
.ms-btn { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 0.3rem 0.7rem; font-size: 0.75rem; font-family: 'Inter', sans-serif; cursor: pointer; display: flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.ms-btn:hover { border-color: var(--gold); }
.ms-btn svg { opacity: 0.5; flex-shrink: 0; }
.ms-dropdown { display: none; position: absolute; top: calc(100% + 4px); right: 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; min-width: 180px; max-height: 300px; z-index: 100; box-shadow: 0 8px 24px rgba(0,0,0,0.4); flex-direction: column; }
.ms-dropdown.open { display: flex; }
.ms-options-list { overflow-y: auto; flex: 1; padding: 0.4rem 0; }
.ms-option { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.75rem; font-size: 0.78rem; color: var(--text); cursor: pointer; white-space: nowrap; }
.ms-option:hover { background: rgba(212,175,55,0.08); }
.ms-option input { accent-color: var(--gold); width: 14px; height: 14px; cursor: pointer; flex-shrink: 0; }
.ms-color { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ms-actions { display: flex; gap: 0.4rem; padding: 0.5rem 0.75rem; border-top: 1px solid var(--border); flex-shrink: 0; background: var(--bg-card); border-radius: 0 0 10px 10px; }
.ms-all, .ms-none { background: none; border: none; color: var(--gold); font-size: 0.7rem; font-family: 'Inter', sans-serif; cursor: pointer; padding: 0.2rem 0.4rem; border-radius: 4px; }
.ms-all:hover, .ms-none:hover { background: rgba(212,175,55,0.12); }
.chart-mode-select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  outline: none;
  appearance: auto;
}
.chart-mode-select:hover, .chart-mode-select:focus { border-color: var(--gold); }
.chart-full { grid-column: 1 / -1; }

/* ===== PLAYER CARDS ===== */
.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.player-card {
  background: linear-gradient(145deg, var(--bg-card), rgba(22, 26, 36, 0.7));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.player-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
  opacity: 0;
  transition: opacity 0.3s;
}

.player-card:hover { transform: translateY(-4px); border-color: var(--border-gold); box-shadow: 0 12px 40px rgba(212, 175, 55, 0.12); }
.player-card:hover::after { opacity: 1; }

.player-name { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.75rem; }
.player-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.player-stat-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); }
.player-stat-value { font-size: 1.1rem; font-weight: 700; }

/* ===== FORM ===== */
.form-card {
  background: linear-gradient(145deg, var(--bg-card), rgba(22, 26, 36, 0.8));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 2rem;
  max-width: 600px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.form-group { margin-bottom: 1.25rem; }

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(12, 15, 20, 0.8);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.25s;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.15);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

.btn {
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), #c9952e);
  color: #000;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover { box-shadow: 0 6px 24px rgba(212, 175, 55, 0.5); transform: translateY(-2px); }

.btn-secondary {
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: rgba(255,255,255,0.08); }

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(231, 76, 60, 0.2);
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
}

.btn-danger:hover { background: rgba(231, 76, 60, 0.25); }

.btn-small { padding: 0.35rem 0.7rem; font-size: 0.75rem; }

.btn-edit {
  background: rgba(52, 152, 219, 0.12);
  color: var(--blue);
  border: 1px solid rgba(52, 152, 219, 0.2);
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
}
.btn-edit:hover { background: rgba(52, 152, 219, 0.25); }

.actions-cell { white-space: nowrap; display: flex; gap: 0.3rem; align-items: center; }

.modal-card-edit { width: 480px; max-width: 95vw; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.edit-result { text-align: center; padding: 0.75rem 0; font-size: 1rem; }

.btn-group { display: flex; gap: 0.75rem; margin-top: 0.5rem; }

.select-add-wrap { position: relative; }

.select-add-input {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.select-add-input input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: rgba(12, 15, 20, 0.8);
  border: 1px solid var(--gold);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}

/* ===== FILTERS ===== */
.filters {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-btn {
  padding: 0.4rem 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
}

.filter-btn:hover { color: var(--text); border-color: var(--text-dim); }
.filter-btn.active { color: var(--gold); border-color: var(--gold); background: var(--gold-glow); }

/* ===== MISC ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.back-link:hover { color: var(--gold); }

.page-header { margin-bottom: 2rem; }

.page-header h1 {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--text), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-header p { color: var(--text-dim); margin-top: 0.3rem; font-size: 0.9rem; }

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: linear-gradient(135deg, var(--green), #27ae60);
  color: #fff;
  padding: 0.8rem 1.5rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.875rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 200;
  box-shadow: 0 4px 20px rgba(46, 204, 113, 0.3);
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: linear-gradient(135deg, var(--red), #c0392b); box-shadow: 0 4px 20px rgba(231, 76, 60, 0.3); }

.streak-bar { display: flex; gap: 3px; margin-top: 0.75rem; }

.streak-block {
  width: 16px;
  height: 22px;
  border-radius: 3px;
  transition: transform 0.15s;
}

.streak-block:hover { transform: scaleY(1.3); }
.streak-block.win { background: linear-gradient(180deg, var(--green), #1a9c54); box-shadow: 0 2px 6px rgba(46, 204, 113, 0.2); }
.streak-block.loss { background: linear-gradient(180deg, var(--red), #c0392b); box-shadow: 0 2px 6px rgba(231, 76, 60, 0.2); }
.streak-block.even { background: linear-gradient(180deg, var(--text-dim), #5a6478); }

/* ===== ADMIN ===== */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.admin-section {
  background: linear-gradient(145deg, var(--bg-card), rgba(22, 26, 36, 0.8));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.5rem;
}

.admin-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.admin-list { list-style: none; }

.admin-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(42, 47, 62, 0.3);
  font-size: 0.85rem;
}

.admin-list li:last-child { border-bottom: none; }

.admin-inline-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.admin-inline-form input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: rgba(12, 15, 20, 0.8);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  outline: none;
}

.admin-inline-form input:focus { border-color: var(--gold); }

.role-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.role-admin { background: rgba(212, 175, 55, 0.15); color: var(--gold); }
.role-user { background: rgba(52, 152, 219, 0.12); color: var(--blue); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  #navbar { padding: 0 1rem; flex-wrap: wrap; height: auto; padding: 0.5rem 1rem; }
  .nav-links { gap: 0; overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .nav-link { padding: 0.4rem 0.5rem; font-size: 0.75rem; flex-shrink: 0; }
  #app { padding: 1rem; }
  .chart-grid, .admin-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 1.5rem; }
  .nav-user span { display: none; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

#app > * { animation: fadeIn 0.35s ease; }

::selection { background: rgba(212, 175, 55, 0.3); color: var(--gold-light); }

/* ===== USER MENU ===== */
.nav-user-wrap {
  position: relative;
}

.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 0.8rem 0.4rem 0.5rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
}

.nav-user-btn:hover {
  border-color: var(--border-gold);
  background: var(--gold-glow);
}

.nav-user-btn svg {
  color: var(--text-dim);
  transition: transform 0.2s;
}

.nav-user-btn.open svg { transform: rotate(180deg); }

.nav-user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--gold), #c9952e);
  color: #000;
  font-size: 0.9rem;
  font-weight: 800;
}

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: linear-gradient(145deg, #1a1f2e, #161a24);
  border: 1px solid var(--border-gold);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 24px rgba(212, 175, 55, 0.05);
  z-index: 200;
  overflow: hidden;
  display: none;
  animation: menuSlide 0.2s ease;
}

@keyframes menuSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-menu.open { display: block; }

.user-menu-header {
  padding: 1rem 1.2rem;
  background: rgba(212, 175, 55, 0.04);
}

.user-menu-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--gold);
}

.user-menu-role {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.user-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.7rem 1.2rem;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
}

.user-menu-item:hover { background: rgba(255,255,255,0.04); }

.user-menu-item svg { color: var(--text-dim); flex-shrink: 0; }

.user-menu-logout { color: var(--red); }
.user-menu-logout svg { color: var(--red); }
.user-menu-logout:hover { background: var(--red-dim); }

.user-menu-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1.2rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.setting-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.toggle-btn {
  padding: 0.25rem 0.6rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-btn:first-child { border-right: 1px solid var(--border); }
.toggle-btn.active { background: var(--gold-glow); color: var(--gold); }

.setting-select {
  padding: 0.25rem 0.5rem;
  background: rgba(12, 15, 20, 0.8);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.75rem;
  outline: none;
  cursor: pointer;
}

.setting-select:focus { border-color: var(--gold); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.modal-card {
  background: linear-gradient(145deg, #1a1f2e, #161a24);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 2rem;
  width: 380px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 32px rgba(212, 175, 55, 0.06);
  animation: fadeIn 0.25s ease;
}

.modal-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

/* ===== AVATARS ===== */
.avatar-img {
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
}
.avatar-suit {
  vertical-align: middle;
  line-height: 1;
}
.avatar-sm { width: 22px; height: 22px; }
.avatar-md { width: 32px; height: 32px; }
.avatar-lg { width: 48px; height: 48px; }
.avatar-xl { width: 64px; height: 64px; }
.avatar-nav { width: 26px; height: 26px; }
span.avatar-suit.avatar-sm { font-size: 1rem; }
span.avatar-suit.avatar-md { font-size: 1.3rem; }
span.avatar-suit.avatar-lg { font-size: 1.8rem; }
span.avatar-suit.avatar-xl { font-size: 2.5rem; }

.nav-user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.avatar-preview-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}
.avatar-preview-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--gold);
  background: var(--bg);
  border: 3px solid var(--border);
}
#avatarFile {
  width: 100%;
  padding: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
}
#avatarFile::file-selector-button {
  background: var(--gold);
  color: #000;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  margin-right: 0.5rem;
}

.modal-card-avatar {
  width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}

.avatar-presets-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.6rem;
}

.avatar-presets {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 1.2rem;
}

.avatar-preset {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-preset svg {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.avatar-preset:hover {
  border-color: var(--gold);
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
}
.avatar-preset.selected {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.5);
  transform: scale(1.1);
}

.avatar-preview-svg {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--gold);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
}
.avatar-preview-svg svg {
  width: 100%;
  height: 100%;
}

.avatar-btn-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.avatar-btn-row .btn {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  font-size: 0.85rem;
  padding: 0.5rem 0.8rem;
}
.btn-danger-text {
  color: #e74c3c !important;
}

/* ===== STRATEGY CARD ===== */
.sc-wrap {
  max-width: 720px;
  margin: 0 auto;
}

.sc-title {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--text), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.sc-legend {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.sc-legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
}

.sc-legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  display: inline-block;
}

.sc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
  min-width: 0;
}

.sc-table th, .sc-table td {
  text-align: center;
  padding: 0.5rem 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.sc-corner {
  background: var(--bg-card);
  color: var(--gold);
  border-radius: 6px;
  font-size: 0.7rem;
  letter-spacing: 1px;
}

.sc-dealer-label {
  background: var(--bg-card);
  color: var(--gold);
  border-radius: 6px;
  font-size: 0.75rem;
  letter-spacing: 2px;
}

.sc-dealer {
  background: var(--bg-card);
  color: var(--text);
  border-radius: 6px;
  font-size: 0.85rem;
  min-width: 44px;
}

.sc-hand {
  background: var(--bg-card);
  color: var(--text);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.5rem 0.6rem;
  white-space: nowrap;
}

.sc-cell {
  border-radius: 5px;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  transition: transform 0.1s;
}

.sc-cell:hover { transform: scale(1.15); z-index: 2; position: relative; }

.sc-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  text-align: center;
  padding: 0.6rem 0 0.2rem;
}

/* ===== DEVISES ===== */
.devises-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }
@media (max-width: 768px) { .devises-grid { grid-template-columns: 1fr; } }
.devises-card { background: linear-gradient(145deg, var(--bg-card), rgba(22, 26, 36, 0.7)); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; }
.devises-card h3 { font-size: 0.9rem; font-weight: 600; color: var(--gold); margin-bottom: 1rem; }
.devises-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.devises-table th { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); color: var(--text-dim); font-size: 0.75rem; font-weight: 500; }
.devises-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid rgba(42,47,62,0.3); }
.devises-update { margin-top: 1rem; font-size: 0.75rem; color: var(--text-dim); }

/* ===== PODIUM ===== */
.podium-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .podium-grid { grid-template-columns: 1fr; }
}

.podium-card {
  background: linear-gradient(145deg, var(--bg-card), rgba(22, 26, 36, 0.7));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.podium-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.podium-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(42, 47, 62, 0.3);
  flex-wrap: wrap;
}

.podium-row:last-child { border-bottom: none; }

.podium-medal {
  font-size: 1.3rem;
  min-width: 28px;
}
.podium-rank {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-dim);
  text-align: center;
}

.podium-name {
  font-weight: 700;
  font-size: 0.9rem;
  flex: 1;
}

.podium-value {
  font-weight: 800;
  font-size: 1rem;
}

.podium-sub {
  width: 100%;
  font-size: 0.7rem;
  color: var(--text-dim);
  padding-left: 2.2rem;
  margin-top: -0.2rem;
}

/* ===== HELPCARD TABS ===== */
.helpcard-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.helpcard-tab {
  padding: 0.6rem 1.5rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
}

.helpcard-tab:hover { color: var(--text); border-color: var(--text-dim); }
.helpcard-tab.active { color: var(--gold); border-color: var(--gold); background: var(--gold-glow); }

/* ===== POKER HAND RANKINGS ===== */
.pk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  max-width: 720px;
  margin: 0 auto;
}

@media (max-width: 600px) {
  .pk-grid { grid-template-columns: 1fr; }
}

.pk-hand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(145deg, var(--bg-card), rgba(22, 26, 36, 0.7));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  transition: all 0.25s;
}

.pk-hand:hover {
  border-color: var(--border-gold);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.pk-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-glow);
  color: var(--gold);
  font-weight: 900;
  font-size: 0.85rem;
  border: 1px solid var(--border-gold);
}

.pk-info { flex: 1; }

.pk-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pk-cards {
  display: flex;
  gap: 4px;
}

.pk-card {
  width: 36px;
  height: 50px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  position: relative;
}

.pk-val {
  font-size: 0.75rem;
  font-weight: 800;
  color: #222;
  line-height: 1;
}

.pk-suit {
  font-size: 0.7rem;
  line-height: 1;
  margin-top: 1px;
}

.pk-red { color: #d32f2f; }
.pk-black { color: #222; }

/* ===== BACCARAT GUIDE ===== */
.bac-section {
  background: linear-gradient(145deg, var(--bg-card), rgba(22, 26, 36, 0.7));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.bac-section-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.bac-values-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bac-value-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bac-value-cards {
  display: flex;
  align-items: center;
  gap: 4px;
}

.bac-to {
  color: var(--text-dim);
  font-size: 1rem;
  margin: 0 2px;
}

.bac-value-eq {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--gold);
  white-space: nowrap;
}

.bac-examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.bac-example {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0,0,0,0.15);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
}

.bac-score {
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
}

.bac-score strong {
  color: var(--gold);
  font-size: 1.1rem;
}

.bac-note {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
}

.bac-rules {
  list-style: none;
  padding: 0;
}

.bac-rules li {
  padding: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--text);
  border-bottom: 1px solid rgba(42,47,62,0.3);
  padding-left: 1.2rem;
  position: relative;
}

.bac-rules li:last-child { border-bottom: none; }

.bac-rules li::before {
  content: '\2666';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-size: 0.7rem;
}

.bac-third-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 500px) {
  .bac-third-grid { grid-template-columns: 1fr; }
}

.bac-third-col {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.bac-third-header {
  padding: 0.6rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
}

.bac-third-body { padding: 0.5rem; }

.bac-third-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.5rem;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(42,47,62,0.2);
}

.bac-third-row:last-child { border-bottom: none; }

.bac-third-row span:first-child {
  font-weight: 700;
  color: var(--text);
  min-width: 36px;
}

.bac-draw {
  color: var(--green);
  font-weight: 700;
  font-size: 0.75rem;
}

.bac-stand {
  color: var(--red);
  font-weight: 700;
  font-size: 0.75rem;
}

.bac-natural {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.75rem;
}

.bac-depends {
  color: var(--text-dim);
  font-size: 0.7rem;
  text-align: right;
}

.bac-payouts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.bac-payout {
  text-align: center;
  background: rgba(0,0,0,0.15);
  border-radius: 10px;
  padding: 1rem 0.5rem;
}

.bac-payout-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 0.4rem;
}

.bac-payout-val {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--gold);
}

.bac-payout-note {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

/* ===== THEMES ===== */
/* Theme: Casino Gold (default) - defined in :root */

/* ─── Theme: Blackjack Felt ─── */
body.theme-felt {
  --bg: #0b1e0b;
  --bg-card: rgba(10, 36, 10, 0.85);
  --border: #1b4a1b;
  --border-gold: rgba(212, 175, 55, 0.35);
  --text: #e0f0e0;
  --text-dim: #6ea06e;
  --gold: #d4af37;
  --gold-light: #f0d060;
  --gold-glow: rgba(212, 175, 55, 0.15);
  background: #0d260d;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent, transparent 49px,
      rgba(255,255,255,0.015) 49px, rgba(255,255,255,0.015) 50px
    ),
    repeating-linear-gradient(
      90deg,
      transparent, transparent 49px,
      rgba(255,255,255,0.015) 49px, rgba(255,255,255,0.015) 50px
    );
  background-attachment: fixed;
}

body.theme-felt::before {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,200,0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(0,0,0,0.4) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 50%, rgba(30,120,30,0.15) 0%, transparent 70%);
}

body.theme-felt::after {
  content: '\2660  \2665  \2666  \2663  \2660  \2665  \2666  \2663  \2660  \2665  \2666  \2663';
  position: fixed;
  bottom: 0; left: 0; right: 0;
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 2rem;
  color: rgba(212,175,55,0.04);
  padding: 1rem;
  pointer-events: none;
  z-index: 0;
}

body.theme-felt #navbar {
  background: linear-gradient(180deg, rgba(8, 30, 8, 0.97), rgba(6, 20, 6, 0.95));
  border-bottom-color: #1b4a1b;
}

body.theme-felt #navbar::after {
  background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

body.theme-felt .stat-card,
body.theme-felt .chart-card,
body.theme-felt .player-card,
body.theme-felt .table-wrap,
body.theme-felt .admin-section,
body.theme-felt .form-card {
  background: linear-gradient(145deg, rgba(12,40,12,0.9), rgba(8,30,8,0.8));
  border-color: #1b4a1b;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 4px 16px rgba(0,0,0,0.3);
}

/* ─── Theme: Vegas Neon ─── */
body.theme-neon {
  --bg: #0a0a14;
  --bg-card: rgba(14, 14, 28, 0.9);
  --border: #1a1a3a;
  --border-gold: rgba(255, 0, 128, 0.3);
  --text: #eee8ff;
  --text-dim: #8080b0;
  --gold: #ff0080;
  --gold-light: #ff66b2;
  --gold-glow: rgba(255, 0, 128, 0.15);
  --green: #00ff88;
  --green-dim: rgba(0, 255, 136, 0.12);
  --red: #ff3366;
  --red-dim: rgba(255, 51, 102, 0.12);
  --blue: #00ccff;
  --purple: #cc44ff;
  background: #08080f;
  background-attachment: fixed;
}

body.theme-neon::before {
  background:
    radial-gradient(ellipse at 15% 20%, rgba(255, 0, 128, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 30%, rgba(0, 204, 255, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(204, 68, 255, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(0, 255, 136, 0.02) 0%, transparent 70%);
}

body.theme-neon::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #ff0080, #00ccff, #cc44ff, #00ff88, #ff0080);
  background-size: 200% 100%;
  animation: neonSlide 4s linear infinite;
  pointer-events: none;
  z-index: 999;
}

@keyframes neonSlide {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

body.theme-neon #navbar {
  background: linear-gradient(180deg, rgba(10, 10, 20, 0.98), rgba(8, 8, 15, 0.95));
  border-bottom: 1px solid rgba(255, 0, 128, 0.2);
  box-shadow: 0 4px 24px rgba(255, 0, 128, 0.1);
}

body.theme-neon #navbar::after {
  background: linear-gradient(90deg, transparent, #ff0080, #00ccff, transparent);
  opacity: 0.6;
}

body.theme-neon .nav-add {
  background: linear-gradient(135deg, #ff0080, #cc0066) !important;
  color: #fff !important;
  box-shadow: 0 2px 16px rgba(255, 0, 128, 0.4), 0 0 30px rgba(255, 0, 128, 0.15);
}

body.theme-neon .stat-card:hover { box-shadow: 0 8px 32px rgba(255, 0, 128, 0.12), 0 0 20px rgba(0, 204, 255, 0.06); }
body.theme-neon .player-card:hover { box-shadow: 0 12px 40px rgba(255, 0, 128, 0.15); }

body.theme-neon .stat-card,
body.theme-neon .chart-card,
body.theme-neon .player-card,
body.theme-neon .table-wrap,
body.theme-neon .admin-section,
body.theme-neon .form-card {
  background: linear-gradient(145deg, rgba(16,16,32,0.9), rgba(10,10,20,0.85));
  border-color: #1a1a3a;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.03);
}

body.theme-neon .nav-user-avatar {
  background: linear-gradient(135deg, #ff0080, #cc44ff);
  color: #fff;
}

body.theme-neon .user-menu {
  background: linear-gradient(145deg, #12122a, #0e0e1e);
  border-color: rgba(255, 0, 128, 0.25);
  box-shadow: 0 16px 48px rgba(0,0,0,0.6), 0 0 30px rgba(255, 0, 128, 0.08);
}

body.theme-neon .modal-card {
  background: linear-gradient(145deg, #12122a, #0e0e1e);
  border-color: rgba(255, 0, 128, 0.25);
}

body.theme-neon .login-container {
  background: linear-gradient(145deg, #12122a, #0e0e1e);
  border-color: rgba(255, 0, 128, 0.3);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(255, 0, 128, 0.08);
}

/* ─── Theme: Poker Night ─── */
body.theme-poker {
  --bg: #120808;
  --bg-card: rgba(24, 12, 12, 0.9);
  --border: #3a1a1a;
  --border-gold: rgba(212, 175, 55, 0.35);
  --text: #f0e0e0;
  --text-dim: #9a7070;
  --gold: #d4af37;
  --gold-light: #f0d060;
  --gold-glow: rgba(212, 175, 55, 0.15);
  background: #100606;
  background-image:
    repeating-conic-gradient(
      rgba(255,255,255,0.008) 0% 25%,
      transparent 0% 50%
    );
  background-size: 40px 40px;
  background-attachment: fixed;
}

body.theme-poker::before {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(180, 20, 20, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 70%, rgba(212, 175, 55, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(120, 10, 10, 0.06) 0%, transparent 50%);
}

body.theme-poker::after {
  content: '\2660';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 40vw;
  color: rgba(255,255,255,0.008);
  pointer-events: none;
  z-index: 0;
}

body.theme-poker #navbar {
  background: linear-gradient(180deg, rgba(18, 8, 8, 0.98), rgba(12, 4, 4, 0.95));
  border-bottom-color: #3a1a1a;
}

body.theme-poker #navbar::after {
  background: linear-gradient(90deg, transparent, #d4af37, #e74c3c, #d4af37, transparent);
}

body.theme-poker .stat-card,
body.theme-poker .chart-card,
body.theme-poker .player-card,
body.theme-poker .table-wrap,
body.theme-poker .admin-section,
body.theme-poker .form-card {
  background: linear-gradient(145deg, rgba(28,14,14,0.9), rgba(18,8,8,0.85));
  border-color: #3a1a1a;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02), 0 4px 16px rgba(0,0,0,0.4);
}

body.theme-poker .nav-add {
  background: linear-gradient(135deg, #d4af37, #c9952e) !important;
}

body.theme-poker .user-menu,
body.theme-poker .modal-card {
  background: linear-gradient(145deg, #1c0e0e, #140808);
  border-color: rgba(212, 175, 55, 0.25);
}

body.theme-poker .login-container {
  background: linear-gradient(145deg, #1c0e0e, #140808);
  border-color: rgba(212, 175, 55, 0.3);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 30px rgba(212, 175, 55, 0.05);
}

/* ─── Theme: Monte Carlo ─── */
body.theme-monte {
  --bg: #f5f0e8;
  --bg-card: #ffffff;
  --border: #d8cfc0;
  --border-gold: rgba(160, 120, 40, 0.3);
  --text: #2c2416;
  --text-dim: #8a7e6c;
  --gold: #a07828;
  --gold-light: #c89e40;
  --gold-glow: rgba(160, 120, 40, 0.1);
  --green: #1a7a3a;
  --green-dim: rgba(26, 122, 58, 0.1);
  --red: #b03020;
  --red-dim: rgba(176, 48, 32, 0.1);
  --blue: #2060a0;
  --purple: #7a3098;
  background: #f5f0e8;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(160,120,40,0.03) 0%, transparent 70%);
  background-attachment: fixed;
}

body.theme-monte::before {
  background:
    repeating-linear-gradient(
      45deg,
      transparent, transparent 20px,
      rgba(160,120,40,0.015) 20px, rgba(160,120,40,0.015) 21px
    );
}

body.theme-monte::after {
  content: '\2666';
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  font-size: 8rem;
  color: rgba(160,120,40,0.04);
  pointer-events: none;
  z-index: 0;
}

body.theme-monte .nav-user-avatar { color: #fff; }

body.theme-monte #navbar {
  background: linear-gradient(180deg, #ffffff 0%, #f8f4ee 100%);
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  border-bottom: 1px solid #d8cfc0;
}

body.theme-monte #navbar::after {
  background: linear-gradient(90deg, transparent, #a07828, transparent);
  opacity: 0.3;
}

body.theme-monte .stat-card,
body.theme-monte .chart-card,
body.theme-monte .player-card,
body.theme-monte .table-wrap,
body.theme-monte .admin-section,
body.theme-monte .form-card {
  background: #ffffff;
  border: 1px solid #d8cfc0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
}

body.theme-monte .stat-card:hover { box-shadow: 0 8px 24px rgba(160,120,40,0.08); }
body.theme-monte .player-card:hover { box-shadow: 0 12px 32px rgba(160,120,40,0.1); }

body.theme-monte .user-menu,
body.theme-monte .modal-card {
  background: linear-gradient(145deg, #ffffff, #faf6f0);
  border-color: #d8cfc0;
}

body.theme-monte .form-group input,
body.theme-monte .form-group select,
body.theme-monte .admin-inline-form input,
body.theme-monte .setting-select {
  background: #faf6f0;
  border-color: #d8cfc0;
}

body.theme-monte .login-container {
  background: linear-gradient(145deg, #ffffff, #faf6f0);
  border-color: rgba(160,120,40,0.3);
  box-shadow: 0 20px 60px rgba(0,0,0,0.08), 0 0 0 1px rgba(160,120,40,0.1);
}

body.theme-monte .nav-add {
  color: #fff !important;
}

/* ─── Theme: Midnight Blue ─── */
body.theme-midnight {
  --bg: #080c18;
  --bg-card: rgba(12, 18, 36, 0.9);
  --border: #162040;
  --border-gold: rgba(100, 160, 255, 0.25);
  --text: #d0d8f0;
  --text-dim: #6070a0;
  --gold: #5090e0;
  --gold-light: #80b8ff;
  --gold-glow: rgba(80, 144, 224, 0.12);
  --green: #30c070;
  --green-dim: rgba(48, 192, 112, 0.12);
  --red: #e05050;
  --red-dim: rgba(224, 80, 80, 0.12);
  --blue: #5090e0;
  --purple: #8060d0;
  background: #060a14;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(40, 80, 160, 0.1) 0%, transparent 60%);
  background-attachment: fixed;
}

body.theme-midnight::before {
  background:
    radial-gradient(2px 2px at 20% 15%, rgba(255,255,255,0.15), transparent),
    radial-gradient(2px 2px at 40% 35%, rgba(255,255,255,0.1), transparent),
    radial-gradient(1px 1px at 60% 20%, rgba(255,255,255,0.12), transparent),
    radial-gradient(2px 2px at 80% 45%, rgba(255,255,255,0.08), transparent),
    radial-gradient(1px 1px at 15% 55%, rgba(255,255,255,0.1), transparent),
    radial-gradient(2px 2px at 50% 70%, rgba(255,255,255,0.06), transparent),
    radial-gradient(1px 1px at 75% 65%, rgba(255,255,255,0.1), transparent),
    radial-gradient(1px 1px at 35% 85%, rgba(255,255,255,0.08), transparent),
    radial-gradient(2px 2px at 90% 80%, rgba(255,255,255,0.06), transparent);
}

body.theme-midnight #navbar {
  background: linear-gradient(180deg, rgba(8, 12, 24, 0.98), rgba(6, 10, 20, 0.95));
  border-bottom-color: #162040;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4), 0 0 20px rgba(80,144,224,0.03);
}

body.theme-midnight #navbar::after {
  background: linear-gradient(90deg, transparent, #5090e0, transparent);
}

body.theme-midnight .nav-add {
  background: linear-gradient(135deg, #5090e0, #3070c0) !important;
  color: #fff !important;
  box-shadow: 0 2px 16px rgba(80, 144, 224, 0.3);
}

body.theme-midnight .stat-card,
body.theme-midnight .chart-card,
body.theme-midnight .player-card,
body.theme-midnight .table-wrap,
body.theme-midnight .admin-section,
body.theme-midnight .form-card {
  background: linear-gradient(145deg, rgba(14,20,40,0.9), rgba(10,16,32,0.85));
  border-color: #162040;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.02);
}

body.theme-midnight .nav-user-avatar {
  background: linear-gradient(135deg, #5090e0, #3070c0);
  color: #fff;
}

body.theme-midnight .user-menu,
body.theme-midnight .modal-card {
  background: linear-gradient(145deg, #101830, #0c1224);
  border-color: rgba(80, 144, 224, 0.2);
}

body.theme-midnight .login-container {
  background: linear-gradient(145deg, #101830, #0c1224);
  border-color: rgba(80, 144, 224, 0.25);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(80,144,224,0.05);
}

/* ===== THEME SELECTOR ===== */
.theme-setting {
  display: block;
  padding: 0.6rem 1.2rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.theme-setting > span { display: block; margin-bottom: 0.5rem; }

.theme-grid {
  display: grid;
  grid-template-columns: repeat(6, 28px);
  gap: 6px;
}

.theme-dot {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.theme-dot:hover { transform: scale(1.15); }
.theme-dot.active { border-color: var(--gold); box-shadow: 0 0 8px var(--gold-glow); }

.theme-dot-label {
  font-size: 0.55rem;
  text-align: center;
  color: var(--text-dim);
  margin-top: 2px;
  font-weight: 600;
}
