/* ChainLuck — demo casino theme */
:root {
  --bg: #070b14;
  --bg2: #0c1220;
  --card: rgba(255, 255, 255, 0.045);
  --card-border: rgba(255, 255, 255, 0.09);
  --txt: #e2e8f0;
  --muted: #8b96ab;
  --cyan: #22d3ee;
  --magenta: #f43f8e;
  --gold: #ffd54a;
  --green: #4ade80;
  --red: #f87171;
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--txt);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); text-decoration: none; }
button { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.win { color: var(--green) !important; }
.lose { color: var(--red) !important; }

.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(700px 420px at 12% -8%, rgba(34, 211, 238, 0.13), transparent 60%),
    radial-gradient(700px 460px at 88% 0%, rgba(244, 63, 142, 0.11), transparent 60%),
    radial-gradient(900px 600px at 50% 110%, rgba(255, 213, 74, 0.06), transparent 60%);
}

/* ---------- sticky head (topbar + banner + tabs in ONE container,
   so a wrapping topbar can never slide under the tabs) ---------- */
.head-sticky {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 11, 20, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
}
.topbar {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 8px 12px;
  flex-wrap: wrap;
  padding: 12px 16px 14px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; color: var(--txt); letter-spacing: 0.3px; }
.brand-ico { font-size: 22px; }
.demo-tag {
  font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: 1.5px;
  color: #3b2505; background: var(--gold); border-radius: 6px; padding: 2px 6px;
}
.topbar-right { display: flex; align-items: center; gap: 6px; max-width: 100%; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn {
  background: var(--card); border: 1px solid var(--card-border);
  font-size: 15px; border-radius: 10px; padding: 6px 8px; cursor: pointer;
  transition: border-color .15s, transform .15s; line-height: 1;
}
.icon-btn:hover { border-color: var(--cyan); transform: translateY(-1px); }
.icon-btn.gift.ready {
  border-color: var(--gold);
  animation: gift-pulse 1.6s infinite;
}
@keyframes gift-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 213, 74, 0.55); }
  50% { box-shadow: 0 0 0 7px rgba(255, 213, 74, 0); }
}
.icon-btn.faucet { border-color: rgba(96, 165, 250, 0.6); }
.lvl-chip {
  font-size: 11.5px; font-weight: 800; color: #06121a;
  background: linear-gradient(135deg, var(--magenta), #c026d3);
  border-radius: 7px; padding: 4px 8px;
}
.xp-wrap { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.xp-bar { width: 100%; height: 100%; background: rgba(255, 255, 255, 0.06); }
.xp-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  transition: width .4s ease;
}
.balance-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--card-border);
  color: var(--txt); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: border-color .2s;
}
.balance-chip:hover { border-color: var(--cyan); }
.balance-chip .cur { color: var(--muted); font-size: 11px; font-weight: 600; }
.wallet-btn {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  border: none; color: #1a0e02; font-weight: 800; border-radius: 999px;
  padding: 8px 14px; font-size: 13px; cursor: pointer; transition: transform .15s;
}
.wallet-btn:hover { transform: translateY(-1px); }

/* ---------- banner ---------- */
.demo-banner {
  background: rgba(255, 213, 74, 0.12);
  border-top: 1px solid rgba(255, 213, 74, 0.25);
  color: var(--gold);
  text-align: center; font-size: 12.5px; font-weight: 600;
  padding: 7px 12px; letter-spacing: 0.2px;
}

