/* ===== BDG WIN - COMPLETE DESIGN SYSTEM ===== */
:root {
  --primary: #f43f5e;
  --primary-dark: #e11d48;
  --primary-light: #fb7185;
  --secondary: #7c3aed;
  --secondary-light: #a78bfa;
  --accent: #f59e0b;
  --green: #10b981;
  --green-light: #34d399;
  --red: #ef4444;
  --violet: #8b5cf6;
  --blue: #3b82f6;
  --bg: #0f0f1a;
  --bg2: #161627;
  --bg3: #1e1e35;
  --bg4: #252540;
  --card: #1a1a2e;
  --card2: #16213e;
  --border: rgba(255,255,255,0.08);
  --text: #f1f5f9;
  --text2: #94a3b8;
  --text3: #64748b;
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-card: 0 2px 16px rgba(0,0,0,0.3);
  --font: 'Outfit', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 80px;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

/* ===== TOP HEADER ===== */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon { font-size: 22px; }

.logo-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.logo-accent { color: var(--primary); }

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

.balance-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
}

.balance-icon {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}

.balance-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.recharge-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 0.2s;
}

.recharge-btn:hover { opacity: 0.9; }

/* ===== BANNER ===== */
.banner-section {
  position: relative;
  margin: 12px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.banner-slider {
  display: flex;
  transition: transform 0.4s ease;
}

.banner-slide {
  min-width: 100%;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 140px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.banner-slide::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.15);
}

.banner-content {
  position: relative;
  z-index: 1;
}

.banner-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  margin-bottom: 8px;
}

.banner-content h2 {
  font-size: 20px;
  font-weight: 800;
  color: white;
  line-height: 1.2;
  margin-bottom: 6px;
}

.banner-content p {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 12px;
}

.banner-cta {
  display: inline-block;
  background: white;
  color: #1a1a2e;
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 700;
  transition: transform 0.2s;
}

.banner-cta:hover { transform: scale(1.05); }

.banner-deco {
  font-size: 60px;
  position: relative;
  z-index: 1;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.banner-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text3);
  transition: all 0.3s;
  cursor: pointer;
}

.dot.active {
  background: var(--primary);
  width: 18px;
  border-radius: 3px;
}

/* ===== NOTICE BAR ===== */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg2);
  border: 1px solid var(--border);
  margin: 8px 12px;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  overflow: hidden;
}

.notice-icon { font-size: 14px; flex-shrink: 0; }

.notice-scroll {
  overflow: hidden;
  flex: 1;
}

.notice-scroll span {
  display: inline-block;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text2);
  animation: scrollText 20s linear infinite;
}

