*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root {
  --bg: #07090d;
  --card: rgba(7, 9, 14, 0.98);
  --card-border: rgba(255,255,255,0.08);
  --elevated: rgba(255,255,255,0.025);
  --elevated-border: rgba(255,255,255,0.06);
  --text: #ffffff;
  --text-dim: rgba(255,255,255,0.65);
  --text-muted: rgba(255,255,255,0.35);
  
  --gold: #fde8a2;
  --gold-dim: rgba(154, 110, 11, 0.2);
  --gold-border: rgba(237, 196, 79, 0.34);
  
  --silver: #eef4fb;
  --silver-dim: rgba(121, 133, 151, 0.16);
  --silver-border: rgba(184, 198, 214, 0.32);
  
  --green: #34d399;
  --red: #f87171;
  
  --app-radius: 8px;
  --app-radius-lg: 12px;
}

html { scrollbar-color: rgba(255,255,255,0.12) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width:5px }
::-webkit-scrollbar-track { background:transparent }
::-webkit-scrollbar-thumb { border-radius:5px; background:rgba(255,255,255,0.12) }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Background - No glow */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background: var(--bg);
  pointer-events: none;
}

/* ---- SIDEBAR ---- */
:root {
  --sb-collapsed: 68px;
  --sb-expanded: 220px;
  --nav-h: 6rem;
}

.sidebar {
  position: fixed; top: var(--nav-h); left: 0; bottom: 0; z-index: 40;
  width: var(--sb-collapsed);
  display: flex; flex-direction: column;
  padding: 0.75rem 0;
  background: rgba(7, 9, 14, 0.98);
  border-right: 1px solid rgba(255,255,255,0.06);
  overflow-x: hidden; overflow-y: auto;
  transition: width 250ms cubic-bezier(0.22, 1, 0.36, 1);
}
.sidebar.expanded { width: var(--sb-expanded); }

