/* =====================================================
   TRUST LUDO — Official Multiplayer Escrow Arena
   Global Stylesheet (app.css)
   Theme: Deep Emerald Green × Rich Gold × Dark Charcoal
   Ultra-premium Indian Gaming Aesthetic
   ===================================================== */

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

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

:root {
  /* ── Core Backgrounds ── */
  --bg-primary:     #0A0F0D;
  --bg-secondary:   #0F1A14;
  --bg-canvas:      #070B09;
  --bg-card:        rgba(16, 40, 24, 0.85);
  --bg-card-border: rgba(255, 215, 0, 0.18);

  /* ── Brand Colors ── */
  --color-gold:     #FFD700;
  --color-gold-lt:  #FFE066;
  --color-gold-dk:  #D4AF37;
  --color-emerald:  #10B981;
  --color-green:    #059669;
  --color-mint:     #D1FAE5;
  --color-red:      #EF4444;
  --color-blue:     #3B82F6;
  --color-white:    #F9FAFB;

  /* ── Text ── */
  --text-primary: #F9FAFB;
  --text-muted:   #D1FAE5;
  --text-dim:     rgba(209, 250, 229, 0.55);

  /* ── Radii ── */
  --radius-sm:  10px;
  --radius-md:  16px;
  --radius-lg:  22px;
  --radius-xl:  32px;

  /* ── Shadows ── */
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.65);
  --shadow-gold: 0 4px 20px rgba(255, 215, 0, 0.35);
  --shadow-emerald: 0 4px 20px rgba(16, 185, 129, 0.35);

  /* ── Misc ── */
  --font: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  background-color: var(--bg-canvas);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(16, 185, 129, 0.22) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 90% 75%, rgba(255, 215, 0, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 50% 35% at 10% 85%, rgba(5, 150, 105, 0.14) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Subtle luxury emerald grid background texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.035;
  background-image:
    radial-gradient(rgba(255, 215, 0, 0.8) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* =====================================================
   PAGE SYSTEM
   ===================================================== */

.page {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(24px);
  transition: opacity var(--transition), transform var(--transition);
  z-index: 1;
}

.page.active {
  opacity: 1;
  pointer-events: all;
  transform: translateX(0);
  z-index: 2;
}

/* =====================================================
   SPLASH SCREEN
   ===================================================== */

@keyframes orbit-spin {
  to { transform: rotateX(72deg) rotate(360deg); }
}
@keyframes orbit-spin-reverse {
  to { transform: rotateX(72deg) rotate(-360deg); }
}
@keyframes orb-drift {
  0%, 100% { transform: translate(0) scale(1); }
  50% { transform: translate(20px, -14px) scale(1.08); }
}

.orbit-ring {
  border: 1.5px solid rgba(255, 215, 0, 0.45);
  border-radius: 9999px;
  animation: 3.4s linear infinite orbit-spin;
  position: absolute;
  inset: -14%;
  transform: rotateX(72deg);
  pointer-events: none;
}
.orbit-ring-reverse {
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  animation: 5.4s linear infinite orbit-spin-reverse;
}
.orbit-dot {
  background: #FFD700;
  border-radius: 9999px;
  width: 7px; height: 7px;
  margin-left: -3.5px;
  position: absolute;
  top: -3.5px; left: 50%;
  box-shadow: 0 0 10px #FFD700, 0 0 20px #FFA500;
}
.orbit-dot-emerald {
  background: #10B981;
  border-radius: 9999px;
  width: 7px; height: 7px;
  margin-left: -3.5px;
  position: absolute;
  bottom: -3.5px; left: 50%;
  box-shadow: 0 0 10px #10B981, 0 0 20px #34D399;
}
.animate-orb {
  animation: 9s ease-in-out infinite orb-drift;
}

#page-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #070B09;
  background-image: 
    radial-gradient(55% 50% at 50% 30%, rgba(16, 185, 129, 0.25) 0%, transparent 75%),
    radial-gradient(circle at 15% 85%, rgba(255, 215, 0, 0.12) 0%, transparent 60%);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), transform 0.55s ease, visibility 0.55s ease;
  opacity: 1;
  visibility: visible;
  overflow: hidden;
}
#page-splash.leaving {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
  visibility: hidden;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
  padding: 2rem;
  position: relative;
  z-index: 2;
}

