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

:root {
  --bg: #070a10;
  --card: rgba(10, 14, 25, 0.96);
  --card-border: rgba(255,255,255,0.09);
  --elevated: rgba(255,255,255,0.04);
  --elevated-border: rgba(255,255,255,0.08);
  --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: 12px;
  --app-radius-lg: 18px;
  --surface-grad: linear-gradient(180deg, rgba(17, 22, 39, 0.96), rgba(8, 11, 21, 0.98));
  --surface-grad-soft: linear-gradient(180deg, rgba(18, 23, 40, 0.92), rgba(9, 13, 25, 0.94));
  --soft-shadow: 0 16px 42px rgba(2, 6, 16, 0.28);
  --soft-shadow-sm: 0 10px 24px rgba(2, 6, 16, 0.22);
}

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:
    radial-gradient(circle at 18% 0%, rgba(52, 211, 153, 0.045), transparent 30rem),
    radial-gradient(circle at 100% 10%, rgba(92, 130, 255, 0.035), transparent 28rem),
    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;
  padding-left: 1.25rem;
  flex-shrink: 0;
}
.nav-logo img {
  height: 110px; width: auto; display: block;
}
.nav-center {
  flex: 1; display: flex; justify-content: center; align-items: center;
}
.nav-right {
  display: flex; align-items: center; gap: 0.4rem;
  flex-shrink: 0;
}
.nav-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 2.2rem; height: 2.2rem;
  background: transparent; border: none; border-radius: 8px;
  color: var(--text-muted); cursor: pointer;
  transition: all 150ms;
}
.nav-icon-btn:hover { color: #fff; background: rgba(255,255,255,0.06); }
.nav-profile-wrap {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.1rem; cursor: pointer; padding: 0.15rem 0.3rem;
  border-radius: 8px; transition: background 150ms;
}
.nav-profile-wrap:hover { background: rgba(255,255,255,0.06); }
.nav-pfp-ring-wrap {
  position: relative; width: 2.25rem; height: 2.25rem;
}
.nav-pfp-ring {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.nav-pfp-img {
  position: absolute;
  top: 3px; left: 3px;
  width: calc(100% - 6px); height: calc(100% - 6px);
  border-radius: 50%; object-fit: cover;
  background: #1a1f2e;
}
.nav-lvl {
  font-size: 0.45rem; font-weight: 800; letter-spacing: 0.04em;
  color: #fbbf24; line-height: 1;
}

/* Level Up Toast */
.lvlup-toast {
  position: fixed; top: -3rem; right: 1.2rem; z-index: 9999;
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  transition: top 0.35s cubic-bezier(0.22,1,0.36,1);
  pointer-events: none;
}
.lvlup-toast.show { top: calc(var(--nav-h) + 0.5rem); }
.lvlup-arrow {
  color: var(--green);
  display: flex; align-items: center;
}
.lvlup-label {
  font-size: 0.72rem; font-weight: 700; color: #fff;
}

/* ---- BALANCE & DROPDOWN ---- */
.nav-bal-wrap { position: relative; }
.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);
  margin-right: var(--chat-w, 320px);
  width: calc(100% - var(--sb-collapsed) - var(--chat-w, 320px));
  transition: margin-left 250ms cubic-bezier(0.22, 1, 0.36, 1), margin-right 300ms cubic-bezier(0.22, 1, 0.36, 1), width 300ms cubic-bezier(0.22, 1, 0.36, 1);
}
body.sb-open main {
  margin-left: var(--sb-expanded);
  width: calc(100% - var(--sb-expanded) - var(--chat-w, 320px));
}
body.chat-closed main {
  margin-right: 0;
  width: calc(100% - var(--sb-collapsed));
}
body.sb-open.chat-closed main {
  width: calc(100% - var(--sb-expanded));
}

.game-layout {
  display: flex;
  gap: 1.25rem;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  justify-content: center;
  align-items: flex-start;
}

.game-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.game-panel-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  background: linear-gradient(180deg, rgba(15, 18, 32, 0.98), rgba(9, 11, 22, 0.98));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  box-shadow: 0 20px 52px rgba(4, 7, 18, 0.42);
}

.game-panel-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.01em;
}

.game-panel-mark {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 12px;
  color: var(--green);
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.game-panel-mark svg {
  width: 1.3rem;
  height: 1.3rem;
}

.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; margin-right: 0; width: 100%; padding: calc(var(--nav-h) + 1rem) 1rem 2rem; }
  body.sb-open main { margin-left: 0; width: 100%; }
  body.chat-closed main { margin-right: 0; width: 100%; }
  .game-layout { flex-direction: column; max-width: none; }
  .game-panel-head { padding: 1rem 1.1rem; }
  .game-panel-title { font-size: 1rem; }
  .game-panel-mark { width: 2.8rem; height: 2.8rem; }
  .controls { width: 100%; }
  #dice-scene-wrap { aspect-ratio: 4 / 3; }
}

/* ---- GAME SECTIONS ---- */
.game-section { display: none; width: 100%; max-width: 1180px; margin: 0 auto; }
.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-result-banner {
  top: 0.8rem;
  bottom: auto;
  padding: 0;
  border: none;
  background: transparent !important;
  font-size: 1.1rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.bj-result-banner.bj-push,
.bj-result-badge.bj-push {
  color: #fbbf24;
}

.bj-result-badge.bj-push {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.22);
}

.bj-result-banner.bj-blackjack,
.bj-result-badge.bj-blackjack {
  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; }
}

/* ---- HOME PAGE ---- */
.home-wrap {
  width: 100%; max-width: 1100px;
  display: flex; flex-direction: column; gap: 0.75rem;
}

/* News Ticker */
.news-ticker-wrap {
  display: flex; align-items: stretch;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
}
.news-ticker-label {
  display: flex; align-items: center;
  padding: 0.55rem 0.9rem;
  background: var(--red);
  font-size: 0.6rem; font-weight: 900; color: #fff;
  letter-spacing: 0.12em; white-space: nowrap; flex-shrink: 0;
}
.news-ticker-track {
  flex: 1; overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 30px, #000 calc(100% - 30px), transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30px, #000 calc(100% - 30px), transparent);
}
.news-ticker-content {
  display: flex; align-items: center; gap: 0.8rem;
  white-space: nowrap;
  animation: tickerScroll 35s linear infinite;
  padding: 0.55rem 0;
  font-size: 0.78rem; color: var(--text-dim); font-weight: 500;
}
.news-ticker-content:hover { animation-play-state: paused; }
.news-item.hl { color: #fbbf24; font-weight: 700; }
.news-sep { color: rgba(255,255,255,0.15); font-size: 0.7rem; font-weight: 300; }
@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Hero tournament */
.h-hero {
  position: relative; overflow: hidden;
  border-radius: var(--app-radius-lg);
  padding: 2rem 2.2rem;
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid rgba(251,191,36,0.24);
  transition: border-color 200ms;
  box-shadow: 0 18px 48px rgba(251, 191, 36, 0.08), var(--soft-shadow-sm);
}
.h-hero:hover { border-color: rgba(251,191,36,0.38); }
.h-hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 64% 110% at 8% 48%, rgba(251,191,36,0.24) 0%, transparent 72%),
    radial-gradient(ellipse 46% 84% at 92% 26%, rgba(245,158,11,0.14) 0%, transparent 62%),
    linear-gradient(135deg, rgba(251, 191, 36, 0.09), transparent 48%),
    var(--card);
}
.h-hero-content { position: relative; z-index: 1; }
.h-hero-eyebrow {
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.15em;
  color: #fde68a; margin-bottom: 0.5rem;
  text-shadow: 0 0 14px rgba(251, 191, 36, 0.2);
}
.h-hero-big {
  font-size: 2rem; font-weight: 900; color: #fff;
  line-height: 1.1; margin-bottom: 0.5rem;
  display: flex; align-items: center; gap: 0.4rem;
}
.h-hero-coin { width: 1.8rem; height: 1.8rem; }
.h-hero-cta {
  font-size: 0.78rem; color: var(--text-muted); font-weight: 600;
}
.h-hero-right {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: flex-end; gap: 1rem;
}
.h-hero-stats { display: flex; gap: 1.5rem; }
.h-hero-stat { display: flex; flex-direction: column; align-items: center; }
.h-hero-stat-val { font-size: 1.3rem; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }
.h-hero-stat-lbl { font-size: 0.6rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.h-hero-join {
  padding: 0.55rem 1.6rem; border: none; border-radius: 6px;
  background: linear-gradient(135deg, #fde68a, #fbbf24 56%, #f59e0b); color: #422006;
  font: 800 0.8rem/1 'Inter', sans-serif;
  cursor: pointer; transition: all 150ms;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 26px rgba(251, 191, 36, 0.16);
}
.h-hero-join:hover { background: #f59e0b; transform: translateY(-1px); }

/* Rakeback card */
.h-rake-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.4rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--app-radius-lg);
  cursor: pointer; transition: all 180ms;
  border-left: 3px solid var(--green);
}
.h-rake-card:hover { background: rgba(52,211,153,0.03); border-color: rgba(52,211,153,0.15); border-left-color: var(--green); }
.h-rake-left { display: flex; flex-direction: column; gap: 0.3rem; }
.h-rake-head { display: flex; align-items: center; gap: 0.6rem; }
.h-rake-title {
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.12em;
  color: var(--text-muted);
}
.h-rake-pct {
  font-size: 1.1rem; font-weight: 900; color: var(--green);
}
.h-rake-desc {
  font-size: 0.72rem; color: var(--text-muted); font-weight: 500;
  max-width: 420px; line-height: 1.45;
}
.h-rake-right {
  display: flex; align-items: center; gap: 0.8rem;
  flex-shrink: 0;
}
.h-rake-amount {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 1.1rem; font-weight: 900; color: #fff;
  font-variant-numeric: tabular-nums;
}
.h-rake-ico { width: 1rem; height: 1rem; }
.h-rake-btn {
  padding: 0.45rem 1rem; border: none; border-radius: 5px;
  background: var(--green); color: #052e16;
  font: 800 0.65rem/1 'Inter', sans-serif;
  cursor: pointer; transition: all 150ms;
  letter-spacing: 0.06em;
}
.h-rake-btn:hover { filter: brightness(1.1); }

/* Game cards grid */
.h-games-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem;
}
.h-gcard {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--app-radius-lg);
  cursor: pointer; transition: all 160ms;
  text-align: left;
}
.h-gcard:hover { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.12); transform: translateY(-1px); }
.h-gcard-icon {
  width: 3rem; height: 3rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  color: #fff;
}
.h-gcard-info { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.h-gcard-name {
  font-size: 0.85rem; font-weight: 800; color: #fff;
  display: flex; align-items: center; gap: 0.4rem;
}
.h-gcard-live {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); display: inline-block;
}
.h-gcard-desc {
  font-size: 0.68rem; color: var(--text-muted); font-weight: 500;
  line-height: 1.35;
}
.h-gcard-off { opacity: 0.35; cursor: default; }
.h-gcard-off:hover { background: var(--card); border-color: var(--card-border); transform: none; }
.h-gcard-soon {
  font-size: 0.45rem; font-weight: 800; letter-spacing: 0.08em;
  color: var(--text-muted); background: rgba(255,255,255,0.06);
  padding: 0.12rem 0.35rem; border-radius: 3px;
  vertical-align: 1px;
}

/* Main grid */
.h-main-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.h-card {
  border-radius: var(--app-radius-lg);
  background: var(--card);
  border: 1px solid var(--card-border);
  overflow: hidden;
}
.h-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.h-card-label {
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.1em;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 0.35rem;
}
.h-card-sub {
  font-size: 0.6rem; font-weight: 600; color: var(--text-muted);
  opacity: 0.7;
}

