/* assets/css/app.css — NeonGames Light Theme */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@600;700;800;900&display=swap');

/* ── CSS Custom Properties ─────────────────────────────── */
:root {
  --primary:       #6c5ce7;
  --primary-dark:  #5a4bd1;
  --primary-light: #a29bfe;
  --accent:        #fd79a8;
  --success:       #00b894;
  --warning:       #fdcb6e;
  --danger:        #d63031;
  --info:          #0984e3;

  --bg:            #f0f2f5;
  --bg-card:       #ffffff;
  --bg-sidebar:    #1e1f26;
  --bg-header:     #ffffff;

  --text-primary:  #1a1a2e;
  --text-secondary:#4a5568;
  --text-muted:    #718096;

  --border:        #e2e8f0;
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.05);
  --shadow-lg:     0 4px 12px rgba(0,0,0,.1), 0 20px 40px rgba(0,0,0,.06);
  --radius:        12px;
  --radius-sm:     8px;

  --sidebar-w:     240px;
  --header-h:      64px;
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }

h1,h2,h3,h4,h5,h6 {
  font-family: 'Poppins', sans-serif;
  line-height: 1.3;
  color: var(--text-primary);
}

img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }

/* ── Layout ─────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--header-h);
  padding: 28px;
  flex: 1;
  min-height: calc(100vh - var(--header-h));
  transition: margin-left .3s;
}

.main-content.no-sidebar { margin-left: 0; }

/* ── Header ─────────────────────────────────────────────── */
.header {
  position: fixed;
  top: 0; left: var(--sidebar-w); right: 0;
  height: var(--header-h);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transition: left .3s;
}

.header.no-sidebar { left: 0; }

.header-brand {
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-right { display: flex; align-items: center; gap: 16px; }

.header-balance {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 600;
  font-size: .9rem;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  z-index: 101;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform .3s;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  font-family: 'Poppins', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, #a29bfe, #fd79a8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-section {
  padding: 12px 12px 4px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.35);
}

.sidebar-nav { flex: 1; padding: 8px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  margin: 2px 8px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.65);
  font-weight: 500;
  font-size: .9rem;
  transition: all .2s;
}

.nav-item:hover, .nav-item.active {
  background: rgba(108,92,231,.25);
  color: #fff;
}