.splash-logo {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.splash-brand-title {
  font-family: var(--font);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  margin-top: 24px;
  background: linear-gradient(135deg, #FFFFFF 0%, #FFE066 30%, #FFD700 70%, #F59E0B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 4px 20px rgba(255, 215, 0, 0.45));
}
.splash-brand-sub {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: #D1FAE5;
  margin-top: 6px;
  text-transform: uppercase;
}

.splash-loader {
  width: 100%;
  max-width: 240px;
  margin-top: 36px;
}

.loader-bar {
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
  position: relative;
}

.loader-fill {
  height: 100%;
  width: 4%;
  background: linear-gradient(to right, #10B981, #FFD700, #F59E0B);
  border-radius: 999px;
  transition: width 0.15s ease;
}

.loader-text, .splash-loader-text {
  text-align: center;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: #FFD700;
  text-transform: uppercase;
}

/* =====================================================
   FILTER PILLS (Marketplace)
   ===================================================== */
.filter-pill {
  background: rgba(16, 40, 24, 0.8);
  border: 1px solid rgba(255, 215, 0, 0.2);
  color: var(--text-muted);
  border-radius: 30px;
  padding: 6px 14px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.filter-pill:hover {
  background: rgba(255, 215, 0, 0.15);
  color: #fff;
}
.filter-pill.active {
  background: linear-gradient(135deg, #FFD700, #F59E0B);
  color: #0A0F0D;
  border-color: #FFD700;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(255, 215, 0, 0.35);
}

.mode-filter-pill {
  background: rgba(16, 40, 24, 0.85);
  border: 1.5px solid rgba(255, 215, 0, 0.25);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.mode-filter-pill:hover {
  background: rgba(255, 215, 0, 0.15);
  color: #fff;
  border-color: rgba(255, 215, 0, 0.5);
}
.mode-filter-pill.active {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  border-color: #34D399;
  font-weight: 800;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.4);
}

.mode-select-btn {
  flex: 1;
  padding: 10px 8px;
  background: rgba(16, 40, 24, 0.85);
  border: 1.5px solid rgba(255, 215, 0, 0.25);
  border-radius: 10px;
  color: #D1FAE5;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}
.mode-select-btn:hover {
  border-color: #FFD700;
}
.mode-select-btn.active {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.22), rgba(245, 158, 11, 0.22));
  border-color: #FFD700;
  color: #FFD700;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

/* =====================================================
   HEADERS
   ===================================================== */

.page-header {
  padding: 48px 24px 20px;
  text-align: center;
  background: linear-gradient(to bottom, rgba(10, 15, 13, 1), rgba(10, 15, 13, 0));
}

.page-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  background: linear-gradient(135deg, #FFFFFF 0%, #FFD700 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 4px;
}

.sub-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(10, 15, 13, 0.95);
  border-bottom: 1px solid rgba(255, 215, 0, 0.18);
  flex-shrink: 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.sub-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFFFFF;
}

/* =====================================================
   PAGE BODY / SCROLL AREA
   ===================================================== */

.page-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 16px 84px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 215, 0, 0.3) transparent;
}

.page-body > * {
  flex-shrink: 0;
}

/* =====================================================
   MODAL DIALOG SYSTEM
   ===================================================== */
.modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.88) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 99999 !important;
  padding: 18px !important;
  box-sizing: border-box !important;
  animation: modalFadeIn 0.2s ease-out forwards;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-card {
  width: 100% !important;
  max-width: 440px !important;
  max-height: 88vh !important;
  overflow-y: auto !important;
  border-radius: 24px !important;
  padding: 20px !important;
  box-sizing: border-box !important;
  background: #0E1A14 !important;
  border: 1.5px solid rgba(255, 215, 0, 0.3) !important;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.95), 0 0 30px rgba(16, 185, 129, 0.15) !important;
  animation: modalPopIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.92) translateY(18px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* =====================================================
   CARDS
   ===================================================== */

.card {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.glass-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-primary);
}

