/* ========================================================
   LUDO EMPIRE - DESIGN TOKENS & PREMIUM CASINO STYLING
   ======================================================== */

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

:root {
  --bg-1: #04190d;
  --bg-2: #0a3d1e;
  --bg-3: #0f4f28;
  --card: #06261a;
  --card-border: #1c6b3b;
  --card-glow: rgba(43, 224, 112, 0.15);

  --green: #1fb35a;
  --green-dark: #0d7a35;
  --neon: #2be070;

  --gold-1: #fff2a8;
  --gold-2: #ffd23f;
  --gold-3: #e0a012;

  --pink: #ff4f8b;
  --pink-dark: #c42760;
  --purple: #a45cff;
  --blue: #3b8cff;
  --orange: #ffb02e;
  --red: #ff4a4a;

  --text: #ffffff;
  --muted: #a8c8b3;
  --muted-light: #d1e7da;
  
  --app-max-width: 480px;
  --header-height: 62px;
  --bottom-nav-height: 64px;
}

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

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #020d07;
  background-image: radial-gradient(circle at 50% 20%, #083319 0%, #03140a 60%, #020b06 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
}

/* Phone-like Container for Desktop */
.app-container {
  width: 100%;
  max-width: var(--app-max-width);
  min-height: 100vh;
  background-color: var(--bg-1);
  background-image: 
    radial-gradient(ellipse at 50% 0%, rgba(27, 107, 59, 0.25) 0%, rgba(4, 25, 13, 0) 70%),
    linear-gradient(180deg, #072616 0%, #04190d 100%);
  position: relative;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(31, 179, 90, 0.15);
  display: flex;
  flex-direction: column;
}

/* App Main Content Area */
.app-main {
  flex: 1;
  padding-top: var(--header-height);
  padding-bottom: calc(var(--bottom-nav-height) + 16px);
  min-height: calc(100vh - var(--bottom-nav-height));
  display: flex;
  flex-direction: column;
}

.app-main.no-nav {
  padding-bottom: 24px;
}

.app-main.no-header {
  padding-top: 0;
}

/* ========================================================
   HEADER BAR
   ======================================================== */
.app-header {
  position: fixed;
  top: 0;
  width: 100%;
  max-width: var(--app-max-width);
  height: var(--header-height);
  background: rgba(4, 25, 13, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(28, 107, 59, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.header-logo img {
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(43, 224, 112, 0.3));
}

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

/* Wallet Chip in Header */
.wallet-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #093b21 0%, #062615 100%);
  border: 1px solid rgba(43, 224, 112, 0.4);
  padding: 5px 10px;
  border-radius: 20px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.wallet-chip:hover {
  border-color: var(--neon);
  box-shadow: 0 0 12px rgba(43, 224, 112, 0.4);
}

.wallet-chip img.coin-icon {
  width: 16px;
  height: 16px;
}

.wallet-chip .chip-add {
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, var(--gold-2) 0%, var(--gold-3) 100%);
  color: #04190d;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  margin-left: 2px;
}

/* Notification Bell */
.notification-bell {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(9, 59, 33, 0.7);
  border: 1px solid rgba(28, 107, 59, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: #fff;
  text-decoration: none;
  transition: all 0.2s;
}

.notification-bell:hover {
  background: rgba(28, 107, 59, 0.8);
  border-color: var(--neon);
}

.notification-bell img {
  width: 18px;
  height: 18px;
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--red);
}

/* ========================================================
   BOTTOM NAVIGATION (5 Tabs)
   ======================================================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: var(--app-max-width);
  height: var(--bottom-nav-height);
  background: rgba(4, 25, 13, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(28, 107, 59, 0.5);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding: 0 6px;
  box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.5);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 0;
  position: relative;
  transition: all 0.2s ease;
}

.nav-item img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  transition: transform 0.2s ease, filter 0.2s ease;
}

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

.nav-item.active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--neon);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 2px 10px var(--neon);
}

.nav-item.active img {
  transform: translateY(-2px) scale(1.08);
  filter: drop-shadow(0 2px 6px rgba(43, 224, 112, 0.6));
}

.nav-item:active {
  transform: scale(0.94);
}

/* ========================================================
   BUTTONS & CTAs
   ======================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  outline: none;
  position: relative;
  overflow: hidden;
}

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

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Gold Gradient Button (Primary CTAs: PLAY NOW, INVITE NOW, ADD CASH) */
.btn-gold {
  background: linear-gradient(180deg, var(--gold-1) 0%, var(--gold-2) 40%, var(--gold-3) 100%);
  color: #121212;
  box-shadow: 0 4px 15px rgba(224, 160, 18, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  border: 1px solid #ffd23f;
}

.btn-gold:hover {
  box-shadow: 0 6px 20px rgba(255, 210, 63, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  filter: brightness(1.05);
}

/* Green Gradient Button */
.btn-green {
  background: linear-gradient(180deg, #2ae070 0%, #1fb35a 50%, #0d7a35 100%);
  color: #ffffff;
  border: 1px solid rgba(43, 224, 112, 0.5);
  box-shadow: 0 4px 15px rgba(31, 179, 90, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.btn-green:hover {
  box-shadow: 0 6px 20px rgba(43, 224, 112, 0.6);
  filter: brightness(1.08);
}

/* Pink Gradient Button (Withdraw) */
.btn-pink {
  background: linear-gradient(180deg, #ff71a3 0%, var(--pink) 50%, var(--pink-dark) 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 79, 139, 0.6);
  box-shadow: 0 4px 15px rgba(255, 79, 139, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-pink:hover {
  box-shadow: 0 6px 20px rgba(255, 79, 139, 0.6);
  filter: brightness(1.08);
}

/* Outline & Ghost Buttons */
.btn-outline {
  background: transparent;
  color: var(--neon);
  border: 1.5px solid var(--neon);
}

.btn-outline:hover {
  background: rgba(43, 224, 112, 0.1);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 8px;
}

/* ========================================================
   CARDS & CONTAINERS
   ======================================================== */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.card-glossy {
  background: linear-gradient(145deg, rgba(8, 44, 28, 0.9) 0%, rgba(4, 25, 14, 0.95) 100%);
  border: 1px solid rgba(28, 107, 59, 0.7);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(43, 224, 112, 0.15);
}

.card-glossy::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

/* ========================================================
   FORM INPUTS & AUTH PAGES
   ======================================================== */
.auth-hero-wrap {
  width: 100%;
  min-height: 220px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px 20px;
}

.auth-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 25, 13, 0.4) 0%, rgba(4, 25, 13, 0.9) 100%);
}

.auth-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.auth-hero-logo {
  max-width: 200px;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.7));
}

.auth-card {
  background: linear-gradient(180deg, #093420 0%, #052013 100%);
  border: 1px solid var(--card-border);
  border-radius: 28px 28px 0 0;
  padding: 26px 20px 40px;
  margin-top: -24px;
  position: relative;
  z-index: 10;
  flex: 1;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.6);
}

.auth-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  text-align: center;
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 22px;
}

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

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-light);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.input-icon {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  pointer-events: none;
  opacity: 0.7;
}

.input-control {
  width: 100%;
  background: rgba(3, 16, 8, 0.85);
  border: 1.5px solid rgba(28, 107, 59, 0.7);
  border-radius: 12px;
  padding: 13px 14px;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.input-control.has-icon {
  padding-left: 44px;
}

.input-control.has-toggle {
  padding-right: 44px;
}

.input-control:focus {
  border-color: var(--neon);
  box-shadow: 0 0 10px rgba(43, 224, 112, 0.3);
  background: rgba(4, 25, 13, 0.95);
}

.input-control::placeholder {
  color: rgba(168, 200, 179, 0.5);
  font-size: 13px;
}

.eye-toggle {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eye-toggle img {
  width: 20px;
  height: 20px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.eye-toggle:hover img {
  opacity: 1;
}

/* Inline Action Button for Input (e.g. "Get OTP") */
.input-action-btn {
  position: absolute;
  right: 6px;
  background: linear-gradient(135deg, var(--gold-2) 0%, var(--gold-3) 100%);
  color: #04190d;
  font-weight: 700;
  font-size: 11px;
  padding: 7px 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
}

.input-action-btn:disabled {
  opacity: 0.5;
  background: #2a4435;
  color: #a8c8b3;
  cursor: not-allowed;
}

/* Checkbox & Confirmation */
.checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  cursor: pointer;
  user-select: none;
}

.checkbox-wrap input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--card-border);
  border-radius: 4px;
  background: rgba(3, 16, 8, 0.8);
  cursor: pointer;
  margin-top: 1px;
  position: relative;
  flex-shrink: 0;
}

.checkbox-wrap input[type="checkbox"]:checked {
  background: var(--neon);
  border-color: var(--neon);
}

.checkbox-wrap input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  color: #04190d;
  font-size: 12px;
  font-weight: 900;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.checkbox-wrap a {
  color: var(--gold-2);
  text-decoration: underline;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 18px 0;
  color: rgba(168, 200, 179, 0.5);
  font-size: 12px;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(28, 107, 59, 0.4);
}

.divider span {
  padding: 0 10px;
}

/* ========================================================
   TOAST NOTIFICATIONS
   ======================================================== */
.toast-container {
  position: fixed;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 440px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #093b21;
  border: 1px solid var(--neon);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  animation: slideDown 0.3s ease-out;
}

.toast.toast-error {
  background: #380b11;
  border-color: var(--red);
}

.toast.toast-info {
  background: #0a2542;
  border-color: var(--blue);
}

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

/* ========================================================
   BOTTOM SHEET MODALS
   ======================================================== */
.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.bottom-sheet-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: var(--app-max-width);
  background: linear-gradient(180deg, #093822 0%, #041b0e 100%);
  border-top: 1px solid var(--card-border);
  border-radius: 24px 24px 0 0;
  padding: 20px;
  z-index: 1001;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
  max-height: 85vh;
  overflow-y: auto;
}

.bottom-sheet.active {
  transform: translateX(-50%) translateY(0);
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  margin: -10px auto 16px;
}

/* ========================================================
   UTILITIES
   ======================================================== */
.text-center { text-align: center; }
.text-gold { color: var(--gold-2); }
.text-neon { color: var(--neon); }
.text-muted { color: var(--muted); }
.font-bold { font-weight: 700; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