/* toggle button */
.sb-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; flex-shrink: 0;
  background: transparent; border: none;
  border-radius: 8px; cursor: pointer;
  color: var(--text-muted);
  transition: all 160ms ease;
}
.sb-toggle:hover { color: #fff; background: rgba(255,255,255,0.06); }
.sb-toggle svg { width: 1.25rem; height: 1.25rem; }

/* sections */
.sb-section { padding: 0.35rem 0; }

/* section head row — holds label + toggle when present */
.sb-section-head {
  display: flex; align-items: center; justify-content: center;
  padding: 0.5rem 0 0.4rem;
}
/* hide the label completely when collapsed so it can't affect centering */
.sb-section-head .sb-section-label {
  display: none;
}
.sidebar.expanded .sb-section-head {
  justify-content: space-between;
  padding: 0.5rem 0.75rem 0.4rem 1.25rem;
}
.sidebar.expanded .sb-section-head .sb-section-label {
  display: block;
}

/* section labels */
.sb-section-label {
  font-size: 0.6rem; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.12em;
  padding: 0.4rem 1.25rem;
  white-space: nowrap;
  opacity: 0; height: 0; overflow: hidden;
  transition: opacity 200ms ease, height 200ms ease;
}
.sidebar.expanded .sb-section-label {
  opacity: 1; height: auto;
}
/* the MENU label is bigger */
.sb-section-label--menu {
  font-size: 0.8rem; letter-spacing: 0.18em;
  color: var(--text-dim);
  padding: 0;
}
.sidebar.expanded .sb-section-label--menu {
  height: auto; opacity: 1;
}

/* nav items */
.sb-item {
  display: flex; align-items: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.85rem; font-weight: 600;
  white-space: nowrap;
  transition: all 160ms ease;
  justify-content: center;
  padding: 0.7rem 0;
}
.sidebar.expanded .sb-item {
  gap: 0.75rem;
  justify-content: flex-start;
  padding: 0.6rem 1.25rem;
  border-left: 3px solid transparent;
}
.sb-item svg {
  width: 1.3rem; height: 1.3rem; flex-shrink: 0;
}
.sb-label {
  display: none;
}
.sidebar.expanded .sb-label {
  display: inline;
}
.sb-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.sb-item.active {
  color: var(--gold);
  background: rgba(253, 232, 162, 0.08);
}
.sidebar.expanded .sb-item.active {
  border-left-color: var(--gold);
  background: rgba(253, 232, 162, 0.04);
}

/* ---- NAV ---- */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center;
  height: var(--nav-h); padding: 0 1.5rem 0 0;
  background: rgba(7, 9, 14, 0.92);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-burger {
  display: none;
  align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem;
  background: transparent; border: none;
  border-radius: 8px; cursor: pointer;
  color: var(--text-muted);
  transition: all 160ms ease;
}
.nav-burger:hover { color: #fff; background: rgba(255,255,255,0.06); }
.nav-burger svg { width: 1.2rem; height: 1.2rem; }

.nav-logo {
  display: flex; align-items: center;
  margin-right: auto;
  padding-left: 1.25rem;
}
.nav-logo img {
  height: 110px; width: auto; display: block;
}

/* ---- BALANCE & DROPDOWN ---- */
.nav-bal-wrap { position: relative; margin-left: auto; }
.nav-bal {
  position: relative; overflow: visible;
  display: flex; align-items: center; gap: 0.5rem;
  height: 2.3rem; padding: 0 0.6rem 0 0.8rem;
  border-radius: 8px;
  background: var(--elevated);
  border: 1px solid var(--elevated-border);
  font-size: 0.85rem; font-weight: 700; color: #fff;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease;
}
.nav-bal:hover, .nav-bal-wrap.open .nav-bal {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
}
.chevron {
  width: 1rem; height: 1rem;
  color: var(--text-muted);
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-bal-wrap.open .chevron {
  transform: rotate(180deg);
}

.bal-popup {
  position: absolute;
  left: 50%; top: 0;
  transform: translateX(-50%) translateY(0);
  font-size: 0.8rem; font-weight: 800;
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
  z-index: 200;
}
.bal-popup.pop {
  animation: balFloat 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.bal-popup.win { color: var(--green); }
.bal-popup.lose { color: var(--red); }

@keyframes balFloat {
  0% { opacity: 0; transform: translateX(-50%) translateY(0); }
  15% { opacity: 1; transform: translateX(-50%) translateY(-8px); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-40px); }
}

.balance-dropdown {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  width: 160px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.4rem;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 220ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 100;
}
.nav-bal-wrap.open .balance-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-btn {
  display: block; width: 100%; text-align: left;
  padding: 0.7rem 0.9rem;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-dim);
  font: 600 0.85rem/1 'Inter', sans-serif;
  cursor: pointer;
  transition: all 150ms ease;
}
.dropdown-btn:hover {
  background: rgba(255,255,255,0.05);
  color: #fff;
}
.dropdown-btn.deposit {
  color: var(--green);
}
.dropdown-btn.deposit:hover {
  background: rgba(52, 211, 153, 0.1);
}

.crypto-icon {
  width: 1.1rem; height: 1.1rem;
  object-fit: contain;
}

/* ---- LAYOUT ---- */
main {
  display: flex; flex-direction: column; align-items: center;
  min-height: 100vh;
  padding: calc(var(--nav-h) + 1.5rem) 2rem 4rem 2rem;
  gap: 1.25rem;
  margin-left: var(--sb-collapsed);
  width: calc(100% - var(--sb-collapsed));
  transition: margin-left 250ms cubic-bezier(0.22, 1, 0.36, 1), width 250ms cubic-bezier(0.22, 1, 0.36, 1);
}
body.sb-open main {
  margin-left: var(--sb-expanded);
  width: calc(100% - var(--sb-expanded));
}

.game-layout {
  display: flex;
  gap: 1.25rem;
  width: 100%;
  max-width: 1100px;
  align-items: center;
}

.game-right {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ---- SCENE ---- */
#scene-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--app-radius-lg) var(--app-radius-lg) 0 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-bottom: none;
  box-shadow: 0 18px 54px rgba(0,0,0,0.42);
  transition: border-color 0.5s ease;
}
#scene-wrap canvas { display: block; width: 100%; height: 100%; outline: none; -webkit-tap-highlight-color: transparent; }

.result-banner {
  position: absolute; bottom: 1.2rem; left: 50%; transform: translateX(-50%) translateY(10px);
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  font-size: 0.85rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.22,1,0.36,1);
  z-index: 5;
}
.result-banner.visible {
  opacity: 1; transform: translateX(-50%) translateY(0);
}
.result-banner.heads {
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  color: var(--gold);
}
.result-banner.tails {
  background: var(--silver-dim);
  border: 1px solid var(--silver-border);
  color: var(--silver);
}

.result-badge {
  position: absolute; top: 1rem; right: 1rem;
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.75rem; font-weight: 700;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  transform: translateY(-5px);
}
.result-badge.visible { opacity: 1; transform: translateY(0); }
.result-badge.win {
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.25);
  color: var(--green);
}
.result-badge.lose {
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: var(--red);
}

