/* ============================================================
   PAK Games - Frontend CSS
   ============================================================ */
:root {
  --primary: #ff2d30;
  --primary2: #ff5f5f;
  --gradient: linear-gradient(135deg, #ff2d30 0%, #ff6060 100%);
  --gradient-h: linear-gradient(to right, #ff2d30, #ff6060);
  --bg: #f0f2f8;
  --card: #fff;
  --text: #1a1e2e;
  --muted: #7a80a0;
  --border: #e2e6f0;
  --nav-h: 65px;
  --header-h: 52px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 14px rgba(0,0,0,.10);
  --shadow-md: 0 4px 22px rgba(0,0,0,.15);
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  line-height: 1.5;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
input, button, select, textarea { font-family: inherit; font-size: inherit; outline: none; border: none; }
button { cursor: pointer; }
ul, ol { list-style: none; }

/* ─── Container ──────────────────────────────────────────── */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 12px;
}

/* ─── App Header ─────────────────────────────────────────── */
.app-header {
  background: var(--gradient);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(238,66,69,.3);
}
.app-header .logo {
  display: flex;
  align-items: center;
  gap: 6px;
}
.app-header .logo-text {
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
}
.app-header .logo-text span { color: #ffd700; }
.app-header .h-icons {
  display: flex;
  align-items: center;
  gap: 16px;
}
.app-header .h-icon {
  color: rgba(255,255,255,.9);
  font-size: 18px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  position: relative;
}
.app-header .h-icon .badge-dot {
  position: absolute;
  top: 2px; right: 2px;
  width: 8px; height: 8px;
  background: #ffd700;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
}

/* Page header (inner pages) */
.page-header-bar {
  background: var(--gradient);
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 200;
}
.page-header-bar .back-btn {
  color: #fff;
  font-size: 18px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-header-bar h2 {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  flex: 1;
}
.page-header-bar .h-action {
  color: rgba(255,255,255,.85);
  font-size: 14px;
}

/* ─── Bottom Navigation ──────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--nav-h);
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 300;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 12px rgba(0,0,0,.08);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
  padding: 8px 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  transition: color .2s;
}
.nav-item.active { color: var(--primary); }
.nav-item i { font-size: 20px; }
.nav-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.nav-go {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(238,66,69,.4);
  margin-top: -20px;
  letter-spacing: .5px;
}
.nav-go-label {
  font-size: 9px;
  color: var(--primary);
  font-weight: 600;
}

/* ─── Banner Slider ──────────────────────────────────────── */
.banner-wrap {
  overflow: hidden;
  margin: 10px 12px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}
.banner-track {
  display: flex;
  transition: transform .4s ease;
}
.banner-slide {
  min-width: 100%;
  aspect-ratio: 16/7;
  background: var(--gradient);
  position: relative;
  overflow: hidden;
}
.banner-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.banner-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 6px 0;
}
.banner-dot {
  width: 6px; height: 6px;
  border-radius: 3px;
  background: var(--border);
  transition: .3s;
}
.banner-dot.active {
  background: var(--primary);
  width: 18px;
}

/* ─── Announcement Ticker ────────────────────────────────── */
.ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  margin: 0 12px 10px;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  box-shadow: var(--shadow);
}
.ticker .speaker {
  color: var(--primary);
  font-size: 15px;
  flex-shrink: 0;
}
.ticker .tick-text {
  flex: 1;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ticker .tick-btn {
  flex-shrink: 0;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}

/* ─── Section Header ─────────────────────────────────────── */
.section-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 12px 10px;
}
.section-hd .s-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.section-hd .s-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 16px;
  background: var(--primary);
  border-radius: 2px;
}
.section-hd .s-more {
  font-size: 12px;
  color: var(--muted);
}

/* ─── Category Grid ──────────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 12px;
  margin-bottom: 14px;
}
.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.cat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: var(--shadow);
  transition: transform .2s;
}
.cat-item:active .cat-icon { transform: scale(.93); }
.cat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

/* Category icon colors */
.cat-popular  { background: linear-gradient(135deg, #ffc400, #ff9500); }
.cat-lottery  { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.cat-slots    { background: linear-gradient(135deg, #22d3f0, #0ea5e9); }
.cat-sports   { background: linear-gradient(135deg, #30e070, #16c050); }
.cat-casino   { background: linear-gradient(135deg, #ff3535, #cc1a1a); }
.cat-rummy    { background: linear-gradient(135deg, #ff8c20, #f56500); }
.cat-fishing  { background: linear-gradient(135deg, #00d4f5, #0097c4); }
.cat-original { background: linear-gradient(135deg, #f966b8, #e0206a); }

/* ─── Featured Games (Platform Recommendation) ───────────── */
.feat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 12px;
}
.feat-card {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  position: relative;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.feat-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.feat-card:active img { transform: scale(.97); }
.feat-card .feat-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 12px 6px 6px;
  text-align: center;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.feat-card .feat-bg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

/* ─── Game Grid (Popular/Category) ──────────────────────── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 12px;
}
.game-card {
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: #1a1a2e;
  box-shadow: var(--shadow);
}
.game-card:active { transform: scale(.96); }
.game-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.game-thumb-ph {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
}
.game-badge {
  position: absolute;
  top: 4px; right: 4px;
  background: #ffd700;
  color: #333;
  font-size: 8px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 4px;
  text-transform: uppercase;
}
.game-name {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  padding: 4px 4px;
  background: rgba(0,0,0,.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-rtp {
  display: flex;
  justify-content: center;
  padding: 3px 0;
  background: var(--card);
}
.game-rtp span {
  background: var(--gradient-h);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ─── Winner Cards ───────────────────────────────────────── */
.winner-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px;
}
.winner-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}
.w-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.w-name { font-size: 12px; font-weight: 700; color: var(--text); }
.w-sub  { font-size: 11px; color: var(--muted); }
.w-game-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.w-game-icon img { width: 100%; height: 100%; object-fit: cover; }
.w-amount {
  margin-left: auto;
  text-align: right;
}
.w-amount .amt { font-size: 13px; font-weight: 700; color: var(--primary); }
.w-amount .lbl { font-size: 10px; color: var(--muted); }

/* ─── Leaderboard ────────────────────────────────────────── */
.lb-podium {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  margin: 0 12px;
  align-items: flex-end;
}
.lb-podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.lb-avatar-wrap { position: relative; }
.lb-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
}
.lb-rank-badge {
  position: absolute;
  bottom: -4px; left: 50%; transform: translateX(-50%);
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  border: 2px solid #fff;
}
.lb-rank-1 .lb-avatar { width: 60px; height: 60px; border: 3px solid #ffd700; font-size: 22px; }
.lb-rank-1 .lb-rank-badge { background: #ffd700; color: #333; }
.lb-rank-2 .lb-rank-badge { background: #c0c0c0; }
.lb-rank-3 .lb-rank-badge { background: #cd7f32; }
.lb-podium-bar {
  width: 100%;
  border-radius: 8px 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  min-height: 60px;
}
.lb-rank-1 .lb-podium-bar { background: linear-gradient(to top, #f7b500, #ffd700); min-height: 90px; }
.lb-rank-2 .lb-podium-bar { background: linear-gradient(to top, #b0bec5, #cfd8dc); min-height: 70px; }
.lb-rank-3 .lb-podium-bar { background: linear-gradient(to top, #a0785a, #c49a6c); }
.lb-username { font-size: 10px; font-weight: 600; color: var(--text); text-align: center; }
.lb-amount { font-size: 10px; color: #333; font-weight: 700; text-align: center; }
.lb-list {
  margin: 4px 12px 0;
  background: var(--card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.lb-row:last-child { border-bottom: none; }
.lb-row-rank {
  width: 22px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}
.lb-row-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
}
.lb-row-name { flex: 1; font-size: 12px; font-weight: 600; }
.lb-row-amount { font-size: 12px; font-weight: 700; color: var(--primary); }

/* ─── Auth Pages ─────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  padding-bottom: 20px;
}
.auth-top {
  background: var(--gradient);
  padding: 50px 24px 40px;
  position: relative;
  overflow: hidden;
}
.auth-top::before {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  bottom: -60px; right: -40px;
}
.auth-top::after {
  content: '';
  position: absolute;
  width: 120px; height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  top: -30px; left: 20px;
}
.auth-top .back-btn {
  position: absolute;
  top: 16px; left: 16px;
  color: rgba(255,255,255,.8);
  font-size: 20px;
  z-index: 2;
}
.auth-logo { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; position: relative; z-index: 2; }
.auth-logo img { width: 40px; height: 40px; border-radius: 10px; }
.auth-logo-text { color: #fff; font-size: 20px; font-weight: 800; }
.auth-logo-text span { color: #ffd700; }
.auth-title { color: #fff; font-size: 22px; font-weight: 700; position: relative; z-index: 2; }
.auth-sub   { color: rgba(255,255,255,.75); font-size: 13px; margin-top: 4px; position: relative; z-index: 2; }

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  padding: 14px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: .2s;
}
.auth-tab.active { color: var(--primary); border-color: var(--primary); }

.auth-body { padding: 0 20px 20px; }

.f-group { margin-bottom: 16px; }
.f-label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.f-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  transition: border-color .2s;
}
.f-input-wrap:focus-within { border-color: var(--primary); background: #fff; }
.f-input-wrap .f-icon { color: var(--primary); font-size: 15px; flex-shrink: 0; }
.f-input-wrap input {
  flex: 1;
  height: 46px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}
.f-input-wrap input::placeholder { color: var(--muted); }
.f-input-wrap .toggle-pw { color: var(--muted); font-size: 15px; cursor: pointer; padding: 4px; }

.cc-select {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 8px;
  border-right: 1px solid var(--border);
  cursor: pointer;
  min-width: 64px;
}
.cc-select select {
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  max-width: 60px;
}

.f-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.f-error { font-size: 11px; color: var(--primary); margin-top: 4px; display: none; }
.f-error.show { display: block; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}
.checkbox-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
.checkbox-row a { color: var(--primary); font-weight: 600; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  height: 48px;
  border-radius: 24px;
  background: var(--gradient);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(238,66,69,.35);
  transition: opacity .2s, transform .1s;
}
.btn-primary:active { opacity: .9; transform: scale(.98); }
.btn-secondary {
  width: 100%;
  height: 48px;
  border-radius: 24px;
  border: 2px solid var(--primary);
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  transition: .2s;
}
.btn-secondary:active { background: #fff5f5; }
.btn-sm {
  height: 36px;
  border-radius: 18px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  background: var(--gradient);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  font-size: 13px;
}
.auth-links a { color: var(--primary); font-weight: 600; }

.divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.divider::before, .divider::after {
  content: ''; flex: 1;
  height: 1px; background: var(--border);
}
.divider span { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ─── Account Page ───────────────────────────────────────── */
.acct-top {
  background: var(--gradient);
  padding: 20px 16px 32px;
  position: relative;
}
.acct-top::after {
  content: '';
  position: absolute;
  bottom: -20px; left: 0; right: 0;
  height: 40px;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
}
.acct-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.acct-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  border: 3px solid rgba(255,255,255,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.acct-info .acct-name {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}
.acct-info .acct-uid {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,.75);
  font-size: 12px;
  margin-top: 2px;
}
.acct-info .vip-badge {
  background: #ffd700;
  color: #333;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 8px;
  text-transform: uppercase;
}
.acct-info .last-login { color: rgba(255,255,255,.6); font-size: 11px; margin-top: 2px; }

.acct-bal-card {
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.2);
}
.acct-bal-label { color: rgba(255,255,255,.75); font-size: 12px; margin-bottom: 4px; }
.acct-bal-amount {
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}
.acct-bal-amount .refresh-btn { font-size: 16px; opacity: .8; }

.acct-quick {
  display: flex;
  justify-content: space-around;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin: 20px 12px 0;
  box-shadow: var(--shadow);
}
.acct-quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.acct-quick-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.qi-wallet  { background: #fff5f0; color: #f97316; }
.qi-deposit { background: #f0fdf4; color: #22c55e; }
.qi-wd      { background: #fef3c7; color: #d97706; }
.qi-vip     { background: #fdf4ff; color: #9333ea; }
.acct-quick-label { font-size: 11px; font-weight: 600; color: var(--text); }

.acct-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
}
.acct-grid-item {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.agi-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.agi-text .t { font-size: 12px; font-weight: 700; }
.agi-text .s { font-size: 10px; color: var(--muted); }

.acct-menu {
  background: var(--card);
  border-radius: var(--radius);
  margin: 0 12px 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.acct-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.acct-menu-item:last-child { border-bottom: none; }
.ami-icon { width: 20px; font-size: 16px; color: var(--primary); text-align: center; flex-shrink: 0; }
.ami-label { flex: 1; font-size: 13px; font-weight: 600; }
.ami-value { font-size: 12px; color: var(--muted); }
.ami-arrow { font-size: 12px; color: var(--muted); }

.acct-service {
  padding: 0 12px 12px;
}
.acct-service-title { font-size: 12px; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.acct-service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.acct-service-item {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.asi-icon { font-size: 22px; color: var(--primary); }
.asi-label { font-size: 11px; font-weight: 600; color: var(--text); text-align: center; }

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 24px);
  height: 48px;
  border-radius: 24px;
  border: 2px solid #ef4444;
  color: #ef4444;
  font-size: 14px;
  font-weight: 700;
  background: #fff;
  margin: 0 12px 20px;
}

/* ─── Deposit / Withdraw ─────────────────────────────────── */
.dw-balance-card {
  background: var(--gradient);
  margin: 12px;
  border-radius: var(--radius);
  padding: 20px;
  color: #fff;
}
.dw-balance-card .lbl { font-size: 12px; opacity: .8; margin-bottom: 4px; }
.dw-balance-card .val { font-size: 28px; font-weight: 800; }

.method-tabs {
  display: flex;
  gap: 8px;
  padding: 0 12px;
  margin-bottom: 12px;
  overflow-x: auto;
}
.method-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--muted);
  transition: .2s;
}
.method-tab.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
}

.bank-card {
  background: var(--card);
  border-radius: var(--radius);
  margin: 0 12px 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  cursor: pointer;
  transition: .2s;
}
.bank-card.selected { border-color: var(--primary); }
.bank-card-row { display: flex; align-items: center; gap: 10px; }
.bank-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.bank-name { font-weight: 700; font-size: 14px; }
.bank-acct { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bank-copy { margin-left: auto; color: var(--primary); font-size: 12px; font-weight: 600; }

.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 12px;
  margin-bottom: 12px;
}
.amount-chip {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  transition: .2s;
}
.amount-chip.selected { border-color: var(--primary); color: var(--primary); background: #fff5f5; }

.dw-form { padding: 0 12px; }

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
}

/* ─── Promotion Page ─────────────────────────────────────── */
.promo-top {
  background: var(--gradient);
  padding: 20px 16px;
  text-align: center;
  position: relative;
}
.promo-commission {
  color: rgba(255,255,255,.8);
  font-size: 13px;
  margin-bottom: 4px;
}
.promo-amount {
  color: #ffd700;
  font-size: 36px;
  font-weight: 800;
}
.promo-tabs {
  display: flex;
  margin: 16px;
  background: rgba(255,255,255,.15);
  border-radius: 30px;
  padding: 4px;
}
.promo-tab {
  flex: 1;
  padding: 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.7);
  border-radius: 26px;
  transition: .2s;
  cursor: pointer;
}
.promo-tab.active { background: #fff; color: var(--primary); }
.promo-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: rgba(255,255,255,.12);
  border-radius: var(--radius);
  margin: 0 16px 20px;
  overflow: hidden;
}
.promo-stat {
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.1);
}
.promo-stat .val { color: #ffd700; font-size: 20px; font-weight: 800; }
.promo-stat .lbl { color: rgba(255,255,255,.7); font-size: 11px; margin-top: 2px; }
.promo-menu {
  background: var(--card);
  border-radius: var(--radius);
  margin: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.promo-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.promo-menu-item:last-child { border-bottom: none; }
.pmi-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.pmi-label { flex: 1; font-size: 13px; font-weight: 600; }
.pmi-value { font-size: 13px; font-weight: 700; color: var(--primary); }
.pmi-arrow { font-size: 12px; color: var(--muted); }
.qr-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--gradient);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  height: 48px;
  border-radius: 24px;
  margin: 12px;
  box-shadow: 0 4px 16px rgba(238,66,69,.3);
}
.promo-data-card {
  background: var(--card);
  border-radius: var(--radius);
  margin: 0 12px 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.promo-data-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.promo-data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.promo-data-item .v { font-size: 18px; font-weight: 800; color: var(--primary); }
.promo-data-item .l { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ─── Activity Page ──────────────────────────────────────── */
.activity-card {
  background: var(--card);
  border-radius: var(--radius);
  margin: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.activity-card .ac-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
}
.activity-card .ac-body { padding: 14px; }
.activity-card .ac-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.activity-card .ac-desc { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.activity-card .ac-badge {
  display: inline-block;
  background: var(--gradient);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
}

/* ─── Games Page ─────────────────────────────────────────── */
.games-page-wrap { padding: 0 0 12px; }
.games-search {
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--card);
  margin-bottom: 8px;
}
.games-search input {
  flex: 1;
  height: 36px;
  background: var(--bg);
  border-radius: 18px;
  padding: 0 14px;
  font-size: 13px;
  color: var(--text);
  border: 1px solid var(--border);
}
.games-search input::placeholder { color: var(--muted); }

/* ─── Game Launch Page ───────────────────────────────────── */
.game-launch-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-h));
  padding: 20px;
  text-align: center;
}
.game-launch-spinner {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.game-launch-msg { font-size: 14px; color: var(--muted); }
.game-frame-wrap {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
}
.game-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.game-close-btn {
  position: fixed;
  top: 10px; right: 10px;
  z-index: 10000;
  background: rgba(0,0,0,.7);
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* ─── Safe Box ───────────────────────────────────────────── */
.safe-card {
  background: linear-gradient(135deg, #ffd700, #f59e0b);
  border-radius: var(--radius);
  margin: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.safe-icon { font-size: 28px; }
.safe-info { flex: 1; }
.safe-title { font-size: 13px; font-weight: 700; color: #333; }
.safe-desc { font-size: 11px; color: #666; margin-top: 2px; }
.safe-amt { font-size: 14px; font-weight: 800; color: #333; }

/* ─── Toast / Alert ──────────────────────────────────────── */
.toast {
  position: fixed;
  top: 70px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: rgba(0,0,0,.8);
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transition: all .3s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Loading Overlay ────────────────────────────────────── */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  display: none;
}
.loading-overlay.show { display: flex; }
.loading-spinner {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}

/* ─── Wallet History ─────────────────────────────────────── */
.txn-item {
  background: var(--card);
  border-radius: var(--radius-sm);
  margin: 0 12px 8px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
}
.txn-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.txn-info { flex: 1; }
.txn-title { font-size: 13px; font-weight: 600; }
.txn-time  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.txn-amount { font-size: 14px; font-weight: 700; }
.txn-amount.credit { color: #22c55e; }
.txn-amount.debit  { color: var(--primary); }

/* ─── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-sheet {
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .3s;
  padding-bottom: env(safe-area-inset-bottom);
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }
.modal-drag { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 12px auto 0; }
.modal-head { padding: 12px 16px 8px; font-size: 16px; font-weight: 700; border-bottom: 1px solid var(--border); }
.modal-body { padding: 16px; }

/* ─── Utilities ──────────────────────────────────────────── */
.text-primary { color: var(--primary); }
.text-muted { color: var(--muted); }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.d-none { display: none !important; }
.page-section { margin-bottom: 20px; }

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

/* ─── Responsive (Desktop) ──────────────────────────────── */
@media (min-width: 480px) {
  .bottom-nav { max-width: 480px; left: 50%; }
  body { background: #e8e8e8; }
  .app-header { max-width: 480px; left: 50%; transform: translateX(-50%); }
  .page-header-bar { max-width: 480px; left: 50%; transform: translateX(-50%); }
}

/* ─── Animations ─────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn .3s ease; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.pulse { animation: pulse 2s infinite; }

/* Winner avatars - gradient backgrounds */
.av-1  { background: linear-gradient(135deg, #ee4245, #ff6b6b); }
.av-2  { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.av-3  { background: linear-gradient(135deg, #22c55e, #4ade80); }
.av-4  { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.av-5  { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.av-6  { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.av-7  { background: linear-gradient(135deg, #ec4899, #f472b6); }
.av-8  { background: linear-gradient(135deg, #f97316, #fb923c); }
.av-9  { background: linear-gradient(135deg, #14b8a6, #2dd4bf); }
.av-10 { background: linear-gradient(135deg, #6366f1, #818cf8); }