/* Activity feed */
.activity-list {
  max-height: 420px; overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.04) transparent;
}
.activity-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  animation: chatFadeIn 0.2s ease;
  border-bottom: 1px solid rgba(255,255,255,0.02);
}
.activity-avatar {
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  flex-shrink: 0; overflow: hidden; background: #1a1f2e;
}
.activity-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.activity-info { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 0.35rem; }
.activity-user { font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.activity-game { font-size: 0.62rem; color: var(--text-muted); font-weight: 500; }
.activity-amt {
  font-size: 0.78rem; font-weight: 800; white-space: nowrap;
  display: flex; align-items: center; gap: 0.2rem;
}
.activity-amt img { width: 0.65rem; height: 0.65rem; }
.activity-amt.win { color: var(--green); }
.activity-amt.lose { color: var(--red); }
.activity-time { font-size: 0.55rem; color: var(--text-muted); font-weight: 500; white-space: nowrap; }

/* Earn / Discord */
.h-earn-list { padding: 0.7rem 0.9rem; }
.h-earn-discord {}
.h-dc-header {
  display: flex; align-items: center; gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.h-dc-title { font-size: 0.78rem; font-weight: 700; color: #5865F2; flex: 1; }
.h-dc-connect {
  padding: 0.35rem 0.8rem; border: none; border-radius: 5px;
  background: #5865F2; color: #fff;
  font: 700 0.65rem/1 'Inter', sans-serif;
  cursor: pointer; transition: all 150ms;
}
.h-dc-connect:hover { background: #4752c4; }
.h-dc-connect.connected {
  background: rgba(88,101,242,0.12); color: #5865F2;
  cursor: default;
}
.h-dc-tasks { display: flex; flex-direction: column; gap: 0.3rem; }
.h-dc-task {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  background: rgba(88,101,242,0.04);
  border-left: 2px solid rgba(88,101,242,0.2);
  transition: all 150ms;
}
.h-dc-task:hover { background: rgba(88,101,242,0.08); }
.h-dc-check {
  width: 14px; height: 14px; border-radius: 3px;
  border: 1.5px solid rgba(255,255,255,0.15);
  flex-shrink: 0; transition: all 150ms;
}
.h-dc-task.completed .h-dc-check {
  background: var(--green); border-color: var(--green);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.5 6L5 8.5L9.5 4' stroke='%23052e16' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 12px; background-position: center; background-repeat: no-repeat;
}
.h-dc-task.completed {
  border-left-color: var(--green);
  background: rgba(52,211,153,0.04);
}
.h-dc-task.completed .h-dc-name { text-decoration: line-through; color: var(--text-muted); }
.h-dc-task.completed .h-dc-reward { color: var(--text-muted); }
.h-dc-name { font-size: 0.72rem; font-weight: 600; color: var(--text-dim); flex: 1; }
.h-dc-reward {
  font-size: 0.7rem; font-weight: 800; color: var(--green);
  display: flex; align-items: center; gap: 0.2rem; flex-shrink: 0;
}
.h-dc-coin { width: 0.6rem; height: 0.6rem; }

/* Daily case at bottom of discord */
.h-dc-case {
  margin-top: 0.6rem;
  padding: 0.7rem 0.8rem;
  border-radius: 6px;
  background: rgba(251,191,36,0.04);
  border: 1px solid rgba(251,191,36,0.1);
  display: flex; align-items: center; gap: 0.8rem;
}
.h-dc-case-left { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; }
.h-dc-case-label {
  font-size: 0.55rem; font-weight: 800; letter-spacing: 0.1em; color: #fbbf24;
}
.h-dc-case-sub {
  font-size: 0.65rem; font-weight: 500; color: var(--text-muted);
  display: flex; align-items: center; gap: 0.2rem;
}
.h-dc-case-btn {
  padding: 0.4rem 0.9rem; border: none; border-radius: 5px;
  background: #fbbf24; color: #422006;
  font: 800 0.62rem/1 'Inter', sans-serif;
  cursor: pointer; transition: all 150ms;
  letter-spacing: 0.03em; white-space: nowrap; flex-shrink: 0;
}
.h-dc-case-btn:hover:not(:disabled) { background: #f59e0b; }
.h-dc-case-btn:disabled { opacity: 0.4; cursor: default; }
.h-dc-case-btn.claimed { background: #22c55e; color: #fff; }
.h-dc-case-timer {
  font-size: 0.55rem; font-weight: 600; color: var(--text-muted); white-space: nowrap;
}

/* Home responsive */
@media (max-width: 900px) {
  .h-main-grid { grid-template-columns: 1fr; }
  .h-games-grid { grid-template-columns: 1fr; }
  .h-hero-big { font-size: 1.3rem; }
  .h-hero-stats { gap: 1rem; }
  .h-rake-card { flex-direction: column; align-items: flex-start; gap: 0.8rem; }
  .h-rake-right { align-self: stretch; justify-content: space-between; }
}
@media (max-width: 480px) {
  .h-hero-right { display: none; }
  .h-hero { padding: 1.2rem 1rem; }
  .h-hero-big { font-size: 1.1rem; }
  .h-games-grid { grid-template-columns: 1fr; }
}

/* ---- TOURNAMENT / RACE ---- */
.tourney-wrap {
  width: 100%; max-width: 900px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 1.5rem;
  padding-bottom: 2rem;
}

/* Header */
.tourney-header { text-align: center; }
.tourney-title-row {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.tourney-prize {
  font-size: 2.4rem; font-weight: 900; color: var(--green);
  font-variant-numeric: tabular-nums;
}
.tourney-prize-ico { width: 2rem; height: 2rem; }
.tourney-title {
  font-size: 2.4rem; font-weight: 900; color: #fff;
}
.tourney-countdown {
  font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
  margin-top: 0.3rem;
}
.tourney-desc {
  font-size: 0.8rem; font-weight: 500; color: var(--text-muted);
  margin-top: 1rem; max-width: 600px; margin-left: auto; margin-right: auto;
  line-height: 1.5;
}

/* Podium */
.podium {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 1.2rem; padding: 1rem 0 0;
}
.podium-slot {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.4rem; position: relative;
  padding: 1.4rem 1.5rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--app-radius-lg);
  min-width: 180px;
}
.podium-1 {
  padding-bottom: 1.8rem;
  border-color: rgba(251,191,36,0.18);
  background: linear-gradient(180deg, rgba(251,191,36,0.04) 0%, var(--card) 60%);
}
.podium-avatar {
  width: 3.2rem; height: 3.2rem; border-radius: 50%;
  overflow: hidden; background: #1a1f2e;
}
.podium-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.podium-avatar-1 {
  width: 3.8rem; height: 3.8rem;
  box-shadow: 0 0 20px rgba(251,191,36,0.15);
}
.podium-rank {
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem; border-radius: 4px;
  background: rgba(255,255,255,0.06); color: var(--text-dim);
}
.podium-rank-1 {
  background: rgba(251,191,36,0.15); color: #fbbf24;
}
.podium-rank-3 {
  background: rgba(100,116,139,0.15); color: #94a3b8;
}
.podium-name {
  font-size: 0.85rem; font-weight: 700; color: #fff;
}
.podium-stat {
  font-size: 0.75rem; font-weight: 600; color: var(--text-dim);
  display: flex; align-items: center; gap: 0.25rem;
  margin-top: 0.15rem;
}
.podium-wager {
  font-size: 0.65rem; font-weight: 500; color: var(--text-muted);
  display: flex; align-items: center; gap: 0.2rem;
}
.podium-coin { width: 0.7rem; height: 0.7rem; }

/* Your stats row */
.tourney-you {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.6rem;
}
.tourney-you-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--app-radius);
  padding: 0.9rem 1rem;
  display: flex; flex-direction: column; gap: 0.35rem;
}
.tourney-you-label {
  font-size: 0.65rem; font-weight: 700; color: var(--text-muted);
}
.tourney-you-val {
  font-size: 0.9rem; font-weight: 800; color: #fff;
  display: flex; align-items: center; gap: 0.3rem;
}
.tourney-you-ico { width: 0.8rem; height: 0.8rem; }

/* Leaderboard table */
.tourney-table-wrap {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--app-radius-lg);
  overflow: hidden;
}
.tourney-table-head {
  display: flex; align-items: center;
  padding: 0.7rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.tourney-col {
  font-size: 0.6rem; font-weight: 700; color: var(--text-muted);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.tourney-col-pos { width: 80px; }
.tourney-col-player { flex: 1; }
.tourney-col-wagered { width: 180px; text-align: right; }
.tourney-col-prize { width: 140px; text-align: right; }

.tourney-row {
  display: flex; align-items: center;
  padding: 0.65rem 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.025);
  transition: background 100ms;
}
.tourney-row:hover { background: rgba(255,255,255,0.015); }
.tourney-row-you {
  background: rgba(52,211,153,0.04);
  border-left: 2px solid var(--green);
}
.tourney-row-pos {
  width: 80px;
  font-size: 0.8rem; font-weight: 800; color: var(--text-dim);
}
.tourney-row-pos-1 { color: #fbbf24; }
.tourney-row-pos-2 { color: #c0c0c0; }
.tourney-row-pos-3 { color: #cd7f32; }
.tourney-row-player {
  flex: 1; display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; font-weight: 700; color: #fff;
  min-width: 0;
}
.tourney-row-avatar {
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  overflow: hidden; background: #1a1f2e; flex-shrink: 0;
}
.tourney-row-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.tourney-row-hidden {
  color: var(--text-muted); font-weight: 600;
  display: flex; align-items: center; gap: 0.3rem;
}
.tourney-row-hidden svg { opacity: 0.5; }
.tourney-row-wagered {
  width: 180px; text-align: right;
  font-size: 0.78rem; font-weight: 700; color: var(--green);
  display: flex; align-items: center; justify-content: flex-end; gap: 0.25rem;
}
.tourney-row-prize {
  width: 140px; text-align: right;
  font-size: 0.78rem; font-weight: 700; color: var(--text-dim);
  display: flex; align-items: center; justify-content: flex-end; gap: 0.25rem;
}
.tourney-row-coin { width: 0.65rem; height: 0.65rem; }

/* Tournament responsive */
@media (max-width: 900px) {
  .podium { flex-direction: column; align-items: center; }
  .podium-slot { min-width: 80%; }
  .tourney-you { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .tourney-title-row { flex-wrap: wrap; justify-content: center; }
  .tourney-prize, .tourney-title { font-size: 1.6rem; }
  .tourney-col-wagered { width: 120px; }
  .tourney-col-prize { width: 100px; }
  .tourney-row-wagered { width: 120px; font-size: 0.7rem; }
  .tourney-row-prize { width: 100px; font-size: 0.7rem; }
}

/* ---- MODAL OVERLAY (generic) ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s 0.3s;
}
.modal-overlay.open {
  opacity: 1; pointer-events: auto; visibility: visible;
  transition: opacity 0.3s ease, visibility 0s 0s;
}

/* ---- PROFILE MODAL ---- */
.profile-modal, .settings-modal {
  position: relative;
  width: 95%; max-width: 560px;
  max-height: 85vh; overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.06) transparent;
}
.profile-close {
  position: absolute; top: 0.8rem; right: 0.8rem;
  background: none; border: none;
  color: var(--text-muted); font-size: 1.4rem;
  cursor: pointer; line-height: 1; z-index: 2;
  width: 2rem; height: 2rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.profile-close:hover { color: #fff; background: rgba(255,255,255,0.06); }

/* Profile Header */
.prof-header {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.5rem 1.5rem 0;
}
.prof-pfp-wrap {
  position: relative; cursor: pointer; flex-shrink: 0;
}
.prof-pfp {
  width: 4.5rem; height: 4.5rem; border-radius: 50%;
  position: relative;
}
.prof-pfp-ring {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.prof-pfp-img {
  position: absolute;
  top: 5px; left: 5px;
  width: calc(100% - 10px); height: calc(100% - 10px);
  object-fit: cover; border-radius: 50%;
  background: #1a1f2e;
}
.prof-pfp-edit {
  position: absolute; bottom: 0; right: -2px;
  width: 1.3rem; height: 1.3rem; border-radius: 50%;
  background: var(--elevated); border: 2px solid var(--bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.prof-pfp-wrap:hover .prof-pfp-edit { color: #fff; background: rgba(255,255,255,0.1); }
.prof-info { display: flex; flex-direction: column; gap: 0.2rem; }
.prof-name { font-size: 1.1rem; font-weight: 800; color: #fff; }
.prof-level {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.06em;
  color: #fbbf24; background: rgba(251,191,36,0.1);
  padding: 0.15rem 0.5rem; border-radius: 4px;
  width: fit-content;
}
.prof-xp-bar {
  width: 100%; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.06); overflow: hidden;
  margin-top: 0.25rem;
}
.prof-xp-bar-fill {
  height: 100%; border-radius: 2px; width: 0%;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  transition: width 0.4s ease;
}
.prof-xp-text {
  font-size: 0.55rem; color: var(--text-muted); font-weight: 600;
}

/* Stats */
.prof-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem;
  padding: 1.2rem 1.5rem;
}
.prof-stat {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.7rem 0.6rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  text-align: center;
}
.prof-stat-val {
  font-size: 0.9rem; font-weight: 800; color: #fff;
  font-variant-numeric: tabular-nums;
}
.prof-stat-label {
  font-size: 0.5rem; font-weight: 700; color: var(--text-muted);
  letter-spacing: 0.05em; text-transform: uppercase;
}

/* Anonymous Mode */
.prof-anon {
  margin: 0 1.5rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 8px;
}
.prof-anon-info { margin-bottom: 0.7rem; }
.prof-anon-title {
  font-size: 0.75rem; font-weight: 800; color: #fff;
  display: block; margin-bottom: 0.15rem;
}
.prof-anon-desc {
  font-size: 0.62rem; color: var(--text-muted); font-weight: 500;
}
.prof-anon-toggles { display: flex; flex-direction: column; gap: 0.5rem; }

/* Toggle switch */
.prof-toggle {
  display: flex; align-items: center; gap: 0.6rem; cursor: pointer;
}
.prof-toggle input { display: none; }
.prof-toggle-slider {
  width: 2rem; height: 1.1rem; border-radius: 999px;
  background: rgba(255,255,255,0.1);
  position: relative; flex-shrink: 0;
  transition: background 150ms;
}
.prof-toggle-slider::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 0.75rem; height: 0.75rem; border-radius: 50%;
  background: var(--text-muted);
  transition: transform 150ms, background 150ms;
}
.prof-toggle input:checked + .prof-toggle-slider {
  background: var(--green);
}
.prof-toggle input:checked + .prof-toggle-slider::after {
  transform: translateX(0.9rem);
  background: #fff;
}
.prof-toggle-label {
  font-size: 0.7rem; font-weight: 600; color: var(--text-dim);
}

/* History */
.prof-history {
  padding: 1.2rem 1.5rem 1.5rem;
}
.prof-history-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.6rem; flex-wrap: wrap; gap: 0.4rem;
}
.prof-history-title {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em;
  color: var(--text-muted); text-transform: uppercase;
}
.prof-filters { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.prof-filter {
  padding: 0.3rem 0.5rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 5px;
  color: var(--text-dim);
  font: 600 0.6rem/1 'Inter', sans-serif;
  cursor: pointer; outline: none;
  -webkit-appearance: none;
}
.prof-filter option {
  background: var(--bg); color: var(--text-dim);
}
.prof-history-list {
  display: flex; flex-direction: column;
  max-height: 300px; overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.04) transparent;
}
.prof-hist-row {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 0.7rem;
}
.prof-hist-row:last-child { border-bottom: none; }
.prof-hist-type {
  font-weight: 700; font-size: 0.55rem; letter-spacing: 0.04em;
  padding: 0.15rem 0.4rem; border-radius: 3px;
  text-transform: uppercase; flex-shrink: 0;
  min-width: 52px; text-align: center;
}
.prof-hist-type.wager { background: rgba(99,102,241,0.12); color: #818cf8; }
.prof-hist-type.deposit { background: rgba(52,211,153,0.12); color: var(--green); }
.prof-hist-type.withdraw { background: rgba(239,68,68,0.12); color: var(--red); }
.prof-hist-game {
  font-weight: 600; color: var(--text-muted); flex-shrink: 0; min-width: 60px;
}
.prof-hist-detail {
  flex: 1; font-weight: 600; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prof-hist-amt {
  font-weight: 800; white-space: nowrap;
  display: flex; align-items: center; gap: 0.2rem;
}
.prof-hist-amt.positive { color: var(--green); }
.prof-hist-amt.negative { color: var(--red); }
.prof-hist-amt img { width: 0.55rem; height: 0.55rem; }
.prof-hist-time {
  font-size: 0.55rem; font-weight: 500; color: var(--text-muted);
  flex-shrink: 0;
}
.prof-hist-empty {
  text-align: center; padding: 2rem;
  font-size: 0.75rem; color: var(--text-muted); font-weight: 600;
}

/* Settings modal */
.settings-modal { max-width: 380px; }
.settings-head {
  font-size: 1rem; font-weight: 800; color: #fff;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.settings-list {
  padding: 1rem 1.5rem 1.5rem;
  display: flex; flex-direction: column; gap: 0.8rem;
}

/* Profile responsive */
@media (max-width: 480px) {
  .prof-stats { grid-template-columns: repeat(2, 1fr); }
  .prof-filters { flex-direction: column; }
}

/* ---- CHAT PANEL ---- */
:root {
  --chat-w: 320px;
}

.chat-panel {
  position: fixed; top: var(--nav-h); right: 0; bottom: 0;
  width: var(--chat-w); z-index: 40;
  display: flex; flex-direction: column;
  background: rgba(7, 9, 14, 0.98);
  border-left: 1px solid rgba(255,255,255,0.06);
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}
.chat-panel.collapsed { transform: translateX(100%); }

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.chat-header-left { display: flex; align-items: center; gap: 0.75rem; }
.chat-header-right { display: flex; align-items: center; gap: 0.5rem; }
.chat-title { font-size: 0.9rem; font-weight: 800; color: #fff; }
.chat-online {
  display: flex; align-items: center; gap: 0.35rem;
  font-size: 0.7rem; font-weight: 600; color: var(--text-muted);
}
.online-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.5);
}

.rain-timer {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.7rem; font-weight: 700; color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: 6px; padding: 0.3rem 0.5rem;
}
.rain-timer svg { color: #fbbf24; }
.rain-timer.rain-soon {
  animation: rainPulse 1.5s ease-in-out infinite;
}
@keyframes rainPulse {
  0%, 100% { background: rgba(251, 191, 36, 0.08); }
  50% { background: rgba(251, 191, 36, 0.2); }
}

.chat-toggle-btn {
  display: flex;
  align-items: center; justify-content: center;
  width: 1.8rem; height: 1.8rem;
  background: transparent; border: none; border-radius: 6px;
  color: var(--text-muted); cursor: pointer; transition: all 160ms;
}
.chat-toggle-btn:hover { color: #fff; background: rgba(255,255,255,0.06); }
.chat-toggle-btn svg { width: 1rem; height: 1rem; }

/* Rain banner */
.rain-banner {
  display: flex; flex-direction: column;
  background: linear-gradient(135deg, rgba(251,191,36,0.1), rgba(245,158,11,0.06));
  border-bottom: 1px solid rgba(251,191,36,0.12);
  flex-shrink: 0;
  font-size: 0.75rem; font-weight: 600; color: #fbbf24;
}
.rain-banner-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0.75rem;
}
.rain-banner-left { display: flex; align-items: center; gap: 0.4rem; }
.rain-banner-left svg { color: #fbbf24; flex-shrink: 0; }
.rain-expand-btn {
  background: rgba(251,191,36,0.15); border: 1px solid rgba(251,191,36,0.25);
  border-radius: 5px; padding: 0.25rem 0.6rem;
  color: #fbbf24; font: 700 0.65rem/1 'Inter', sans-serif;
  cursor: pointer; transition: all 160ms;
}
.rain-expand-btn:hover { background: rgba(251,191,36,0.25); }
.rain-tip-drawer {
  display: none; padding: 0.5rem 0.75rem 0.6rem;
  border-top: 1px solid rgba(251,191,36,0.08);
  gap: 0.4rem; flex-direction: column;
}
.rain-tip-drawer.open { display: flex; }
.rain-tip-amounts {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.3rem;
}
.rain-amt-btn {
  height: 1.8rem; border: 1px solid rgba(251,191,36,0.2);
  border-radius: 5px; background: rgba(251,191,36,0.08);
  color: #fbbf24; font: 700 0.7rem/1 'Inter', sans-serif;
  cursor: pointer; transition: all 140ms;
}
.rain-amt-btn:hover { background: rgba(251,191,36,0.2); transform: translateY(-1px); }
.rain-tip-custom { display: flex; gap: 0.3rem; }
.rain-tip-input-wrap {
  flex: 1; display: flex; align-items: center; gap: 0.3rem;
  height: 1.8rem; padding: 0 0.5rem;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(251,191,36,0.15);
  border-radius: 5px;
}
.rain-tip-input-wrap input {
  width: 100%; border: none; background: transparent;
  color: #fbbf24; font: 600 0.7rem/1 'Inter', sans-serif;
  outline: none;
}
.rain-tip-input-wrap input::placeholder { color: rgba(251,191,36,0.4); }
.rain-tip-input-wrap input::-webkit-outer-spin-button,
.rain-tip-input-wrap input::-webkit-inner-spin-button { -webkit-appearance: none; }
.rain-tip-input-wrap input[type=number] { -moz-appearance: textfield; }
.rain-tip-send {
  width: 1.8rem; height: 1.8rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 5px;
  background: #fbbf24; color: #422006;
  cursor: pointer; transition: all 140ms;
}
.rain-tip-send:hover { background: #f59e0b; }

/* Messages area */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 0.75rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

/* Message styles */
.chat-msg {
  display: flex; gap: 0.5rem; align-items: flex-start;
  animation: chatFadeIn 0.2s ease;
}
@keyframes chatFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-avatar-wrap {
  position: relative; flex-shrink: 0;
  width: 2.375rem; height: 2.375rem;
}
.chat-avatar-ring {
  position: relative; width: 100%; height: 100%;
}
.chat-lvl-ring {
  position: absolute; inset: 0;
}
.chat-avatar-img {
  position: absolute;
  top: 3px; left: 3px;
  width: calc(100% - 6px); height: calc(100% - 6px);
  border-radius: 50%; object-fit: cover;
  background: #1a1f2e;
}
.chat-lvl-badge {
  position: absolute; top: -3px; right: -6px; z-index: 2;
  font-size: 0.4rem; font-weight: 800; letter-spacing: 0.03em;
  color: #fbbf24; background: #13161e;
  border: 1px solid rgba(251,191,36,0.25);
  padding: 0.05rem 0.22rem; border-radius: 3px;
  line-height: 1; white-space: nowrap;
}
.chat-msg-content { min-width: 0; flex: 1; }
.chat-msg-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; margin-bottom: 0.18rem;
}
.chat-msg-meta {
  min-width: 0;
  display: flex; align-items: baseline; gap: 0.4rem;
  flex-wrap: wrap;
}
.chat-msg-user {
  font-size: 0.75rem; font-weight: 700; cursor: pointer;
  transition: text-decoration 120ms;
}
.chat-msg-user:hover { text-decoration: underline; }
.chat-msg-time { font-size: 0.6rem; color: var(--text-muted); font-weight: 500; }
.chat-reply-btn {
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  padding: 0.15rem 0.5rem;
  font: 700 0.62rem/1 'Inter', sans-serif;
  cursor: pointer;
  transition: all 150ms ease;
}
.chat-reply-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
}
.chat-msg-reply {
  margin-bottom: 0.28rem;
  padding: 0.35rem 0.45rem;
  border-left: 2px solid rgba(52, 211, 153, 0.4);
  border-radius: 0 6px 6px 0;
  background: rgba(255,255,255,0.03);
}
.chat-msg-reply-user {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--green);
  margin-bottom: 0.12rem;
}
.chat-msg-reply-text {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.35;
  word-break: break-word;
}
.chat-msg-text { font-size: 0.8rem; color: var(--text-dim); line-height: 1.4; word-break: break-word; }

/* Special message types */
.chat-msg-system {
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  text-align: center;
  font-size: 0.7rem; color: var(--text-muted); font-weight: 500;
}
.chat-msg-rain {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(251,191,36,0.12), rgba(245,158,11,0.06));
  border: 1px solid rgba(251,191,36,0.15);
  text-align: center;
  font-size: 0.75rem; color: #fbbf24; font-weight: 700;
  animation: chatFadeIn 0.3s ease;
}
.chat-msg-tip {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: rgba(52, 211, 153, 0.06);
  border: 1px solid rgba(52, 211, 153, 0.1);
  font-size: 0.75rem; color: var(--green); font-weight: 600;
  text-align: center;
}
.chat-msg-win {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: rgba(253, 232, 162, 0.06);
  border: 1px solid rgba(253, 232, 162, 0.1);
  font-size: 0.75rem; color: var(--gold); font-weight: 600;
  text-align: center;
}

/* Input bar */
.chat-input-bar {
  display: flex; flex-direction: column; gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.chat-compose-row {
  display: flex;
  gap: 0.5rem;
}
.chat-input-bar input {
  flex: 1; height: 2.4rem;
  background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; padding: 0 0.75rem;
  color: #fff; font: 500 0.8rem/1 'Inter', sans-serif;
  outline: none; transition: border-color 180ms;
}
.chat-input-bar input:focus { border-color: rgba(255,255,255,0.2); }
.chat-input-bar input::placeholder { color: var(--text-muted); }
.chat-reply-preview {
  display: none;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
}
.chat-reply-preview.active { display: block; }
.chat-reply-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.chat-reply-preview-label {
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--green);
}
.chat-reply-preview-text {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
  word-break: break-word;
}
.chat-reply-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.chat-reply-close:hover { color: #fff; }
.chat-send-btn {
  width: 2.4rem; height: 2.4rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--green); border: none; border-radius: 8px;
  color: #052e16; cursor: pointer; transition: all 160ms;
}
.chat-send-btn:hover { background: #10b981; transform: translateY(-1px); }
.chat-send-btn:active { transform: scale(0.95); }

/* Chat FAB (toggle when closed) */
.chat-fab {
  display: flex;
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 45;
  width: 3rem; height: 3rem;
  border-radius: 50%; border: none;
  background: var(--green); color: #052e16;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  cursor: pointer; transition: all 200ms;
  align-items: center; justify-content: center;
}
.chat-fab:hover { transform: scale(1.05); }
.chat-fab.hidden { display: none !important; }

.chat-profile-modal { max-width: 380px; }
.profile-top {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.4rem; margin-bottom: 1.25rem;
}
.profile-avatar {
  width: 4.5rem; height: 4.5rem; border-radius: 50%;
  position: relative;
}
.profile-avatar-ring {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.profile-avatar-img {
  position: absolute;
  top: 4px; left: 4px;
  width: calc(100% - 8px); height: calc(100% - 8px);
  border-radius: 50%; object-fit: cover;
  background: #1a1f2e;
}
.profile-name { font-size: 1.1rem; font-weight: 800; color: #fff; }
.profile-level-badge {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.06em;
  color: #fbbf24; background: rgba(251,191,36,0.1);
  padding: 0.15rem 0.5rem; border-radius: 4px;
}
.profile-joined { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.profile-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 1.25rem;
}
.profile-stat-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  padding: 0.75rem 0.5rem; background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06); border-radius: 8px;
}
.profile-stat-val { font-size: 0.95rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.profile-stat-label { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.profile-tip-section { border-top: 1px solid rgba(255,255,255,0.06); padding-top: 1rem; }
.profile-tip-row { display: flex; gap: 0.5rem; }
.profile-tip-wrap { flex: 1; height: 2.6rem; }
.profile-tip-btn { width: 5rem; height: 2.6rem; font-size: 0.85rem; }

/* Chat @ mentions */
.chat-mention-popup {
  display: none;
  position: absolute; bottom: 100%; left: 0; right: 0;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  max-height: 180px; overflow-y: auto;
  z-index: 10;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.04) transparent;
}
.chat-mention-popup.open { display: block; }
.chat-mention-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  cursor: pointer; transition: background 100ms;
  font-size: 0.72rem; font-weight: 600; color: var(--text-dim);
}
.chat-mention-item:hover, .chat-mention-item.active {
  background: rgba(255,255,255,0.05);
}
.chat-mention-av {
  width: 1.2rem; height: 1.2rem; border-radius: 50%;
  overflow: hidden; background: #1a1f2e; flex-shrink: 0;
}
.chat-mention-av img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.chat-msg-text .mention,
.chat-msg-reply-text .mention {
  color: #818cf8; font-weight: 700; cursor: pointer;
}
.chat-msg-text .mention:hover,
.chat-msg-reply-text .mention:hover { text-decoration: underline; }
.chat-input-bar { position: relative; }

/* ---- DICE GAME ---- */
.dice-controls { }
.dice-mode-row { display: flex; gap: 0.35rem; }
.dice-mode-btn { flex: 1; font-size: 0.72rem !important; padding: 0.5rem 0.3rem !important; }
.dice-mode-btn.active-over,
.dice-mode-btn.active-under,
.dice-mode-btn.active-exact {
  background: rgba(52,211,153,0.08);
  border-color: var(--green);
  color: var(--green);
}

.dice-target-wrap {
  display: flex; align-items: center; gap: 0.8rem;
}
.dice-slider {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px;
  background: rgba(255,255,255,0.1);
  outline: none;
}
.dice-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--green); cursor: pointer;
  border: 2px solid #fff;
}
.dice-slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--green); cursor: pointer;
  border: 2px solid #fff;
}
.dice-target-display {
  width: 2.5rem; height: 2.5rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--elevated);
  border: 1px solid var(--elevated-border);
  border-radius: 8px;
  flex-shrink: 0;
}
.dice-target-val {
  font-size: 1.1rem; font-weight: 900; color: #fff;
  font-variant-numeric: tabular-nums;
}
.dice-odds-row {
  display: flex; gap: 0.4rem;
}
.dice-odds-row .info-row { flex: 1; }
.dice-roll-btn { letter-spacing: 0.04em; }

#dice-scene-wrap {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  aspect-ratio: 16 / 9;
  border-radius: var(--app-radius-lg);
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: radial-gradient(circle at 50% 18%, rgba(33, 44, 63, 0.45), rgba(7, 9, 13, 0.96) 72%);
  box-shadow: 0 18px 54px rgba(0,0,0,0.42);
}
#dice-canvas {
  width: 100%; height: 100%; display: block;
}

#game-dice .game-right {
  align-items: stretch;
}

#game-dice .history {
  width: 100%;
  margin: 0;
}
.dice-result-banner {
  position: absolute; top: 0.8rem; left: 50%;
  transform: translateX(-50%) translateY(-20px);
  font-size: 1.1rem; font-weight: 900; letter-spacing: 0.08em;
  opacity: 0; transition: all 0.3s ease; pointer-events: none;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  white-space: nowrap;
}
.dice-result-banner.visible {
  opacity: 1; transform: translateX(-50%) translateY(0);
}
.dice-result-banner.win { color: var(--green); }
.dice-result-banner.lose { color: var(--red); }
.dice-result-badge {
  position: absolute; bottom: 0.8rem; left: 50%;
  transform: translateX(-50%) translateY(20px);
  display: flex; align-items: center; gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.9rem; font-weight: 800;
  opacity: 0; transition: all 0.3s ease; pointer-events: none;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(6px);
}
.dice-result-badge.visible {
  opacity: 1; transform: translateX(-50%) translateY(0);
}
.dice-result-badge.win { color: var(--green); }
.dice-result-badge.lose { color: var(--red); }

/* ---- MINES & CRASH ---- */
.mines-board-wrap {
  position: relative;
  width: 100%;
  min-height: 520px;
  border-radius: var(--app-radius-lg) var(--app-radius-lg) 0 0;
  border: 1px solid rgba(255,255,255,0.1);
  border-bottom: none;
  background:
    radial-gradient(circle at 50% 18%, rgba(52, 211, 153, 0.07), transparent 42%),
    radial-gradient(circle at 82% 76%, rgba(251, 191, 36, 0.04), transparent 32%),
    linear-gradient(180deg, rgba(14, 18, 34, 0.98), rgba(7, 10, 20, 0.98));
  overflow: hidden;
  box-shadow: 0 18px 54px rgba(0,0,0,0.42);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mines-board {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.55rem;
}

.mine-tile {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.09);
  background:
    radial-gradient(circle at 38% 30%, rgba(255,255,255,0.08), transparent 36%),
    linear-gradient(180deg, rgba(22, 28, 48, 0.98), rgba(14, 18, 32, 0.98));
  color: #8af3c7;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 180ms ease, box-shadow 180ms ease;
  font: 900 1rem/1 'Inter', sans-serif;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 6px 16px rgba(0,0,0,0.22);
  display: grid;
  place-items: center;
}

.tile-coin {
  width: 48%;
  height: 48%;
  object-fit: contain;
  opacity: 0.8;
  filter: saturate(1.1) drop-shadow(0 4px 8px rgba(0,0,0,0.3));
  transition: opacity 120ms ease, transform 120ms ease;
}

.mine-tile:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(52, 211, 153, 0.3);
  background:
    radial-gradient(circle at 50% 50%, rgba(52, 211, 153, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(24, 30, 52, 0.98), rgba(16, 20, 36, 0.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 24px rgba(0,0,0,0.28), 0 0 18px rgba(52, 211, 153, 0.1);
}

.mine-tile:hover:not(:disabled) .tile-coin {
  opacity: 1;
  transform: scale(1.08);
}

.mine-tile.revealed {
  pointer-events: none;
  animation: tileReveal 320ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes tileReveal {
  0% { transform: scale(0.8) rotateY(90deg); opacity: 0.4; }
  50% { transform: scale(1.08) rotateY(0deg); opacity: 1; }
  100% { transform: scale(1) rotateY(0deg); opacity: 1; }
}

.mine-tile.revealed.safe {
  color: #047857;
  background:
    radial-gradient(circle at 50% 38%, rgba(255,255,255,0.42), transparent 44%),
    linear-gradient(135deg, #a7f3d0, #6ee7b7);
  border-color: rgba(167, 243, 208, 0.55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 4px 14px rgba(110, 231, 183, 0.22), 0 0 24px rgba(110, 231, 183, 0.12);
}

.mine-tile.revealed.mine {
  color: #fff;
  background:
    radial-gradient(circle at 50% 40%, rgba(255,255,255,0.14), transparent 38%),
    linear-gradient(135deg, #f87171, #b91c1c);
  border-color: rgba(248, 113, 113, 0.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 4px 14px rgba(248, 113, 113, 0.2), 0 0 20px rgba(248, 113, 113, 0.1);
}

.gem-icon,
.mine-icon,
.tile-icon {
  display: grid;
  place-items: center;
  font-size: 1.15rem;
}

.gem-icon {
  color: #064e3b;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.mine-svg {
  width: 54%;
  height: 54%;
  stroke: #fff;
  fill: rgba(185, 28, 28, 0.65);
  stroke-width: 2;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35));
}

.mine-count-row {
  display: grid;
  grid-template-columns: 3rem 1fr 3rem;
  gap: 0.55rem;
}

.mines-count-display {
  min-height: 3.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(52, 211, 153, 0.14);
  background: rgba(52, 211, 153, 0.07);
}

.mines-count-display b { color: #fff; font-size: 1.1rem; line-height: 1; order: 2; }
.mines-count-display span { color: #8af3c7; font-size: 0.56rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; order: 1; margin-bottom: 0.18rem; }

.mines-cash-btn,
.crash-cash-btn {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(251, 191, 36, 0.10));
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.22);
  transition: background 160ms ease, border-color 160ms ease, transform 100ms ease;
}
.mines-cash-btn:hover:not(:disabled),
.crash-cash-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.28), rgba(251, 191, 36, 0.16));
  border-color: rgba(251, 191, 36, 0.38);
  transform: translateY(-1px);
}

.game-hist-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
  color: #d8ddff;
  font-size: 0.72rem;
  font-weight: 900;
  transition: border-color 160ms ease, background 160ms ease;
}

.game-hist-pill:hover {
  background: rgba(255,255,255,0.06);
}

.game-hist-pill b {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  color: #fff;
}

.game-hist-pill .crypto-icon { width: 0.68rem; height: 0.68rem; }
.game-hist-pill.win { border-color: rgba(52, 211, 153, 0.18); color: #8af3c7; }
.game-hist-pill.lose { border-color: rgba(248, 113, 113, 0.16); color: #fca5a5; }

.crash-auto-wrap {
  height: 3rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
  transition: border-color 160ms ease;
}

.crash-auto-wrap:focus-within {
  border-color: rgba(52, 211, 153, 0.28);
}

.crash-auto-wrap span,
.crash-auto-wrap b {
  color: #8af3c7;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.crash-auto-wrap input {
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font: 900 0.95rem/1 'Inter', sans-serif;
  text-align: right;
}

.crash-live-panel {
  padding: 0.85rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
}

.crash-live-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  color: #aeb8d8;
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.crash-live-head b {
  color: #fff;
  background: rgba(52, 211, 153, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.72rem;
}

.crash-live-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 13rem;
  overflow-y: auto;
}

.crash-live-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  background: rgba(0,0,0,0.18);
  color: #d8ddff;
  font-size: 0.72rem;
  font-weight: 800;
  transition: background 160ms ease, color 200ms ease;
}

.crash-live-user {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crash-live-user img {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
}

.crash-live-bet {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.crash-live-row.cashed {
  color: #8af3c7;
  background: rgba(52, 211, 153, 0.08);
}
.crash-live-row.crashed {
  color: #fca5a5;
  opacity: 0.65;
  background: rgba(248, 113, 113, 0.06);
}
.crash-live-row.riding {
  color: #fff;
}

.crash-stage {
  position: relative;
  width: 100%;
  min-height: 520px;
  border-radius: var(--app-radius-lg) var(--app-radius-lg) 0 0;
  border: 1px solid rgba(255,255,255,0.1);
  border-bottom: none;
  overflow: hidden;
  box-shadow: 0 18px 54px rgba(0,0,0,0.42);
  background:
    radial-gradient(circle at 70% 24%, rgba(52, 211, 153, 0.09), transparent 36%),
    radial-gradient(circle at 24% 72%, rgba(251, 191, 36, 0.05), transparent 30%),
    radial-gradient(ellipse at 50% 100%, rgba(52, 211, 153, 0.04), transparent 50%),
    linear-gradient(180deg, rgba(9, 13, 25, 0.98), rgba(5, 7, 14, 0.98));
}

.crash-stage.is-flying {
  background:
    radial-gradient(circle at 70% 24%, rgba(52, 211, 153, 0.14), transparent 38%),
    radial-gradient(circle at 24% 72%, rgba(251, 191, 36, 0.06), transparent 30%),
    radial-gradient(ellipse at 50% 100%, rgba(52, 211, 153, 0.06), transparent 50%),
    linear-gradient(180deg, rgba(9, 13, 25, 0.98), rgba(5, 7, 14, 0.98));
}

.crash-stage.is-crashed {
  background:
    radial-gradient(circle at 50% 50%, rgba(248, 113, 113, 0.12), transparent 42%),
    radial-gradient(circle at 24% 72%, rgba(248, 113, 113, 0.06), transparent 30%),
    linear-gradient(180deg, rgba(12, 10, 18, 0.98), rgba(5, 7, 14, 0.98));
}

.crash-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.crash-stars::before,
.crash-stars::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.30) 1px, transparent 1.5px);
  background-size: 48px 48px;
  opacity: 0.16;
}

.crash-stars::after {
  background-size: 72px 72px;
  opacity: 0.08;
}

.crash-trail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.crash-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.crash-trail path {
  fill: none;
  stroke: rgba(52, 211, 153, 0.7);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.35)) drop-shadow(0 0 18px rgba(52, 211, 153, 0.15));
}

.crash-stage.is-crashed .crash-trail path {
  stroke: rgba(248, 113, 113, 0.5);
  filter: drop-shadow(0 0 6px rgba(248, 113, 113, 0.25));
  transition: stroke 400ms ease, filter 400ms ease;
}

.crash-multiplier {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.06em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 14px 38px rgba(0,0,0,0.5), 0 0 60px rgba(52, 211, 153, 0.08);
  z-index: 3;
  transition: color 400ms ease, text-shadow 400ms ease;
}

.crash-stage.is-flying .crash-multiplier {
  color: #8af3c7;
  text-shadow: 0 14px 38px rgba(0,0,0,0.5), 0 0 80px rgba(52, 211, 153, 0.15);
}

.crash-stage.is-crashed .crash-multiplier {
  color: #f87171;
  text-shadow: 0 14px 38px rgba(0,0,0,0.5), 0 0 60px rgba(248, 113, 113, 0.15);
}

/* ---- CASE BATTLES ---- */
.cb-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.85rem 1rem;
  position: relative;
  isolation: isolate;
}

