:root {
  --bg: #06090f;
  --bg-2: #0b1119;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-2: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e9eff8;
  --muted: #8b97a8;
  --gold: #ffd166;
  --gold-2: #f0a93b;
  --green: #3ce08c;
  --red: #ff6b6b;
  --blue: #5cc8ff;
  --purple: #b07bff;
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(240, 169, 59, 0.14), transparent 60%),
    radial-gradient(1000px 700px at 92% 0%, rgba(92, 200, 255, 0.1), transparent 60%),
    radial-gradient(900px 900px at 50% 120%, rgba(176, 123, 255, 0.08), transparent 65%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { display: block; max-width: 100%; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
.note { color: var(--muted); font-size: 12.5px; line-height: 1.55; margin: 10px 2px 0; }
.footnote { color: var(--muted); font-size: 12px; text-align: center; margin: 22px 0 8px; opacity: 0.8; }

/* ── Đăng nhập ─────────────────────────────────────────────── */

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px 40px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 34px 28px 26px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px);
  animation: rise 0.5s ease both;
}

.login-mark {
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #1a1205;
  background: linear-gradient(145deg, var(--gold), var(--gold-2));
  box-shadow: 0 10px 30px rgba(240, 169, 59, 0.35);
}

.login-card h1 {
  margin: 0;
  text-align: center;
  font-size: 24px;
  letter-spacing: 3px;
  font-weight: 800;
}

.login-card h1 span {
  color: var(--gold);
  font-weight: 900;
}

.login-sub {
  margin: 8px 0 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

#login-form label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: var(--muted);
  margin-bottom: 8px;
}

#code {
  width: 100%;
  padding: 16px 14px;
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 10px;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#code::placeholder {
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: 6px;
  font-size: 20px;
}

#code:focus {
  border-color: rgba(255, 209, 102, 0.6);
  box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.12);
}

#login-btn {
  width: 100%;
  margin-top: 14px;
  padding: 15px;
  border-radius: 14px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #1a1205;
  background: linear-gradient(145deg, var(--gold), var(--gold-2));
  box-shadow: 0 12px 30px rgba(240, 169, 59, 0.28);
  transition: transform 0.15s, filter 0.2s;
}

#login-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
#login-btn:active { transform: translateY(0); }
#login-btn:disabled { opacity: 0.6; cursor: wait; }

.login-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  color: #ffd4d4;
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.3);
}

.login-help {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.login-help p { margin: 6px 0; }
.login-help code {
  padding: 2px 7px;
  border-radius: 6px;
  color: var(--gold);
  background: rgba(255, 209, 102, 0.1);
  border: 1px solid rgba(255, 209, 102, 0.2);
  font-family: inherit;
  font-weight: 700;
}
.login-help b { color: #dfe7f2; }
.login-help .warn { color: #ffc9a3; margin-top: 12px; }

/* ── Khung ứng dụng ───────────────────────────────────────── */

.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px clamp(14px, 4vw, 34px);
  background: rgba(6, 9, 15, 0.72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
  border-radius: 12px;
}

.brand-icon { font-size: 22px; filter: drop-shadow(0 4px 10px rgba(255, 209, 102, 0.35)); }

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-weight: 900;
  letter-spacing: 2px;
  font-size: 14px;
}

.brand-text small { color: var(--gold); font-size: 10px; letter-spacing: 3px; }

.top-actions { display: flex; align-items: center; gap: 8px; }

.wallet {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 209, 102, 0.28);
  background: rgba(255, 209, 102, 0.08);
  transition: background 0.3s, border-color 0.3s;
}

.wallet-label { font-size: 9px; letter-spacing: 1.4px; color: var(--muted); font-weight: 800; }

.wallet strong {
  font-size: 15px;
  font-weight: 900;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.wallet.up { animation: walletUp 0.7s ease; }
.wallet.down { animation: walletDown 0.7s ease; }

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 16px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.icon-btn:hover { background: var(--panel-2); border-color: var(--line-strong); transform: translateY(-1px); }

main {
  flex: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 30px) clamp(14px, 4vw, 28px) 40px;
}

/* ── Sảnh ─────────────────────────────────────────────────── */

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.hero h1 { margin: 0 0 6px; font-size: clamp(22px, 4vw, 30px); letter-spacing: -0.4px; }
.hero p { margin: 0; color: var(--muted); font-size: 13.5px; }

.hero-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px 9px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.hero-user img,
.avatar-fallback {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(145deg, #2b3648, #151d29);
  border: 1px solid var(--line-strong);
}

.avatar-fallback {
  display: grid;
  place-items: center;
  font-weight: 900;
  color: var(--gold);
}

.hero-user strong { display: block; font-size: 13.5px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-user span { display: block; font-size: 11px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.game-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 148px;
  padding: 18px 18px 16px;
  text-align: left;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.025));
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.25s;
}

.game-card::after {
  content: "";
  position: absolute;
  inset: -40% -60% auto auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent, #ffd166) 0%, transparent 68%);
  opacity: 0.16;
  transition: opacity 0.25s;
  pointer-events: none;
}

.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.game-card:hover::after { opacity: 0.28; }

.game-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-size: 24px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
}

.game-card h3 { margin: 0; font-size: 16px; letter-spacing: 0.2px; }
.game-card p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; flex: 1; }