/* ---------- tabs ---------- */
.tabs {
  display: flex; gap: 4px; overflow-x: auto;
  border-top: 1px solid var(--card-border);
  padding: 8px 12px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; white-space: nowrap;
  color: var(--muted); font-weight: 700; font-size: 14px;
  padding: 8px 14px; border-radius: 999px;
  transition: all .18s;
}
.tab:hover { color: var(--txt); background: var(--card); }
.tab.active { color: #06121a; background: linear-gradient(135deg, var(--cyan), #60a5fa); }

/* ---------- main ---------- */
main { max-width: 1000px; margin: 0 auto; padding: 20px 16px 40px; }

/* lobby */
.hero { text-align: center; padding: 28px 8px 24px; }
.hero h1 { font-size: clamp(28px, 6vw, 44px); font-weight: 900; letter-spacing: -0.5px; }
.hero h1 span { background: linear-gradient(90deg, var(--cyan), var(--magenta)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); margin-top: 8px; font-size: 15px; }
.hero-note { font-size: 13px !important; color: var(--gold) !important; }

.lobby-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px;
  margin-top: 18px;
}
.lobby-card {
  display: block;
  background: linear-gradient(160deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--txt);
  transition: transform .18s, border-color .18s, box-shadow .18s;
  position: relative; overflow: hidden;
}
.lobby-card:hover {
  transform: translateY(-3px);
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
}
.lc-ico { font-size: 34px; }
.lobby-card h3 { margin: 10px 0 6px; font-size: 18px; }
.lobby-card p { color: var(--muted); font-size: 13px; min-height: 40px; }
.lc-cta { display: inline-block; margin-top: 12px; color: var(--cyan); font-weight: 800; font-size: 14px; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 26px; }
.info-card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 16px; }
.info-card h4 { margin-bottom: 6px; font-size: 15px; }
.info-card p { color: var(--muted); font-size: 13px; }