.cb-wrap::before,
.cb-wrap::after {
  content: '';
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  filter: blur(56px);
  opacity: 0.45;
  pointer-events: none;
}

.cb-wrap::before {
  width: 18rem;
  height: 18rem;
  top: -3rem;
  right: 4%;
  background: rgba(52, 211, 153, 0.16);
}

.cb-wrap::after {
  width: 16rem;
  height: 16rem;
  bottom: 8rem;
  left: -5rem;
  background: rgba(92, 130, 255, 0.11);
}

.cb-shell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cb-lobby,
.cb-battle {
  width: 100%;
}

.cb-battle {
  max-width: 1180px;
  margin: 0 auto;
}

.cb-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.45rem;
  background:
    radial-gradient(circle at 92% 18%, rgba(52, 211, 153, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(20, 24, 42, 0.98), rgba(7, 10, 20, 0.98));
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(4, 7, 18, 0.48), inset 0 1px 0 rgba(255,255,255,0.06);
  overflow: hidden;
  position: relative;
}

.cb-board-head::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0.07), transparent 34%, rgba(52, 211, 153, 0.06));
  pointer-events: none;
}

.cb-title-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  min-width: 0;
}

.cb-lobby-title {
  font-size: 1.5rem;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.035em;
}

.cb-lobby-subtitle {
  max-width: 34rem;
  color: #aeb8d8;
  font-size: 0.84rem;
  line-height: 1.5;
}

