/*
 * Glory Casino-style shared design system
 * Used by all user-facing pages (index, dashboard, wallet, deposit, withdraw,
 * profile, settings, referral, history, deposit_pay, login, register).
 */

:root {
  /* Colors */
  --bg:           #eef1f6;
  --surface:      #ffffff;
  --surface-2:    #f5f7fb;
  --border:       #e5e7eb;
  --border-2:     #eef1f6;

  --text:         #141a2e;
  --text-2:       #475569;
  --muted:        #94a3b8;

  --primary:      #2b59ff;          /* blue button */
  --primary-600:  #1f45e0;
  --accent:       #ec1450;          /* pink/red CTA + nav center */
  --accent-2:     #ff3b85;
  --gold:         #fac20c;

  --success:      #10b981;
  --warning:      #f59e0b;
  --danger:       #ef4444;

  /* Effects */
  --shadow-sm:    0 1px 2px rgba(15,23,42,.06);
  --shadow:       0 6px 20px rgba(15,23,42,.08);
  --shadow-lg:    0 16px 40px rgba(15,23,42,.14);
  --radius-sm:    10px;
  --radius:       14px;
  --radius-lg:    20px;

  /* Layout */
  --header-h:     64px;
  --bottomnav-h:  74px;
  --shell-max:    560px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { background: var(--bg); }

body {
  font-family: 'Hind Siliguri', 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; }

/* ============================================================
 * SHELL
 * ========================================================== */
.casino-shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  min-height: 100dvh;
  padding-top: var(--header-h);
  padding-bottom: calc(var(--bottomnav-h) + 16px);
  padding-left: 14px;
  padding-right: 14px;
  position: relative;
}

.casino-shell.no-nav { padding-bottom: 24px; }

/* Back-only header pages */
.casino-shell.standalone { padding-top: 0; }

/* ============================================================
 * HEADER (logged-in and public)
 * ========================================================== */
.casino-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 120;
}
.casino-header-inner {
  max-width: var(--shell-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Glory-style logo */
.casino-logo {
  display: flex; flex-direction: column; line-height: 1;
  font-weight: 900; letter-spacing: .4px;
}
.casino-logo .crown { font-size: .85rem; color: var(--primary); margin-bottom: 2px; }
.casino-logo .top   { font-size: 1.55rem; color: var(--primary); }
.casino-logo .sub   { font-size: .72rem; color: var(--accent); letter-spacing: 2px; font-weight: 800; margin-top: 2px; }

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

/* Balance pill */
.hdr-balance {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #0ea271, #15b585);
  color: #fff;
  border-radius: 999px;
  font-weight: 800; font-size: .85rem;
  box-shadow: 0 4px 14px rgba(16,185,129,.25);
}
.hdr-balance i { font-size: .9rem; }

.hdr-icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1.15rem;
}
.hdr-icon-btn:active { transform: scale(.97); }

/* Sign-in / Sign-up buttons (public header) */
.btn-signin, .btn-signup {
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700; font-size: .85rem;
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap;
}
.btn-signin { background: var(--primary); }
.btn-signup { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.btn-signin:active, .btn-signup:active { transform: scale(.98); }

/* ============================================================
 * STANDALONE PAGE HEADER (with back button)
 * ========================================================== */
.page-header {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 0 14px;
}
.back-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text); font-size: 1.2rem;
  box-shadow: var(--shadow-sm);
}
.page-title { font-size: 1.2rem; font-weight: 800; }

/* ============================================================
 * DRAWER (slide-in menu)
 * ========================================================== */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(2, 6, 23, .55);
  z-index: 200;
  opacity: 0; visibility: hidden;
  transition: opacity .2s ease;
}
.drawer-overlay.open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0; left: -320px;
  width: 300px; height: 100dvh;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  z-index: 210;
  display: flex; flex-direction: column;
  transition: left .25s ease;
  overflow-y: auto;
}
.drawer.open { left: 0; }

.drawer-head {
  padding: 20px;
  background: linear-gradient(135deg, var(--primary), #1e46d1);
  color: #fff;
  display: flex; align-items: center; gap: 12px;
}
.drawer-avatar {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.2);
  font-weight: 800; font-size: 1rem;
}
.drawer-head h4 { font-size: .95rem; font-weight: 800; }
.drawer-head p  { font-size: .8rem; opacity: .85; }

.drawer-list { padding: 10px 8px; flex: 1; }
.drawer-section-title {
  padding: 12px 14px 6px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  color: var(--muted); letter-spacing: 1px;
}
.drawer-item {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 14px; border-radius: 12px;
  font-size: .92rem; font-weight: 600; color: var(--text-2);
}
.drawer-item i { width: 22px; text-align: center; font-size: 1.05rem; color: var(--primary); }
.drawer-item.active { background: rgba(43,89,255,.08); color: var(--primary); }
.drawer-item.logout i, .drawer-item.logout { color: var(--danger); }

.drawer-foot { padding: 14px 18px; border-top: 1px solid var(--border); font-size: .72rem; color: var(--muted); }

