/* ============================================
   GRANT GAME STORE v2 - App Style
   Mobile-First | Dark Gaming Theme
   ============================================ */

:root {
  --bg: #0a0f1e;
  --bg2: #111827;
  --bg3: #1a2236;
  --primary: #1e9fd8;
  --accent: #00d4ff;
  --gold: #f59e0b;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --text: #e2e8f0;
  --muted: #64748b;
  --light: #94a3b8;
  --border: rgba(30,159,216,0.15);
  --card: #111827;
  --nav-h: 60px;
  --bottom-h: 65px;
}

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html { font-size:16px; }
body {
  font-family: 'Segoe UI', 'Noto Sans Myanmar', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* ── TOP HEADER ── */
.top-header {
  position: fixed;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--nav-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
  z-index: 100;
}

.header-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  overflow: hidden;
}
.header-avatar img { width:100%; height:100%; object-fit:cover; border-radius:50%; }

.header-info { flex: 1; }
.header-phone { font-size: 13px; font-weight: 700; color: var(--text); }
.header-balance {
  font-size: 12px; font-weight: 700;
  color: var(--green);
  display: flex; align-items: center; gap: 4px;
}

.header-actions { display:flex; gap:8px; }

.btn-header {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: flex; align-items: center; gap: 4px;
}
.btn-logout { background: #ef444420; color: var(--red); border: 1px solid #ef444440; }
.btn-key { background: #1e9fd820; color: var(--primary); border: 1px solid var(--border); }

/* ── MAIN CONTENT ── */
.main {
  padding-top: var(--nav-h);
  padding-bottom: var(--bottom-h);
  min-height: 100vh;
}

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: var(--bottom-h);
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
}

.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: 600;
  transition: color 0.2s;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}
.nav-item .nav-icon { font-size: 22px; line-height: 1; }
.nav-item.active { color: var(--gold); }

/* ── PAGE TITLE ── */
.page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--gold);
  padding: 16px 14px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── GAME GRID ── */
.store-title {
  font-size: 22px;
  font-weight: 900;
  text-align: center;
  padding: 14px 14px 10px;
  color: var(--gold);
  letter-spacing: 1px;
}

.games-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 10px 10px;
}

.game-card {
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  transition: transform 0.15s, border-color 0.15s;
  display: block;
  position: relative;
}
.game-card:active { transform: scale(0.97); }

.game-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.game-card-info {
  padding: 8px 10px;
}
.game-card-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}
.game-card-sub {
  font-size: 11px;
  color: var(--muted);
}