/* =====================================================
   BUTTONS
   ===================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, opacity var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  position: relative;
  overflow: hidden;
}

.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.btn-primary:not(:disabled):active {
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.btn-gold {
  background: linear-gradient(135deg, #FFD700 0%, #F59E0B 100%);
  color: #0A0F0D;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border: 1.5px solid rgba(255, 215, 0, 0.25);
}

.btn-sm {
  min-height: 36px;
  padding: 6px 16px;
  font-size: 0.8rem;
}

.btn-full { width: 100%; }

.icon-btn {
  background: rgba(16, 40, 24, 0.8);
  border: 1px solid rgba(255, 215, 0, 0.2);
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  min-width: 44px;
  min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.icon-btn:active { background: rgba(255, 215, 0, 0.15); }

/* Shimmer effect on buttons */
.btn-primary::after, .btn-gold::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: shimmer 2.5s infinite;
}
@keyframes shimmer {
  0%   { left: -100%; }
  100% { left: 220%; }
}

.btn-loader {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* =====================================================
   FORMS
   ===================================================== */

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

input[type="text"],
input[type="password"],
input[type="tel"],
input[type="email"] {
  background: rgba(16, 40, 24, 0.6);
  border: 1.5px solid rgba(255, 215, 0, 0.22);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  outline: none;
  min-height: 50px;
}

input:focus {
  border-color: #FFD700;
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.18);
  background: rgba(16, 40, 24, 0.85);
}

input::placeholder { color: rgba(209, 250, 229, 0.4); }

.form-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.form-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.form-row input { flex: 1; }

/* =====================================================
   TABS
   ===================================================== */

.tab-row {
  display: flex;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 44px;
}

.tab-btn.active {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.45);
}

/* =====================================================
   MENU PAGE (HOME)
   ===================================================== */

.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  background: rgba(10, 15, 13, 0.95);
  border-bottom: 1px solid rgba(255, 215, 0, 0.18);
  flex-shrink: 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.menu-user { display: flex; align-items: center; gap: 10px; }

.avatar-circle {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  background: linear-gradient(135deg, #10B981, #FFD700);
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45);
  border: 2px solid rgba(255, 215, 0, 0.4);
}

.user-info { display: flex; flex-direction: column; }
.user-name { font-size: 0.95rem; font-weight: 700; color: #FFFFFF; }
.user-coins { font-size: 0.8rem; color: #D1FAE5; }

.menu-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 80px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.menu-banner {
  background: linear-gradient(135deg, rgba(16, 40, 24, 0.9), rgba(5, 25, 15, 0.95));
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1.5px solid rgba(255, 215, 0, 0.28);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.25);
}

.banner-dice { font-size: 3rem; }
.banner-text h2 {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, #FFFFFF, #FFD700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.banner-text p { color: #D1FAE5; font-size: 0.82rem; }

#home-active-match-card {
  user-select: none;
  -webkit-user-select: none;
}
#home-active-match-card:active {
  transform: scale(0.985);
  box-shadow: 0 4px 16px rgba(0,0,0,0.7), 0 0 10px rgba(16,185,129,0.3) !important;
}

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

.menu-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 12px;
  border-radius: var(--radius-md);
  border: none;
  font-family: var(--font);
  cursor: pointer;
  transition: transform 0.12s, box-shadow var(--transition);
  min-height: 108px;
}
.menu-card:active { transform: scale(0.95); }