.game-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; }

.mini-tag {
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: #cfe0f5;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}

.mini-tag.live {
  color: #06241a;
  background: linear-gradient(145deg, #4df0a0, #23b26d);
  border-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.mini-tag.live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #06241a;
  animation: blink 1.4s infinite;
}

.mini-tag.hot { color: var(--gold); border-color: rgba(255, 209, 102, 0.35); background: rgba(255, 209, 102, 0.08); }

/* ── Đầu màn game ─────────────────────────────────────────── */

.game-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.game-head h2 { margin: 0 0 3px; font-size: clamp(19px, 3.4vw, 24px); letter-spacing: -0.3px; }
.game-head p { margin: 0; font-size: 12.5px; }

.back-btn {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 19px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: background 0.2s, transform 0.15s;
}

.back-btn:hover { background: var(--panel-2); transform: translateX(-2px); }

.tag {
  margin-left: auto;
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 1.4px;
  color: var(--gold);
  border: 1px solid rgba(255, 209, 102, 0.3);
  background: rgba(255, 209, 102, 0.08);
}

.game-body { display: flex; flex-direction: column; gap: 14px; }

/* ── Thẻ & nút ────────────────────────────────────────────── */

.card {
  padding: clamp(16px, 3vw, 24px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.022));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card h3 {
  margin: 0 0 14px;
  font-size: 11px;
  letter-spacing: 1.6px;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 13px;
  font-weight: 900;
  letter-spacing: 0.8px;
  font-size: 13.5px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  transition: transform 0.15s, filter 0.2s, opacity 0.2s;
}

.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }

.btn-gold {
  color: #1a1205;
  border-color: transparent;
  background: linear-gradient(145deg, var(--gold), var(--gold-2));
  box-shadow: 0 10px 26px rgba(240, 169, 59, 0.22);
}

.btn-green {
  color: #052015;
  border-color: transparent;
  background: linear-gradient(145deg, #52f0a4, #1fbe70);
  box-shadow: 0 10px 26px rgba(60, 224, 140, 0.2);
}

.btn-red {
  color: #2a0707;
  border-color: transparent;
  background: linear-gradient(145deg, #ff8b8b, #e24646);
  box-shadow: 0 10px 26px rgba(255, 107, 107, 0.2);
}

.btn-block { width: 100%; }

.btn-big { padding: 16px 22px; font-size: 15px; letter-spacing: 1.4px; }

.btn[disabled] .cd { font-variant-numeric: tabular-nums; }

/* ── Ô cược ───────────────────────────────────────────────── */

.bet-field { display: flex; flex-direction: column; gap: 9px; }

.bet-label {
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 1.6px;
  color: var(--muted);
}

.bet-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }

.bet-input {
  flex: 1 1 150px;
  min-width: 0;
  padding: 14px 16px;
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.bet-input:focus {
  border-color: rgba(255, 209, 102, 0.55);
  box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.1);
}

.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.chip {
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #cdd9e8;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.chip:hover { background: rgba(255, 209, 102, 0.1); border-color: rgba(255, 209, 102, 0.35); color: var(--gold); }
.chip.active { background: rgba(255, 209, 102, 0.16); border-color: rgba(255, 209, 102, 0.5); color: var(--gold); }

.bet-hint { margin: 0; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Kết quả chung ────────────────────────────────────────── */

.result-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 13px;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.4px;
  border: 1px solid transparent;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.result-banner.empty { color: var(--muted); border-color: var(--line); background: rgba(0, 0, 0, 0.18); font-weight: 600; font-size: 13px; }
.result-banner.win { color: #7dffc0; background: rgba(60, 224, 140, 0.1); border-color: rgba(60, 224, 140, 0.32); animation: pop 0.45s ease; }
.result-banner.lose { color: #ff9d9d; background: rgba(255, 107, 107, 0.09); border-color: rgba(255, 107, 107, 0.3); animation: shake 0.4s ease; }
.result-banner.draw { color: #ffd98a; background: rgba(255, 209, 102, 0.09); border-color: rgba(255, 209, 102, 0.3); }

.subline { margin: 12px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.subline b { color: #e6eef9; }

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--gold);
  animation: spin 0.7s linear infinite;
}

/* ── Tài Xỉu tức thì ──────────────────────────────────────── */

.dice-row {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 2.4vw, 16px);
  padding: 8px 0 4px;
}

.die {
  width: clamp(58px, 15vw, 78px);
  height: clamp(58px, 15vw, 78px);
  display: grid;
  place-items: center;
  font-size: clamp(42px, 11vw, 58px);
  line-height: 1;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, #1b2534, #0d131c);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.die.rolling { animation: tumble 0.42s linear infinite; }
.die.pop { animation: pop 0.38s ease; }

.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }

.choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 18px 10px;
  border-radius: 15px;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 2px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.15s, border-color 0.2s, background 0.2s, opacity 0.2s;
}

.choice small { font-size: 10.5px; letter-spacing: 1px; font-weight: 700; color: var(--muted); }

.choice.tai { color: #ffb4a1; }
.choice.xiu { color: #9fd8ff; }
.choice.tai:hover { background: rgba(255, 107, 107, 0.12); border-color: rgba(255, 107, 107, 0.45); transform: translateY(-2px); }
.choice.xiu:hover { background: rgba(92, 200, 255, 0.12); border-color: rgba(92, 200, 255, 0.45); transform: translateY(-2px); }
.choice:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ── Spin 777 ─────────────────────────────────────────────── */

.slot-machine { text-align: center; }

.reels {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 2.5vw, 18px);
  padding: 10px 0 6px;
}

.reel {
  width: clamp(72px, 18vw, 100px);
  height: clamp(88px, 22vw, 118px);
  display: grid;
  place-items: center;
  font-size: clamp(40px, 10vw, 54px);
  font-weight: 900;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0 2px, transparent 2px 12px),
    linear-gradient(180deg, #16202e, #0a1018);
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.7), 0 14px 30px rgba(0, 0, 0, 0.4);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.reel .bar-text { font-size: 20px; letter-spacing: 2px; color: #dfe9f5; }

.reel.rolling { filter: blur(1.2px) brightness(0.9); }

.reel.win {
  border-color: rgba(255, 209, 102, 0.75);
  box-shadow: 0 0 24px rgba(255, 209, 102, 0.35), inset 0 0 26px rgba(255, 209, 102, 0.12);
  animation: pop 0.3s ease;
}

.slot-line {
  margin: 14px auto 0;
  width: min(320px, 100%);
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 209, 102, 0.6), transparent);
}

.paytable { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }

.paytable span {
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

.paytable b { color: var(--gold); }

/* ── Block Bounty ─────────────────────────────────────────── */

.bb-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(3px, 0.9vw, 7px);
  max-width: 470px;
  margin: 0 auto;
}

.cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: clamp(17px, 4.6vw, 27px);
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(160deg, #141d29, #0a1017);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.2s, background 0.2s, border-color 0.2s;
}

.cell-img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}

.cell.hit {
  border-color: rgba(255, 209, 102, 0.7);
  background: linear-gradient(160deg, rgba(255, 209, 102, 0.22), rgba(255, 169, 59, 0.08));
  transform: scale(1.06);
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.28);
}

.cell.drop { animation: dropIn 0.35s ease; }

.bb-stats { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.stat-pill {
  padding: 6px 11px;
  border-radius: 9px;
  font-size: 11.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.stat-pill b { color: var(--text); font-variant-numeric: tabular-nums; }

.free-banner {
  margin: 12px auto 0;
  max-width: 420px;
  padding: 10px 14px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--purple);
  border: 1px solid rgba(176, 123, 255, 0.35);
  background: rgba(176, 123, 255, 0.1);
  animation: pop 0.4s ease;
}

/* ── Arrow ────────────────────────────────────────────────── */

.arrow-stage { text-align: center; padding: 6px 0 2px; }

.target {
  position: relative;
  width: clamp(150px, 42vw, 200px);
  height: clamp(150px, 42vw, 200px);
  margin: 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: clamp(46px, 13vw, 64px);
  background:
    radial-gradient(circle, rgba(255, 209, 102, 0.16) 0 34%, transparent 35%),
    repeating-radial-gradient(circle, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 16px),
    linear-gradient(160deg, #141d29, #080d14);
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6), 0 20px 40px rgba(0, 0, 0, 0.4);
}

.target::before {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  border: 1px dashed rgba(255, 209, 102, 0.25);
}

.target.shoot { animation: recoil 0.5s ease; }

.arrow-num {
  position: absolute;
  inset: auto 0 -8px;
  margin: auto;
  width: max-content;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  color: var(--gold);
  background: #0a1018;
  border: 1px solid rgba(255, 209, 102, 0.4);
}

/* ── Wheel ────────────────────────────────────────────────── */

.wheel-stage { position: relative; width: min(300px, 78vw); margin: 6px auto 0; aspect-ratio: 1; }

.wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 6px solid #131c28;
  box-shadow:
    0 0 0 1px rgba(255, 209, 102, 0.35),
    0 26px 50px rgba(0, 0, 0, 0.5),
    inset 0 0 60px rgba(0, 0, 0, 0.55);
  transition: transform 3.6s cubic-bezier(0.16, 0.84, 0.22, 1);
  will-change: transform;
}

.wheel::after {
  content: "";
  position: absolute;
  inset: 34%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #26344a, #0a1119);
  border: 1px solid var(--line-strong);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
}

.wheel-seg { position: absolute; inset: 0; z-index: 1; }

.wheel-seg span {
  position: absolute;
  top: 7%;
  left: 50%;
  width: 30px;
  margin-left: -15px;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.3px;
  color: #071018;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

.wheel-pointer {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 18px solid var(--gold);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
}

.wheel-legend { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 18px; }

.legend-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

.legend-dot i { width: 8px; height: 8px; border-radius: 50%; display: block; }

/* ── RPS ──────────────────────────────────────────────────── */

.rps-arena {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 5vw, 34px);
  padding: 8px 0 4px;
}

.rps-side { display: flex; flex-direction: column; align-items: center; gap: 8px; }

.rps-hand {
  width: clamp(70px, 18vw, 92px);
  height: clamp(70px, 18vw, 92px);
  display: grid;
  place-items: center;
  font-size: clamp(34px, 9vw, 44px);
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, #17212f, #0a1018);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s;
}

.rps-hand.pop { animation: pop 0.35s ease; }
.rps-hand.shake { animation: shake 0.4s ease; }

.rps-vs { font-size: 12px; font-weight: 900; letter-spacing: 2px; color: var(--muted); }

.rps-side small { font-size: 10.5px; letter-spacing: 1.2px; color: var(--muted); font-weight: 800; }

.rps-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }

.rps-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 8px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}

.rps-btn span { font-size: 26px; }
.rps-btn:hover { transform: translateY(-2px); border-color: rgba(92, 200, 255, 0.45); background: rgba(92, 200, 255, 0.1); }
.rps-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ── Xóc Đĩa ──────────────────────────────────────────────── */

.xd-table {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 18px 0 6px;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 0%, rgba(255, 143, 163, 0.08), transparent 60%);
}