/* ---------- game layout ---------- */
.game-wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 16px; align-items: start;
}
.game-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
}
.game-card h2 { font-size: 20px; margin-bottom: 16px; }
.game-card h3 { font-size: 15px; margin-bottom: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

/* ---------- forms ---------- */
.bet-row { margin-bottom: 14px; }
.bet-row label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.num-in {
  width: 100%; padding: 11px 12px; font-size: 16px; font-weight: 700;
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--card-border); border-radius: 10px;
  color: var(--txt); outline: none;
}
.num-in:focus { border-color: var(--cyan); }
.quick-bets { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.qbtn {
  background: var(--card); border: 1px solid var(--card-border); color: var(--muted);
  border-radius: 8px; padding: 5px 10px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.qbtn:hover { color: var(--txt); border-color: var(--cyan); }
input[type="range"] { width: 100%; accent-color: var(--cyan); margin-top: 8px; }

.mode-toggle { display: flex; gap: 6px; margin-bottom: 14px; }
.seg {
  flex: 1; padding: 9px 6px; font-size: 13px; font-weight: 700;
  background: var(--card); color: var(--muted);
  border: 1px solid var(--card-border); border-radius: 10px; cursor: pointer;
  transition: all .15s;
}
.seg.active { color: #06121a; background: linear-gradient(135deg, var(--cyan), #60a5fa); border-color: transparent; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; width: 100%; margin-top: 8px;
  padding: 11px 14px; font-size: 15px; font-weight: 800;
  background: var(--card); color: var(--txt);
  border: 1px solid var(--card-border); border-radius: 12px;
  cursor: pointer; transition: all .15s;
}
.btn:hover:not(:disabled) { border-color: var(--cyan); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, #f59e0b, #f97316); border: none; color: #1a0e02; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-big {
  background: linear-gradient(135deg, var(--cyan), #3b82f6);
  border: none; color: #04121c; font-size: 17px; padding: 14px;
}
.btn-big:hover:not(:disabled) { filter: brightness(1.1); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--red); border-color: rgba(248, 113, 113, 0.35); }

/* ---------- dice ---------- */
.roll-result { margin-top: 16px; text-align: center; }
.roll-num {
  font-size: 64px; font-weight: 900; letter-spacing: -2px; line-height: 1;
  color: var(--cyan); font-variant-numeric: tabular-nums;
  text-shadow: 0 0 30px rgba(34, 211, 238, 0.45);
}
.roll-num.win { color: var(--green); text-shadow: 0 0 30px rgba(74, 222, 128, 0.45); }
.roll-num.lose { color: var(--red); text-shadow: 0 0 30px rgba(248, 113, 113, 0.45); }
.roll-outcome { margin-top: 8px; font-weight: 800; font-size: 16px; }
.pf-panel {
  margin-top: 16px; padding: 12px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.3); border: 1px dashed var(--card-border);
  font-size: 12px; color: var(--muted);
}
.pf-panel code { color: var(--cyan); font-size: 11px; word-break: break-all; }
.rolls-list { display: flex; flex-direction: column; gap: 6px; }
.roll-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px; font-size: 13px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--card-border);
}
.roll-row.win { border-color: rgba(74, 222, 128, 0.35); }
.roll-row.lose { border-color: rgba(248, 113, 113, 0.25); }
.rr-roll { font-weight: 900; font-variant-numeric: tabular-nums; min-width: 52px; }
.rr-info { flex: 1; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rr-profit { font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- plinko ---------- */
.pk-canvas {
  display: block; width: 100%; max-width: 460px; margin: 14px auto 0;
  border-radius: 14px; border: 1px solid var(--card-border);
  background: #0a0e17;
}
.pk-result { text-align: center; margin-top: 12px; font-size: 16px; font-weight: 800; }
.pk-table { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-chip {
  font-size: 11px; font-weight: 800; padding: 5px 8px; border-radius: 8px;
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--card-border); color: var(--muted);
}

/* ---------- blackjack ---------- */
.bj-table {
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--card-border);
  border-radius: 14px; padding: 16px; margin-bottom: 14px;
}
.bj-hand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.bj-hand-row:last-of-type { margin-bottom: 0; }
.bj-label { width: 58px; font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.bj-cards { display: flex; gap: 6px; flex-wrap: wrap; min-height: 80px; flex: 1; }
.bj-total { font-weight: 900; font-size: 18px; min-width: 30px; text-align: right; color: var(--cyan); }
.bj-status { margin-top: 12px; font-weight: 700; font-size: 14px; min-height: 22px; }
.bj-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bj-actions .btn-big { grid-column: 1 / -1; }
.bj-last { margin-top: 12px; font-size: 16px; font-weight: 800; text-align: center; }

.card {
  width: 58px; height: 80px; border-radius: 8px;
  background: linear-gradient(160deg, #ffffff, #e8ecf4);
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 5px 6px; font-weight: 900; font-size: 15px;
  color: #0f172a; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  position: relative;
}
.card .cr { font-size: 15px; line-height: 1; }
.card .cs { font-size: 16px; line-height: 1; }
.card .cr.red, .card .cs.red { color: #dc2626; }
.card.down {
  background: repeating-linear-gradient(45deg, #1e3a8a 0 6px, #1d4ed8 6px 12px);
  border-color: #172554;
}
.card.down::after { content: "⚡"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; color: rgba(255,255,255,0.85); }

.rules { padding-left: 18px; color: var(--muted); font-size: 13.5px; }
.rules li { margin-bottom: 6px; }

/* ---------- slots ---------- */
.slot-machine {
  background: linear-gradient(180deg, #1a1030, #0d0a1c);
  border: 1px solid rgba(255, 213, 74, 0.3);
  border-radius: 18px; padding: 18px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6);
  margin-bottom: 14px;
}
.reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.reel {
  background: #05030c; border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex; flex-direction: column; gap: 2px; padding: 4px;
}
.cell {
  height: 64px; display: grid; place-items: center;
  font-size: 38px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}
.cell.pop { animation: pop .3s ease; }
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.sl-result { text-align: center; margin-top: 12px; font-size: 17px; font-weight: 800; }
.pay-table { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.pay-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; border-radius: 8px; background: rgba(0,0,0,0.25); }
.pay-row .sym { font-size: 18px; }
.pay-row .val { color: var(--muted); font-weight: 700; }

/* ---------- footer ---------- */
.foot { max-width: 1000px; margin: 0 auto; padding: 18px 16px 40px; }
.session {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  padding: 12px 16px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--card-border);
  font-size: 13.5px; color: var(--muted);
}
.session b { color: var(--txt); }
.session .r { margin-left: auto; color: var(--gold); font-weight: 700; }
.fine { margin-top: 14px; font-size: 12px; color: var(--muted); text-align: center; }

/* ---------- modals ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(3, 6, 12, 0.72);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal {
  width: 100%; max-width: 400px;
  background: linear-gradient(170deg, #121a2c, #0b101d);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.modal-sm { max-width: 320px; text-align: center; padding-bottom: 20px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--card-border);
  font-weight: 800;
}
.modal-head small { color: var(--muted); font-weight: 600; }
.modal-x { background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 4px 8px; }
.modal-body { padding: 16px; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--card-border); font-size: 11.5px; }
.w-state { margin: 12px 0; }
.w-addr {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px; color: var(--cyan);
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--card-border);
  border-radius: 10px; padding: 10px; word-break: break-all;
}
.w-type { font-size: 12px; color: var(--muted); margin-top: 6px; }
.w-bal { margin-top: 8px; font-size: 15px; }
.w-tx-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tx-spin { font-size: 44px; margin: 18px 0 6px; animation: pulse 1s infinite alternate; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.18); } }
.tx-status { font-weight: 800; }
.tx-hash { font-family: ui-monospace, Menlo, monospace; font-size: 11px; margin-top: 8px; word-break: break-all; }

/* ---------- toasts ---------- */
.toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast {
  background: rgba(13, 20, 34, 0.96); border: 1px solid var(--card-border);
  border-left: 3px solid var(--cyan);
  color: var(--txt); font-size: 13.5px; font-weight: 600;
  border-radius: 10px; padding: 10px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toast-in .25s ease; text-align: center;
}
.toast-warn { border-left-color: var(--gold); }
.toast-success { border-left-color: var(--green); }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .4s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- confetti overlay ---------- */
.confetti {
  position: fixed; inset: 0; z-index: 300;
  pointer-events: none; width: 100vw; height: 100dvh;
}

/* ---------- lobby extras: live feed + race ---------- */
.lobby-extras {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 14px; margin-top: 26px; align-items: start;
}
.feed-list { display: flex; flex-direction: column; gap: 5px; max-height: 300px; overflow-y: auto; }
.feed-row {
  display: grid; grid-template-columns: minmax(70px, 1fr) minmax(80px, 1.2fr) auto auto auto;
  gap: 8px; align-items: center;
  font-size: 12.5px; padding: 6px 10px; border-radius: 9px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--card-border);
  animation: feed-in .25s ease;
}
@keyframes feed-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.feed-row.you { border-color: rgba(255, 213, 74, 0.5); background: rgba(255, 213, 74, 0.07); }
.feed-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-game { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-bet { color: var(--muted); font-variant-numeric: tabular-nums; }
.feed-mult, .feed-profit { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.race-preview, .lb-list { display: flex; flex-direction: column; gap: 5px; }
.race-row {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center;
  font-size: 13px; padding: 7px 10px; border-radius: 9px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--card-border);
}
.race-row.you { border-color: rgba(255, 213, 74, 0.5); background: rgba(255, 213, 74, 0.07); }
.race-rank { font-size: 15px; text-align: center; }
.race-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-wager { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--cyan); }
.info-link { cursor: pointer; transition: border-color .15s, transform .15s; }
.info-link:hover { border-color: rgba(34, 211, 238, 0.5); transform: translateY(-2px); }

/* ---------- crash ---------- */
.cr-canvas {
  display: block; width: 100%; max-width: 460px; margin: 4px auto 10px;
  border-radius: 14px; border: 1px solid var(--card-border);
  background: #0a0e17;
}
.btn-big.cash { background: linear-gradient(135deg, #f59e0b, #f97316); color: #1a0e02; }
.cr-result { text-align: center; margin-top: 10px; font-size: 16px; font-weight: 800; min-height: 22px; }
.cr-hist { display: flex; flex-wrap: wrap; gap: 5px; }
.cr-chip {
  font-size: 11.5px; font-weight: 800; padding: 4px 8px; border-radius: 8px;
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--card-border);
}
.cr-chip.lo { color: var(--red); border-color: rgba(248, 113, 113, 0.4); }
.cr-chip.mid { color: var(--green); border-color: rgba(74, 222, 128, 0.4); }
.cr-chip.hi { color: var(--gold); border-color: rgba(255, 213, 74, 0.5); }

/* ---------- mines ---------- */
.mn-stats {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
  font-size: 13.5px; color: var(--muted); margin-bottom: 12px;
}
.mn-stats b { color: var(--txt); font-variant-numeric: tabular-nums; }
.mn-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px;
  max-width: 400px; margin: 0 auto 12px;
}
.mn-tile {
  aspect-ratio: 1; border-radius: 12px; font-size: 24px; cursor: pointer;
  background: linear-gradient(160deg, rgba(255,255,255,0.09), rgba(255,255,255,0.03));
  border: 1px solid var(--card-border);
  transition: transform .12s, border-color .12s;
}
.mn-tile:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--cyan); }
.mn-tile:disabled { cursor: default; }
.mn-tile.gem { background: rgba(74, 222, 128, 0.16); border-color: rgba(74, 222, 128, 0.55); animation: pop .3s ease; }
.mn-tile.boom { background: rgba(248, 113, 113, 0.2); border-color: rgba(248, 113, 113, 0.6); animation: shake .4s ease; }
.mn-tile.mine { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.35); opacity: 0.85; }
@keyframes shake {
  0%, 100% { transform: none; }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-3px); }
}
.mn-result { text-align: center; margin-top: 8px; font-size: 16px; font-weight: 800; min-height: 22px; }