.menu-icon { font-size: 1.9rem; }
.menu-label { font-size: 0.85rem; font-weight: 700; color: #fff; }

.card-red    { background: linear-gradient(135deg, #EF4444 0%, #B91C1C 100%); box-shadow: 0 6px 22px rgba(239, 68, 68, 0.35); }
.card-blue   { background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%); box-shadow: 0 6px 22px rgba(59, 130, 246, 0.35); }
.card-green  { background: linear-gradient(135deg, #10B981 0%, #047857 100%); box-shadow: 0 6px 22px rgba(16, 185, 129, 0.35); }
.card-yellow { background: linear-gradient(135deg, #FFD700 0%, #D97706 100%); box-shadow: 0 6px 22px rgba(255, 215, 0, 0.35); }
.card-yellow .menu-label { color: #0A0F0D; }

.menu-secondary {
  display: flex;
  gap: 10px;
}
.menu-secondary .btn {
  flex: 1;
  border-color: rgba(255, 215, 0, 0.35);
  color: #FFD700;
  font-weight: 700;
  background: rgba(16, 40, 24, 0.65);
}

/* =====================================================
   BOTTOM NAV
   ===================================================== */

.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  display: flex;
  background: rgba(8, 14, 11, 0.98);
  border-top: 1px solid rgba(255, 215, 0, 0.2);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition);
  color: rgba(209, 250, 229, 0.45);
  min-height: 56px;
}

.nav-item.active { color: #FFD700; }

.nav-icon { font-size: 1.3rem; }
.nav-label { font-size: 0.65rem; font-weight: 700; font-family: var(--font); }

/* =====================================================
   BACK BUTTON
   ===================================================== */

.back-btn {
  background: rgba(16, 40, 24, 0.85);
  border: 1px solid rgba(255, 215, 0, 0.2);
  color: #FFFFFF;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 44px;
  transition: background var(--transition);
}
.back-btn:active { background: rgba(255, 215, 0, 0.15); }

/* =====================================================
   MODE SELECTOR
   ===================================================== */

.mode-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  border-radius: var(--radius-md);
  border: 2px solid rgba(255, 215, 0, 0.18);
  background: rgba(16, 40, 24, 0.5);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  min-height: 80px;
}

.mode-btn.active {
  border-color: #FFD700;
  background: rgba(255, 215, 0, 0.15);
  color: #FFD700;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.25);
}

.mode-icon { font-size: 1.5rem; }

/* =====================================================
   ROOM CODE
   ===================================================== */

.room-code-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  background: rgba(8, 20, 13, 0.75);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 1.5px dashed rgba(255, 215, 0, 0.4);
}

.room-code-label {
  font-size: 0.75rem;
  color: #D1FAE5;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.room-code {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: 0.25em;
  color: #FFD700;
  text-shadow: 0 0 24px rgba(255, 215, 0, 0.5);
}

.players-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.player-slot {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(16, 40, 24, 0.5);
  border: 1px solid rgba(255, 215, 0, 0.15);
}

.player-slot.empty { color: rgba(209, 250, 229, 0.4); }
.player-slot.filled { color: #FFFFFF; border-color: rgba(16, 185, 129, 0.5); background: rgba(16, 185, 129, 0.12); }

.lobby-status {
  text-align: center;
  color: #D1FAE5;
  font-size: 0.85rem;
  margin-bottom: 14px;
}

/* =====================================================
   CHALLENGES
   ===================================================== */

.challenge-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(16, 40, 24, 0.65);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 1px solid rgba(255, 215, 0, 0.16);
  transition: background 0.15s;
}
.challenge-item:active { background: rgba(255, 215, 0, 0.1); }

.challenge-from { font-weight: 700; font-size: 0.9rem; color: #FFFFFF; }
.challenge-time { font-size: 0.75rem; color: #D1FAE5; }

.challenge-actions { display: flex; gap: 6px; }

.btn-accept {
  padding: 6px 14px;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.btn-decline {
  padding: 6px 14px;
  background: rgba(239, 68, 68, 0.15);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
}

/* =====================================================
   LEADERBOARD
   ===================================================== */

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}

.lb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  transition: transform 0.1s;
}

.lb-item:active { transform: scale(0.98); }

.lb-rank {
  width: 32px;
  text-align: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

.lb-rank.rank-1 { color: #FFD700; font-size: 1.3rem; text-shadow: 0 0 10px rgba(255, 215, 0, 0.6); }
.lb-rank.rank-2 { color: #E2E8F0; }
.lb-rank.rank-3 { color: #CD7F32; }

.lb-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; color: #fff;
  flex-shrink: 0;
}

.lb-info { flex: 1; min-width: 0; }
.lb-name { font-weight: 700; font-size: 0.95rem; color: #FFFFFF; }
.lb-stats { font-size: 0.75rem; color: #D1FAE5; }

.lb-coins { font-size: 0.85rem; font-weight: 800; color: #FFD700; }

/* =====================================================
   PROFILE
   ===================================================== */

.profile-header-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 28px;
}

.profile-avatar {
  width: 82px; height: 82px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, #10B981, #FFD700);
  margin-bottom: 4px;
  box-shadow: 0 8px 28px rgba(16, 185, 129, 0.45);
  border: 3px solid rgba(255, 215, 0, 0.4);
}

.editable-avatar {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.editable-avatar:hover, .editable-avatar:active {
  transform: scale(1.05);
  box-shadow: 0 10px 32px rgba(255, 215, 0, 0.45);
}
.avatar-opt-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 10px;
  padding: 8px 4px;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.avatar-opt-btn:hover, .avatar-opt-btn:active {
  background: rgba(255, 215, 0, 0.2);
  border-color: #FFD700;
  transform: scale(1.1);
}
.avatar-color-btn {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.avatar-color-btn:hover {
  transform: scale(1.15);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-item {
  background: rgba(8, 20, 13, 0.65);
  border: 1px solid rgba(255, 215, 0, 0.16);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #FFD700;
}

.stat-label {
  font-size: 0.75rem;
  color: #D1FAE5;
  font-weight: 600;
}

/* =====================================================
   TOAST NOTIFICATION
   ===================================================== */

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: rgba(14, 30, 20, 0.98);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 215, 0, 0.35);
  z-index: 999;
  white-space: nowrap;
  transition: opacity 0.3s, transform 0.3s;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.toast.hidden { opacity: 0; pointer-events: none; }

/* =====================================================
   LOADING SPINNER
   ===================================================== */

.loading-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #FFD700;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: block;
}

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

/* =====================================================
   EMPTY STATE
   ===================================================== */

.empty-state {
  text-align: center;
  color: rgba(209, 250, 229, 0.5);
  padding: 24px;
  font-size: 0.9rem;
}

/* =====================================================
   UTILITY
   ===================================================== */

.hidden { display: none !important; }

/* =====================================================
   WALLET & ESCROW STYLES
   ===================================================== */
.balance-chips { display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.user-cash {
  background: rgba(16, 185, 129, 0.18);
  color: #34D399;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: 1px solid rgba(16, 185, 129, 0.45);
}
.user-cash .plus-btn {
  background: #10B981;
  color: #fff;
  width: 14px; height: 14px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  line-height: 1;
}

.stake-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 6px;
}
.stake-btn {
  background: rgba(16, 40, 24, 0.7);
  border: 1.5px solid rgba(255, 215, 0, 0.22);
  color: #fff;
  padding: 10px 8px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}
.stake-btn.active {
  background: rgba(255, 215, 0, 0.2);
  border-color: #FFD700;
  color: #FFD700;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.3);
  transform: scale(1.02);
}
.stake-btn:active { transform: scale(0.96); }

.wallet-hero {
  background: linear-gradient(135deg, rgba(16, 40, 24, 0.95), rgba(6, 24, 14, 0.98));
  border: 1.5px solid rgba(255, 215, 0, 0.35);
  border-radius: 18px;
  padding: 20px 16px;
  text-align: center;
  margin-bottom: 14px;
  box-shadow: 0 8px 28px rgba(16, 185, 129, 0.25);
}
.wallet-hero .cash-label { font-size: 0.78rem; color: #D1FAE5; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.wallet-hero .cash-amount { font-size: 2.4rem; font-weight: 900; color: #FFD700; margin: 4px 0; text-shadow: 0 0 24px rgba(255, 215, 0, 0.5); }
.wallet-hero .escrow-note { font-size: 0.75rem; color: #D1FAE5; display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }

.wallet-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.wallet-tab-btn {
  flex: 1;
  padding: 10px 6px;
  background: rgba(16, 40, 24, 0.6);
  border: 1px solid rgba(255, 215, 0, 0.18);
  border-radius: 10px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
}
.wallet-tab-btn.active {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #fff;
  border-color: #10B981;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.qr-box {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  display: inline-block;
  margin: 10px auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}
.qr-box img { display: block; width: 170px; height: 170px; }

.upi-details-card {
  background: rgba(16, 40, 24, 0.6);
  border: 1px dashed rgba(255, 215, 0, 0.3);
  border-radius: 10px;
  padding: 10px;
  margin: 10px 0;
  text-align: left;
  font-size: 0.8rem;
}
.upi-row { display: flex; justify-content: space-between; align-items: center; margin: 4px 0; }
.copy-pill {
  background: rgba(255, 215, 0, 0.2);
  color: #FFD700;
  border: 1px solid rgba(255, 215, 0, 0.5);
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  cursor: pointer;
  font-weight: 700;
}

.pot-badge {
  background: linear-gradient(90deg, #FFD700, #10B981);
  color: #0A0F0D;
  font-weight: 900;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

/* =====================================================
   LUXURIOUS WALLET AMOUNT INPUT BAR
===================================================== */
.lux-amount-card {
  background: linear-gradient(145deg, rgba(16, 40, 24, 0.95), rgba(8, 20, 12, 0.98));
  border: 1.5px solid rgba(255, 215, 0, 0.45);
  border-radius: 18px;
  padding: 18px 16px;
  margin: 14px 0 16px 0;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 215, 0, 0.15);
  text-align: left;
}

.lux-amount-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #FFD700;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.lux-amount-input-box {
  display: flex;
  align-items: center;
  background: rgba(4, 10, 6, 0.75);
  border: 2px solid rgba(255, 215, 0, 0.55);
  border-radius: 14px;
  padding: 12px 18px;
  transition: all 0.25s ease;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.7);
}

.lux-amount-input-box:focus-within {
  border-color: #FFD700;
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.35), inset 0 2px 10px rgba(0, 0, 0, 0.7);
}

.lux-currency {
  font-size: 2.4rem;
  font-weight: 900;
  color: #FFD700;
  margin-right: 10px;
  line-height: 1;
  user-select: none;
}

.lux-amount-input {
  background: transparent !important;
  border: none !important;
  outline: none !important;
  font-size: 2.4rem !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  width: 100% !important;
  font-family: var(--font) !important;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
  min-height: unset !important;
}

.lux-amount-input::-webkit-outer-spin-button,
.lux-amount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.lux-quick-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.lux-chip {
  background: rgba(16, 40, 24, 0.85);
  border: 1px solid rgba(255, 215, 0, 0.28);
  border-radius: 10px;
  color: #FFD700;
  padding: 9px 12px;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  min-width: 65px;
  text-align: center;
  font-family: var(--font);
}

.lux-chip:hover, .lux-chip:active, .lux-chip.active {
  background: rgba(255, 215, 0, 0.25);
  border-color: #FFD700;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.btn-max-pill {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.45);
  transition: all 0.2s ease;
  font-family: var(--font);
}

.btn-max-pill:active {
  transform: scale(0.96);
}

/* =====================================================
   HOME ACTIVE MATCH BANNER & PULSE
===================================================== */
@keyframes livePulseAnim {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.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-pulse-dot {
  animation: livePulseAnim 1.6s infinite ease-in-out;
}

/* Scroll fix for wallet and forms */
#page-wallet .page-body,
#page-createroom .page-body {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 120px !important;
}