/* ---- CONTROLS ---- */
.controls {
  width: 280px;
  flex-shrink: 0;
  padding: 1.25rem;
  border-radius: var(--app-radius-lg);
  display: flex; flex-direction: column; gap: 1rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: 0 18px 54px rgba(0,0,0,0.42);
}

.pick-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.pick-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  height: 3.2rem;
  border: 1px solid var(--elevated-border);
  border-radius: var(--app-radius);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  font: 700 0.85rem/1 'Inter', sans-serif;
  cursor: pointer;
  transition: all 180ms ease;
  outline: none;
}
.pick-btn:hover {
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.04);
  color: var(--text);
}
.pick-btn.active-heads {
  border-color: var(--gold-border);
  background: var(--gold-dim);
  color: var(--gold);
}
.pick-btn.active-tails {
  border-color: var(--silver-border);
  background: var(--silver-dim);
  color: var(--silver);
}

.coin-dot {
  width: 1.35rem; height: 1.35rem;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.7rem; font-weight: 900; line-height: 1;
}
.coin-dot.g { background: #fde8a2; color: #5c3b1f; }
.coin-dot.s { background: #eef4fb; color: #1e2530; }

.bet-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.bet-wrap {
  flex: 1; display: flex; align-items: center; gap: 0.4rem;
  height: 3rem;
  border: 1px solid var(--elevated-border);
  border-radius: var(--app-radius);
  background: rgba(0,0,0,0.2);
  padding-left: 0.8rem;
  transition: border-color 180ms ease;
}
.bet-wrap:focus-within { 
  border-color: rgba(255,255,255,0.25); 
}
.bet-wrap input {
  width: 100%; height: 100%;
  border: none; background: transparent; color: #fff;
  font: 600 0.9rem/1 'Inter', sans-serif;
  padding: 0 0.5rem; outline: none;
  font-variant-numeric: tabular-nums;
}
.bet-wrap input::placeholder { color: var(--text-muted); }
.bet-wrap input::-webkit-outer-spin-button,
.bet-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; }
.bet-wrap input[type=number] { -moz-appearance: textfield; }

.multi { display: flex; gap: 0.4rem; }
.multi button {
  height: 3rem; padding: 0 0.8rem;
  border: 1px solid var(--elevated-border);
  border-radius: var(--app-radius);
  background: var(--elevated);
  color: var(--text-dim);
  font: 700 0.75rem/1 'Inter', sans-serif;
  cursor: pointer;
  transition: all 180ms ease;
}
.multi button:hover {
  border-color: rgba(255,255,255,0.15);
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 0.2rem;
  font-size: 0.8rem;
}
.info-row .label { color: var(--text-muted); font-weight: 500; }
.info-row .val { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 0.4rem; }

.flip-btn {
  height: 3.2rem;
  border: none;
  border-radius: var(--app-radius);
  background: #34d399;
  color: #052e16;
  font: 800 0.95rem/1 'Inter', sans-serif;
  cursor: pointer;
  transition: all 180ms ease;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.flip-btn:hover:not(:disabled) { 
  background: #10b981; 
  transform: translateY(-1px); 
}
.flip-btn:active:not(:disabled) { transform: scale(0.98); }
.flip-btn:disabled { 
  background: var(--elevated); 
  color: var(--text-muted); 
  cursor: default; 
}

/* ---- HISTORY (shared) ---- */
@keyframes chipPop {
  from { opacity:0; transform: scale(0.6) translateY(4px); }
  to { opacity:1; transform: scale(1) translateY(0); }
}

/* ---- COINFLIP HISTORY ---- */
.history {
  width: 100%;
  padding: 0.9rem 1.25rem;
  border-radius: 0 0 var(--app-radius-lg) var(--app-radius-lg);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-top: none;
}
.history-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.6rem;
}
.history-title {
  font-size: 0.75rem; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.history-count {
  font-size: 0.7rem; color: var(--text-muted); font-weight: 600;
}
.history-list {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.history-list::-webkit-scrollbar { height: 3px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
.history-empty { color: var(--text-muted); font-size: 0.8rem; font-weight: 500; }

.cf-hist-item {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.65rem 0.4rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--elevated-border);
  background: rgba(255,255,255,0.02);
  animation: chipPop 0.2s cubic-bezier(0.22,1,0.36,1) both;
}
.cf-hist-item.cf-hw {
  border-color: rgba(52, 211, 153, 0.2);
  background: rgba(52, 211, 153, 0.04);
}
.cf-hist-item.cf-hl {
  border-color: rgba(248, 113, 113, 0.15);
  background: rgba(248, 113, 113, 0.03);
}
.cf-hist-side {
  font-size: 0.65rem; font-weight: 800;
  white-space: nowrap;
}
.cf-hw .cf-hist-side { color: var(--gold); }
.cf-hl .cf-hist-side { color: var(--silver); }
.cf-hist-dot {
  width: 0.45rem; height: 0.45rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.cf-hw .cf-hist-dot { background: var(--green); }
.cf-hl .cf-hist-dot { background: var(--red); }
.cf-hist-amt {
  font-size: 0.7rem; font-weight: 700;
  white-space: nowrap;
}
.cf-hw .cf-hist-amt { color: var(--green); }
.cf-hl .cf-hist-amt { color: var(--red); }

/* ---- CASHIER MODAL (GLASSMORPHISM) ---- */
.cashier-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; justify-content: center; align-items: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s 0.4s;
}
.cashier-overlay.open { opacity: 1; pointer-events: auto; visibility: visible; transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s 0s; }

.cashier-modal {
  width: 100%; max-width: 440px; margin: 0 1rem;
  background: rgba(12, 15, 22, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.1);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  position: relative;
}
.cashier-overlay.open .cashier-modal { transform: translateY(0) scale(1); }

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.modal-header h2 { font-size: 1.1rem; font-weight: 800; color: #fff; margin: 0; }
.close-btn {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 1.8rem; line-height: 1; cursor: pointer; transition: color 0.2s;
  padding: 0.25rem 0.5rem; border-radius: 8px;
}
.close-btn:hover { color: #fff; background: rgba(255,255,255,0.05); }

.modal-body { position: relative; padding: 1.5rem; min-height: 380px; }
.modal-step {
  position: absolute; inset: 0; padding: 1.5rem;
  opacity: 0; pointer-events: none;
  transform: translateX(20px);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1;
}
.modal-step.active {
  opacity: 1; pointer-events: auto;
  transform: translateX(0);
  position: relative; padding: 0;
  z-index: 2;
}
.modal-step.slide-left { transform: translateX(-20px); }

.rate-info { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 1.2rem; text-align: center; }
.rate-info strong { color: var(--green); }

.crypto-grid { display: flex; flex-direction: column; gap: 0.6rem; }
.crypto-card {
  display: flex; align-items: center; gap: 1rem;
  width: 100%; padding: 1rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px; cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  color: #fff; font-size: 0.95rem; font-weight: 600; text-align: left;
}
.crypto-card:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.crypto-card img, .crypto-card svg { width: 24px; height: 24px; object-fit: contain; }

.pay-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.back-btn { background: transparent; border: none; color: var(--text-dim); font-size: 0.85rem; cursor: pointer; transition: color 0.2s; font-weight: 600; padding: 0; }
.back-btn:hover { color: #fff; }
.selected-crypto { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.9rem; }

.qr-placeholder {
  width: 140px; height: 140px; margin: 0 auto 1rem;
  background: #fff; border-radius: 8px; padding: 0.5rem;
  display: flex; justify-content: center; align-items: center;
}
.qr-placeholder svg { width: 100%; height: 100%; color: #000; }

.address-box {
  background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 0.75rem; text-align: center; margin-bottom: 1rem;
}
.addr-label { display: block; font-size: 0.7rem; color: var(--text-muted); margin-bottom: 0.4rem; text-transform: uppercase; letter-spacing: 0.05em; }
.addr-string { font-family: monospace; color: #fff; font-size: 0.85rem; word-break: break-all; }

.input-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.input-group label { font-size: 0.75rem; color: var(--text-dim); font-weight: 600; }
.input-group input {
  width: 100%; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; padding: 0.8rem; color: #fff; font-size: 0.9rem; font-family: 'Inter', sans-serif;
  transition: border-color 0.2s; outline: none;
}
.input-group input:focus { border-color: var(--green); }
.mt-15 { margin-top: 1.5rem; }

.amount-input-wrap { position: relative; }
.fiat-equiv { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--green); font-size: 0.85rem; font-weight: 600; pointer-events: none; }

.confirm-btn {
  width: 100%; padding: 0.9rem;
  background: var(--green); color: #052e16; border: none; border-radius: 8px;
  font-weight: 800; font-size: 0.95rem; cursor: pointer; transition: all 0.2s; margin-top: 0.5rem;
}
.confirm-btn:hover { background: #10b981; transform: translateY(-1px); }
.confirm-btn:active { transform: scale(0.98); }

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); z-index: 55; }
  .sidebar.expanded { transform: translateX(0); }
  .nav-burger { display: flex; margin-right: 0.5rem; }
  .nav-logo { padding-left: 0.5rem; }
  nav { padding: 0 1rem; }
  main { margin-left: 0; width: 100%; padding: calc(var(--nav-h) + 1rem) 1rem 2rem; }
  body.sb-open main { margin-left: 0; width: 100%; }
  .game-layout { flex-direction: column; max-width: none; }
  .controls { width: 100%; }
}

/* ---- GAME SECTIONS ---- */
.game-section { display: none; width: 100%; max-width: 1100px; }
.game-section.active { display: block; }

/* ---- BLACKJACK ---- */
.bj-scene-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: var(--app-radius-lg) var(--app-radius-lg) 0 0;
  overflow: hidden;
  background: #080c12;
  border: 1px solid rgba(255,255,255,0.10);
  border-bottom: none;
  box-shadow: 0 18px 54px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.05);
}
.bj-scene-wrap canvas { display: block; width: 100%; height: 100%; }

/* Score display */
.bj-score-display {
  display: flex;
  align-items: center;
  gap: 0;
  border-radius: var(--app-radius);
  border: 1px solid var(--elevated-border);
  background: rgba(0,0,0,0.2);
  overflow: hidden;
}
.bj-score-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.7rem 0.5rem;
  gap: 0.25rem;
}
.bj-score-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.bj-score-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.bj-score-divider {
  width: 1px;
  height: 2.5rem;
  background: var(--elevated-border);
}

/* Action buttons grid */
.bj-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.bj-btn {
  height: 3.2rem;
  border: none;
  border-radius: var(--app-radius);
  font: 700 0.85rem/1 'Inter', sans-serif;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: all 160ms ease;
}
.bj-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.1); }
.bj-btn:active:not(:disabled) { transform: scale(0.97); }
.bj-btn:disabled { opacity: 0.25; cursor: default; filter: saturate(0.3); }