/* ---------- auto-bet panel ---------- */
.auto-box {
  margin-top: 10px; border: 1px dashed var(--card-border); border-radius: 12px;
  padding: 10px 12px; background: rgba(0, 0, 0, 0.18);
}
.auto-box summary { cursor: pointer; font-weight: 800; font-size: 13.5px; color: var(--muted); }
.auto-box summary:hover { color: var(--txt); }
.auto-box[open] summary { margin-bottom: 10px; }
.auto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.auto-grid label {
  display: flex; flex-direction: column; gap: 3px;
  font-size: 11.5px; font-weight: 700; color: var(--muted);
}
.auto-grid label small { font-weight: 500; font-size: 10.5px; opacity: 0.8; }
.auto-grid input {
  padding: 7px 8px; font-size: 13px; font-weight: 700;
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--card-border);
  border-radius: 8px; color: var(--txt); outline: none; width: 100%;
}
.auto-grid input:focus { border-color: var(--cyan); }
.auto-toggle { margin-top: 10px; font-size: 14px; padding: 10px; }
.auto-toggle.stop { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }

/* ---------- slots win highlight ---------- */
.cell.win-cell {
  background: rgba(74, 222, 128, 0.18);
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px rgba(74, 222, 128, 0.6);
  animation: win-glow 1s ease infinite alternate;
}
@keyframes win-glow {
  from { box-shadow: inset 0 0 0 2px rgba(74, 222, 128, 0.6); }
  to { box-shadow: inset 0 0 12px 2px rgba(74, 222, 128, 0.55); }
}