.cb-board-mark {
  position: relative;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #b7ffe4;
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.2), rgba(52, 211, 153, 0.07));
  border: 1px solid rgba(52, 211, 153, 0.24);
  box-shadow: 0 16px 34px rgba(52, 211, 153, 0.14);
}

.cb-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, max-content)) minmax(180px, 1fr);
  gap: 0.8rem;
  align-items: stretch;
}

.cb-stat-chip {
  min-height: 3rem;
  padding: 0.82rem 1rem;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(18, 23, 40, 0.96), rgba(9, 13, 25, 0.96));
  border: 1px solid rgba(255,255,255,0.09);
  color: #d5d8ff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.cb-stat-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cb-stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #afbbb7;
}

.cb-stat-value {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.92rem;
  font-weight: 800;
  color: #8af3c7;
}

.cb-stat-value .crypto-icon {
  width: 0.8rem;
  height: 0.8rem;
}

.cb-create-btn,
.cb-start-btn {
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #78f7b0, #34d399 48%, #18b98c);
  color: #052e16;
  font: 800 0.8rem/1 'Inter', sans-serif;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease, opacity 180ms ease;
  box-shadow: 0 14px 32px rgba(52, 211, 153, 0.18), inset 0 1px 0 rgba(255,255,255,0.32);
}

