/* =============================================
   MODERN DARK GAMING THEME — style.css
   ============================================= */

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

html, body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Sarabun', sans-serif;
  font-size: 15px;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: 'Sarabun', sans-serif; }

/* --- Page wrapper --- */
.page-wrapper {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 80px;
  min-height: 100vh;
  position: relative;
}

/* --- Top Bar --- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,17,23,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; gap: 8px;
}
.topbar-logo { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.topbar-user { flex: 1; padding: 0 8px; }
.topbar-user .name { font-weight: 600; font-size: 14px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user .bank { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.topbar-user .bank img { width: 16px; border-radius: 3px; }
.topbar-icons { display: flex; align-items: center; gap: 8px; }
.topbar-icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-card-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; transition: background 0.2s;
}
.topbar-icon-btn:hover { background: var(--bg-card); }
.topbar-icon-btn a { color: inherit; }
.logout-btn {
  background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3);
  border-radius: 8px; color: #ef4444; font-size: 13px; font-weight: 600;
  padding: 5px 12px; cursor: pointer; transition: 0.2s;
}
.logout-btn:hover { background: rgba(239,68,68,0.25); }

/* --- Balance Card --- */
.balance-card {
  margin: 12px 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  position: relative; overflow: hidden;
}
.balance-card::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(245,158,11,0.15) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.balance-label { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.balance-amount { font-size: 36px; font-weight: 700; color: var(--accent); line-height: 1.1; display: flex; align-items: center; gap: 10px; }
.balance-amount .unit { font-size: 16px; color: var(--text-muted); font-weight: 400; }
.balance-reload { background: none; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; padding: 4px; border-radius: 50%; transition: 0.2s; }
.balance-reload:hover { color: var(--accent); }
.balance-footer { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.balance-promo { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.balance-promo i { color: var(--accent); }
.quick-actions { display: flex; gap: 8px; margin-top: 14px; }
.quick-btn {
  flex: 1; padding: 10px 8px; border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: 0.2s;
}
.quick-btn-primary { background: var(--accent-grad); color: #000; }
.quick-btn-primary:hover { opacity: 0.9; }
.quick-btn-danger { background: var(--danger-grad); color: #fff; }
.quick-btn-danger:hover { opacity: 0.9; }
.quick-btn-purple { background: linear-gradient(135deg,#8b5cf6,#6d28d9); color: #fff; }
.quick-btn-green  { background: linear-gradient(135deg,#22c55e,#15803d); color: #fff; }

/* --- Banner Slider --- */
.swiper-container-2 { margin: 0 16px 12px; border-radius: var(--radius); overflow: hidden; }
.swiper-container-2 .swiper-slide img { height: 140px; object-fit: cover; border-radius: var(--radius); }
.swiper-pagination-bullet { background: rgba(255,255,255,0.4); opacity: 1; }
.swiper-pagination-bullet-active { background: var(--accent); }
.swiper-button-next, .swiper-button-prev { --swiper-navigation-size: 22px; color: #fff; }

/* --- Section Header --- */
.section-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; }
.section-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.section-title i { color: var(--accent); }
.section-back {
  font-size: 13px; color: var(--text-muted);
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 12px;
  cursor: pointer; transition: 0.2s;
  display: flex; align-items: center; gap: 5px;
}
.section-back:hover { color: var(--text-primary); }

/* --- Menu Grid --- */
.menu-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; padding: 0 16px; margin-bottom: 12px; }
.menu-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 12px 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: 0.2s;
  font-size: 11px; font-weight: 600; text-align: center; color: var(--text-primary);
}
.menu-item:hover, .menu-item:active { border-color: var(--accent); background: var(--bg-card-2); }
.menu-icon {
  width: 42px; height: 42px; background: var(--accent-grad);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #000;
}
.menu-icon.red    { background: var(--danger-grad); color: #fff; }
.menu-icon.purple { background: linear-gradient(135deg,#8b5cf6,#6d28d9); color: #fff; }
.menu-icon.blue   { background: linear-gradient(135deg,#3b82f6,#1d4ed8); color: #fff; }
.menu-icon.green  { background: linear-gradient(135deg,#22c55e,#15803d); color: #fff; }
.menu-icon.teal   { background: linear-gradient(135deg,#14b8a6,#0f766e); color: #fff; }
.menu-icon.orange { background: linear-gradient(135deg,#f97316,#c2410c); color: #fff; }
.menu-icon.pink   { background: linear-gradient(135deg,#ec4899,#be185d); color: #fff; }

/* --- Card Panel --- */
.card-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin: 0 16px 12px; overflow: hidden; }
.card-panel-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.card-panel-header i { color: var(--accent); font-size: 18px; }
.card-panel-body { padding: 16px; }

/* --- Form Elements --- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.form-control-dark {
  width: 100%; background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  padding: 12px 14px; font-size: 15px; outline: none; transition: border-color 0.2s;
  font-family: 'Sarabun', sans-serif;
}
.form-control-dark:focus { border-color: var(--accent); }
.form-control-dark::placeholder { color: var(--text-muted); }
.form-control-dark:disabled { opacity: 0.5; cursor: not-allowed; }
select.form-control-dark { -webkit-appearance: none; appearance: none; }

/* --- Buttons --- */
.btn-primary-grad {
  width: 100%; padding: 14px; background: var(--accent-grad);
  border: none; border-radius: var(--radius-sm);
  color: #000; font-weight: 700; font-size: 15px; cursor: pointer; transition: 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary-grad:hover { opacity: 0.88; }
.btn-primary-grad:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-danger-grad {
  width: 100%; padding: 14px; background: var(--danger-grad);
  border: none; border-radius: var(--radius-sm);
  color: #fff; font-weight: 700; font-size: 15px; cursor: pointer; transition: 0.2s;
}
.btn-danger-grad:hover { opacity: 0.88; }
.btn-outline {
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-muted);
  padding: 10px 16px; font-size: 14px; cursor: pointer; transition: 0.2s;
}
.btn-outline:hover { border-color: var(--accent); color: var(--text-primary); }

/* --- Accordion --- */
.accordion-item { margin-bottom: 8px; }
.accordion-toggle {
  width: 100%; padding: 14px 16px; background: var(--bg-card-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 15px; font-weight: 600;
  cursor: pointer; text-align: left; display: flex; align-items: center; gap: 10px; transition: 0.2s;
}
.accordion-toggle.active { border-color: var(--accent); }
.accordion-toggle img { height: 32px; width: auto; }
.accordion-panel { display: none; background: var(--bg-primary); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 16px; }
.accordion-panel.open { display: block; }

/* --- Bank Info Box --- */
.bank-info-box { text-align: center; padding: 16px; background: var(--bg-card-2); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.bank-info-box img { width: 56px; margin: 0 auto 10px; border-radius: 10px; }
.bank-info-number { font-size: 18px; font-weight: 700; letter-spacing: 2px; margin: 6px 0; }
.copy-btn { background: var(--accent-grad); border: none; border-radius: 8px; color: #000; font-weight: 700; padding: 8px 20px; cursor: pointer; margin-top: 8px; font-size: 14px; transition: 0.2s; }
.copy-btn:hover { opacity: 0.85; }

/* --- Withdraw --- */
.withdraw-info-box {
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px;
  display: flex; align-items: center; gap: 14px; margin-bottom: 14px;
}
.withdraw-info-box img { width: 52px; border-radius: 10px; }
.withdraw-info-box .info .name { font-weight: 700; font-size: 15px; }
.withdraw-info-box .info .number { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.withdraw-info-box .info .bank-name { font-size: 12px; color: var(--text-muted); }
.stat-row { display: flex; gap: 8px; margin-bottom: 14px; }
.stat-box { flex: 1; background: var(--bg-card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; text-align: center; }
.stat-box .stat-label { font-size: 11px; color: var(--text-muted); }
.stat-box .stat-value { font-size: 16px; font-weight: 700; color: var(--accent); margin-top: 4px; }

/* --- History --- */
.history-item {
  background: var(--bg-card-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 12px; cursor: pointer; transition: 0.2s;
}
.history-item:hover { border-color: var(--accent); }
.history-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.history-icon.deposit  { background: rgba(34,197,94,0.15); color: var(--success); }
.history-icon.withdraw { background: rgba(239,68,68,0.15); color: var(--danger); }
.history-body { flex: 1; }
.history-body .h-title { font-weight: 600; font-size: 14px; }
.history-body .h-date  { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.history-amount { font-weight: 700; font-size: 16px; }
.history-amount.plus  { color: var(--success); }
.history-amount.minus { color: var(--danger); }
.badge-status { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; margin-top: 4px; }
.badge-success { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-pending { background: rgba(245,158,11,0.15); color: var(--accent); }
.badge-danger  { background: rgba(239,68,68,0.15); color: var(--danger); }

/* --- Account Info --- */
.profile-avatar { width: 64px; height: 64px; border-radius: 16px; background: var(--accent-grad); display: flex; align-items: center; justify-content: center; font-size: 28px; color: #000; margin: 0 auto 12px; }
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.info-row:last-child { border-bottom: none; }
.info-row .info-key { color: var(--text-muted); }
.info-row .info-val { font-weight: 600; }

/* --- Referral --- */
.ref-box { background: var(--bg-primary); border: 1px dashed var(--accent); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; margin: 12px 0; font-size: 13px; }
.ref-link { color: var(--accent); font-weight: 600; word-break: break-all; flex: 1; margin-right: 8px; }
.ref-copy-btn { background: var(--accent-grad); border: none; border-radius: 8px; color: #000; font-weight: 700; padding: 6px 14px; cursor: pointer; font-size: 13px; white-space: nowrap; }

/* --- Tabs Nav --- */
.tabs-nav { display: flex; gap: 0; background: var(--bg-primary); border-radius: var(--radius-sm); padding: 4px; margin-bottom: 14px; }
.tab-nav-btn { flex: 1; padding: 8px; background: transparent; border: none; border-radius: 8px; color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer; transition: 0.2s; }
.tab-nav-btn.active { background: var(--accent-grad); color: #000; }

/* --- Promotions --- */
.promo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.promo-card { background: var(--bg-card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; transition: 0.2s; }
.promo-card:hover { border-color: var(--accent); }
.promo-card img { width: 100%; height: 90px; object-fit: cover; }
.promo-card-body { padding: 8px; }
.promo-card-title { font-size: 12px; font-weight: 600; }
.promo-card-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.promo-take-btn { margin-top: 8px; width: 100%; padding: 7px; background: var(--accent-grad); border: none; border-radius: 6px; color: #000; font-weight: 700; font-size: 12px; cursor: pointer; }

/* --- Spin --- */
.spin-wrap { text-align: center; padding: 20px 16px; }
.spin-ticket { background: var(--bg-card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 20px; display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.spin-ticket i { color: var(--accent); }
.spin-button { background: var(--accent-grad); border: none; border-radius: var(--radius-sm); color: #000; font-weight: 700; font-size: 16px; padding: 14px 40px; cursor: pointer; margin-top: 16px; transition: 0.2s; }
.spin-button:hover { opacity: 0.88; }
.spin-button:disabled { opacity: 0.4; cursor: not-allowed; }

/* --- Free Credit --- */
.freecredit-code-box { display: flex; gap: 8px; }
.freecredit-code-box input { flex: 1; }
.freecredit-code-box button { background: var(--accent-grad); border: none; border-radius: var(--radius-sm); color: #000; font-weight: 700; padding: 0 20px; cursor: pointer; white-space: nowrap; }

/* --- Games --- */
.game-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px 8px; scrollbar-width: none; }
.game-tabs::-webkit-scrollbar { display: none; }
.game-tab-btn { flex-shrink: 0; padding: 7px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer; transition: 0.2s; white-space: nowrap; }
.game-tab-btn.active { background: var(--accent-grad); border-color: transparent; color: #000; }
.game-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; padding: 0 16px; }
.game-item { border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; border: 1px solid var(--border); transition: 0.2s; }
.game-item:hover { border-color: var(--accent); transform: scale(1.02); }
.game-item img { width: 100%; height: 90px; object-fit: cover; display: block; }
.game-item-name { background: var(--bg-card-2); font-size: 11px; font-weight: 600; padding: 6px; text-align: center; }

/* --- Bottom Navigation --- */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: rgba(22,27,39,0.96);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border); display: flex; z-index: 200;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 10px 4px 8px; cursor: pointer; transition: 0.2s; color: var(--text-muted); font-size: 10px; font-weight: 600; gap: 3px; }
.nav-item .nav-icon { font-size: 20px; }
.nav-item.active { color: var(--accent); }
.nav-item-center { position: relative; top: -16px; width: 52px; height: 52px; background: var(--accent-grad); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #000; box-shadow: 0 4px 16px rgba(245,158,11,0.4); }
.nav-item.center-item { flex-direction: column; align-items: center; gap: 0; padding-top: 4px; color: var(--accent); }
.nav-item.center-item span { margin-top: -8px; }

/* --- Tab Sections --- */
.tabcontent { display: none; }
.tabcontent.active-tab { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* --- Auth Pages --- */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px 16px 40px; background: var(--bg-primary); }
.auth-logo { width: 80px; border-radius: 16px; margin: 0 auto 8px; display: block; }
.auth-title { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.auth-sub { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 28px; }
.auth-card { width: 100%; max-width: 420px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.auth-divider { text-align: center; margin: 18px 0; position: relative; color: var(--text-muted); font-size: 13px; }
.auth-divider::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
.auth-divider span { background: var(--bg-card); padding: 0 12px; position: relative; }
.auth-link { text-align: center; font-size: 14px; color: var(--text-muted); margin-top: 16px; }
.auth-link a { color: var(--accent); font-weight: 600; }
.input-icon-wrap { position: relative; }
.input-icon-wrap i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 16px; pointer-events: none; }
.input-icon-wrap .form-control-dark { padding-left: 40px; }
.pwd-toggle { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; }
.step-bar { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 24px; }
.step { width: 28px; height: 28px; border-radius: 50%; background: var(--bg-card-2); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.step.active { border-color: var(--accent); color: var(--accent); }
.step.done { background: var(--accent-grad); border-color: transparent; color: #000; }
.step-line { flex: 1; height: 2px; background: var(--border); border-radius: 2px; max-width: 40px; }
.step-line.done { background: var(--accent); }

/* --- Toast Copy --- */
.toast-copy { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); background: rgba(34,197,94,0.9); color: #fff; font-weight: 600; padding: 10px 24px; border-radius: 20px; font-size: 14px; z-index: 9999; display: none; white-space: nowrap; }
.toast-copy.show { display: block; }

/* --- Line Float Button --- */
.linebtn { position: fixed; right: 16px; bottom: 90px; width: 56px; height: 56px; background: #00b900; border-radius: 16px; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(0,185,0,0.35); z-index: 150; cursor: pointer; }
.linebtn img { width: 36px; }

/* --- Popup --- */
.popup-overlay { display: none; position: fixed; inset: 0; z-index: 9000; background: rgba(0,0,0,0.7); align-items: center; justify-content: center; }
.popup-overlay.show { display: flex; }
.popup-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; width: 90%; max-width: 380px; position: relative; text-align: center; }
.popup-close { position: absolute; top: 12px; right: 12px; background: var(--bg-card-2); border: none; color: var(--text-muted); font-size: 18px; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.popup-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.popup-text  { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.popup-img { border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 14px; }
.popup-img img { width: 100%; }

/* --- Loading --- */
#loading { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 99999; align-items: center; justify-content: center; }
#loading.show { display: flex; }
.loading-spinner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.spinner-bars { display: flex; gap: 5px; }
.spinner-bars span { display: block; width: 5px; height: 32px; background: var(--accent); border-radius: 3px; animation: bar-wave 1.2s infinite ease-in-out; }
.spinner-bars span:nth-child(1){animation-delay:-1.2s}
.spinner-bars span:nth-child(2){animation-delay:-1.1s}
.spinner-bars span:nth-child(3){animation-delay:-1.0s}
.spinner-bars span:nth-child(4){animation-delay:-0.9s}
.spinner-bars span:nth-child(5){animation-delay:-0.8s}
@keyframes bar-wave { 0%,40%,100%{transform:scaleY(0.4)} 20%{transform:scaleY(1)} }
.loading-text { font-size: 14px; color: var(--text-muted); }

/* --- QR Modal --- */
.qr-modal { position: fixed; inset: 0; z-index: 8000; background: rgba(0,0,0,0.8); display: flex; align-items: flex-end; justify-content: center; }
.qr-modal-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; width: 100%; max-width: 480px; padding: 20px; max-height: 90vh; overflow-y: auto; }
.qr-modal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.qr-modal-title { font-size: 18px; font-weight: 700; }
.qr-modal-sub { font-size: 13px; color: var(--accent); margin-top: 4px; }
.qr-x { background: var(--bg-card-2); border: none; color: var(--text-muted); font-size: 18px; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.qr-amount-line { text-align: center; font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.qr-amount-line b { color: var(--accent); font-size: 22px; }
.qr-img-wrap { text-align: center; margin: 0 auto 12px; }
.qr-img-wrap img { width: 200px; height: 200px; object-fit: contain; margin: 0 auto; }
.qr-status-line { text-align: center; font-size: 14px; color: var(--text-muted); margin: 12px 0; }
.qr-status-line b { color: var(--success); }
.qr-cancel { width: 100%; padding: 12px; background: var(--bg-card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); font-size: 14px; cursor: pointer; margin-top: 8px; }
.qr-deposit-field { margin: 12px 0; }
.qr-deposit-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; display: block; }
.qr-deposit-input { display: flex; align-items: center; background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.qr-deposit-cur { padding: 12px; color: var(--accent); font-weight: 700; }
.qr-deposit-input input { flex: 1; background: none; border: none; color: var(--text-primary); font-size: 18px; font-weight: 700; outline: none; padding: 12px 0; font-family:'Sarabun',sans-serif; }
.qr-deposit-clear { padding: 10px 14px; background: none; border: none; border-left: 1px solid var(--border); color: var(--text-muted); cursor: pointer; }
.qr-deposit-quick { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.qr-qbtn { flex:1; min-width:56px; padding:8px 4px; background:var(--bg-card-2); border:1px solid var(--border); border-radius:8px; color:var(--text-primary); font-size:13px; font-weight:600; cursor:pointer; transition:0.2s; }
.qr-qbtn:hover { border-color:var(--accent); color:var(--accent); }
.qr-deposit-hint { font-size:11px; color:var(--text-muted); margin-top:4px; }
.qr-deposit-note { font-size:12px; color:#f87171; margin-top:6px; }
.qr-deposit-submit { width:100%; margin-top:12px; padding:13px; background:var(--accent-grad); border:none; border-radius:var(--radius-sm); color:#000; font-weight:700; font-size:15px; cursor:pointer; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width:4px; height:4px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:rgba(255,255,255,0.15); border-radius:4px; }

/* --- History Tab Buttons --- */
.headdeposit, .headwithdraw { background: none; border: none; padding: 0; }
.headdeposit button, .headwithdraw button { background: none; border: none; color: inherit; font-family: 'Sarabun',sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; }

/* --- Aff sub-tabs --- */
.wrapgrid001 { display: flex; gap: 6px; margin-bottom: 12px; }
.inwrapgrid001 { flex: 1; }
.ininwrapgrid001 { padding: 8px 4px; background: var(--bg-card-2); border: 1px solid var(--border); border-radius: var(--radius-sm); text-align: center; font-size: 11px; font-weight: 600; cursor: pointer; color: var(--text-muted); transition: 0.2s; }
.ininwrapgrid001.active { border-color: var(--accent); color: var(--accent); }
.friendcontent { display: none; }

/* --- Section Header (legacy support) --- */
.headerprocess { padding: 14px 16px 10px; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--text-primary); }

/* --- QR Deposit Box --- */
.qr-deposit-box { margin: 0; }

/* --- Accordion Panel open state --- */
.accordion-panel.open { display: block; }

/* --- Utility --- */
.text-accent  { color:var(--accent) !important; }
.text-success { color:var(--success) !important; }
.text-danger  { color:var(--danger) !important; }
.fw-700 { font-weight:700; }
.pending-warning { background:rgba(245,158,11,0.12); border:1px solid rgba(245,158,11,0.3); border-radius:var(--radius-sm); padding:12px 16px; font-size:14px; color:var(--accent); text-align:center; font-weight:600; display:flex; align-items:center; justify-content:center; gap:8px; }

/* Slip uploader */
.uploader label { display:block; width:100%; padding:2rem; text-align:center; background:var(--bg-card-2); border:2px dashed var(--border); border-radius:var(--radius-sm); cursor:pointer; transition:0.2s; color:var(--text-muted); font-size:14px; }
.uploader label:hover { border-color:var(--accent); color:var(--text-primary); }

/* --- Back Button --- */
.back-home-btn {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: 10px 16px;
  background: none; border: none; border-bottom: 1px solid var(--border);
  color: var(--text-muted); font-size: 13px; font-family: inherit;
  cursor: pointer; text-align: left; transition: color 0.15s;
}
.back-home-btn:hover, .back-home-btn:active { color: var(--accent); background: rgba(255,255,255,0.03); }
.back-home-btn i { font-size: 14px; }

/* --- Outline Button --- */
.btn-outline {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-card-2);
  color: var(--text-primary); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: 0.2s; font-family: inherit; width: 100%;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* --- Game List Grid (AJAX loaded) --- */
.gridofgame {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px 16px 20px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
@media (max-width: 360px) {
  .gridofgame { grid-template-columns: repeat(2, 1fr); }
}
.gridofgame a {
  text-decoration: none;
  display: block;
  min-width: 0;
  overflow: hidden;
}
.ingridgame {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: border-color 0.2s, transform 0.2s;
  min-width: 0;
  width: 100%;
}
.ingridgame:hover { border-color: var(--accent); transform: scale(1.02); }
.iningridgame { display: block; width: 100%; }
.iningridgame br { display: none; }
.iningridgame img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.iningridgame .text-truncate {
  font-size: 11px; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 5px 6px 6px;
  display: block;
  text-align: center;
}
.containprocess { width: 100%; }
.headerprocess {
  padding: 14px 16px 10px;
  font-size: 15px; font-weight: 700;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  color: var(--text-primary);
}

/* --- Slip Button (โดดเด่น) --- */
.slip-attach-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px 16px; margin-top: 12px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  border: none; border-radius: var(--radius-sm);
  color: #000; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  box-shadow: 0 4px 15px rgba(245,158,11,0.4);
  position: relative; overflow: hidden;
  transition: opacity 0.2s, transform 0.15s;
  text-decoration: none;
}
.slip-attach-btn::before {
  content: '';
  position: absolute; top: -50%; left: -60%;
  width: 40%; height: 200%;
  background: rgba(255,255,255,0.25);
  transform: skewX(-20deg);
  animation: slip-shine 3s infinite;
}
@keyframes slip-shine {
  0%   { left: -60%; }
  40%  { left: 120%; }
  100% { left: 120%; }
}
.slip-attach-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.slip-attach-btn:active { transform: translateY(0); }
.slip-attach-btn i { font-size: 18px; }

/* Safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav { padding-bottom: env(safe-area-inset-bottom); }
  .page-wrapper { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}