.xd-coins { display: flex; gap: clamp(8px, 3vw, 16px); }

.xd-coin {
  width: clamp(46px, 13vw, 60px);
  height: clamp(46px, 13vw, 60px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: clamp(20px, 5vw, 26px);
  background: radial-gradient(circle at 35% 30%, #f8fbff, #b9c6d6 55%, #7d8ea3);
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), inset 0 -6px 12px rgba(0, 0, 0, 0.18);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.xd-coin.red {
  background: radial-gradient(circle at 35% 30%, #ff9aa8, #e5384f 55%, #9c0f24);
  border-color: rgba(255, 180, 190, 0.8);
}

.xd-coin.shaking { animation: xdShake 0.42s ease-in-out infinite; }
.xd-coin.reveal { animation: pop 0.4s ease; }
.xd-face { pointer-events: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4)); }

@keyframes xdShake {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-5px) rotate(4deg); }
}

.xd-pattern { font-size: 12px; font-weight: 900; letter-spacing: 1.5px; color: var(--muted); }

.xd-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }

.xd-choice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 6px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}

.xd-choice small { font-size: 10px; color: var(--muted); font-weight: 700; }
.xd-choice:hover { transform: translateY(-1px); border-color: rgba(255, 143, 163, 0.5); }
.xd-choice.active { border-color: rgba(255, 143, 163, 0.75); background: rgba(255, 143, 163, 0.14); }
.xd-choice:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Plinko ───────────────────────────────────────────────── */