.bj-btn-hit { background: #34d399; color: #052e16; }
.bj-btn-stand { background: #fbbf24; color: #422006; }
.bj-btn-double { background: #60a5fa; color: #0c2d5e; }
.bj-btn-split { background: #c084fc; color: #2e1065; }

.bj-result-banner.bj-win {
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: var(--green);
}
.bj-result-banner.bj-lose {
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--red);
}
.bj-result-banner.bj-push {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fbbf24;
}
.bj-result-banner.bj-blackjack {
  background: rgba(253, 232, 162, 0.15);
  border: 1px solid var(--gold-border);
  color: var(--gold);
}

/* BJ History */
.bj-history {
  width: 100%;
  padding: 0.9rem 1.25rem;
  border-radius: 0 0 var(--app-radius-lg) var(--app-radius-lg);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-top: none;
}
.bj-history-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.6rem;
}
.bj-history-title {
  font-size: 0.75rem; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.bj-history-count {
  font-size: 0.7rem; color: var(--text-muted); font-weight: 600;
}
.bj-history-scroll {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.bj-history-scroll::-webkit-scrollbar { height: 3px; }
.bj-history-scroll::-webkit-scrollbar-track { background: transparent; }
.bj-history-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
.bj-history-empty { color: var(--text-muted); font-size: 0.8rem; font-weight: 500; }

.bj-hist-card {
  flex-shrink: 0;
  width: 160px;
  padding: 0.65rem 0.75rem;
  border-radius: var(--app-radius);
  border: 1px solid var(--elevated-border);
  background: rgba(255,255,255,0.015);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: chipPop 0.25s cubic-bezier(0.22,1,0.36,1) both;
}
.bj-hist-card.bj-hw {
  border-color: rgba(52, 211, 153, 0.2);
  background: rgba(52, 211, 153, 0.03);
}
.bj-hist-card.bj-hl {
  border-color: rgba(248, 113, 113, 0.15);
  background: rgba(248, 113, 113, 0.025);
}
.bj-hist-card.bj-hp {
  border-color: rgba(251, 191, 36, 0.15);
  background: rgba(251, 191, 36, 0.025);
}

.bj-hist-top {
  display: flex; justify-content: space-between; align-items: center;
}
.bj-hist-result {
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
}
.bj-hw .bj-hist-result { color: var(--green); }
.bj-hl .bj-hist-result { color: var(--red); }
.bj-hp .bj-hist-result { color: #fbbf24; }

.bj-hist-amount {
  font-size: 0.7rem; font-weight: 700;
  display: flex; align-items: center; gap: 0.2rem;
}
.bj-hw .bj-hist-amount { color: var(--green); }
.bj-hl .bj-hist-amount { color: var(--red); }
.bj-hp .bj-hist-amount { color: #fbbf24; }
.bj-hist-amount img { width: 0.55rem; height: 0.55rem; }

/* Mini cards row */
.bj-hist-hand {
  display: flex;
  gap: 0.2rem;
  align-items: center;
}
.bj-hist-hand-label {
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 1.1rem;
  flex-shrink: 0;
}
.bj-hist-mini {
  width: 1.4rem; height: 1.9rem;
  border-radius: 2.5px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
.bj-hist-mini-rank {
  font-size: 0.5rem;
  font-weight: 800;
}
.bj-hist-mini-suit {
  font-size: 0.45rem;
  line-height: 1;
}
.bj-hist-mini.red .bj-hist-mini-rank,
.bj-hist-mini.red .bj-hist-mini-suit { color: #cc1a1a; }
.bj-hist-mini.black .bj-hist-mini-rank,
.bj-hist-mini.black .bj-hist-mini-suit { color: #1a1a2e; }

.bj-hist-vs {
  font-size: 0.5rem;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0 0.15rem;
}

@media (max-width: 480px) {
  .nav-logo img { height: 48px; }
  .controls { padding: 1rem; }
  .pick-btn { height: 2.8rem; }
  .bet-wrap, .multi button, .flip-btn { height: 2.8rem; }
}
