/**
 * SattaKhelo.io - Modern Design System & UI Engine
 * Version: 2.0.0 (Mobile-First Neo-Emerald Luxury Theme)
 */

:root {
  /* Dynamic CSS Tokens (Can be overridden by PHP dynamic DB colors) */
  --brand-primary: #004d40;
  --brand-primary-light: #00796b;
  --brand-secondary: #025e5e;
  --brand-accent: #d4af37;
  --brand-accent-glow: rgba(212, 175, 55, 0.28);
  --brand-gradient: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 60%, #00332b 100%);
  --gold-gradient: linear-gradient(135deg, #f7d070 0%, #d4af37 50%, #aa820a 100%);

  /* Neutrals & Surfaces */
  --bg-app: #f4f6f9;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --bg-subtle: #f8fafc;
  --border-color: rgba(0, 0, 0, 0.07);
  --border-focus: #004d40;

  /* Typography Colors */
  --text-main: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-white: #ffffff;

  /* Status Tokens */
  --status-open: #10b981;
  --status-open-bg: #ecfdf5;
  --status-late: #f59e0b;
  --status-late-bg: #fffbeb;
  --status-closed: #ef4444;
  --status-closed-bg: #fef2f2;
  --status-win: #059669;

  /* Elevation & Shadows */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 28px rgba(0, 77, 64, 0.14);
  --shadow-float: 0 14px 30px -4px rgba(0, 77, 64, 0.25);

  /* Geometry */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;

  /* Safe Area / Ergonomics */
  --safe-bottom: max(16px, env(safe-area-inset-bottom));
}

/* Base Reset & Mobile Ergonomics */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  padding-bottom: calc(75px + var(--safe-bottom));
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Monospaced Figures for Clocks & Results */
.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-family: 'SF Pro Text', Menlo, Consolas, Monaco, monospace;
}

/* ─────────────────────────────────────────────────────────────
   TOP APP HEADER & LIVE TICKER
────────────────────────────────────────────────────────────── */
.app-header {
  background: var(--brand-gradient);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 3px 12px rgba(0, 30, 25, 0.25);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-decoration: none;
  cursor: pointer;
}

.brand-menu-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.brand-menu-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.2);
}

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

.wallet-badge {
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.1);
  text-decoration: none;
  transition: transform 0.15s ease;
}

.wallet-badge:active {
  transform: scale(0.96);
}

.wallet-badge i {
  color: var(--brand-accent);
  font-size: 14px;
}

.header-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  text-decoration: none;
  position: relative;
  transition: background 0.2s;
}

.header-icon-btn:active {
  background: rgba(255, 255, 255, 0.25);
}

.notif-badge-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3b30;
  border: 2px solid var(--brand-primary);
}

/* ─────────────────────────────────────────────────────────────
   HERO ACTIONS BAR (DEPOSIT & WITHDRAW)
────────────────────────────────────────────────────────────── */
.hero-action-panel {
  background: var(--brand-gradient);
  padding: 6px 16px 26px 16px;
}

.action-buttons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hero-btn {
  padding: 13px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  border: none;
}

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