.plinko-canvas { display: block; margin: 2px auto 0; }
.plinko-hint { text-align: center; color: var(--muted); font-size: 11px; margin: 6px 0 0; }

.risk-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }

.risk-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 6px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 800;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}

.risk-btn small { font-size: 9.5px; color: var(--muted); font-weight: 700; }
.risk-btn:hover { transform: translateY(-1px); border-color: rgba(125, 211, 252, 0.5); }
.risk-btn.active { border-color: rgba(125, 211, 252, 0.7); background: rgba(125, 211, 252, 0.13); }
.risk-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

@media (max-width: 420px) {
  .xd-choices { grid-template-columns: repeat(2, 1fr); }
}

/* ── Live chung ───────────────────────────────────────────── */

.live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 1.4px;
  color: #9ff5c9;
}

.live-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(60, 224, 140, 0.8);
  animation: blink 1.4s infinite;
}

.live-dot.off { color: var(--muted); }
.live-dot.off::before { background: var(--muted); box-shadow: none; animation: none; }

.timer-text { font-size: 13px; font-weight: 900; color: var(--gold); font-variant-numeric: tabular-nums; }

.timer-bar {
  height: 5px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.timer-bar i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd166, #f0a93b);
  transition: width 0.5s linear;
}

.timer-bar.closed i { background: linear-gradient(90deg, #ff6b6b, #b33434); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.stat {
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
}

.stat span { display: block; font-size: 9.5px; letter-spacing: 1.2px; font-weight: 800; color: var(--muted); margin-bottom: 4px; }
.stat strong { font-size: 15px; font-variant-numeric: tabular-nums; }

.side-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

.side-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 15px 10px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1.6px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}

.side-btn small { font-size: 10px; letter-spacing: 0.6px; color: var(--muted); font-weight: 700; }
.side-btn.even { color: #ffb4a1; }
.side-btn.odd { color: #9fd8ff; }
.side-btn.even:hover { background: rgba(255, 107, 107, 0.12); border-color: rgba(255, 107, 107, 0.45); transform: translateY(-2px); }
.side-btn.odd:hover { background: rgba(92, 200, 255, 0.12); border-color: rgba(92, 200, 255, 0.45); transform: translateY(-2px); }
.side-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.side-btn.triple {
  grid-column: span 2;
  padding: 11px;
  font-size: 13px;
  color: var(--purple);
}
.side-btn.triple:hover { background: rgba(176, 123, 255, 0.12); border-color: rgba(176, 123, 255, 0.45); transform: translateY(-2px); }

.my-bets { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }

.my-bet {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--gold);
  border: 1px solid rgba(255, 209, 102, 0.3);
  background: rgba(255, 209, 102, 0.08);
  font-variant-numeric: tabular-nums;
}

.result-strip {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.chip-dice {
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 13px;
  letter-spacing: 1px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
}

/* ── Bầu Cua ──────────────────────────────────────────────── */

.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }

.tab {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.tab.active { color: var(--gold); border-color: rgba(255, 209, 102, 0.45); background: rgba(255, 209, 102, 0.1); }

.animal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }

.animal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 14px 6px 12px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}

