/* ============================================================
   XocDia88 Clone - Dark theme (giong xocdia88.green)
   ============================================================ */
:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2333;
  --bg-input: #0d1117;
  --accent: #f5c518;
  --accent-hover: #e6b800;
  --success: #2ea043;
  --danger: #f85149;
  --warning: #d29922;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --border: #30363d;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); cursor: pointer; text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ---- HEADER ---- */
#header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  height: 56px;
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; height: 100%; gap: 12px;
}
.logo { cursor: pointer; height: 36px; }
.logo img { height: 36px; }
.nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 16px; border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-primary { background: var(--accent); color: #000; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; border: 1px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: #000; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #000; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---- MAIN ---- */
#content {
  max-width: 1200px; margin: 56px auto 80px; padding: 16px;
  min-height: calc(100vh - 136px);
}

/* ---- CARDS ---- */
.card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 20px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: var(--accent); }

/* ---- FORMS ---- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 10px 12px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-size: 14px; outline: none;
}
.form-input:focus { border-color: var(--accent); }
select.form-input { appearance: none; }
.form-error { color: var(--danger); font-size: 12px; margin-top: 4px; }
.form-msg { text-align: center; margin: 12px 0; font-size: 14px; }
.form-msg.success { color: var(--success); }
.form-msg.error { color: var(--danger); }

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; white-space: nowrap; }
td { color: var(--text); }
tr:hover td { background: rgba(255,255,255,.03); }

/* ---- STATUS BADGES ---- */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
}
.badge-pending { background: #d29922; color: #000; }
.badge-approved, .badge-completed { background: #2ea043; color: #fff; }
.badge-rejected { background: #f85149; color: #fff; }
.badge-active { background: #2ea043; color: #fff; }
.badge-banned { background: #f85149; color: #fff; }

/* ---- BALANCE ---- */
.balance-display {
  display: flex; align-items: center; gap: 4px;
  background: var(--bg-primary); padding: 4px 12px;
  border-radius: 20px; font-weight: 700; font-size: 14px;
  color: var(--accent);
}
.balance-icon { font-size: 16px; }

/* ---- USER MENU ---- */
.user-menu { position: relative; }
.user-name-text {
  cursor: pointer; padding: 6px 12px; border-radius: var(--radius);
  background: var(--bg-primary); color: var(--text); font-size: 13px;
}
.user-menu:hover .dropdown { display: block; }
.dropdown {
  display: none; position: absolute; right: 0; top: 100%;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); min-width: 150px; padding: 4px 0;
  z-index: 200; box-shadow: var(--shadow);
}
.dropdown a {
  display: block; padding: 8px 16px; color: var(--text);
  font-size: 13px;
}
.dropdown a:hover { background: var(--bg-primary); color: var(--accent); }
.admin-badge {
  background: var(--danger); color: #fff; font-size: 11px;
  padding: 2px 8px; border-radius: 4px; font-weight: 700;
}

/* ---- HOME BANNER ---- */
.banner {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: 12px; padding: 40px 24px; text-align: center;
  margin-bottom: 24px; border: 1px solid var(--border);
}
.banner h1 { font-size: 28px; color: var(--accent); margin-bottom: 8px; }
.banner p { color: var(--text-muted); font-size: 15px; }

.game-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; margin-top: 16px;
}
.game-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; text-align: center;
  cursor: pointer; transition: transform .15s, border-color .15s;
}
.game-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.game-card .game-icon { font-size: 40px; margin-bottom: 8px; }
.game-card .game-name { font-size: 13px; font-weight: 600; }

/* ---- GAME IFRAME ---- */
.game-frame {
  width: 100%; height: calc(100vh - 120px);
  border: none; border-radius: var(--radius);
  background: #000;
}

/* ---- CHAT ---- */
.chat-container { display: flex; flex-direction: column; height: calc(100vh - 140px); }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 12px;
  background: var(--bg-primary); border-radius: var(--radius);
}
.chat-msg { margin-bottom: 8px; max-width: 80%; }
.chat-msg.user { margin-left: auto; }
.chat-msg .bubble {
  padding: 8px 12px; border-radius: 12px;
  font-size: 14px; line-height: 1.4; word-break: break-word;
}
.chat-msg.user .bubble { background: var(--accent); color: #000; border-bottom-right-radius: 4px; }
.chat-msg.admin .bubble { background: var(--bg-card); color: var(--text); border-bottom-left-radius: 4px; }
.chat-msg .time { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.chat-msg.user .time { text-align: right; }
.chat-input-bar {
  display: flex; gap: 8px; padding: 12px 0;
}
.chat-input-bar input { flex: 1; }

/* ---- BOTTOM NAV (mobile) ---- */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-secondary); border-top: 1px solid var(--border);
  padding: 4px 0; z-index: 100;
}
.bnav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  font-size: 10px; color: var(--text-muted); padding: 4px;
  text-decoration: none;
}
.bnav-item.active { color: var(--accent); }
.bnav-icon { font-size: 20px; }
.bnav-play {
  width: 44px; height: 44px; background: var(--accent); color: #000;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-top: -20px; box-shadow: 0 2px 12px rgba(245,197,24,.4);
}

/* ---- DEPOSIT INFO ---- */
.bank-info {
  background: var(--bg-primary); border-radius: var(--radius);
  padding: 16px; border: 1px solid var(--border);
}
.bank-info .row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.bank-info .row:last-child { border: none; }
.bank-info .label { color: var(--text-muted); font-size: 13px; }
.bank-info .value { font-weight: 600; font-size: 14px; }
.copy-btn { font-size: 11px; cursor: pointer; color: var(--accent); margin-left: 8px; }

/* ---- ADMIN STATS ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border-radius: var(--radius); padding: 16px; text-align: center; border: 1px solid var(--border); }
.stat-value { font-size: 28px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---- ADMIN CHAT ROOMS ---- */
.chat-room-list { }
.chat-room-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.chat-room-item:hover { background: var(--bg-primary); }
.unread-badge { background: var(--danger); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 10px; }

/* ---- PAGINATION ---- */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 16px; }
.pagination button { padding: 6px 12px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .bottom-nav { display: flex; }
  #content { margin-bottom: 70px; }
  .nav .btn { padding: 6px 10px; font-size: 12px; }
  .game-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .banner h1 { font-size: 22px; }
  .header-inner { padding: 0 8px; }
  table { font-size: 11px; }
  th, td { padding: 6px 8px; }
}
@media (max-width: 480px) {
  .game-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .balance-display { font-size: 12px; padding: 2px 8px; }
}

/* ---- LOADING ---- */
.loading { text-align: center; padding: 40px; color: var(--text-muted); }
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- FILTERS ---- */
.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filters select, .filters input { font-size: 13px; }