.hero-btn-deposit {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-btn-withdraw {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ─────────────────────────────────────────────────────────────
   MAIN CONTAINER (CURVED SHEET)
────────────────────────────────────────────────────────────── */
.main-sheet {
  background: var(--bg-app);
  border-radius: 28px 28px 0 0;
  margin-top: -16px;
  position: relative;
  z-index: 10;
  padding: 18px 14px 20px 14px;
  min-height: 70vh;
}

/* Live Players Indicator Pill */
.live-players-pill {
  background: #ffffff;
  border: 1px solid #d1fae5;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-xs);
}

.live-pulse-dot {
  width: 9px;
  height: 9px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.live-players-text {
  font-size: 13px;
  font-weight: 700;
  color: #065f46;
}

.live-tag {
  margin-left: auto;
  font-size: 11px;
  font-weight: 800;
  color: #10b981;
  letter-spacing: 0.5px;
}

/* ─────────────────────────────────────────────────────────────
   CATEGORY FILTER TABS (DISAWAR, MAIN, STARLINE)
────────────────────────────────────────────────────────────── */
.category-tabs-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.category-tabs-nav::-webkit-scrollbar {
  display: none;
}

.cat-tab-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-tab-btn.active {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
  box-shadow: 0 4px 10px rgba(0, 77, 64, 0.25);
}

/* ─────────────────────────────────────────────────────────────
   MODERN GAME CARDS
────────────────────────────────────────────────────────────── */
.modern-game-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: transform 0.15s, box-shadow 0.15s;
}

.modern-game-card:active {
  transform: translateY(1px);
}

.card-header-bar {
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
}

.card-header-open {
  background: linear-gradient(90deg, #059669 0%, #10b981 100%);
}

.card-header-late {
  background: linear-gradient(90deg, #d97706 0%, #f59e0b 100%);
}

.card-header-closed {
  background: linear-gradient(90deg, #b91c1c 0%, #ef4444 100%);
}

.badge-status {
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-times {
  font-size: 11px;
  opacity: 0.92;
  font-family: inherit;
}

.card-body-content {
  padding: 14px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.market-meta {
  flex: 1;
  min-width: 0;
}

.market-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-note {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 4px;
}

.late-info-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff8e1;
  color: #b45309;
  border: 1px solid #fde68a;
  border-radius: var(--radius-xs);
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 700;
  margin-top: 2px;
}

.market-result-box {
  text-align: center;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.market-result-digits {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1;
  color: var(--brand-primary);
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
}

.action-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.action-play-btn:active {
  transform: scale(0.92);
}

.btn-play-active {
  background: var(--brand-gradient);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 77, 64, 0.35);
}

.btn-play-locked {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

/* ─────────────────────────────────────────────────────────────
   FLOATING BOTTOM NAVIGATION BAR (GLASSMORPHIC)
────────────────────────────────────────────────────────────── */
.modern-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  height: 64px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  z-index: 999;
}

.nav-tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 10.5px;
  font-weight: 600;
  text-decoration: none;
  width: 20%;
  height: 100%;
  transition: color 0.15s;
}

.nav-tab-item i {
  font-size: 19px;
  margin-bottom: 3px;
  transition: transform 0.15s;
}

.nav-tab-item.active {
  color: var(--brand-primary);
  font-weight: 700;
}

.nav-tab-item.active i {
  transform: translateY(-2px);
  color: var(--brand-primary);
}

.nav-center-hub {
  position: relative;
  top: -14px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--gold-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-size: 22px;
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.4);
  border: 4px solid #ffffff;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s;
}

.nav-center-hub:active {
  transform: scale(0.92);
}

/* ─────────────────────────────────────────────────────────────
   QUICK AMOUNT CHIPS & FORM ENHANCERS
────────────────────────────────────────────────────────────── */
.quick-chips-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 0 12px;
  scrollbar-width: none;
}

.quick-chips-bar::-webkit-scrollbar {
  display: none;
}

.chip-amount {
  flex-shrink: 0;
  padding: 8px 14px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-amount:active {
  transform: scale(0.92);
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
}

/* ─────────────────────────────────────────────────────────────
   NATIVE TOAST NOTIFICATIONS (NO BROWSER ALERT)
────────────────────────────────────────────────────────────── */
.toast-host {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 90%;
  max-width: 400px;
  pointer-events: none;
}

.toast-pill {
  pointer-events: auto;
  background: #1e293b;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideDownToast 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.25s, transform 0.25s;
}

.toast-pill.success {
  background: linear-gradient(135deg, #065f46 0%, #047857 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.toast-pill.error {
  background: linear-gradient(135deg, #991b1b 0%, #b91c1c 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.toast-pill.info {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

@keyframes slideDownToast {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─────────────────────────────────────────────────────────────
   BOTTOM SHEET DRAWER (FOR CONFIRMATION / SUPPORT)
────────────────────────────────────────────────────────────── */
.sheet-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 20000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}

.sheet-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.sheet-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  padding: 20px 20px calc(24px + var(--safe-bottom));
  z-index: 20001;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85vh;
  overflow-y: auto;
}

.sheet-backdrop.active .sheet-modal {
  transform: translateY(0);
}

.sheet-handle {
  width: 44px;
  height: 5px;
  background: #cbd5e1;
  border-radius: var(--radius-full);
  margin: 0 auto 16px;
}