/* ---------- bet history page ---------- */
.hist-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip {
  background: var(--card); border: 1px solid var(--card-border); color: var(--muted);
  border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.chip:hover { color: var(--txt); }
.chip.active { color: #06121a; background: linear-gradient(135deg, var(--cyan), #60a5fa); border-color: transparent; }
.hist-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.hist-row {
  display: grid; grid-template-columns: 48px minmax(90px, 1.2fr) auto auto auto;
  gap: 10px; align-items: center;
  font-size: 13px; padding: 7px 10px; border-radius: 9px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--card-border);
}
.hist-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.hist-game { font-weight: 700; }
.hist-bet { color: var(--muted); font-variant-numeric: tabular-nums; }
.hist-mult, .hist-profit { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- achievements & settings ---------- */
.modal-wide { max-width: 480px; }
.ach-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; }
.ach-row {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center;
  padding: 9px 10px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--card-border);
}
.ach-row.got { border-color: rgba(255, 213, 74, 0.45); background: rgba(255, 213, 74, 0.06); }
.ach-ico { font-size: 20px; text-align: center; }
.ach-txt { display: flex; flex-direction: column; }
.ach-txt small { color: var(--muted); font-size: 11.5px; }
.ach-reward { font-weight: 800; font-size: 13px; }
.set-label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.set-div { height: 1px; background: var(--card-border); margin: 14px 0; }