.cb-create-btn {
  justify-self: end;
  min-width: 180px;
  padding: 0 1.1rem;
}

.cb-create-btn:hover,
.cb-start-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(52, 211, 153, 0.24);
  filter: brightness(1.02);
}

.cb-start-btn {
  width: 100%;
  min-height: 3rem;
}

.cb-start-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
  box-shadow: none;
  filter: none;
}

.cb-battle-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.cb-lobby-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(270px, 1.15fr) 1px minmax(330px, 1.1fr) 1px minmax(160px, 0.72fr) 7.25rem;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 1.15rem;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(17, 22, 39, 0.98), rgba(9, 13, 25, 0.98));
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow: 0 18px 48px rgba(4, 7, 18, 0.28), inset 0 1px 0 rgba(255,255,255,0.04);
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.cb-lobby-row::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.95), rgba(92, 130, 255, 0.18));
  opacity: 0.72;
}

.cb-lobby-row.completed::before {
  background: linear-gradient(180deg, rgba(185, 167, 255, 0.9), rgba(52, 211, 153, 0.2));
}

.cb-lobby-row:hover {
  transform: translateY(-2px);
  border-color: rgba(52, 211, 153, 0.2);
  box-shadow: 0 24px 58px rgba(4, 7, 18, 0.36), 0 0 0 1px rgba(52, 211, 153, 0.05) inset;
}

.cb-row-divider {
  width: 1px;
  align-self: stretch;
  background: rgba(255,255,255,0.08);
}

.cb-row-main,
.cb-row-cases,
.cb-row-status {
  min-width: 0;
}

.cb-row-stake {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

.cb-row-amount {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 1.18rem;
  font-weight: 900;
  color: #fff;
}

.cb-row-amount img {
  width: 1rem;
  height: 1rem;
}

.cb-row-mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.55rem;
  padding: 0 0.65rem;
  border-radius: 7px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.cb-row-mode {
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
}

.cb-row-state {
  display: inline-flex;
  align-items: center;
  height: 1.55rem;
  padding: 0 0.6rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: #d8ddff;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cb-row-state.is-open,
.cb-row-state.is-in_progress {
  border-color: rgba(52, 211, 153, 0.2);
  background: rgba(52, 211, 153, 0.08);
  color: #8af3c7;
}

.cb-row-state.is-completed {
  border-color: rgba(185, 167, 255, 0.2);
  background: rgba(185, 167, 255, 0.08);
  color: #d6ccff;
}

.cb-row-players {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cb-team {
  display: flex;
  align-items: center;
}

.cb-avatar-slot {
  position: relative;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  margin-right: -0.34rem;
  border: 2px solid rgba(9, 11, 22, 0.98);
  background: #12172b;
  overflow: visible;
  box-shadow: 0 6px 16px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.04);
}

.cb-avatar-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.cb-avatar-level {
  position: absolute;
  right: -0.15rem;
  bottom: -0.15rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.16rem;
  border-radius: 999px;
  background: #34d399;
  color: #042f22;
  font-size: 0.5rem;
  font-weight: 900;
  line-height: 1rem;
  text-align: center;
  border: 1px solid rgba(16, 18, 30, 0.9);
  z-index: 2;
  box-shadow: 0 4px 10px rgba(0,0,0,0.28);
}

.cb-row-vs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  font-size: 0.66rem;
  font-weight: 800;
  color: #b1b7f2;
}

.cb-row-cases {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cb-row-cases-label,
.cb-row-status-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #afbbb7;
}

.cb-case-strip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 4rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(52, 211, 153, 0.35) transparent;
}

.cb-case-strip::-webkit-scrollbar {
  height: 4px;
}

.cb-case-strip::-webkit-scrollbar-track {
  background: transparent;
}

.cb-case-strip::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.35);
}

.cb-case-glyph {
  --case-a: #4f1d3f;
  --case-b: #241a53;
  --case-accent: #34d399;
  position: relative;
  width: 3.85rem;
  height: 3.85rem;
  flex-shrink: 0;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,0.12), transparent 36%),
    linear-gradient(140deg, var(--case-a), var(--case-b));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 12px 22px rgba(2, 6, 23, 0.22);
  overflow: hidden;
}

.cb-case-glyph::after {
  content: '';
  position: absolute;
  inset: auto -12% -34% auto;
  width: 78%;
  height: 60%;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  filter: blur(14px);
}

.cb-case-glyph-stack {
  position: absolute;
  inset: 0;
}

.cb-case-shared-decal {
  position: absolute;
  inset: 2% -4% -6%;
  z-index: 0;
  background-image: var(--item-decal);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  filter: drop-shadow(0 10px 16px rgba(0,0,0,0.3));
}

.cb-case-preview-item {
  position: absolute;
  z-index: 1;
  width: 40%;
  height: 40%;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.34));
}

.cb-case-preview-item.is-a {
  top: 27%;
  left: 20%;
  transform: rotate(-10deg) translateY(0);
}

.cb-case-preview-item.is-b {
  right: 18%;
  bottom: 20%;
  transform: rotate(10deg) translateY(0);
}

.cb-item-frame {
  --item-decal: none;
  position: relative;
  display: grid;
  place-items: center;
  overflow: visible;
  isolation: isolate;
}

.cb-item-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--item-decal);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.28));
}

.cb-item-img,
.cb-item-coin {
  width: 64%;
  height: 64%;
  object-fit: contain;
  filter: drop-shadow(0 5px 9px rgba(0,0,0,0.3));
}

.cb-item-coin {
  width: 58%;
  height: 58%;
  filter: saturate(1.2) drop-shadow(0 5px 9px rgba(0,0,0,0.32));
}

.cb-item-frame.is-small {
  width: 100%;
  height: 100%;
}

.cb-item-frame.is-spinner {
  width: 5.2rem;
  height: 5.2rem;
}

.cb-item-frame.is-drop {
  width: 100%;
  height: 100%;
}

.cb-case-glyph-badge {
  display: none;
  position: absolute;
  left: 0.4rem;
  bottom: 0.35rem;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.25rem;
  border-radius: 6px;
  background: var(--case-accent);
  color: #052e16;
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1.2rem;
  text-align: center;
  box-shadow: 0 8px 18px rgba(0,0,0,0.22);
}