.animal span { font-size: 30px; line-height: 1; }
.animal b { font-size: 11.5px; letter-spacing: 1.2px; }
.animal em { font-style: normal; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.animal:hover { transform: translateY(-2px); border-color: rgba(255, 209, 102, 0.45); background: rgba(255, 209, 102, 0.08); }
.animal:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }

.animal.mine { border-color: rgba(255, 209, 102, 0.6); box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.25) inset; }

.animal .badge {
  position: absolute;
  top: -7px;
  right: -7px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9.5px;
  font-style: normal;
  font-weight: 900;
  color: #1a1205;
  background: var(--gold);
}

.bc-history { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }

.bc-result {
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 14px;
  letter-spacing: 1px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
}

/* ── Crash ────────────────────────────────────────────────── */

.crash-stage {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: clamp(22px, 5vw, 38px) 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 120%, rgba(255, 107, 107, 0.28), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.3));
}

.crash-stage.flying { background: radial-gradient(circle at 50% 120%, rgba(60, 224, 140, 0.26), transparent 62%), linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.3)); }
.crash-stage.crashed { background: radial-gradient(circle at 50% 120%, rgba(255, 107, 107, 0.4), transparent 66%), linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.38)); animation: shake 0.45s ease; }

.crash-mult {
  font-size: clamp(46px, 15vw, 82px);
  font-weight: 900;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
  color: #eafff4;
  text-shadow: 0 0 34px rgba(60, 224, 140, 0.5);
  transition: color 0.25s;
}

.crash-stage.crashed .crash-mult { color: #ff8b8b; text-shadow: 0 0 34px rgba(255, 107, 107, 0.55); }

.crash-phase {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--muted);
}

.crash-stage.flying .crash-phase { color: #8bf5c1; }
.crash-stage.crashed .crash-phase { color: #ffb3b3; }

.crash-rocket { font-size: 26px; margin-bottom: 4px; display: inline-block; }
.crash-stage.flying .crash-rocket { animation: fly 1.1s ease-in-out infinite; }

.crash-history { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }

.crash-pill {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
}

.crash-pill.low { color: #ff9d9d; border-color: rgba(255, 107, 107, 0.3); }
.crash-pill.mid { color: var(--gold); border-color: rgba(255, 209, 102, 0.3); }
.crash-pill.high { color: #7dffc0; border-color: rgba(60, 224, 140, 0.35); }

.cashout-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 15px;
  border-radius: 13px;
  border: 1px solid rgba(60, 224, 140, 0.3);
  background: rgba(60, 224, 140, 0.07);
}

.cashout-box strong { font-size: 14px; color: #9dffcb; font-variant-numeric: tabular-nums; }
.cashout-box span { display: block; font-size: 10px; letter-spacing: 1.1px; font-weight: 800; color: var(--muted); margin-bottom: 3px; }

/* ── Xổ số ────────────────────────────────────────────────── */

.lottery-hero {
  text-align: center;
  padding: 8px 0 4px;
}

.lottery-round { font-size: 11px; font-weight: 900; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; }

.countdown-big {
  margin: 8px 0 4px;
  font-size: clamp(32px, 9vw, 46px);
  font-weight: 900;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

.pool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 16px; }

.ticket-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.ticket-input {
  flex: 0 1 130px;
  padding: 13px 14px;
  font-size: 16px;
  font-weight: 800;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  font-variant-numeric: tabular-nums;
}

.ticket-input:focus { border-color: rgba(255, 209, 102, 0.55); }

.winners { display: flex; flex-direction: column; gap: 8px; }

.winner-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.2);
  font-size: 12.5px;
}

.winner-row b { color: var(--gold); font-variant-numeric: tabular-nums; }
.winner-row span { color: var(--muted); font-size: 11px; }

.drawn-banner {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 800;
  color: #ffe3a3;
  border: 1px solid rgba(255, 209, 102, 0.4);
  background: rgba(255, 209, 102, 0.1);
}

/* ── Lịch sử ──────────────────────────────────────────────── */

.history-list { display: flex; flex-direction: column; gap: 8px; }

.history-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.history-row .h-game { font-size: 13.5px; font-weight: 700; }
.history-row .h-time { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.history-row .h-net { font-size: 14px; font-weight: 900; font-variant-numeric: tabular-nums; }
.history-row .h-bet { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.h-net.win { color: var(--green); }
.h-net.lose { color: var(--red); }
.h-net.zero { color: var(--muted); }

.empty-state {
  padding: 34px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
}

/* ── Toast ────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 90;
  transform: translate(-50%, 20px);
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: #e9eff8;
  background: rgba(18, 25, 36, 0.96);
  border: 1px solid var(--line-strong);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-color: rgba(60, 224, 140, 0.4); color: #a9ffd0; }
.toast.err { border-color: rgba(255, 107, 107, 0.45); color: #ffc2c2; }

/* ── Animation ────────────────────────────────────────────── */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0.9); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes tumble {
  0% { transform: rotate(0) translateY(0); }
  50% { transform: rotate(14deg) translateY(-4px); }
  100% { transform: rotate(0) translateY(0); }
}
@keyframes dropIn { from { transform: translateY(-14px); opacity: 0.2; } to { transform: none; opacity: 1; } }
@keyframes recoil {
  0% { transform: scale(1); }
  25% { transform: scale(1.08) rotate(-3deg); }
  55% { transform: scale(0.96) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes fly {
  0%, 100% { transform: translate(0, 0) rotate(-8deg); }
  50% { transform: translate(6px, -10px) rotate(-4deg); }
}
@keyframes walletUp {
  0% { background: rgba(255, 209, 102, 0.08); }
  35% { background: rgba(60, 224, 140, 0.28); border-color: rgba(60, 224, 140, 0.6); }
  100% { background: rgba(255, 209, 102, 0.08); }
}
@keyframes walletDown {
  0% { background: rgba(255, 209, 102, 0.08); }
  35% { background: rgba(255, 107, 107, 0.26); border-color: rgba(255, 107, 107, 0.6); }
  100% { background: rgba(255, 209, 102, 0.08); }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 0 rgba(255, 209, 102, 0); }
  50% { box-shadow: 0 0 26px rgba(255, 209, 102, 0.3); }
}

/* ── Coinflip ─────────────────────────────────────────────── */

.cf-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

.cf-panel h3 { margin-top: 18px; }
.cf-panel h3:first-child { margin-top: 0; }

.cf-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.cf-mode {
  padding: 12px 11px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
  text-align: left;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.cf-mode strong { display: block; font-size: 12.5px; letter-spacing: 0.2px; }
.cf-mode small { display: block; margin-top: 3px; font-size: 10px; line-height: 1.4; color: var(--muted); }

.cf-mode.active {
  border-color: rgba(255, 209, 102, 0.55);
  background: linear-gradient(140deg, rgba(255, 209, 102, 0.16), rgba(255, 209, 102, 0.03));
}

.cf-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.cf-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 15px 8px 12px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}

.cf-side-icon { font-size: 26px; line-height: 1; }
.cf-side strong { font-size: 13.5px; letter-spacing: 1.4px; }
.cf-side small { font-size: 10.5px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }

.cf-side.active {
  border-color: rgba(255, 209, 102, 0.7);
  background: radial-gradient(circle at 50% 120%, rgba(255, 209, 102, 0.22), transparent 65%), rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.cf-side.active strong { color: var(--gold); }

.cf-quick { display: flex; gap: 7px; margin-top: 10px; }
.cf-quick .chip { flex: 1; }

.cf-play { margin-top: 14px; }
.cf-cancel { margin-top: 9px; }
.cf-meta { margin: 12px 0 0; font-size: 11px; color: var(--muted); text-align: center; line-height: 1.5; }

.cf-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  padding: clamp(22px, 4vw, 34px) 18px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 209, 102, 0.13), transparent 62%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 34px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.32));
}

.cf-coin { width: clamp(160px, 26vw, 214px); aspect-ratio: 1; perspective: 900px; }

.cf-coin-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.3, 1.4, 0.4, 1);
}