/* ---------- crash v2 (Aviator-style) ---------- */
.cr-histstrip {
  display: flex; gap: 5px; overflow-x: auto;
  padding: 2px 0 10px; scrollbar-width: none;
}
.cr-histstrip::-webkit-scrollbar { display: none; }
.cr-hist {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 800;
  padding: 4px 10px; border-radius: 999px;
  animation: chip-in .25s ease;
}
@keyframes chip-in { from { transform: scale(0.4); opacity: 0; } }
.cr-hist.lo { background: rgba(96, 165, 250, 0.14); color: #60a5fa; }
.cr-hist.mid { background: rgba(167, 139, 250, 0.16); color: #a78bfa; }
.cr-hist.hi { background: rgba(244, 114, 182, 0.18); color: #f472b6; }
.cr-riders {
  display: flex; flex-direction: column; gap: 4px;
  max-height: 330px; overflow-y: auto;
}
.cr-rider {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px; align-items: baseline;
  font-size: 12.5px; padding: 5px 9px; border-radius: 8px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--card-border);
  animation: feed-in .2s ease;
}
.cr-rider.you { border-color: rgba(255, 213, 74, 0.5); }
.cr-rider.cashed { border-color: rgba(74, 222, 128, 0.45); background: rgba(74, 222, 128, 0.08); }
.cr-r-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-r-bet { color: var(--muted); font-variant-numeric: tabular-nums; }
.cr-r-mult, .cr-r-win { font-weight: 800; text-align: right; min-width: 46px; font-variant-numeric: tabular-nums; }
.btn-big.bet-green { background: linear-gradient(135deg, #22c55e, #16a34a); color: #04170a; }
.btn-big.cancel { background: transparent; border: 1px solid rgba(248, 113, 113, 0.5); color: var(--red); }

/* ---------- touch & press feedback (casino-standard responsiveness) ---------- */
button { touch-action: manipulation; }
.btn:active:not(:disabled), .qbtn:active, .seg:active, .icon-btn:active,
.mn-tile:active:not(:disabled), .chip:active, .tab:active { transform: scale(0.96); }
.btn-big:active:not(:disabled) { transform: scale(0.98); filter: brightness(1.15); }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  /* minmax(0,·) everywhere: plain `1fr` keeps an automatic content minimum
     and long feed rows / hash codes blow out the 375px viewport */
  .game-wrap { grid-template-columns: minmax(0, 1fr); }
  .lobby-extras { grid-template-columns: minmax(0, 1fr); }
  .topbar { padding: 10px 10px 12px; gap: 6px; }
  .brand-name { display: none; }
  .balance-chip { padding: 6px 10px; font-size: 13px; }
  .wallet-btn { padding: 7px 10px; font-size: 12px; }
  .cell { height: 52px; font-size: 30px; }
  .roll-num { font-size: 52px; }
  .bj-label { width: 46px; }
  .card { width: 50px; height: 70px; }
  .mn-tile { font-size: 20px; }
  .cr-canvas { max-width: 100%; }
  .feed-row {
    grid-template-columns: minmax(58px, 1fr) minmax(64px, 1.1fr) auto auto auto;
    font-size: 11.5px; gap: 6px;
  }
}