.cb-case-glyph.is-large {
  width: 5.45rem;
  height: 5.45rem;
  border-radius: 18px;
}

.cb-case-glyph.is-large .cb-case-glyph-badge {
  min-width: 1.35rem;
  height: 1.35rem;
  line-height: 1.35rem;
  font-size: 0.64rem;
}

.cb-case-overflow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.cb-row-progress {
  position: relative;
  width: 100%;
  height: 0.5rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.18);
}

.cb-row-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34d399, #10b981);
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.35);
}

.cb-row-status {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cb-row-status-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: #6ee7b7;
}

.cb-row-winners {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.cb-row-winners .cb-avatar-slot {
  width: 1.8rem;
  height: 1.8rem;
}

.cb-row-winners-text {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
}

.cb-row-winners-sub {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: #d3d7ff;
}

.cb-row-winners-sub .crypto-icon {
  width: 0.72rem;
  height: 0.72rem;
}

.cb-row-eye {
  width: 100%;
  height: 2.5rem;
  gap: 0.4rem;
  border: 1px solid rgba(52, 211, 153, 0.18);
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.08);
  color: #8af3c7;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 160ms ease;
}

.cb-row-eye:hover {
  border-color: rgba(52, 211, 153, 0.24);
  background: rgba(52, 211, 153, 0.14);
  transform: translateY(-1px);
}

.cb-row-eye span {
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

/* Battle view */
.cb-battle-top {
  display: flex; align-items: center; gap: 0.75rem;
  width: 100%;
  max-width: 1060px;
  margin: 0 auto 1rem;
  padding: 0.85rem;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(17, 22, 39, 0.96), rgba(9, 13, 25, 0.96));
  box-shadow: 0 18px 48px rgba(4, 7, 18, 0.25);
}
.cb-back-btn {
  width: 2.3rem; height: 2.3rem; border-radius: 12px; border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.04); color: #cbd3ff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 150ms;
}
.cb-back-btn:hover { color: #fff; border-color: rgba(255,255,255,0.12); }
.cb-battle-title { font-size: 1rem; font-weight: 900; color: #fff; flex: 1; letter-spacing: -0.01em; }
.cb-top-entry {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.85rem;
  padding: 0.26rem 0.58rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.04);
  color: #aeb8d8;
  white-space: nowrap;
}
.cb-top-entry span {
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cb-top-entry b {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.cb-top-entry .crypto-icon {
  width: 0.7rem;
  height: 0.7rem;
}
.cb-battle-mode {
  font-size: 0.66rem; font-weight: 900; color: #8af3c7;
  background: rgba(52, 211, 153, 0.08); border: 1px solid rgba(52, 211, 153, 0.16); padding: 0.35rem 0.65rem; border-radius: 999px;
}

.cb-jackpot {
  display: flex; align-items: center; justify-content: flex-start;
  gap: 0.65rem; padding: 0.75rem 0.9rem;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.12), rgba(12, 16, 29, 0.98)); border: 1px solid rgba(52, 211, 153, 0.16);
  border-radius: 16px; margin: 0 auto 1rem;
  width: 100%;
  max-width: 760px;
}
.cb-jackpot-label {
  font-size: 0.5rem; font-weight: 800; letter-spacing: 0.1em;
  color: #6ee7b7;
}
.cb-jackpot-val {
  font-size: 0.9rem; font-weight: 900; color: #fff;
  display: flex; align-items: center; gap: 0.3rem;
}
.cb-jackpot-val .crypto-icon { width: 0.72rem; height: 0.72rem; }

.cb-battle-values {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto 1.15rem;
  padding: 0.7rem 0.9rem 0.95rem;
  border-radius: 12px;
  background: rgba(12, 16, 29, 0.86);
  border: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}

.cb-battle-values-title {
  display: block;
  margin-bottom: 0.8rem;
  color: #b9a7ff;
  font-size: 1.05rem;
  font-weight: 800;
}

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

.cb-end-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  min-height: 2rem;
  color: #d8ddff;
  font-size: 0.95rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.cb-end-value .crypto-icon {
  width: 0.82rem;
  height: 0.82rem;
}

.cb-end-value.is-winning {
  color: var(--green);
  text-shadow: 0 0 16px rgba(52, 211, 153, 0.32);
}

.cb-end-value.is-losing {
  color: var(--red);
  opacity: 0.72;
}

/* Spinners */
.cb-spinners {
  display: flex; align-items: stretch; justify-content: center; gap: 0.8rem;
  width: 100%;
  max-width: 650px;
  margin: 0 auto 1.15rem;
}
.cb-spinner-col { flex: 0 1 280px; min-width: 0; }
.cb-vs {
  width: 2.7rem;
  height: 2.7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  font-size: 0.72rem; font-weight: 900; color: #fff;
  padding: 0; flex-shrink: 0;
  align-self: center;
  box-shadow: 0 14px 34px rgba(0,0,0,0.28);
}
.cb-spinner-viewport {
  position: relative; height: 390px; overflow: hidden;
  background:
    linear-gradient(180deg, rgba(16, 21, 38, 0.98), rgba(7, 10, 20, 0.98)); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  box-shadow: 0 22px 58px rgba(4, 7, 18, 0.34), inset 0 1px 0 rgba(255,255,255,0.05);
}

.cb-spinner-viewport::before,
.cb-spinner-viewport::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  z-index: 4;
  height: 34%;
  pointer-events: none;
}

.cb-spinner-viewport::before {
  top: 0;
  background: linear-gradient(180deg, rgba(7, 10, 20, 0.96), transparent);
}

.cb-spinner-viewport::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(7, 10, 20, 0.96), transparent);
}
.cb-spinner-strip {
  display: flex; flex-direction: column; position: absolute; top: 0; left: 0;
  width: 100%; will-change: transform;
  transition: none;
}
.cb-spinner-strip.spinning {
  transition: transform 5.2s cubic-bezier(0.12, 0.74, 0.18, 1);
}
.cb-spinner-strip.gold-spinning {
  transition: transform 3.8s cubic-bezier(0.12, 0.74, 0.18, 1);
}
.cb-spin-item {
  width: 100%; height: 130px; flex-shrink: 0;
  display: grid; grid-template-columns: 1fr; grid-template-rows: auto auto; place-items: center;
  row-gap: 0.42rem; padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  border-right: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
}
.cb-spin-item > img,
.cb-spin-item > svg {
  grid-row: 1 / span 2;
  width: 72px; height: 72px; object-fit: contain;
  align-self: center;
  justify-self: center;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.cb-spinner-strip:not(.is-settled) .cb-spin-item {
  grid-template-columns: 1fr;
  place-items: center;
}

.cb-spinner-strip:not(.is-settled) .cb-spin-item > img,
.cb-spinner-strip:not(.is-settled) .cb-spin-item > svg {
  grid-row: auto;
}
.cb-spin-item-val {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.86rem; font-weight: 900; color: #fff;
  text-align: center;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.cb-spin-item-val .crypto-icon {
  width: 0.78rem;
  height: 0.78rem;
}
.cb-spin-item.rarity-common,
.cb-spin-item.rarity-uncommon,
.cb-spin-item.rarity-rare,
.cb-spin-item.rarity-epic,
.cb-spin-item.rarity-legendary {
  border-left: 1px solid rgba(255,255,255,0.04);
}
.cb-spin-item.rarity-gold {
  border-left: 1px solid rgba(251, 191, 36, 0.18);
  background:
    radial-gradient(circle at 50% 38%, rgba(251, 191, 36, 0.13), transparent 44%),
    linear-gradient(180deg, rgba(251, 191, 36, 0.055), rgba(255,255,255,0.018));
}

.cb-spinner-strip.is-settled .cb-spin-item.is-landed {
  background:
    linear-gradient(90deg, rgba(52, 211, 153, 0.02), rgba(52, 211, 153, 0.13), rgba(52, 211, 153, 0.02)),
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018));
  box-shadow:
    inset 0 0 0 1px rgba(52, 211, 153, 0.18),
    inset 0 18px 32px rgba(52, 211, 153, 0.035);
}

.cb-spinner-strip.is-settled .cb-spin-item.rarity-gold.is-landed {
  background:
    radial-gradient(circle at 50% 42%, rgba(251, 191, 36, 0.24), transparent 48%),
    linear-gradient(90deg, rgba(251, 191, 36, 0.035), rgba(251, 191, 36, 0.18), rgba(251, 191, 36, 0.035)),
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.018));
  box-shadow:
    inset 0 0 0 1px rgba(251, 191, 36, 0.28),
    inset 0 20px 34px rgba(251, 191, 36, 0.07),
    0 0 22px rgba(251, 191, 36, 0.12);
}

.cb-spinner-strip.is-settled .cb-spin-item.is-landed .cb-spin-item-val {
  opacity: 1;
  transform: translateY(0);
}

.cb-gold-burst {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  gap: 0.45rem;
  background:
    radial-gradient(circle at 50% 46%, rgba(251, 191, 36, 0.36), rgba(245, 158, 11, 0.18) 34%, rgba(8, 10, 20, 0.82) 66%, rgba(8, 10, 20, 0.94)),
    linear-gradient(180deg, rgba(251, 191, 36, 0.08), transparent);
  color: #fde68a;
  pointer-events: none;
  animation: cbGoldBurst 5s ease both;
  perspective: 700px;
}

.cb-gold-burst span {
  margin-top: 6.5rem;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cb-gold-spin-coin {
  position: absolute;
  width: 6.2rem;
  height: 6.2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(251, 191, 36, 0.36);
  background:
    radial-gradient(circle at 34% 24%, rgba(255,255,255,0.28), transparent 28%),
    linear-gradient(145deg, rgba(251, 191, 36, 0.24), rgba(120, 53, 15, 0.26));
  box-shadow:
    0 22px 48px rgba(251, 191, 36, 0.18),
    inset -12px -14px 22px rgba(120, 53, 15, 0.28),
    inset 8px 8px 16px rgba(255,255,255,0.14);
  transform-style: preserve-3d;
  animation: cbGoldStarSpin 4.85s cubic-bezier(0.18, 0.9, 0.28, 1) both;
}

.cb-gold-spin-coin img {
  width: 74%;
  height: 74%;
  object-fit: contain;
  filter: saturate(1.25) contrast(1.05) drop-shadow(0 8px 12px rgba(0,0,0,0.3));
}

@keyframes cbGoldBurst {
  0% { opacity: 0; transform: scale(0.96); }
  14% { opacity: 1; transform: scale(1); }
  82% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.05); }
}

@keyframes cbGoldStarSpin {
  0% { transform: rotateY(0deg) rotateZ(-16deg) scale(0.45); filter: blur(1px); }
  45% { transform: rotateY(1080deg) rotateZ(10deg) scale(1.08); filter: blur(0); }
  78% { transform: rotateY(1620deg) rotateZ(-6deg) scale(1); filter: blur(0); }
  100% { transform: rotateY(1980deg) rotateZ(0deg) scale(1); filter: blur(0); }
}

.cb-spinner-pointer {
  display: none;
}

.cb-spinner-pointer::before,
.cb-spinner-pointer::after {
  content: none;
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  transform: translateY(-50%);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.cb-spinner-pointer::before {
  left: -0.15rem;
  border-left: 9px solid #34d399;
}

.cb-spinner-pointer::after {
  right: -0.15rem;
  border-right: 9px solid #34d399;
}

/* Players */
.cb-players {
  display: flex; gap: 0.75rem; width: 100%; max-width: 1060px; margin: 0 auto 1rem;
}

.cb-drop-results {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
  max-width: 1060px;
  margin: -0.3rem auto 1rem;
}

.cb-drop-result {
  min-width: 0;
  padding: 0.75rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.09);
  background: linear-gradient(180deg, rgba(17, 22, 39, 0.94), rgba(9, 13, 25, 0.96));
}

.cb-drop-owner {
  display: block;
  margin-bottom: 0.5rem;
  color: #aeb8d8;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cb-drop-empty {
  display: grid;
  min-height: 4.1rem;
  place-items: center;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px dashed rgba(255,255,255,0.09);
  border-radius: 12px;
  background: rgba(255,255,255,0.025);
}

.cb-drop-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.cb-drop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 7.2rem;
  padding: 0.6rem 0.45rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
  min-width: 0;
}