.cf-coin.show-heads .cf-coin-inner { transform: rotateY(0deg); }
.cf-coin.show-tails .cf-coin-inner { transform: rotateY(180deg); }
.cf-coin.flipping .cf-coin-inner { animation: cf-spin 1.15s cubic-bezier(0.35, 0.1, 0.3, 1) forwards; }
.cf-coin.land { animation: pop 0.4s ease; }

@keyframes cf-spin {
  from { transform: rotateY(0deg) scale(1); }
  50% { transform: rotateY(720deg) scale(1.06); }
  to { transform: rotateY(1440deg) scale(1); }
}

.cf-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 0 46px rgba(0, 0, 0, 0.32), 0 18px 42px rgba(0, 0, 0, 0.45);
}

.cf-face span { font-size: clamp(36px, 6.4vw, 52px); line-height: 1; }
.cf-face strong { font-size: 14px; letter-spacing: 3px; }

.cf-face-heads {
  background: radial-gradient(circle at 35% 25%, #ffe9a8, #f3b929 46%, #b07a10 100%);
  color: #3a2704;
}

.cf-face-tails {
  transform: rotateY(180deg);
  background: radial-gradient(circle at 35% 25%, #e8e6ff, #9b8cd8 46%, #5a4d9e 100%);
  color: #211a44;
}

.cf-status { font-size: 10.5px; letter-spacing: 2px; font-weight: 900; color: var(--muted); text-align: center; }
.cf-stage .result-banner { width: min(420px, 100%); }

.cf-payline {
  padding: 6px 15px;
  border-radius: 999px;
  border: 1px dashed rgba(255, 209, 102, 0.28);
  font-size: 10.5px;
  letter-spacing: 1.6px;
  font-weight: 900;
  color: rgba(255, 209, 102, 0.8);
}

.cf-streak {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 3px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.cf-streak-label { font-size: 9.5px; letter-spacing: 1.6px; font-weight: 900; color: var(--muted); }
.cf-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.cf-dot {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 900;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
  color: var(--muted);
  opacity: 0.55;
}

.cf-dot.heads { color: #3a2704; background: radial-gradient(circle at 35% 25%, #ffe9a8, #f3b929); border-color: rgba(255, 209, 102, 0.5); }
.cf-dot.tails { color: #211a44; background: radial-gradient(circle at 35% 25%, #e8e6ff, #9b8cd8); border-color: rgba(155, 140, 216, 0.5); }
.cf-dot.hot { opacity: 1; box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.18); }
.cf-dots-empty { font-size: 11px; color: var(--muted); }

.cf-rooms h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.cf-count {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 209, 102, 0.3);
  background: rgba(255, 209, 102, 0.12);
  color: var(--gold);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.cf-mine {
  margin-bottom: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 209, 102, 0.35);
  background: rgba(255, 209, 102, 0.07);
}

.cf-mine-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 9.5px;
  letter-spacing: 1.2px;
  font-weight: 900;
  color: var(--gold);
}

.cf-mine-time { font-variant-numeric: tabular-nums; }
.cf-mine-body { font-size: 13.5px; font-weight: 800; margin-bottom: 4px; }
.cf-mine-note { margin: 0; font-size: 10.5px; line-height: 1.5; color: var(--muted); }

.cf-room-list { display: flex; flex-direction: column; gap: 8px; }

.cf-room {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.cf-room-info { min-width: 0; }

.cf-room-info strong {
  display: block;
  margin-bottom: 3px;
  font-size: 12.5px;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cf-room-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.cf-side-tag { font-weight: 800; }
.cf-side-tag.heads { color: var(--gold); }
.cf-side-tag.tails { color: #b7a8ff; }
.cf-room-bet { color: var(--muted); font-variant-numeric: tabular-nums; }

.cf-join { padding: 9px 12px; border-radius: 10px; font-size: 11px; letter-spacing: 0.6px; flex: none; }
.cf-join.confirming { background: linear-gradient(145deg, var(--gold), #e2951f); color: #241802; }

.cf-empty {
  padding: 14px 12px;
  border-radius: 12px;
  border: 1px dashed var(--line-strong);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  text-align: center;
}

.cf-recent { margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--line); }
.cf-recent h3 { margin-bottom: 6px; }

.cf-recent-row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 11.5px; }

.cf-recent-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.cf-recent-face.win { color: #7dffc0; }
.cf-recent-face.lose { color: #ff9d9d; }

@media (max-width: 1180px) {
  .cf-layout { grid-template-columns: 290px minmax(0, 1fr); }
  .cf-rooms { grid-column: span 2; }
}

@media (max-width: 760px) {
  .cf-layout { grid-template-columns: 1fr; }
  .cf-rooms { grid-column: auto; }
  .cf-stage { order: -1; padding-top: 20px; }
}

/* ── Cổ phiếu ─────────────────────────────────────────────── */

.st-banner {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #060a12;
}

.st-banner-img { width: 100%; height: auto; display: block; }

.st-banner-txt {
  position: absolute;
  inset: auto auto 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(4, 8, 14, 0.72);
  border: 1px solid rgba(255, 209, 102, 0.25);
  backdrop-filter: blur(4px);
}

.st-banner-txt b { font-size: 12px; letter-spacing: 1.2px; color: var(--gold); }
.st-banner-txt span { font-size: 9.5px; letter-spacing: 0.8px; color: var(--muted); }

.st-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.st-stat {
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.24);
}

.st-stat-label {
  display: block;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: var(--muted);
}

.st-stat-value {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

.st-list { display: flex; flex-direction: column; gap: 7px; }

.st-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 64px 84px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.st-row:hover { transform: translateX(2px); border-color: var(--line-strong); }
.st-row.active {
  border-color: color-mix(in srgb, var(--accent, #ffd166) 55%, transparent);
  background: color-mix(in srgb, var(--accent, #ffd166) 9%, transparent);
}

.st-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.st-id { display: flex; flex-direction: column; min-width: 0; }
.st-id b { font-size: 13px; letter-spacing: 0.6px; }
.st-id span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.st-spark { display: block; }

.st-quote { display: flex; flex-direction: column; align-items: flex-end; }
.st-quote b { font-size: 13.5px; font-variant-numeric: tabular-nums; color: var(--gold); }
.st-quote span { font-size: 10.5px; font-weight: 800; font-variant-numeric: tabular-nums; }

.st-chart-head { display: flex; align-items: center; gap: 11px; margin-bottom: 6px; }

.st-chart-logo {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.st-chart-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.st-chart-id b { font-size: 14px; }
.st-chart-id span { font-size: 11px; color: var(--muted); }

.st-chart-quote { display: flex; flex-direction: column; align-items: flex-end; }
.st-chart-quote b { font-size: 18px; font-variant-numeric: tabular-nums; }
.st-chart-quote span { font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }

.st-chart { display: block; width: 100%; }

.st-trade-top { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }

.st-trade-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.st-trade-name { display: flex; flex-direction: column; min-width: 0; }
.st-trade-name b { font-size: 13px; }
.st-trade-name span { font-size: 11px; font-variant-numeric: tabular-nums; }

.st-estimate {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px dashed var(--line-strong);
  background: rgba(0, 0, 0, 0.2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: #cfe0f5;
}

.st-estimate.warn { color: #ffc2c2; border-color: rgba(255, 107, 107, 0.45); }

.st-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }

.st-pf-list { display: flex; flex-direction: column; gap: 7px; }

.st-pf-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 96px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}

.st-pf-row:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.05); }
.st-pf-row .st-logo { width: 34px; height: 34px; }

.st-pf-total {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.st-pf-total b { color: #e6eef9; }
.st-pf-total b.up { color: var(--green); }
.st-pf-total b.down { color: var(--red); }

.st-empty {
  padding: 16px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 11px;
}

.st-trades { display: flex; flex-direction: column; gap: 5px; }

.st-trade-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
}

.st-side {
  min-width: 40px;
  text-align: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.8px;
}

.st-side.buy { color: #7dffc0; background: rgba(60, 224, 140, 0.12); }
.st-side.sell { color: #ff9d9d; background: rgba(255, 107, 107, 0.12); }

.st-trade-main { flex: 1; font-variant-numeric: tabular-nums; color: #d7e2f2; }
.st-trade-time { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.st-row .up, .st-chart-quote .up, .st-pf-row .up, .st-stat-value.up { color: var(--green); }
.st-row .down, .st-chart-quote .down, .st-pf-row .down, .st-stat-value.down { color: var(--red); }

@media (max-width: 640px) {
  .st-summary { grid-template-columns: 1fr; gap: 7px; }
  .st-stat { display: flex; align-items: center; justify-content: space-between; padding: 8px 11px; }
  .st-stat-value { margin-top: 0; font-size: 14px; }
  .st-row { grid-template-columns: 34px minmax(0, 1fr) 76px; }
  .st-row .st-spark { display: none; }
  .st-banner-txt { inset: auto 8px 8px 8px; padding: 6px 9px; }
  .st-banner-txt b { font-size: 11px; }
  .st-actions { grid-template-columns: 1fr; }
  .st-chart-quote b { font-size: 15px; }
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 640px) {
  .topbar { padding: 10px 14px; }
  .brand-text { display: none; }
  .wallet { padding: 7px 11px; }
  .wallet-label { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .game-card { min-height: 132px; padding: 14px; }
  .game-card h3 { font-size: 14px; }
  .game-card p { font-size: 11.5px; }
  .game-icon { width: 38px; height: 38px; font-size: 20px; }
  .hero-user { width: 100%; }
  .hero-user strong { max-width: none; }
  .history-row { grid-template-columns: 1fr auto; }
  .history-row .h-bet { display: none; }
  .animal-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .animal { padding: 11px 4px 9px; }
  .animal span { font-size: 26px; }
  .rps-choices { gap: 7px; }
  .rps-btn { padding: 11px 5px; font-size: 11px; }
  .rps-btn span { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ── Dò Mìn ───────────────────────────────────────────────── */

.mn-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.mn-panel h3 { margin-top: 18px; }
.mn-panel h3:first-child { margin-top: 0; }
.mn-bombs { margin-top: 2px; }
.mn-bombs .chip { min-width: 46px; }
.mn-hint { margin: 8px 0 0; font-size: 11px; color: var(--muted); line-height: 1.45; }
.mn-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 10px; }
.mn-start { margin-top: 14px; }
.mn-cash { margin-top: 9px; }
.mn-meta { margin: 12px 0 0; font-size: 11px; color: var(--muted); text-align: center; }

.mn-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(16px, 2.6vw, 26px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 177, 92, 0.12), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(0, 0, 0, 0.3));
}

.mn-hud { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

.mn-pill {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.24);
}

.mn-pill span { display: block; font-size: 9.5px; letter-spacing: 0.9px; color: var(--muted); }
.mn-pill strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(13px, 1.8vw, 16px);
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.mn-grid { display: grid; gap: clamp(6px, 1.1vw, 10px); width: 100%; max-width: 560px; margin: 0 auto; }

.mn-tile {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.07), transparent 60%),
    linear-gradient(160deg, #182231, #0a1017);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 6px 14px rgba(0, 0, 0, 0.25);
  font-size: clamp(20px, 4.4vw, 32px);
  transition: transform 0.14s, border-color 0.2s, background 0.2s, opacity 0.2s;
}

.mn-tile:not(:disabled):hover {
  transform: translateY(-3px);
  border-color: rgba(255, 209, 102, 0.6);
}

.mn-tile:not(:disabled):active { transform: translateY(0) scale(0.97); }

.mn-tile.safe {
  border-color: rgba(60, 224, 140, 0.6);
  background:
    radial-gradient(circle at 50% 20%, rgba(60, 224, 140, 0.3), transparent 70%),
    linear-gradient(160deg, #12291f, #07130d);
}

.mn-tile.bomb {
  border-color: rgba(255, 107, 107, 0.75);
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 107, 107, 0.35), transparent 70%),
    linear-gradient(160deg, #2b1214, #170707);
}

.mn-tile.over:not(.safe):not(.bomb) { opacity: 0.42; }
.mn-tile.dim { opacity: 0.5; }
.mn-tile.pop { animation: pop 0.34s ease; }
.mn-tile.bomb.pop { animation: shake 0.4s ease; }
.mn-face { line-height: 1; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)); }
.mn-legend { margin: 0; text-align: center; font-size: 11px; color: var(--muted); }

@media (max-width: 980px) {
  .mn-layout { grid-template-columns: 1fr; }
  .mn-hud { grid-template-columns: repeat(2, 1fr); }
}