@keyframes scrollText {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* ===== QUICK STATS ===== */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 8px 12px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-icon { font-size: 20px; }

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.stat-label {
  font-size: 10px;
  color: var(--text3);
}

/* ===== SECTION HEADERS ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.section-badge {
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.see-all {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}

/* ===== GAMES SECTION ===== */
.games-section {
  padding: 12px;
}

.games-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.game-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

.game-card-bg {
  position: absolute;
  inset: 0;
  opacity: 0.15;
}

.wingo-card { background: linear-gradient(135deg, #1a0a2e, #2d1b4e); }
.wingo-card .game-card-bg { background: radial-gradient(circle at 70% 50%, #f43f5e, transparent); }

.k3-card { background: linear-gradient(135deg, #0a1a2e, #1b2d4e); }
.k3-card .game-card-bg { background: radial-gradient(circle at 70% 50%, #3b82f6, transparent); }

.d5-card { background: linear-gradient(135deg, #0a2e1a, #1b4e2d); }
.d5-card .game-card-bg { background: radial-gradient(circle at 70% 50%, #10b981, transparent); }

.trx-card { background: linear-gradient(135deg, #2e1a0a, #4e2d1b); }
.trx-card .game-card-bg { background: radial-gradient(circle at 70% 50%, #f59e0b, transparent); }

.game-card-content {
  position: relative;
  z-index: 1;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-icon-wrap {
  margin-bottom: 4px;
}

.game-color-dots {
  display: flex;
  gap: 5px;
}

.cdot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}

.cdot.red { background: #ef4444; box-shadow: 0 0 8px #ef4444; }
.cdot.green { background: #10b981; box-shadow: 0 0 8px #10b981; }
.cdot.violet { background: #8b5cf6; box-shadow: 0 0 8px #8b5cf6; }

.dice-wrap { font-size: 18px; }

.num-balls {
  display: flex;
  gap: 4px;
}

.num-balls span {
  width: 18px;
  height: 18px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
}

.trx-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: white;
}

.game-info h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.game-info p {
  font-size: 11px;
  color: var(--text2);
  margin-top: 2px;
}

.game-modes {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.game-modes span {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  color: var(--text2);
  font-weight: 500;
}

.game-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--text3);
}

.game-live-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  animation: pulse 2s infinite;
}

/* ===== WINNERS SECTION ===== */
.winners-section {
  padding: 0 12px 12px;
}

.winners-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.winner-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.winner-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.winner-info {
  flex: 1;
}

.winner-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.winner-game {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

.winner-amount {
  font-size: 15px;
  font-weight: 700;
  color: var(--green);
}

/* ===== HOW TO PLAY ===== */
.how-section {
  padding: 0 12px 12px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.step-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
  position: relative;
}

.step-num {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-icon { font-size: 22px; margin-bottom: 6px; margin-top: 4px; }

.step-card h5 {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.step-card p {
  font-size: 9px;
  color: var(--text3);
  line-height: 1.4;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 200;
  padding: 8px 0 12px;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 4px 0;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.nav-icon { font-size: 20px; }

.nav-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text3);
}

.nav-item.active .nav-label { color: var(--primary); }
.nav-item.active .nav-icon { filter: drop-shadow(0 0 6px var(--primary)); }

.nav-item.active::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

/* ===== AUTH PAGES ===== */
.auth-page {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.auth-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  padding: 40px 24px 60px;
  position: relative;
  overflow: hidden;
}

.auth-header::before {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  top: -60px;
  right: -40px;
}

.auth-header::after {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  bottom: -40px;
  left: -30px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.auth-logo-icon { font-size: 28px; }

.auth-logo-text {
  font-size: 26px;
  font-weight: 800;
  color: white;
}

.auth-logo-text span { color: rgba(255,255,255,0.7); }

.auth-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: white;
  margin-bottom: 6px;
}

.auth-header p {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
}

.auth-body {
  background: var(--bg);
  border-radius: 24px 24px 0 0;
  margin-top: -24px;
  padding: 28px 20px;
  flex: 1;
  position: relative;
  z-index: 1;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 8px;
}

.form-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  z-index: 1;
}

.form-input {
  width: 100%;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 14px 44px;
  font-size: 15px;
  font-family: var(--font);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--primary);
  background: var(--bg4);
}

.form-input::placeholder { color: var(--text3); }

.form-input-suffix {
  position: absolute;
  right: 14px;
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}

.form-hint {
  font-size: 11px;
  color: var(--text3);
  margin-top: 6px;
}

.invite-code-box {
  background: var(--bg3);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.invite-code-box span:first-child { font-size: 18px; }

.invite-code-info {
  flex: 1;
}

.invite-code-info p {
  font-size: 12px;
  color: var(--text3);
}

.invite-code-info strong {
  font-size: 15px;
  color: var(--accent);
  font-weight: 700;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.checkbox-row label {
  font-size: 12px;
  color: var(--text3);
  line-height: 1.5;
}

.checkbox-row a { color: var(--primary); }

.submit-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  letter-spacing: 0.5px;
}

.submit-btn:hover { opacity: 0.95; }
.submit-btn:active { transform: scale(0.98); }

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text3);
}

.auth-switch a {
  color: var(--primary);
  font-weight: 600;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  font-size: 12px;
  color: var(--text3);
}

/* ===== WINGO GAME PAGE ===== */
.wingo-page {
  background: var(--bg);
  min-height: 100vh;
  padding-bottom: 80px;
}

.game-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.back-btn {
  width: 36px;
  height: 36px;
  background: var(--bg3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  border: 1px solid var(--border);
}

.game-header-title {
  flex: 1;
}

.game-header-title h3 {
  font-size: 17px;
  font-weight: 700;
}

.game-header-title p {
  font-size: 11px;
  color: var(--text3);
}

.game-balance {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
}

.game-balance span:first-child {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}

.game-balance span:last-child {
  font-size: 13px;
  font-weight: 600;
}

/* Mode Tabs */
.mode-tabs {
  display: flex;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
  gap: 4px;
}

.mode-tab {
  flex: 1;
  padding: 12px 4px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.mode-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Timer Section */
.timer-section {
  background: linear-gradient(135deg, #1a0a2e, #2d1b4e);
  padding: 16px;
  margin: 12px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(244,63,94,0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timer-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timer-label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.period-id {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.timer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.timer-display {
  display: flex;
  align-items: center;
  gap: 4px;
}

.timer-block {
  background: var(--bg);
  border-radius: 6px;
  padding: 6px 10px;
  min-width: 36px;
  text-align: center;
}

.timer-block span {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.timer-sep {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}

.timer-hint {
  font-size: 10px;
  color: var(--text3);
}

/* Last Results */
.last-results {
  padding: 0 12px;
  margin-bottom: 12px;
}

.last-results-label {
  font-size: 12px;
  color: var(--text3);
  margin-bottom: 8px;
}

.result-balls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.result-ball {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.result-ball.red { background: var(--red); }
.result-ball.green { background: var(--green); }
.result-ball.violet { background: var(--violet); }
.result-ball.red-violet { background: linear-gradient(135deg, var(--red), var(--violet)); }
.result-ball.green-violet { background: linear-gradient(135deg, var(--green), var(--violet)); }

/* Betting Area */
.betting-area {
  padding: 0 12px;
}

.bet-colors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.bet-color-btn {
  border: none;
  border-radius: var(--radius);
  padding: 14px 8px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.bet-color-btn:active { transform: scale(0.95); }

.bet-color-btn.red {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 4px 15px rgba(239,68,68,0.3);
}

.bet-color-btn.green {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 15px rgba(16,185,129,0.3);
}

.bet-color-btn.violet {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  box-shadow: 0 4px 15px rgba(139,92,246,0.3);
}

.bet-color-btn .bet-multiplier {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
}

/* Number Grid */
.bet-numbers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.bet-num-btn {
  aspect-ratio: 1;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bet-num-btn:active { transform: scale(0.9); }

.bet-num-btn.n0 { background: linear-gradient(135deg, #ef4444, #8b5cf6); color: white; }
.bet-num-btn.n1 { background: #10b981; color: white; }
.bet-num-btn.n2 { background: #ef4444; color: white; }
.bet-num-btn.n3 { background: #10b981; color: white; }
.bet-num-btn.n4 { background: #ef4444; color: white; }
.bet-num-btn.n5 { background: linear-gradient(135deg, #10b981, #8b5cf6); color: white; }
.bet-num-btn.n6 { background: #ef4444; color: white; }
.bet-num-btn.n7 { background: #10b981; color: white; }
.bet-num-btn.n8 { background: #ef4444; color: white; }
.bet-num-btn.n9 { background: #10b981; color: white; }

/* Big/Small Buttons */
.bet-size-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.bet-size-btn {
  border: none;
  border-radius: var(--radius);
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 0.15s;
}

.bet-size-btn:active { transform: scale(0.97); }

.bet-size-btn.big {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.bet-size-btn.small {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

/* History Table */
.history-section {
  padding: 0 12px;
  margin-top: 8px;
}

.history-tabs {
  display: flex;
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 12px;
  gap: 4px;
}

.history-tab {
  flex: 1;
  padding: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.history-tab.active {
  background: var(--primary);
  color: white;
}

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

.history-table th {
  font-size: 11px;
  color: var(--text3);
  font-weight: 600;
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.history-table td {
  font-size: 12px;
  color: var(--text2);
  padding: 10px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.history-table tr:last-child td { border-bottom: none; }

.result-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: white;
}

/* ===== BET MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.bet-modal {
  background: var(--bg2);
  border-radius: 24px 24px 0 0;
  padding: 20px;
  width: 100%;
  max-width: 480px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  border-top: 1px solid var(--border);
}

.modal-overlay.active .bet-modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  width: 30px;
  height: 30px;
  background: var(--bg3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  border: 1px solid var(--border);
}

.modal-color-indicator {
  height: 6px;
  border-radius: 3px;
  margin-bottom: 16px;
}

.modal-balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.modal-balance-row span:first-child {
  font-size: 13px;
  color: var(--text3);
}

.modal-balance-row span:last-child {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

.bet-amount-label {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 8px;
}

.bet-presets {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.bet-preset {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}

.bet-preset.active, .bet-preset:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(244,63,94,0.1);
}

.bet-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.bet-qty-btn {
  width: 40px;
  height: 40px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 20px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
  flex-shrink: 0;
}

.bet-amount-input {
  flex: 1;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font);
  color: var(--text);
  text-align: center;
  outline: none;
}

.bet-amount-input:focus { border-color: var(--primary); }

.bet-summary {
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
}

.bet-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bet-summary-item span:first-child {
  font-size: 11px;
  color: var(--text3);
}

.bet-summary-item span:last-child {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.confirm-bet-btn {
  width: 100%;
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  color: white;
  transition: opacity 0.2s;
}

.confirm-bet-btn:hover { opacity: 0.9; }

/* ===== WALLET PAGE ===== */
.wallet-page {
  background: var(--bg);
  min-height: 100vh;
  padding-bottom: 80px;
}

.wallet-header {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 20px 16px 40px;
  position: relative;
  overflow: hidden;
}

.wallet-header::before {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  top: -60px;
  right: -40px;
}

.wallet-header h3 {
  font-size: 14px;
  color: rgba(255,255,255,0.75);
  margin-bottom: 6px;
}

.wallet-balance-big {
  font-size: 36px;
  font-weight: 800;
  color: white;
  margin-bottom: 4px;
}

.wallet-balance-sub {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
}

.wallet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: -20px 12px 0;
  position: relative;
  z-index: 10;
}

.wallet-action-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.2s;
  text-decoration: none;
}

.wallet-action-btn:hover { transform: translateY(-2px); }

.wallet-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.wallet-action-btn.recharge .wallet-action-icon {
  background: rgba(16,185,129,0.15);
}

.wallet-action-btn.withdraw .wallet-action-icon {
  background: rgba(244,63,94,0.15);
}

.wallet-action-btn span:last-child {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.wallet-section {
  padding: 16px 12px 0;
}

.wallet-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

/* Payment Methods */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.payment-method {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.payment-method.selected {
  border-color: var(--primary);
  background: rgba(244,63,94,0.05);
}

.payment-method-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--bg3);
  flex-shrink: 0;
}

.payment-method-info {
  flex: 1;
}

.payment-method-info h5 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.payment-method-info p {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

.payment-method-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.payment-method.selected .payment-method-radio {
  border-color: var(--primary);
  background: var(--primary);
}

.payment-method.selected .payment-method-radio::after {
  content: '✓';
  font-size: 11px;
  color: white;
  font-weight: 700;
}

/* Amount Presets */
.amount-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.amount-preset {
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}

.amount-preset.active, .amount-preset:hover {
  border-color: var(--primary);
  background: rgba(244,63,94,0.1);
}

.amount-preset .preset-amount {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: block;
}

.amount-preset .preset-bonus {
  font-size: 10px;
  color: var(--green);
  margin-top: 2px;
  display: block;
}

/* Transaction History */
.transaction-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.transaction-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.transaction-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.transaction-icon.credit { background: rgba(16,185,129,0.15); }
.transaction-icon.debit { background: rgba(244,63,94,0.15); }

.transaction-info {
  flex: 1;
}

.transaction-info h5 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.transaction-info p {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

.transaction-amount {
  font-size: 15px;
  font-weight: 700;
}

.transaction-amount.credit { color: var(--green); }
.transaction-amount.debit { color: var(--red); }

/* ===== PROFILE PAGE ===== */
.profile-page {
  background: var(--bg);
  min-height: 100vh;
  padding-bottom: 80px;
}

.profile-header {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  padding: 24px 16px 50px;
  position: relative;
  overflow: hidden;
}

.profile-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 3px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.profile-info h3 {
  font-size: 20px;
  font-weight: 700;
  color: white;
}

.profile-info p {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
}

.profile-uid {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  margin-top: 8px;
}

.profile-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: -24px 12px 0;
  position: relative;
  z-index: 10;
}

.profile-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
}

.profile-stat-num {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  display: block;
}

.profile-stat-label {
  font-size: 10px;
  color: var(--text3);
  margin-top: 4px;
  display: block;
}

.profile-menu {
  padding: 16px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-menu-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}

.profile-menu-item:hover { background: var(--bg3); }

.profile-menu-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.profile-menu-text {
  flex: 1;
}

.profile-menu-text h5 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.profile-menu-text p {
  font-size: 11px;
  color: var(--text3);
  margin-top: 2px;
}

.profile-menu-arrow {
  font-size: 12px;
  color: var(--text3);
}

/* ===== RESULT POPUP ===== */
.result-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.result-popup.active {
  opacity: 1;
  pointer-events: all;
}

.result-card {
  background: var(--bg2);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  width: 85%;
  max-width: 320px;
  text-align: center;
  border: 1px solid var(--border);
  transform: scale(0.8);
  transition: transform 0.3s;
}

.result-popup.active .result-card {
  transform: scale(1);
}

.result-emoji { font-size: 56px; margin-bottom: 12px; }

.result-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}

.result-title.win { color: var(--green); }
.result-title.lose { color: var(--red); }

.result-amount {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 16px;
}

.result-amount.win { color: var(--green); }
.result-amount.lose { color: var(--red); }

.result-detail {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 20px;
}

.result-close-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== UTILITIES ===== */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-accent { color: var(--accent); }
.text-primary { color: var(--primary); }
.fw-700 { font-weight: 700; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 2px; }