.cb-drop-img {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(5, 7, 12, 0.42);
}

.cb-drop-img .cb-item-frame {
  width: 100%;
  height: 100%;
}
.cb-drop-img > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

.cb-drop-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  width: 100%;
}

.cb-drop-meta b {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.cb-drop-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #d8ddff;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.cb-drop-meta .crypto-icon {
  width: 0.68rem;
  height: 0.68rem;
}

.cb-drop-card.rarity-rare,
.cb-drop-card.rarity-epic,
.cb-drop-card.rarity-legendary {
  border-color: rgba(52, 211, 153, 0.18);
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.055), rgba(255,255,255,0.035));
}
.cb-player {
  flex: 1; display: flex; align-items: center; justify-content: space-between;
  padding: 0.9rem 1rem;
  background: linear-gradient(180deg, rgba(17, 22, 39, 0.98), rgba(9, 13, 25, 0.98)); border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px;
  box-shadow: 0 16px 42px rgba(4, 7, 18, 0.22), inset 0 1px 0 rgba(255,255,255,0.04);
}
.cb-player.cb-winner { border-color: rgba(52, 211, 153, 0.55); box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.08), 0 20px 48px rgba(52, 211, 153, 0.12); }
.cb-player.cb-loser { opacity: 0.5; }
.cb-player.is-transfer-target {
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.2), 0 18px 42px rgba(52, 211, 153, 0.12);
}
.cb-player.is-transfer-source {
  border-color: rgba(248, 113, 113, 0.2);
}
.cb-player-info { display: flex; align-items: center; gap: 0.4rem; }
.cb-player-av { width: 2.15rem; height: 2.15rem; border-radius: 50%; background: #1a1f2e; border: 1px solid rgba(255,255,255,0.12); }
.cb-player-name { font-size: 0.8rem; font-weight: 700; color: #fff; }
.cb-player-val {
  font-size: 0.8rem; font-weight: 800; color: #fff;
  display: flex; align-items: center; gap: 0.2rem;
  font-variant-numeric: tabular-nums;
  opacity: 1;
  max-width: 10rem;
  overflow: hidden;
  transition: opacity 180ms ease, max-width 220ms ease;
}
.cb-player-val .crypto-icon { width: 0.82rem; height: 0.82rem; }
.cb-players.show-values .cb-player-val {
  opacity: 1;
  max-width: 10rem;
}
.cb-player-val.is-winning { color: var(--green); }
.cb-player-val.is-losing { color: var(--red); }

.cb-final-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.cb-final-box {
  min-height: 4.2rem;
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(17, 22, 39, 0.98), rgba(9, 13, 25, 0.98));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.cb-final-label {
  min-width: 0;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-final-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.32rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.cb-final-value .crypto-icon {
  width: 0.82rem;
  height: 0.82rem;
}

.cb-final-value.is-winning {
  color: var(--green);
}

.cb-final-value.is-losing {
  color: var(--red);
  opacity: 0.75;
}

/* Result */
.cb-result {
  width: 100%;
  max-width: 1060px;
  margin: 1rem auto 0;
  text-align: center;
  padding: 1.15rem;
  background: linear-gradient(180deg, rgba(17, 22, 39, 0.98), rgba(9, 13, 25, 0.98)); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  box-shadow: 0 20px 54px rgba(4, 7, 18, 0.26);
}
.cb-result.win { border-color: rgba(45,212,160,0.32); }
.cb-result.lose { border-color: rgba(240,96,96,0.15); }
.cb-result-text {
  display: block; font-size: 1rem; font-weight: 800;
}
.cb-result.win .cb-result-text { color: var(--green); }
.cb-result.lose .cb-result-text { color: var(--red); }
.cb-result-val {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-top: 0.45rem;
}

.cb-result-val .crypto-icon {
  width: 0.82rem;
  height: 0.82rem;
}

.cb-result-sep {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cb-result-total {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 1rem;
  color: #fff;
}

.cb-result-breakdown {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cb-result-breakdown .crypto-icon {
  width: 0.72rem;
  height: 0.72rem;
}

.cb-result-profit {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.72rem;
  font-weight: 900;
}

.cb-result-profit .crypto-icon {
  width: 0.72rem;
  height: 0.72rem;
}

.cb-result-profit.is-profit {
  color: var(--green);
}

.cb-result-profit.is-loss {
  color: var(--red);
}

.cb-create-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(8, 10, 22, 0.58);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.cb-create-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.cb-create-modal {
  position: relative;
  max-width: 1040px;
  width: 100%;
  width: min(1040px, 100%);
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.1);
  background:
    radial-gradient(circle at 84% 12%, rgba(52, 211, 153, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(15, 20, 36, 0.98), rgba(8, 10, 20, 0.99));
  box-shadow:
    0 40px 90px rgba(2, 6, 23, 0.54),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

.cb-create-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(50px);
  opacity: 0.45;
  pointer-events: none;
}

.cb-create-glow-a {
  width: 15rem;
  height: 15rem;
  top: -4rem;
  right: -2rem;
  background: rgba(92, 130, 255, 0.32);
}

.cb-create-glow-b {
  width: 12rem;
  height: 12rem;
  left: -3rem;
  bottom: -4rem;
  background: rgba(52, 211, 153, 0.24);
}

.cb-create-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.45rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cb-create-kicker {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6ee7b7;
}

.cb-create-head h3 {
  font-size: 1.12rem;
  font-weight: 800;
  color: #fff;
}

.cb-create-close {
  width: 2.3rem;
  height: 2.3rem;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.cb-create-body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  align-items: stretch;
  gap: 1rem;
  padding: 1.2rem 1.45rem 1.45rem;
}

.cb-case-grid {
  min-height: 0;
  max-height: 520px;
  max-height: min(58vh, 520px);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overflow-y: auto;
  padding-right: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(52, 211, 153, 0.35) transparent;
}

.cb-case-grid::-webkit-scrollbar {
  width: 4px;
}

.cb-case-grid::-webkit-scrollbar-track {
  background: transparent;
}

.cb-case-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.35);
}

.cb-case-option {
  text-align: left;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(5.5rem, auto);
  gap: 1rem;
  align-items: center;
  min-height: 6.4rem;
  padding: 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
  cursor: pointer;
  transition: border-color 170ms ease, transform 170ms ease, background 170ms ease;
}

.cb-case-option:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
}

.cb-case-option.is-active {
  border-color: rgba(52, 211, 153, 0.32);
  background: linear-gradient(90deg, rgba(52, 211, 153, 0.12), rgba(255,255,255,0.04));
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.08), 0 14px 36px rgba(52, 211, 153, 0.08);
}

.cb-case-option-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.cb-case-option-name {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

.cb-case-option-drops {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  min-width: 0;
}

.cb-case-option-label {
  font-size: 0.66rem;
  font-weight: 800;
  color: #6ee7b7;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cb-case-drop-strip,
.cb-create-preview-drops {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex-wrap: wrap;
}

.cb-case-drop {
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(5, 7, 12, 0.42);
}

.cb-case-drop .cb-item-frame {
  width: 100%;
  height: 100%;
}

.cb-case-drop img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.26));
}

.cb-case-option-buy {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  font-size: 0.86rem;
  font-weight: 800;
  color: #6ee7b7;
  white-space: nowrap;
}

.cb-case-option-buy .crypto-icon {
  width: 0.8rem;
  height: 0.8rem;
}

.cb-case-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  padding: 0.1rem 0.38rem;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.22);
  color: #6ee7b7;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  vertical-align: middle;
  margin-left: 0.3rem;
}

.cb-create-side {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.cb-create-preview,
.cb-round-panel,
.cb-create-summary {
  position: relative;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.cb-create-preview {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
}

.cb-create-preview-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.cb-create-preview-name {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
}

.cb-create-preview-copy {
  font-size: 0.74rem;
  line-height: 1.45;
  color: #ccd1ff;
}

.cb-create-preview-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #6ee7b7;
}

.cb-create-preview-meta .crypto-icon {
  width: 0.76rem;
  height: 0.76rem;
}

.cb-create-preview-price {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.1rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
}

.cb-create-preview-price .crypto-icon {
  width: 0.8rem;
  height: 0.8rem;
}

.cb-preview-case-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 310px;
  overflow-y: auto;
  padding-right: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(52, 211, 153, 0.32) transparent;
}

.cb-preview-case-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
}

.cb-preview-case-row .cb-case-glyph {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 12px;
}

.cb-preview-case-hit {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.18rem;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.cb-preview-case-hit:hover .cb-preview-case-name {
  color: #8af3c7;
}

.cb-preview-case-name {
  max-width: 100%;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cb-preview-case-cost {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #8af3c7;
  font-size: 0.72rem;
  font-weight: 800;
}

.cb-preview-case-cost .crypto-icon {
  width: 0.68rem;
  height: 0.68rem;
}

.cb-preview-case-controls {
  display: grid;
  grid-template-columns: 1.9rem 2.3rem 1.9rem;
  align-items: center;
  gap: 0.3rem;
}

.cb-preview-case-controls button {
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.045);
  color: #fff;
  font: 900 0.9rem/1 'Inter', sans-serif;
  cursor: pointer;
}

.cb-preview-case-controls button:hover {
  border-color: rgba(52, 211, 153, 0.2);
  background: rgba(52, 211, 153, 0.1);
}

.cb-preview-case-controls span {
  color: #d8ddff;
  font-size: 0.76rem;
  font-weight: 900;
  text-align: center;
}

.cb-round-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}

.cb-round-count {
  color: #6ee7b7;
  font-size: 0.95rem;
  font-weight: 900;
}

.cb-round-stepper {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) 3rem;
  align-items: stretch;
  gap: 0.65rem;
}

.cb-round-btn {
  height: 3rem;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.045);
  color: #fff;
  font: 900 1.25rem/1 'Inter', sans-serif;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.cb-round-btn:hover {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.18);
  transform: translateY(-1px);
}

.cb-round-step-value {
  min-width: 0;
  min-height: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(52, 211, 153, 0.14);
  background: rgba(52, 211, 153, 0.07);
}

.cb-round-step-value b {
  color: #fff;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
}

.cb-round-step-value small {
  margin-top: 0.2rem;
  color: #8af3c7;
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.cb-round-slider {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  outline: none;
}

.cb-round-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #34d399;
  border: 2px solid #fff;
  box-shadow: 0 10px 18px rgba(52, 211, 153, 0.25);
  cursor: pointer;
}

.cb-round-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #34d399;
  border: 2px solid #fff;
  box-shadow: 0 10px 18px rgba(52, 211, 153, 0.25);
  cursor: pointer;
}

.cb-round-presets {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}

.cb-round-presets button {
  min-width: 2.15rem;
  height: 2rem;
  padding: 0 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: #d9ddff;
  font: 800 0.72rem/1 'Inter', sans-serif;
  cursor: pointer;
}

.cb-round-presets button:hover {
  border-color: rgba(52, 211, 153, 0.2);
  color: #fff;
}

.cb-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0;
}

.cb-summary-row + .cb-summary-row {
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 0.5rem;
  padding-top: 0.7rem;
}

.cb-summary-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #afbbb7;
}

.cb-summary-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
}

.cb-summary-value.is-accent {
  color: #6ee7b7;
}

.cb-summary-value .crypto-icon {
  width: 0.78rem;
  height: 0.78rem;
}