/* ============================================================
 * BOTTOM NAV
 * ========================================================== */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--bottomnav-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(15,23,42,.06);
  z-index: 110;
}
.bottom-nav-inner {
  max-width: var(--shell-max);
  height: 100%;
  margin: 0 auto;
  padding: 8px 6px 10px;
  display: flex; align-items: flex-end; justify-content: space-around;
}
.bn-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--muted); font-size: .68rem; font-weight: 600;
  padding: 4px 2px;
}
.bn-item i { font-size: 1.3rem; }
.bn-item.active { color: var(--primary); }

.bn-center {
  position: relative;
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  color: var(--muted); font-size: .68rem; font-weight: 600;
}
.bn-center-btn {
  position: relative;
  top: -22px;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  display: grid; place-items: center;
  font-size: 1.5rem;
  box-shadow: 0 10px 24px rgba(236,20,80,.45);
  border: 4px solid var(--surface);
}
.bn-center span { margin-top: -14px; }

/* ============================================================
 * CARDS
 * ========================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.card.pad-lg { padding: 22px; }

.balance-hero {
  background: linear-gradient(135deg, #0b1730 0%, #1b2a55 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}
.balance-hero::before {
  content: '';
  position: absolute; right: -60px; top: -60px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(250,194,12,.28), transparent 70%);
}
.balance-hero .label { font-size: .82rem; opacity: .8; }
.balance-hero .value {
  font-size: 2.2rem; font-weight: 900; color: var(--gold);
  margin-top: 2px; letter-spacing: .3px;
}
.balance-hero .actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 16px;
}
.balance-hero .actions a {
  padding: 12px; border-radius: 12px; font-weight: 800; font-size: .92rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.balance-hero .actions a.deposit  { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.balance-hero .actions a.withdraw { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25); }

/* Stat grid */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow-sm);
}
.stat .icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; font-size: 1.05rem;
  margin-bottom: 8px;
}
.stat.green .icon  { background: #d1fae5; color: #047857; }
.stat.blue  .icon  { background: #dbeafe; color: #1d4ed8; }
.stat.pink  .icon  { background: #ffe4ec; color: #be185d; }
.stat.amber .icon  { background: #fef3c7; color: #b45309; }
.stat.slate .icon  { background: #e2e8f0; color: #334155; }
.stat .label { font-size: .75rem; color: var(--muted); }
.stat .value { font-size: 1.1rem; font-weight: 800; margin-top: 2px; }

/* ============================================================
 * FORMS
 * ========================================================== */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 8px; color: var(--text); }
.field .hint { font-size: .75rem; color: var(--muted); margin-top: 6px; }

.input, .select, .textarea {
  width: 100%;
  padding: 13px 14px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: .98rem;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(43,89,255,.1);
}
.textarea { min-height: 110px; resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 18px;
  border-radius: 12px;
  font-weight: 800; font-size: .95rem;
  width: 100%;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
.btn-accent  { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.btn-ghost   { background: var(--surface); border: 1.5px solid var(--border); color: var(--text); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger); color: #fff; }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Preset amount chips */
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.preset {
  padding: 10px 6px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-weight: 700; font-size: .88rem;
}
.preset:hover { border-color: var(--primary); color: var(--primary); }
.preset.active { border-color: var(--primary); background: rgba(43,89,255,.08); color: var(--primary); }

/* ============================================================
 * ALERTS / BADGES
 * ========================================================== */
.alert { padding: 12px 14px; border-radius: 12px; font-size: .9rem; margin-bottom: 14px; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warn    { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .3px;
}
.badge.pending           { background: #fef3c7; color: #92400e; }
.badge.verified          { background: #d1fae5; color: #065f46; }
.badge.approved          { background: #d1fae5; color: #065f46; }
.badge.rejected          { background: #fee2e2; color: #991b1b; }
.badge.expired           { background: #e2e8f0; color: #334155; }
.badge.awaiting_payment  { background: #dbeafe; color: #1e40af; }

/* ============================================================
 * LISTS
 * ========================================================== */
.tx-list { display: flex; flex-direction: column; gap: 8px; }
.tx-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-shadow: var(--shadow-sm);
}
.tx-left { display: flex; align-items: center; gap: 12px; }
.tx-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.05rem; }
.tx-icon.up   { background: #fee2e2; color: #b91c1c; }
.tx-icon.down { background: #d1fae5; color: #047857; }
.tx-icon.win  { background: #dcfce7; color: #15803d; }
.tx-icon.loss { background: #fee2e2; color: #b91c1c; }
.tx-icon.ref  { background: #e9d5ff; color: #7e22ce; }
.tx-icon.meta { background: #e2e8f0; color: #334155; }
.tx-type  { font-size: .92rem; font-weight: 700; }
.tx-date  { font-size: .75rem; color: var(--muted); }
.tx-amount { font-weight: 800; font-size: .98rem; }
.tx-amount.up   { color: #b91c1c; }
.tx-amount.down { color: #047857; }

.empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 34px 18px;
  text-align: center;
  color: var(--muted);
}
.empty i { font-size: 2.2rem; color: var(--muted); display: block; margin-bottom: 8px; }
.empty .hint { font-size: .85rem; }

/* ============================================================
 * HERO BANNER (dashboard home)
 * ========================================================== */
.hero-carousel {
  background: linear-gradient(135deg, #b6d9ff 0%, #e8f3ff 55%, #fff 100%);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
  min-height: 190px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.hero-carousel::after {
  content: '';
  position: absolute; right: -20px; top: -30px; width: 240px; height: 240px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><defs><radialGradient id='g' cx='50%' cy='50%' r='50%'><stop offset='0%' stop-color='%23ffffff' stop-opacity='.4'/><stop offset='100%' stop-color='%23ffffff' stop-opacity='0'/></radialGradient></defs><circle cx='100' cy='100' r='100' fill='url(%23g)'/></svg>");
  background-repeat: no-repeat; pointer-events: none;
}
.hero-title {
  font-size: 1.55rem; font-weight: 900; color: #0f172a;
  letter-spacing: .4px; line-height: 1.15;
}
.hero-title .brand { color: var(--primary); font-style: italic; }
.hero-sub { font-size: .92rem; color: var(--text-2); margin-top: 6px; }
.hero-btn {
  display: inline-block; margin-top: 14px;
  padding: 12px 28px; border-radius: 999px;
  background: var(--primary); color: #fff;
  font-weight: 800; font-size: .92rem;
  box-shadow: 0 10px 24px rgba(43,89,255,.28);
}
.hero-dots {
  position: absolute; bottom: 16px; right: 16px;
  display: flex; gap: 6px;
}
.hero-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(15,23,42,.18); }
.hero-dots span.active { background: var(--primary); }

/* ============================================================
 * GAME ICON TILES (big square with caption)
 * ========================================================== */
.quick-games {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  margin-top: 18px;
}
.qg {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: .75rem; font-weight: 700; color: var(--text);
  text-align: center; line-height: 1.15;
}
.qg-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 18px;
  display: grid; place-items: center;
  color: #fff; font-size: 2rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.qg-img::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.06) 0%, rgba(0,0,0,.12) 100%);
  pointer-events: none;
}
.qg-img.aviator  { background: linear-gradient(135deg, #ff4444 0%, #b00020 100%); }
.qg-img.chicken  { background: linear-gradient(135deg, #ffab00 0%, #ff6d00 100%); }
.qg-img.color    { background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%); }
.qg-img.jackpot  { background: linear-gradient(135deg, #f59e0b 0%, #ef4444 50%, #ec4899 100%); }
/* Admin-uploaded custom thumbnail — fully replaces the gradient */
.qg-img.has-thumb { background-size: cover !important; background-position: center !important; background-repeat: no-repeat !important; }
.qg-img.has-thumb::after { background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.25) 100%); }
.qg-hot {
  position: absolute; top: 8px; left: 8px;
  background: #ef4444; color: #fff;
  font-size: .6rem; font-weight: 800;
  padding: 2px 6px; border-radius: 4px;
  letter-spacing: .5px;
}

/* ============================================================
 * CATEGORY PILLS
 * ========================================================== */
.cat-pills {
  display: flex; gap: 10px; padding: 6px 0 8px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 16px -14px 0; padding-left: 14px; padding-right: 14px;
}
.cat-pills::-webkit-scrollbar { display: none; }
.cat-pill {
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-weight: 700; font-size: .85rem;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-2);
}
.cat-pill i { font-size: 1rem; }
.cat-pill.active {
  border-color: var(--primary);
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
 * TOP GAMES GRID
 * ========================================================== */
.section {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 0 12px;
}
.section h3 { font-size: 1rem; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.section a  { font-size: .85rem; font-weight: 700; color: var(--primary); }

.game-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.game-tile {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  position: relative;
  box-shadow: var(--shadow);
  display: block;
}
.game-tile .bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: transform .25s ease;
}
.game-tile:hover .bg { transform: scale(1.03); }
.game-tile .label {
  position: absolute; inset: auto 0 0 0;
  padding: 10px 12px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.65));
  color: #fff; font-weight: 800; font-size: .9rem;
}

/* ============================================================
 * SEARCH / FILTER BAR
 * ========================================================== */
.search-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px;
  margin-top: 12px;
}
.search-row input {
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: .9rem; font-weight: 600;
}
.search-row button {
  width: 44px; height: 44px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 1.1rem;
  color: var(--text);
}

/* ============================================================
 * DEPOSIT / WITHDRAW PROVIDER PICKER
 * ========================================================== */
.provider-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 14px;
}
.provider-opt {
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  font-weight: 800; font-size: .95rem;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--text-2);
}
.provider-opt img { width: 22px; height: 22px; object-fit: contain; }
.provider-opt.active.bkash  { border-color: #e2136e; color: #e2136e; background: #fff0f6; }
.provider-opt.active.nagad  { border-color: #f05a28; color: #f05a28; background: #fff4ee; }
.provider-opt.active.rocket { border-color: #8b2f89; color: #8b2f89; background: #fbf0fb; }

/* ============================================================
 * MISC
 * ========================================================== */
.muted { color: var(--muted); }
.flex-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* Small screens still look right */
@media (max-width: 380px) {
  .quick-games { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .hero-title { font-size: 1.35rem; }
}