/* ── WALLET PAGE ── */
.wallet-balance-card {
  margin: 10px 14px;
  background: linear-gradient(135deg, #0d2137, #0a3d2e);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}
.wallet-balance-label { font-size: 13px; color: var(--light); margin-bottom: 6px; }
.wallet-balance-amount { font-size: 40px; font-weight: 900; color: var(--green); }
.wallet-balance-currency { font-size: 16px; color: var(--light); }

.section-title {
  font-size: 14px;
  font-weight: 700;
  padding: 12px 14px 8px;
  color: var(--gold);
  display: flex; align-items: center; gap: 6px;
}

/* Payment method buttons */
.payment-methods {
  display: flex;
  gap: 10px;
  padding: 0 14px;
}
.pay-btn {
  flex: 1;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.pay-btn.selected {
  border-color: var(--green);
  background: rgba(16,185,129,0.1);
}
.pay-btn img { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; display: block; margin: 0 auto 6px; background: white; padding: 3px; }
.pay-btn span { font-size: 11px; font-weight: 700; color: var(--text); }

/* Account info card */
.account-card {
  margin: 10px 14px;
  background: var(--bg3);
  border: 1px dashed rgba(30,159,216,0.3);
  border-radius: 12px;
  padding: 14px;
}
.account-row { display:flex; justify-content:space-between; align-items:center; margin-bottom: 6px; font-size: 13px; }
.account-label { color: var(--muted); }
.account-value { font-weight: 700; color: var(--gold); font-size: 16px; }
.account-name { font-weight: 600; }
.copy-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; gap: 4px;
}

.warning-box {
  margin: 0 14px 10px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  color: #fca5a5;
  line-height: 1.5;
}

/* Input */
.input-group { padding: 0 14px 10px; }
.input-label { font-size: 13px; color: var(--light); margin-bottom: 6px; display: block; }
.input-field {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.input-field:focus { outline: none; border-color: var(--primary); }
.input-field::placeholder { color: var(--muted); }

/* Upload area */
.upload-box {
  margin: 0 14px 10px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
}
.upload-box.has-file { border-color: var(--green); }
.upload-box p { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Submit button */
.submit-btn {
  margin: 0 14px 16px;
  width: calc(100% - 28px);
  padding: 14px;
  background: var(--green);
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit;
}
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── HISTORY CARDS ── */
.history-list { padding: 0 10px; }
.history-card {
  background: var(--card);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border-left: 3px solid var(--muted);
  position: relative;
}
.history-card.completed { border-left-color: var(--green); }
.history-card.processing { border-left-color: var(--yellow); }
.history-card.failed { border-left-color: var(--red); }
.history-card.pending { border-left-color: var(--primary); }
.history-card.approved { border-left-color: var(--green); }
.history-card.rejected { border-left-color: var(--red); }

.history-top { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:6px; }
.history-pkg { font-size: 15px; font-weight: 800; }
.history-status { font-size: 12px; font-weight: 700; }
.status-completed { color: var(--green); }
.status-processing { color: var(--yellow); }
.status-failed { color: var(--red); }
.status-pending { color: var(--primary); }
.status-approved { color: var(--green); }
.status-rejected { color: var(--red); }

.history-details { font-size: 12px; color: var(--light); line-height: 1.7; }
.history-price { color: var(--gold); font-weight: 700; }
.history-date { color: var(--muted); font-size: 11px; }

/* ── GUIDE PAGE ── */
.guide-card {
  margin: 0 14px 12px;
  background: var(--card);
  border-radius: 12px;
  padding: 14px;
}
.guide-card-title { font-size: 14px; font-weight: 800; color: var(--gold); margin-bottom: 8px; }
.guide-card p { font-size: 13px; color: var(--light); line-height: 1.7; }
.guide-card strong { color: var(--text); }

/* ── SERVER SELECTION ── */
.server-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 10px;
}
.server-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  display: block;
  transition: all 0.15s;
}
.server-card:active, .server-card.selected { border-color: var(--primary); background: rgba(30,159,216,0.1); }
.server-card img { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; margin-bottom: 6px; }
.server-card-name { font-size: 12px; font-weight: 700; }
.server-card-api { font-size: 10px; color: var(--muted); }

/* ── PACKAGES ── */
.packages-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 10px;
}
.pkg-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.pkg-card.selected { border-color: var(--primary); background: rgba(30,159,216,0.12); }
.pkg-card:active { transform: scale(0.97); }
.pkg-icon { font-size: 24px; margin-bottom: 4px; }
.pkg-amount { font-size: 16px; font-weight: 800; color: var(--accent); }
.pkg-mmk { font-size: 13px; font-weight: 700; color: var(--text); margin-top: 2px; }
.pkg-thb { font-size: 11px; color: var(--muted); }

/* ── ORDER CONFIRM ── */
.confirm-card {
  margin: 10px 14px;
  background: rgba(30,159,216,0.08);
  border: 1px solid rgba(30,159,216,0.3);
  border-radius: 14px;
  padding: 16px;
}
.confirm-row { display:flex; justify-content:space-between; font-size: 13px; margin-bottom: 8px; }
.confirm-label { color: var(--muted); }
.confirm-value { font-weight: 700; }
.confirm-price { font-size: 20px; font-weight: 900; color: var(--accent); }

/* ── ALERT ── */
.alert {
  margin: 0 14px 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
}
.alert-success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.alert-danger { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-info { background: rgba(30,159,216,0.1); border: 1px solid rgba(30,159,216,0.3); color: #7dd3fc; }

/* ── BUTTONS ── */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--light);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-group { display:flex; gap:8px; padding: 0 14px; margin-bottom: 10px; }

/* ── AUTH ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
}
.auth-logo { margin-bottom: 16px; }
.auth-logo img { height: 70px; object-fit: contain; }
.auth-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; text-align:center; }
.auth-sub { font-size: 13px; color: var(--muted); margin-bottom: 24px; text-align:center; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; width: 100%; }

.social-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  margin-bottom: 10px;
  font-family: inherit;
}

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

/* ── SPINNER ── */
.spinner { width:18px; height:18px; border:2px solid rgba(255,255,255,0.3); border-top-color:white; border-radius:50%; animation:spin .7s linear infinite; display:inline-block; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ── SUPPORT FAB ── */
.support-fab {
  position: fixed;
  bottom: calc(var(--bottom-h) + 14px);
  right: 14px;
  width: 50px; height: 50px;
  background: var(--gold);
  border-radius: 50%;
  border: none;
  font-size: 22px;
  cursor: pointer;
  display: flex; align-items:center; justify-content:center;
  box-shadow: 0 4px 16px rgba(245,158,11,0.4);
  z-index: 90;
}

.support-menu {
  position: fixed;
  bottom: calc(var(--bottom-h) + 70px);
  right: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  display: none;
  z-index: 90;
  min-width: 170px;
}
.support-menu.show { display: block; }
.support-menu a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.support-menu a:hover { background: rgba(30,159,216,0.1); }

/* ── MISC ── */
.empty { text-align:center; padding: 40px 14px; color: var(--muted); }
.empty-icon { font-size: 48px; margin-bottom: 10px; }
.empty p { font-size: 14px; }

.section-gap { height: 10px; }
.px { padding: 0 14px; }
.mb { margin-bottom: 10px; }

/* Back button */
.back-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  color: var(--light);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

/* Toast */
.toast-wrap { position:fixed; top:70px; right:10px; z-index:999; display:flex; flex-direction:column; gap:6px; }
.toast { background:var(--card); border:1px solid var(--border); border-radius:10px; padding:10px 14px; font-size:13px; max-width:280px; display:flex; gap:8px; box-shadow:0 4px 20px rgba(0,0,0,0.4); animation:slideIn .3s ease; }
.toast.success { border-color:var(--green); }
.toast.error { border-color:var(--red); }
@keyframes slideIn { from{transform:translateX(100%);opacity:0} to{transform:translateX(0);opacity:1} }

/* Loading */
.loading { text-align:center; padding:30px; color:var(--muted); }