@media (max-width: 900px) {
  .cb-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cb-create-btn {
    justify-self: stretch;
    min-width: 0;
  }

  .cb-lobby-row {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .cb-spinners {
    flex-direction: column;
    align-items: center;
  }

  .cb-spinner-col {
    max-width: 360px;
    width: min(100%, 360px);
    flex-basis: auto;
  }

  .cb-row-divider {
    width: auto;
    height: 1px;
  }

  .cb-row-eye {
    justify-self: start;
    width: auto;
    padding: 0 1rem;
  }

  .cb-create-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .cb-wrap {
    padding: 1rem 0.5rem;
  }

  .game-panel-head {
    padding-left: 0.95rem;
    padding-right: 0.95rem;
  }

  .cb-case-grid {
    grid-template-columns: 1fr;
  }

  .cb-board-head,
  .cb-lobby-row,
  .cb-create-head,
  .cb-create-body {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .cb-board-head {
    align-items: flex-start;
  }

  .cb-board-mark {
    width: 2.6rem;
    height: 2.6rem;
    flex-shrink: 0;
  }

  .cb-toolbar {
    grid-template-columns: 1fr;
  }

  .cb-create-btn {
    min-height: 3rem;
  }

  .cb-row-stake {
    flex-wrap: wrap;
  }

  .cb-row-eye {
    justify-self: stretch;
    width: 100%;
  }

  .cb-battle-top,
  .cb-players,
  .cb-drop-results {
    max-width: 360px;
  }

  .cb-battle-title {
    font-size: 0.9rem;
  }

  .cb-players {
    flex-direction: column;
  }

  .cb-drop-results {
    grid-template-columns: 1fr;
  }

  .cb-case-option {
    grid-template-columns: auto 1fr;
  }

  .cb-case-option-buy {
    grid-column: 2;
  }

  .cb-create-preview {
    flex-direction: column;
    align-items: flex-start;
  }

  .cb-preview-case-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .cb-preview-case-controls {
    grid-column: 2;
    justify-self: start;
  }

  .cb-spinner-viewport {
    height: 330px;
  }

  .cb-spin-item {
    height: 110px;
    grid-template-columns: 1fr;
    padding: 0.75rem;
  }

  .cb-spin-item .cb-item-frame.is-spinner {
    width: 4.5rem;
    height: 4.5rem;
  }

  .cb-drop-card {
    min-height: 6.8rem;
  }

  .cb-final-strip,
  .cb-battle-values-row {
    grid-template-columns: 1fr;
  }
}

/* ---- SITE THEME PASS ---- */
body {
  background: #070a10;
}

.sidebar,
nav,
.chat-panel {
  background: rgba(8, 11, 20, 0.94);
  border-color: rgba(255,255,255,0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

nav {
  box-shadow: 0 12px 30px rgba(2, 6, 16, 0.18);
}

.sb-toggle,
.nav-burger,
.nav-icon-btn,
.chat-toggle-btn,
.profile-close,
.close-btn {
  border-radius: 12px;
}

.sb-toggle:hover,
.nav-burger:hover,
.nav-icon-btn:hover,
.nav-profile-wrap:hover,
.chat-toggle-btn:hover,
.profile-close:hover,
.close-btn:hover {
  background: rgba(52, 211, 153, 0.08);
  color: #fff;
}

.sidebar.expanded .sb-item,
.sb-item {
  border-radius: 0 14px 14px 0;
}

.sb-item:hover {
  color: #fff;
  background: rgba(255,255,255,0.045);
}

.sb-item.active,
.sidebar.expanded .sb-item.active {
  color: #8af3c7;
  background: rgba(52, 211, 153, 0.085);
  border-left-color: var(--green);
}

.nav-bal,
.balance-dropdown,
.lvlup-toast,
.cashier-modal,
.profile-modal,
.settings-modal,
.game-panel-head,
#scene-wrap,
.bj-scene-wrap,
.controls,
.history,
.bj-history,
.h-rake-card,
.h-gcard,
.h-card,
.tourney-you-card,
.tourney-card,
.prof-stat,
.prof-anon,
.prof-filter,
.cb-stat-chip,
.cb-lobby-row,
.cb-battle-top,
.cb-jackpot,
.cb-spinner-viewport,
.cb-player,
.cb-final-box,
.cb-result,
.cb-battle-values,
.cb-create-modal {
  background: var(--surface-grad);
  border-color: rgba(255,255,255,0.095);
  box-shadow: var(--soft-shadow-sm);
}

.game-panel-head,
.h-hero,
.cb-board-head {
  background:
    radial-gradient(circle at 92% 14%, rgba(52, 211, 153, 0.075), transparent 23rem),
    var(--surface-grad-soft);
  border-color: rgba(255,255,255,0.1);
  border-radius: 20px;
  box-shadow: var(--soft-shadow);
}

.game-panel-title,
.cb-lobby-title,
.h-hero-big,
.tourney-title,
.modal-header h2,
.settings-head,
.chat-title {
  letter-spacing: -0.025em;
}

.game-panel-mark,
.h-gcard-icon,
.cb-board-mark {
  border-radius: 16px;
  color: #b7ffe4;
  background: rgba(52, 211, 153, 0.09);
  border: 1px solid rgba(52, 211, 153, 0.18);
  box-shadow: none;
}

.controls,
.cashier-modal,
.profile-modal,
.settings-modal,
.cb-create-modal {
  border-radius: 22px;
}

.pick-btn,
.bet-wrap,
.multi button,
.bj-score-display,
.crypto-card,
.input-group input,
.address-box,
.dropdown-btn,
.cf-hist-item,
.bj-hist-card,
.h-dc-task,
.h-dc-case,
.chat-input-wrap,
.rain-tip-input-wrap,
.rain-amt-btn,
.prof-toggle-slider,
.cb-case-option,
.cb-create-preview,
.cb-round-panel,
.cb-create-summary,
.cb-case-drop {
  border-radius: 14px;
  background: rgba(255,255,255,0.035);
  border-color: rgba(255,255,255,0.085);
}

.pick-btn:hover,
.multi button:hover,
.crypto-card:hover,
.h-gcard:hover,
.cb-case-option:hover {
  background: rgba(255,255,255,0.055);
  border-color: rgba(52, 211, 153, 0.16);
  box-shadow: none;
}

.flip-btn,
.confirm-btn,
.h-rake-btn,
.cb-create-btn,
.cb-start-btn,
.bj-btn-hit {
  border-radius: 14px;
  background: linear-gradient(135deg, #78f7b0, #34d399 52%, #18b98c);
  color: #052e16;
  box-shadow: none;
}

.flip-btn:hover:not(:disabled),
.confirm-btn:hover,
.h-rake-btn:hover,
.cb-create-btn:hover,
.cb-start-btn:hover:not(:disabled),
.bj-btn:hover:not(:disabled),
.h-hero-join:hover,
.rain-amt-btn:hover {
  transform: translateY(-1px);
  box-shadow: none;
  filter: brightness(1.04);
}

.h-hero {
  border-color: rgba(52, 211, 153, 0.14);
}

.h-hero:hover {
  border-color: rgba(52, 211, 153, 0.2);
}

.h-hero-bg {
  background:
    radial-gradient(ellipse 58% 90% at 8% 50%, rgba(52,211,153,0.09) 0%, transparent 70%),
    radial-gradient(ellipse 42% 75% at 92% 24%, rgba(92,130,255,0.045) 0%, transparent 62%),
    var(--surface-grad);
}

.h-hero-eyebrow,
.h-rake-pct,
.h-rake-title,
.tourney-prize,
.h-dc-reward,
.cb-stat-value,
.cb-row-status-value {
  color: #8af3c7;
}

.h-hero-join,
.h-dc-case-btn,
.rain-tip-send,
.bj-btn-stand {
  border-radius: 14px;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.18);
  color: #fde68a;
}

.h-hero-join:hover,
.h-dc-case-btn:hover:not(:disabled),
.rain-tip-send:hover {
  background: rgba(251, 191, 36, 0.18);
}

.news-ticker-wrap,
.rain-banner,
.rain-timer {
  border-radius: 16px;
  background: var(--surface-grad);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
}

.news-ticker-label {
  background: rgba(52, 211, 153, 0.14);
  color: #8af3c7;
}

.rain-banner {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.13);
}

.online-dot {
  box-shadow: none;
}

.chat-msg,
.activity-item,
.prof-hist-row,
.tourney-row {
  border-color: rgba(255,255,255,0.045);
}

.modal-overlay,
.cashier-overlay,
.cb-create-overlay {
  background: rgba(5, 8, 15, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.cb-wrap::before,
.cb-wrap::after,
.cb-create-glow {
  opacity: 0.16;
  filter: blur(44px);
}

.cb-board-head,
.cb-lobby-row,
.cb-spinner-viewport,
.cb-player,
.cb-result,
.cb-create-modal {
  box-shadow: var(--soft-shadow-sm);
}

.cb-create-btn,
.cb-start-btn {
  box-shadow: none;
}

.cb-create-btn:hover,
.cb-start-btn:hover:not(:disabled) {
  box-shadow: none;
}

.cb-spinner-pointer {
  box-shadow: 0 0 8px rgba(45,212,160,0.26);
}

.podium-slot,
.tourney-table-wrap,
.chat-profile-modal,
.rain-banner,
.chat-msg-system,
.chat-msg-rain,
.chat-msg-tip,
.chat-msg-win {
  background: var(--surface-grad);
  border-color: rgba(255,255,255,0.09);
  box-shadow: var(--soft-shadow-sm);
  border-radius: 18px;
}

.podium-avatar-1,
.cb-player.cb-winner,
.cb-player.is-transfer-target {
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.12);
}

.cb-end-value.is-winning {
  text-shadow: none;
}

.cb-gold-spin-coin {
  box-shadow: 0 16px 34px rgba(251, 191, 36, 0.14), inset 0 1px 0 rgba(255,255,255,0.14);
}

.balance-dropdown,
.cashier-modal,
.profile-modal,
.settings-modal {
  box-shadow: var(--soft-shadow);
}

.crypto-card:hover {
  transform: translateY(-1px);
}

.h-hero {
  border-color: rgba(251, 191, 36, 0.28);
  box-shadow: 0 18px 48px rgba(251, 191, 36, 0.1), var(--soft-shadow-sm);
}

.h-hero:hover {
  border-color: rgba(251, 191, 36, 0.42);
}

.h-hero-bg {
  background:
    radial-gradient(ellipse 64% 110% at 8% 48%, rgba(251,191,36,0.26) 0%, transparent 72%),
    radial-gradient(ellipse 46% 84% at 92% 26%, rgba(245,158,11,0.16) 0%, transparent 62%),
    linear-gradient(135deg, rgba(251, 191, 36, 0.1), transparent 48%),
    var(--surface-grad);
}

.h-hero-eyebrow {
  color: #fde68a;
}

.h-hero-join {
  background: linear-gradient(135deg, #fde68a, #fbbf24 56%, #f59e0b);
  border-color: rgba(251, 191, 36, 0.28);
  color: #422006;
}

/* Theme cleanup pass */
.balance-dropdown {
  width: 172px;
  padding: 0.35rem;
  border-radius: 12px;
  background: rgba(8, 11, 20, 0.98);
}

.balance-dropdown .dropdown-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 2.35rem;
  padding: 0 0.75rem;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: #d5d8ff;
  font-size: 0.8rem;
  font-weight: 700;
}

.balance-dropdown .dropdown-btn:hover {
  background: rgba(255,255,255,0.055);
  border-color: rgba(255,255,255,0.08);
}

.balance-dropdown .dropdown-btn.deposit {
  color: #8af3c7;
}

.balance-dropdown .dropdown-btn.deposit:hover {
  background: rgba(52, 211, 153, 0.08);
  border-color: rgba(52, 211, 153, 0.13);
}

.rain-banner,
.rain-timer,
.rain-expand-btn,
.rain-amt-btn,
.rain-tip-input-wrap,
.rain-tip-send {
  border-radius: 8px;
}

.rain-banner {
  margin: 0.65rem 0.75rem 0;
  border: 1px solid rgba(251, 191, 36, 0.11);
  box-shadow: none;
}

.rain-banner-top,
.rain-banner-left,
.rain-timer,
.rain-tip-custom,
.rain-tip-input-wrap,
.rain-tip-send {
  align-items: center;
}

.rain-banner-top {
  min-height: 2.45rem;
}

.rain-expand-btn,
.rain-amt-btn,
.rain-tip-send {
  transform: none;
  box-shadow: none;
}

.rain-amt-btn:hover,
.rain-tip-send:hover {
  transform: none;
}

.cb-final-strip {
  margin-top: 0.2rem;
}

.cb-final-box {
  min-height: 3.6rem;
  padding: 0.75rem 0.85rem;
}

@media (max-width: 640px) {
  .cb-battle-top {
    flex-wrap: wrap;
  }

  .cb-top-entry {
    order: 4;
    width: 100%;
    justify-content: space-between;
  }
}

/* Responsive adjustments for chat */
@media (max-width: 1100px) {
  :root { --chat-w: 280px; }
}
@media (max-width: 768px) {
  .chat-panel { width: 100%; z-index: 55; }
  .chat-panel.collapsed { transform: translateX(100%); }
  .chat-fab { display: flex; }
  .chat-fab.hidden { display: none !important; }
  main { margin-right: 0; width: 100%; }
  body.sb-open main { width: 100%; }
  body.chat-closed main { margin-right: 0; }
}
