:root {
  --bg: #0e1116;
  --card: #171b22;
  --line: #262c36;
  --text: #e6e9ef;
  --muted: #8a93a3;
  --gold: #f5c451;
  --green: #3ecf8e;
  --red: #ff6b6b;
  --accent: #6c8cff;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, Segoe UI, Roboto, sans-serif;
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
h1 { font-size: 20px; margin: 0; }
.tag {
  font-size: 11px; background: var(--line); color: var(--muted);
  padding: 2px 8px; border-radius: 999px; vertical-align: middle; margin-left: 6px;
}
.userbar { display: flex; align-items: center; gap: 16px; }
.balance b { color: var(--gold); }
.userbar a { color: var(--accent); text-decoration: none; }
section { max-width: 720px; margin: 24px auto; padding: 0 16px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px; margin-bottom: 20px;
}
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button {
  flex: 1; background: transparent; border: 1px solid var(--line);
  color: var(--muted); padding: 8px; border-radius: 8px; cursor: pointer;
}
.tabs button.active { color: var(--text); border-color: var(--accent); }
form { display: flex; flex-direction: column; gap: 10px; }
input {
  background: #0c0f14; border: 1px solid var(--line); color: var(--text);
  padding: 10px 12px; border-radius: 8px; font-size: 15px;
}
button {
  background: var(--accent); color: #fff; border: 0; padding: 10px 16px;
  border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 15px;
}
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
button:disabled { opacity: .5; cursor: not-allowed; }
.hint { color: var(--muted); font-size: 13px; }
.err { color: var(--red); min-height: 18px; margin: 8px 0 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* Slot */
.slotcard { text-align: center; }
.reels {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  background: #0c0f14; padding: 16px; border-radius: 12px; margin-bottom: 18px;
}
.cell {
  font-size: 46px; height: 78px; display: flex; align-items: center; justify-content: center;
  background: #11151c; border: 1px solid var(--line); border-radius: 10px;
  transition: transform .15s ease;
}
.cell.win { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.spinning { animation: shake .25s linear infinite; }
@keyframes shake { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-4px)} }
.controls { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.controls label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 4px; }
.controls input { width: 90px; text-align: center; }
#spinBtn { background: var(--green); color: #06281c; font-size: 18px; padding: 12px 28px; }
.spinmsg { min-height: 22px; font-weight: 600; margin: 14px 0 0; }
.spinmsg.win { color: var(--green); }
.spinmsg.lose { color: var(--muted); }

/* Transactions */
.txns { list-style: none; padding: 0; margin: 0; }
.txns li {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid var(--line); font-size: 14px;
}
.txns li:last-child { border-bottom: 0; }
.pos { color: var(--green); }
.neg { color: var(--red); }

/* Admin table */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--muted); font-weight: 600; }
.row-actions { display: flex; gap: 6px; }
.row-actions input { width: 80px; padding: 6px; }
.row-actions button { padding: 6px 10px; font-size: 13px; }
.badge { font-size: 11px; padding: 2px 7px; border-radius: 999px; }
.badge.admin { background: #3a2d12; color: var(--gold); }
.badge.banned { background: #3a1212; color: var(--red); }

/* Game tabs */
.gametabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.gametabs button { background: var(--card); border: 1px solid var(--line); color: var(--muted); padding: 10px 16px; border-radius: 10px; cursor: pointer; }
.gametabs button.active { color: var(--text); border-color: var(--accent); background: #1b2230; }
h4 { margin: 16px 0 8px; }

/* Roulette */
.wheel-result { font-size: 34px; font-weight: 700; text-align: center; padding: 14px; background: #0c0f14; border-radius: 12px; margin-bottom: 14px; }
.r-row, .r-bets { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.r-row label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 4px; }
.r-row input { width: 110px; }
.r-bets button { flex: 1 1 30%; }
.slip { list-style: none; padding: 0; margin: 0 0 12px; }
.slip li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rm { background: transparent; border: 0; color: var(--red); cursor: pointer; padding: 0 4px; font-size: 14px; }

/* Blackjack */
.bj-area { display: flex; flex-direction: column; gap: 16px; background: #0c0f14; border-radius: 12px; padding: 16px; margin-bottom: 16px; min-height: 150px; }
.bj-hand { display: flex; flex-direction: column; gap: 8px; }
.cards { display: flex; gap: 8px; flex-wrap: wrap; min-height: 64px; }
.pcard { min-width: 44px; height: 64px; display: flex; align-items: center; justify-content: center; background: #f5f5f5; color: #111; border-radius: 8px; font-weight: 700; font-size: 18px; }
.pcard.red { color: #c0392b; }
.pcard.back { background: #2a3550; color: #8a93a3; }

/* Wallet */
.wallet-forms { display: flex; gap: 16px; flex-wrap: wrap; }
.wallet-form { flex: 1 1 200px; background: #0c0f14; padding: 14px; border-radius: 10px; }
.wallet-form h4 { margin-top: 0; }
.wallet-form input { width: 100%; margin-bottom: 8px; }
.wallet-form button { width: 100%; }

/* External games */
.ext-games { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
#nolimitFrame { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 12px; margin-top: 12px; }

/* Stat cards */
.stat-cards { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat { flex: 1 1 130px; background: #0c0f14; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.stat span { color: var(--muted); font-size: 12px; }
.stat b { font-size: 22px; }