.nav-item.active { background: var(--primary); color: #fff; }

.nav-item .icon { font-size: 1.1rem; width: 22px; text-align: center; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Stat Cards ──────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  border-left: 4px solid var(--primary);
}

.stat-card.green  { border-left-color: var(--success); }
.stat-card.orange { border-left-color: var(--warning); }
.stat-card.red    { border-left-color: var(--danger); }
.stat-card.blue   { border-left-color: var(--info); }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.stat-card .stat-icon { background: rgba(108,92,231,.1); }
.stat-card.green  .stat-icon { background: rgba(0,184,148,.1); }
.stat-card.orange .stat-icon { background: rgba(253,203,110,.15); }
.stat-card.red    .stat-icon { background: rgba(214,48,49,.1); }
.stat-card.blue   .stat-icon { background: rgba(9,132,227,.1); }

.stat-info h3 { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); }
.stat-info p  { font-size: .8rem; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  border: none;
  transition: all .2s;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.btn:active { transform: translateY(0); }

.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-success  { background: var(--success); color: #fff; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-warning  { background: var(--warning); color: var(--text-primary); }
.btn-info     { background: var(--info); color: #fff; }
.btn-outline  {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-weight: 600;
  font-size: .875rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108,92,231,.15);
}

textarea.form-control { resize: vertical; min-height: 90px; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
  background: var(--bg);
  padding: 12px 16px;
  text-align: left;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 2px solid var(--border);
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .9rem;
  color: var(--text-primary);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #f7f8fc; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-danger  { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info    { background: #d1ecf1; color: #0c5460; }
.badge-primary { background: #e7e4fb; color: var(--primary-dark); }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-weight: 500;
  font-size: .9rem;
  border-left: 4px solid transparent;
}

.alert-success { background: #d4edda; color: #155724; border-left-color: var(--success); }
.alert-error   { background: #f8d7da; color: #721c24; border-left-color: var(--danger); }
.alert-warning { background: #fff3cd; color: #856404; border-left-color: var(--warning); }
.alert-info    { background: #d1ecf1; color: #0c5460; border-left-color: var(--info); }

/* ── Toast ───────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.toast {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 600;
  font-size: .9rem;
  box-shadow: var(--shadow-lg);
  transform: translateX(110%);
  transition: transform .35s cubic-bezier(.25,.46,.45,.94);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.show  { transform: translateX(0); }
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
.toast.info    { background: var(--info); }
.toast.warning { background: #e67e22; }

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
}

.page-title span { color: var(--primary); }

/* ── GAME STYLES ─────────────────────────────────────────── */

/* Wheel */
.wheel-wrapper { position: relative; display: inline-flex; flex-direction: column; align-items: center; }

.wheel-pointer {
  width: 0; height: 0;
  border-left: 14px solid transparent;
  border-right: 14px solid transparent;
  border-top: 28px solid var(--danger);
  margin-bottom: 4px;
  filter: drop-shadow(0 2px 4px rgba(214,48,49,.5));
  z-index: 5;
}

#wheel-canvas {
  border-radius: 50%;
  box-shadow: 0 8px 32px rgba(0,0,0,.15), 0 0 0 6px var(--primary);
  display: block;
}

/* Color Prediction */
.color-btn {
  border: 3px solid transparent;
  border-radius: var(--radius);
  padding: 18px 28px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  flex: 1;
}

.color-btn.red    { background: #e17055; border-color: #c0392b; }
.color-btn.green  { background: #00b894; border-color: #00876a; }
.color-btn.violet { background: #6c5ce7; border-color: #4a3cb5; }

.color-btn.selected, .color-btn:hover { transform: scale(1.04); box-shadow: var(--shadow-lg); }
.color-btn.red.selected    { border-color: #fff; }
.color-btn.green.selected  { border-color: #fff; }
.color-btn.violet.selected { border-color: #fff; }

.color-result-ball {
  width: 80px; height: 80px;
  border-radius: 50%;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
  transition: background .5s;
}

/* Number Prediction */
.num-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }

.num-btn {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--bg-card);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all .2s;
  display: flex; align-items: center; justify-content: center;
}

.num-btn:hover { border-color: var(--primary); background: rgba(108,92,231,.06); }
.num-btn.selected { background: var(--primary); color: #fff; border-color: var(--primary); }

.range-btns { display: flex; gap: 12px; margin-top: 12px; }
.range-btn {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--bg-card);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}

.range-btn.small { border-color: var(--info); color: var(--info); }
.range-btn.big   { border-color: var(--danger); color: var(--danger); }
.range-btn.selected.small { background: var(--info); color: #fff; }
.range-btn.selected.big   { background: var(--danger); color: #fff; }

/* Bet Controls */
.bet-controls { display: flex; gap: 8px; margin-bottom: 12px; }
.bet-quick-btn {
  flex: 1; padding: 8px; border: 2px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg);
  font-weight: 700; font-size: .85rem; cursor: pointer; transition: all .2s;
}
.bet-quick-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Result animation */
@keyframes pop-in {
  0%   { transform: scale(.3); opacity: 0; }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
.pop-in { animation: pop-in .5s ease forwards; }

/* Win/Loss flash */
@keyframes win-flash {
  0%,100% { background: transparent; }
  50%      { background: rgba(0,184,148,.12); }
}
.win-flash { animation: win-flash .6s ease 3; }

@keyframes lose-flash {
  0%,100% { background: transparent; }
  50%      { background: rgba(214,48,49,.08); }
}
.lose-flash { animation: lose-flash .6s ease 3; }

/* ── Navbar (public pages) ───────────────────────────────── */
.pub-nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 200;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.pub-nav .brand {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pub-nav-links { display: flex; align-items: center; gap: 20px; }

/* ── Auth pages ──────────────────────────────────────────── */
.auth-wrap {
  min-height: calc(100vh - var(--header-h));
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
}

.auth-card {
  background: var(--bg-card);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 40px;
  width: 100%;
  max-width: 440px;
}

.auth-title {
  font-size: 1.8rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.auth-title span { color: var(--primary); }

/* ── Game Lobby ──────────────────────────────────────────── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.game-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.game-card-banner {
  height: 140px;
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem;
}

.game-card.spin-card   .game-card-banner { background: linear-gradient(135deg, #a29bfe, #6c5ce7); }
.game-card.color-card  .game-card-banner { background: linear-gradient(135deg, #fd79a8, #e17055); }
.game-card.number-card .game-card-banner { background: linear-gradient(135deg, #55efc4, #00b894); }

.game-card-body { padding: 20px; }
.game-card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.game-card-desc  { font-size: .85rem; color: var(--text-muted); margin-bottom: 16px; }

/* ── Wallet Cards ────────────────────────────────────────── */
.wallet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.wallet-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  border-top: 4px solid var(--primary);
}

.wallet-card.green  { border-top-color: var(--success); }
.wallet-card.purple { border-top-color: var(--primary); }
.wallet-card.yellow { border-top-color: var(--warning); }
.wallet-card.pink   { border-top-color: var(--accent); }

.wallet-label { font-size: .8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em; }
.wallet-amount { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); font-family: 'Poppins', sans-serif; }

/* ── Landing Page ────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 100px 32px;
  text-align: center;
  color: #fff;
}

.hero h1 { font-size: 3rem; font-weight: 900; margin-bottom: 16px; color: #fff; }
.hero p  { font-size: 1.2rem; opacity: .85; max-width: 560px; margin: 0 auto 36px; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-240px); }
  .sidebar.open { transform: translateX(0); width: 240px; }
  .main-content { margin-left: 0 !important; padding: 16px; }
  .header { left: 0 !important; padding: 0 16px; }
  .hero h1 { font-size: 2rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .num-grid  { grid-template-columns: repeat(5, 1fr); }
  .auth-card { padding: 28px 20px; }
}

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

/* ── Utility ─────────────────────────────────────────────── */
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-primary-c { color: var(--primary); }
.fw-700 { font-weight: 700; }
.mt-4   { margin-top: 4px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-8   { margin-bottom: 8px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.text-center { text-align: center; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 3px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
