/* ============================================================
   EMC Gold Casino -- Bloxflip-Style Dark Navy Design System
   Deep Navy, Slate Blue, Radiant Gold, Emerald, and Ruby
   ============================================================ */

:root {
  --bg: #1B1B3A;
  --bg-surface: #25254A;
  --bg-card: #25254A;
  --bg-card-hover: #2F2F58;
  --bg-input: #14142D;
  --game-surface: #21264A;
  --game-ui-gutter: 16px;
  --border: #3A3A5E;
  --border-bright: #4D4D72;
  --border-focus: #3b82f6;

  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --gold: #eab308;
  --gold-bright: #facc15;
  --gold-glow: rgba(234, 179, 8, 0.35);
  --gold-dark: #ca8a04;

  --green: #22c55e;
  --green-bright: #4ade80;
  --green-glow: rgba(34, 197, 94, 0.2);

  --red: #ef4444;
  --red-bright: #f87171;
  --red-glow: rgba(239, 68, 68, 0.2);

  --blue: #3b82f6;
  --purple: #8b5cf6;

  --font-display: 'Space Grotesk', 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
}

* {
  box-sizing: border-box;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

/* Keep wheel, touch, and keyboard scrolling without native scrollbar chrome. */
*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

html {
  height: 100%;
  font-size: 14px;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 1000px 560px at 50% -10%, rgba(59, 130, 246, 0.08), transparent 70%),
    radial-gradient(ellipse 700px 460px at 85% 20%, rgba(139, 92, 246, 0.06), transparent 60%),
    url('/images/background/background.png');
  background-position: center, center, center;
  background-repeat: no-repeat;
  background-size: auto, auto, cover;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand, button, .btn-login {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

h1 {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0 0 16px;
}

.amt, .balance-pill, .activity-amount, .crash-multiplier,
.leaderboard-table td:nth-child(3), .case-cost, .history-pill,
.cba-hud-value, .cba-lane-score, .cba-pcard-total, .cba-history-value,
input[type="number"], .gold-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ============ Layout Shells ============ */
.site-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 240px minmax(0, 1fr);
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 138px minmax(0, 1fr) 340px;
  grid-template-rows: 80px 1fr;
  column-gap: var(--game-ui-gutter);
  grid-template-areas:
    "topbar topbar topbar"
    "sidebar main chat";
}

.site-sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar {
  grid-area: sidebar;
  background: transparent;
  padding: var(--game-ui-gutter) 10px 14px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  overflow-y: auto;
}

.site-sidebar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 10px;
  margin-bottom: 20px;
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.03em;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  width: 100%;
  margin-bottom: 24px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.sidebar .brand-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(234, 179, 8, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(234, 179, 8, 0.2);
  flex-shrink: 0;
}

.sidebar .brand-icon svg {
  width: 18px;
  height: 18px;
  color: var(--gold-bright);
}

.sidebar-brand-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}

.sidebar-brand-text span {
  color: var(--gold-bright);
}

.brand-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #121008;
  border-radius: 8px;
  box-shadow: 0 0 12px var(--gold-glow);
  flex-shrink: 0;
}

.sidebar .brand-icon {
  width: 32px;
  height: 32px;
  background: rgba(234, 179, 8, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(234, 179, 8, 0.2);
  box-shadow: none;
}

.sidebar .brand-icon svg {
  width: 18px;
  height: 18px;
  color: var(--gold-bright);
}

.brand-icon svg {
  width: 16px;
  height: 16px;
}

.brand span {
  color: var(--gold-bright);
}

.sidebar-section-label {
  color: var(--text-dim);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 12px 0 4px;
  display: none;
}

.sidebar-panel {
  width: 100%;
  flex: 0 0 auto;
  overflow: hidden;
  background: linear-gradient(180deg, #1B1B3A 0%, #1F1F48 68%, #282860 100%);
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(91, 105, 177, 0.1);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  background: linear-gradient(180deg, #1B1B3A 0%, #1F1F48 68%, #282860 100%);
  border: 0;
  border-radius: 16px;
  padding: 10px 4px 14px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.sidebar-panel > .sidebar-nav {
  background: transparent;
  border-radius: 16px 16px 0 0;
}

.sidebar-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 80px;
  padding: 8px 3px;
  border-radius: 12px;
  color: rgba(166, 177, 221, 0.9);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  transition: all 0.15s ease;
  text-align: center;
}

.sidebar-link:hover {
  background: transparent;
  color: #fff;
}

.sidebar-link.active {
  color: #fff;
  background: radial-gradient(
    ellipse 86% 72% at 50% 34%,
    rgba(255, 169, 28, 0.1) 0%,
    rgba(255, 153, 8, 0.045) 42%,
    transparent 80%
  );
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 16px;
  bottom: 16px;
  width: 4px;
  background: linear-gradient(180deg, #ffd229 0%, #ff9408 100%);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 10px rgba(255, 159, 10, 0.42);
}

.sidebar-link .nav-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(119, 130, 177, 0.96);
  transition: color 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.sidebar-link.active .nav-icon {
  color: #ff9d0a;
  transform: scale(1.06);
  filter: drop-shadow(0 0 7px rgba(255, 157, 10, 0.72));
}

.sidebar-link .nav-icon svg {
  width: 29px;
  height: 29px;
}

.sidebar-utility {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px 0 18px;
  background: linear-gradient(180deg, rgba(35, 35, 82, 0.48), rgba(35, 35, 100, 0.88));
  border-bottom: 1px solid #4262ff;
  border-radius: 0 0 16px 16px;
}

.sidebar-utility-link {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4168ff;
  border-radius: 9px;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.sidebar-utility-link:hover {
  color: #7892ff;
  background: rgba(65, 104, 255, 0.12);
  transform: translateY(-1px);
}

.sidebar-utility-link svg {
  width: 22px;
  height: 22px;
}

.site-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

.main-col {
  grid-area: main;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  background-image:
    radial-gradient(circle at 78% 34%, rgba(72, 55, 150, 0.08), transparent 34%),
    radial-gradient(circle at 28% 80%, rgba(39, 81, 158, 0.07), transparent 38%);
}

/* ============ Top Bars ============ */
.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 14px 28px;
  background: rgba(22, 22, 46, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.dash-topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  padding: 0 26px;
  background-color: rgba(27, 27, 54, 0.95);
  background-image: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top: 2px solid rgba(112, 120, 198, 0.45);
  border-bottom: 1px solid rgba(9, 13, 45, 0.8);
  position: sticky;
  top: 0;
  z-index: 20;
  height: 80px;
  gap: 0;
  box-shadow: 0 6px 18px rgba(3, 6, 25, 0.18);
}

.dash-topbar-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  justify-content: flex-start;
  padding: 0 10px;
}

.dash-topbar-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 80px;
  color: rgba(169, 180, 230, 0.58);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0 2px;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.dash-topbar-nav a:hover {
  color: #d8deff;
}

.dash-topbar-nav a.active {
  color: #4766ff;
}

.dash-topbar-nav a.active::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 5px;
  border-radius: 0 0 5px 5px;
  background: #4262ff;
  box-shadow: 0 2px 8px rgba(66, 98, 255, 0.65);
}

.dash-topbar-nav-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dash-topbar-nav-icon svg {
  width: 18px;
  height: 18px;
}

.dash-topbar-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 32px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f5f7ff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
}

.topbar-logo {
  width: 160px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 160px;
}

.topbar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.topbar-logo-fallback {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: #facc15;
  border-radius: 12px;
  background: rgba(250, 204, 21, 0.12);
}

.topbar-logo.is-fallback .topbar-logo-fallback {
  display: flex;
}

.topbar-logo-fallback svg {
  width: 25px;
  height: 25px;
}

.dash-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.topbar-user-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(145deg, #f4bf59, #b44825 58%, #261b42 59%);
  border: 2px solid rgba(104, 117, 208, 0.28);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  box-shadow: 0 0 0 3px rgba(13, 18, 56, 0.4);
  overflow: hidden;
}

.topbar-user-avatar-fallback {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.topbar-user-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.topbar-wallet {
  display: flex;
  flex-direction: column;
  min-width: 66px;
  color: rgba(171, 181, 230, 0.68);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.15;
}

.topbar-wallet strong {
  margin-top: 3px;
  color: #f0f3ff;
  font-size: 0.9rem;
}

.topbar-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  transition: color 0.15s ease;
}

.topbar-link:hover {
  color: var(--text);
}

.topbar-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  color: #8ca2ff;
  background: rgba(90, 90, 170, 0.16);
  text-decoration: none;
  transition: all 0.15s ease;
}

.topbar-icon-btn:hover {
  color: #fff;
  background: rgba(90, 90, 170, 0.32);
}

.topbar-add-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: #fff;
  background: #4262ff;
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease;
}

.topbar-add-btn:hover {
  background: #5a75ff;
  transform: translateY(-1px);
}

.topbar-add-btn:focus-visible {
  outline: 2px solid #9baaff;
  outline-offset: 3px;
}

html.deposit-dialog-open {
  overflow: hidden;
}

.deposit-dialog {
  width: min(430px, calc(100% - 28px));
  max-width: none;
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
}

.deposit-dialog::backdrop {
  background: rgba(5, 8, 28, .78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.deposit-dialog-card {
  position: relative;
  max-height: calc(100vh - 28px);
  padding: 34px 36px 30px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(104, 123, 216, .18);
  border-radius: 16px;
  background:
    radial-gradient(circle at 92% 90%, rgba(69, 87, 190, .16), transparent 36%),
    #202650;
  box-shadow: 0 28px 80px rgba(2, 5, 22, .64), 0 0 0 1px rgba(255, 255, 255, .02) inset;
  animation: deposit-dialog-in 220ms cubic-bezier(.16, 1, .3, 1);
}

@keyframes deposit-dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.deposit-dialog-close {
  position: absolute;
  top: 23px;
  right: 25px;
  z-index: 2;
  display: grid;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #7f8dbd;
  background: transparent;
  box-shadow: none;
  font: 400 1.75rem/1 var(--font-body);
}

.deposit-dialog-close:hover {
  color: #fff;
  background: rgba(89, 107, 198, .16);
  box-shadow: none;
  transform: none;
}

.deposit-dialog-close:focus-visible {
  outline: 2px solid #8fa2ff;
  outline-offset: 2px;
}

.deposit-dialog-header {
  padding-right: 40px;
}

.deposit-dialog-header > span {
  display: block;
  margin-bottom: 7px;
  color: #8093ef;
  font: 700 .64rem var(--font-display);
  letter-spacing: .14em;
}

.deposit-dialog-header h2 {
  margin: 0;
  color: #fff;
  font: 800 1.42rem var(--font-display);
  letter-spacing: -.02em;
}

.deposit-dialog-header p {
  max-width: 300px;
  margin: 8px 0 20px;
  color: #8d9ac8;
  font-size: .75rem;
  line-height: 1.55;
}

.deposit-dialog-options {
  display: grid;
  gap: 12px;
}

.deposit-dialog-option {
  position: relative;
  display: grid;
  min-height: 104px;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 18px;
  padding: 22px 20px 22px 23px;
  overflow: hidden;
  border: 1px solid rgba(111, 129, 221, .08);
  border-radius: 13px;
  color: #fff;
  background: #2c3365;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease;
}

.deposit-dialog-option::before {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  right: -70px;
  bottom: -105px;
  border-radius: 50%;
  background: rgba(76, 96, 209, .08);
  pointer-events: none;
}

.deposit-dialog-option:hover {
  border-color: rgba(105, 130, 255, .3);
  background: #323a72;
  box-shadow: 0 14px 30px rgba(5, 8, 29, .2);
  transform: translateY(-1px);
}

.deposit-dialog-option:focus-visible {
  outline: 2px solid #8fa2ff;
  outline-offset: 3px;
}

.deposit-dialog-option-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.deposit-dialog-option-copy strong,
.deposit-dialog-option-copy small {
  display: block;
}

.deposit-dialog-option-copy strong {
  color: #f7f8ff;
  font: 700 .88rem var(--font-display);
}

.deposit-dialog-option-copy small {
  margin-top: 7px;
  color: #8290be;
  font-size: .67rem;
}

.deposit-dialog-gold-icon {
  position: relative;
  z-index: 1;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid rgba(244, 186, 65, .2);
  border-radius: 17px;
  background: rgba(243, 181, 55, .08);
  box-shadow: 0 0 28px rgba(240, 173, 42, .08);
}

.deposit-dialog-gold-icon .gold-token-icon {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, .2));
}

.deposit-dialog-option-arrow {
  position: relative;
  z-index: 1;
  color: #7385cc;
  font-size: 1.08rem;
  transition: color .16s ease, transform .16s ease;
}

.deposit-dialog-option:hover .deposit-dialog-option-arrow {
  color: #fff;
  transform: translateX(2px);
}

.deposit-dialog-promo {
  background:
    radial-gradient(circle at 76% 50%, rgba(210, 55, 135, .14), transparent 26%),
    #2c3365;
}

.deposit-dialog-ticket {
  position: relative;
  z-index: 1;
  display: grid;
  width: 58px;
  height: 36px;
  place-items: center;
  border-radius: 5px;
  color: #fff;
  background: linear-gradient(135deg, #ff416f, #ff5e9a);
  box-shadow: 0 0 28px rgba(255, 61, 128, .32), 7px 8px 0 rgba(255, 155, 61, .82);
  transform: rotate(-10deg);
}

.deposit-dialog-ticket::before,
.deposit-dialog-ticket::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2c3365;
  transform: translateY(-50%);
}

.deposit-dialog-ticket::before { left: -5px; }
.deposit-dialog-ticket::after { right: -5px; }

.deposit-dialog-ticket span {
  font: 800 .52rem var(--font-display);
  letter-spacing: .1em;
}

@media (max-width: 520px) {
  .deposit-dialog-card { padding: 28px 20px 22px; }
  .deposit-dialog-close { top: 17px; right: 17px; }
  .deposit-dialog-header p { margin-bottom: 17px; }
  .deposit-dialog-option { min-height: 94px; gap: 12px; padding: 18px 14px 18px 17px; }
  .deposit-dialog-gold-icon { width: 50px; height: 50px; }
  .deposit-dialog-gold-icon .gold-token-icon { width: 36px; height: 36px; }
  .deposit-dialog-ticket { width: 50px; height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .deposit-dialog-card { animation: none; }
  .deposit-dialog-option,
  .deposit-dialog-option-arrow { transition: none; }
}

html[data-animations-enabled="false"] .deposit-dialog-card {
  animation: none;
}

.topbar-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  color: #4f6cff;
  text-decoration: none;
  transition: all 0.15s ease;
}

.topbar-logout-btn:hover {
  color: #fff;
  background: rgba(79, 79, 235, 0.18);
}

.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(18, 18, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--gold-bright);
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
  box-shadow: none;
}

.gold-token-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--gold-bright);
  flex: 0 0 auto;
  vertical-align: -2px;
}

.gold-token-icon > img,
.gold-token-icon > .gold-token-fallback-icon {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: 100%;
}

.gold-token-icon > img {
  position: relative;
  z-index: 1;
  object-fit: contain;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 24px 72px;
  width: 100%;
}

.container.narrow {
  max-width: 520px;
}

.dash-main {
  padding: 24px;
  flex: 1;
}

/* ============ Cards & Sections ============ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 22px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.muted {
  color: var(--text-muted);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 16px;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--gold-bright);
}

/* ============ Activity Row ============ */
.activity-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 24px;
}

.activity-card {
  flex: 0 0 auto;
  width: 130px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.activity-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-bright);
}

.activity-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin: 0 auto 8px;
  font-size: 0.85rem;
  font-family: var(--font-display);
}

.activity-name {
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-amount {
  font-size: 0.85rem;
  font-weight: 700;
}

.activity-amount.win { color: var(--green-bright); }
.activity-amount.lose { color: var(--red-bright); }

/* ============ Promo Banner ============ */
.promo-banner {
  background: linear-gradient(135deg, #181835 0%, #25254A 50%, #1C1C3A 100%);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  text-align: center;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.promo-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 30%;
  width: 300px;
  height: 200px;
  background: radial-gradient(ellipse, rgba(245, 158, 11, 0.12), transparent 70%);
  pointer-events: none;
}

.promo-banner h2 {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 8px;
}

.promo-banner p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 auto;
  max-width: 500px;
}

/* ============ Game Tiles & Grid ============ */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}

.game-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  text-decoration: none;
  color: var(--text);
  min-height: 155px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.game-tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.03), transparent 60%);
  pointer-events: none;
}

.game-tile:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  background: var(--bg-card-hover);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4), 0 0 16px var(--gold-glow);
}

.game-tile .tile-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-bright);
  margin-bottom: 20px;
  transition: all 0.2s ease;
}

.game-tile:hover .tile-icon-wrap {
  background: var(--gold);
  color: #100c06;
  border-color: var(--gold-bright);
  box-shadow: 0 0 12px var(--gold-glow);
}

.game-tile .tile-icon-wrap svg {
  width: 22px;
  height: 22px;
}

.game-tile .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  display: block;
  color: var(--text);
}

.game-tile .tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 700;
  margin-top: 2px;
}

.game-tile .badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ============ Forms, Inputs & Buttons ============ */
form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 380px;
}

label {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input, select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: var(--font-body);
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

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

.bet-row input {
  flex: 1;
  min-width: 100px;
}

.bet-row button {
  margin-top: 0;
  flex: 0 0 auto;
  padding: 0 24px;
  white-space: nowrap;
}

button {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #1B1B3A;
  border: 1px solid var(--gold-bright);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.25);
  transition: all 0.15s ease;
}

button:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 22px var(--gold-glow), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.5);
  box-shadow: none;
}

.btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #1B1B3A;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  border: 1px solid var(--gold-bright);
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.25);
  transition: all 0.15s ease;
}

.btn-login:hover {
  filter: brightness(1.06);
  box-shadow: 0 4px 14px var(--gold-glow);
}

.result {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-top: 16px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid;
}

.result.win {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--green);
  color: var(--green-bright);
}

.result.lose {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--red);
  color: var(--red-bright);
}

/* ============ Leaderboard ============ */
.dash-main.leaderboard-main {
  min-width: 0;
  padding: var(--game-ui-gutter) 0 56px;
}

.leaderboard-page {
  width: calc(100% - (var(--game-ui-gutter) * 2));
  max-width: 1364px;
  margin: 0 auto;
}

.leaderboard-overview {
  min-height: 116px;
  padding: 22px 28px;
  border: 1px solid rgba(92, 110, 181, 0.14);
  border-radius: 13px;
  background:
    radial-gradient(circle at 72% 0%, rgba(63, 93, 255, 0.14), transparent 36%),
    linear-gradient(135deg, rgba(35, 42, 87, 0.97), rgba(30, 36, 77, 0.96));
  box-shadow: 0 14px 34px rgba(5, 9, 34, 0.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.leaderboard-eyebrow {
  display: block;
  margin-bottom: 5px;
  color: #6f83bd;
  font: 700 0.7rem var(--font-display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.leaderboard-overview h1,
.leaderboard-results h2 {
  margin: 0;
  color: #fff;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.leaderboard-overview h1 { font-size: clamp(1.45rem, 2vw, 1.9rem); }
.leaderboard-overview p { margin: 4px 0 0; color: #8293c8; font-size: 0.84rem; }

.leaderboard-overview-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, auto));
  align-items: center;
}

.leaderboard-overview-stats > div {
  min-height: 62px;
  padding: 8px 24px;
  border-left: 1px solid rgba(118, 133, 193, 0.16);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.leaderboard-overview-stats span {
  color: #7588c1;
  font-size: 0.72rem;
}

.leaderboard-overview-stats strong {
  color: #fff;
  font: 800 1.25rem var(--font-display);
  white-space: nowrap;
}

.leaderboard-overview-stats strong .gold-token-icon {
  width: 19px;
  height: 19px;
  margin-left: 4px;
  color: #8fa0cf;
}

.leaderboard-login-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(73, 102, 255, 0.58);
  border-radius: 8px;
  color: #fff;
  background: #3658ed;
  text-decoration: none;
  font: 700 0.82rem var(--font-display);
}

.leaderboard-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(205px, 335px));
  grid-template-areas: 'second first third';
  align-items: end;
  justify-content: center;
  gap: clamp(18px, 3vw, 56px);
  margin: 70px auto 66px;
  padding-inline: 4%;
}

.leaderboard-podium-card {
  --rank-rgb: 139, 153, 198;
  position: relative;
  min-height: 350px;
  padding: 24px 24px 28px;
  overflow: hidden;
  border: 1px solid rgba(var(--rank-rgb), 0.1);
  border-radius: 13px;
  background:
    radial-gradient(circle at 50% 46%, rgba(var(--rank-rgb), 0.1), transparent 35%),
    linear-gradient(180deg, rgba(35, 41, 82, 0.98), rgba(29, 35, 74, 0.97));
  box-shadow:
    0 18px 40px rgba(6, 10, 35, 0.2),
    inset 0 0 42px rgba(var(--rank-rgb), 0.035);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.leaderboard-podium-card--first {
  --rank-rgb: 255, 183, 31;
  grid-area: first;
  min-height: 385px;
  transform: translateY(-18px);
}

.leaderboard-podium-card--second { grid-area: second; }
.leaderboard-podium-card--third { --rank-rgb: 229, 102, 50; grid-area: third; }

.leaderboard-rank-badge {
  align-self: center;
  min-width: 105px;
  padding: 6px 14px;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(180deg, rgba(var(--rank-rgb), 1), rgba(var(--rank-rgb), 0.76));
  box-shadow: 0 7px 20px rgba(var(--rank-rgb), 0.15);
  text-align: center;
  font: 800 0.78rem var(--font-display);
  text-transform: uppercase;
}

.leaderboard-podium-card--first .leaderboard-rank-badge { color: #171b38; }

.leaderboard-profile-button {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  box-shadow: none;
  font: inherit;
}

.leaderboard-profile-button:hover,
.leaderboard-profile-button:active {
  filter: none;
  box-shadow: none;
  transform: none;
}

.leaderboard-profile-button:focus-visible {
  outline: 2px solid #4b6fff;
  outline-offset: 5px;
  border-radius: 8px;
}

.leaderboard-podium-card > .leaderboard-profile-button {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.leaderboard-avatar-stage {
  position: relative;
  width: 180px;
  height: 168px;
  margin: 9px 0 0;
  display: grid;
  place-items: center;
}

.leaderboard-avatar-stage::before {
  content: '';
  position: absolute;
  inset: 3px;
  background: repeating-conic-gradient(
    from -5deg,
    rgba(var(--rank-rgb), 0.19) 0deg 7deg,
    transparent 7deg 20deg
  );
  -webkit-mask-image: radial-gradient(circle, #000 0 22%, transparent 69%);
  mask-image: radial-gradient(circle, #000 0 22%, transparent 69%);
}

.leaderboard-crown {
  position: absolute;
  top: 20px;
  z-index: 2;
  color: rgb(var(--rank-rgb));
  font-size: 2rem;
  line-height: 1;
  filter: drop-shadow(0 0 9px rgba(var(--rank-rgb), 0.38));
}

.leaderboard-avatar {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgb(var(--rank-rgb));
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #4a5794, #283369);
  box-shadow: 0 0 22px rgba(var(--rank-rgb), 0.34);
  font: 800 1.35rem var(--font-display);
}

.leaderboard-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.leaderboard-podium-avatar {
  z-index: 1;
  width: 78px;
  height: 78px;
  margin-top: 26px;
}

.leaderboard-podium-card--first .leaderboard-podium-avatar {
  width: 90px;
  height: 90px;
}

.leaderboard-player-name {
  max-width: 100%;
  overflow: hidden;
  color: #fff;
  font: 800 0.9rem var(--font-display);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-wagered-pill {
  width: min(100%, 220px);
  min-height: 42px;
  margin-top: 20px;
  padding: 7px 12px;
  border: 1px solid rgba(var(--rank-rgb), 0.08);
  border-radius: 7px;
  background: rgba(52, 61, 119, 0.82);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #9bacdb;
  font-size: 0.72rem;
}

.leaderboard-wagered-pill strong,
.leaderboard-wager-cell {
  color: #fff;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.leaderboard-wagered-pill strong {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.leaderboard-wagered-pill .gold-token-icon,
.leaderboard-wager-cell .gold-token-icon {
  width: 17px;
  height: 17px;
  color: #91a1d0;
}

.leaderboard-results {
  width: 100%;
}

.leaderboard-results-heading {
  min-height: 56px;
  padding: 0 4px 10px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.leaderboard-results h2 { font-size: 1.55rem; }
.leaderboard-results-heading > span { color: #7083bb; font-size: 0.74rem; }

.leaderboard-table {
  width: 100%;
  min-width: 560px;
  border-collapse: separate;
  border-spacing: 0 7px;
  table-layout: fixed;
}

.leaderboard-table th {
  text-align: left;
  color: #7184bd;
  font-size: 0.75rem;
  text-transform: none;
  letter-spacing: 0;
  padding: 5px 20px;
  border: 0;
  font-family: var(--font-display);
}

.leaderboard-table td {
  height: 58px;
  padding: 9px 20px;
  border: 0;
  background: linear-gradient(90deg, rgba(29, 36, 79, 0.78), rgba(28, 34, 73, 0.58));
}

.leaderboard-table th:first-child,
.leaderboard-table td:first-child { width: 82px; }

.leaderboard-table th:last-child,
.leaderboard-table td:last-child {
  width: 250px;
  text-align: right;
}

.leaderboard-table td:first-child { border-radius: 9px 0 0 9px; }
.leaderboard-table td:last-child { border-radius: 0 9px 9px 0; }

.leaderboard-result-rank {
  color: #dfe6ff;
  font: 800 0.82rem var(--font-display);
}

.leaderboard-result-rank--1 { color: #ffbf2f; }
.leaderboard-result-rank--2 { color: #aebbdc; }
.leaderboard-result-rank--3 { color: #ef7640; }

.leaderboard-row-profile {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-align: left;
}

.leaderboard-row-profile strong {
  overflow: hidden;
  font: 700 0.82rem var(--font-display);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row-avatar {
  --rank-rgb: 90, 111, 190;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-width: 1px;
  font-size: 0.78rem;
  box-shadow: 0 0 12px rgba(78, 99, 185, 0.22);
}

.leaderboard-wager-cell {
  display: table-cell;
  white-space: nowrap;
}

.leaderboard-wager-cell strong { margin-right: 7px; }

.leaderboard-empty-row {
  height: 90px !important;
  border-radius: 9px !important;
  color: #8192c6;
  text-align: center;
}

@media (max-width: 1280px) {
  .leaderboard-podium {
    gap: 18px;
    padding-inline: 0;
  }

  .leaderboard-podium-card { padding-inline: 16px; }
}

@media (max-width: 920px) {
  .leaderboard-overview {
    align-items: flex-start;
    flex-direction: column;
  }

  .leaderboard-overview-stats { width: 100%; }
  .leaderboard-overview-stats > div:first-child { border-left: 0; padding-left: 0; }

  .leaderboard-podium {
    grid-template-columns: repeat(2, minmax(210px, 335px));
    grid-template-areas: 'first first' 'second third';
    margin-top: 44px;
  }

  .leaderboard-podium-card--first {
    width: min(335px, 100%);
    justify-self: center;
    transform: none;
  }
}

@media (max-width: 620px) {
  .dash-main.leaderboard-main { padding-top: 12px; }
  .leaderboard-page { width: calc(100% - 24px); }
  .leaderboard-overview { padding: 20px; }
  .leaderboard-overview-stats { grid-template-columns: 1fr; }
  .leaderboard-overview-stats > div { padding: 8px 0; border-left: 0; border-top: 1px solid rgba(118, 133, 193, 0.16); }

  .leaderboard-podium {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'first' 'second' 'third';
    margin: 34px auto 48px;
  }

  .leaderboard-podium-card {
    width: 100%;
    min-height: 330px;
  }

  .leaderboard-results { overflow-x: auto; }
  .leaderboard-results-heading { position: sticky; left: 0; }
  .leaderboard-table th,
  .leaderboard-table td { padding-inline: 12px; }
  .leaderboard-table th:last-child,
  .leaderboard-table td:last-child { width: 175px; }
}

/* ============ Chat Panel ============ */
.chat-panel {
  grid-area: chat;
  background:
    radial-gradient(circle at 55% 72%, rgba(58, 58, 135, 0.16), transparent 42%),
    linear-gradient(160deg, rgba(24, 24, 62, 0.98), rgba(14, 14, 42, 0.98));
  border: 1px solid rgba(72, 88, 164, 0.1);
  display: flex;
  flex-direction: column;
  width: calc(340px - var(--game-ui-gutter));
  height: auto;
  position: fixed;
  top: calc(80px + var(--game-ui-gutter));
  right: var(--game-ui-gutter);
  bottom: var(--game-ui-gutter);
  overflow: hidden;
  margin: 0;
  border-radius: 14px;
  z-index: 12;
}

.chat-header {
  min-height: 74px;
  padding: 18px 22px 12px;
  border-bottom: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-header-left {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex: 1;
}

.chat-title {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 500;
}

.chat-header svg {
  width: 18px;
  height: 18px;
  color: var(--gold);
}

.chat-online-badge {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffb51b;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  padding: 0;
}

.chat-online-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffb51b;
}

.chat-header-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  margin-left: 14px;
  border-radius: 5px;
  background: #2C2C52;
  color: #6e7aa9;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.chat-header-expand:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.chat-header-expand svg {
  color: inherit;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 4px 22px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-msg {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border-radius: 5px;
  transition: background 0.15s ease;
}

.chat-msg:hover {
  background: transparent;
}

.chat-msg-avatar {
  position: relative;
  flex-shrink: 0;
}

.chat-msg-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(145deg, #d6b554, #5f7834 45%, #2E2E55 46%, #18183A);
  border: 1px solid rgba(111, 126, 190, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
}

.chat-msg-level {
  position: absolute;
  top: -8px;
  right: -7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #8796c8;
  border: 2px solid #c0c9e7;
  font-size: 0.64rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-msg-body {
  flex: 1;
  min-width: 0;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 12px;
  background: linear-gradient(135deg, #24244D, #20204A);
  border-radius: 5px;
}

.chat-msg-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 3px;
}

.chat-msg-user {
  font-weight: 700;
  font-size: 0.9rem;
  color: #909bc9;
}

.chat-msg-time {
  font-size: 0.72rem;
  color: rgba(148, 163, 201, 0.5);
  font-weight: 500;
}

.chat-msg-text {
  color: rgba(255, 255, 255, 0.94);
  font-size: 0.9rem;
  line-height: 1.4;
  word-break: break-word;
}

.chat-msg-tip .chat-msg-body {
  box-shadow: inset 3px 0 #f5b83b;
}

.chat-msg-tip .chat-msg-text {
  color: #ffd873;
  font-weight: 700;
}

.chat-msg-system-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(245, 184, 59, 0.14);
  border: 1px solid rgba(245, 184, 59, 0.35);
  color: #ffd873;
}

.chat-discord-card {
  margin: 10px 22px 16px;
  background: linear-gradient(135deg, #cf1919, #b90f16);
  border-radius: 12px;
  padding: 16px;
}

.chat-discord-card h4 {
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  margin: 0 0 2px;
}

.chat-discord-card p {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

.chat-input-wrap {
  position: relative;
  padding: 7px 22px 20px;
  border-top: 0;
}

.chat-command-feedback {
  margin: 7px 2px 0;
  color: #ef718d;
  font-size: 0.7rem;
  line-height: 1.35;
}

.chat-command-feedback:empty { display: none; }
.chat-command-feedback.success { color: #54d7b1; }

.chat-input-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: none;
  padding: 6px 9px 6px 13px;
  background: linear-gradient(135deg, #353565, #2E2E55);
  border-radius: 5px;
}

.chat-input-row input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  padding: 0;
  height: 30px;
  font-size: 0.82rem;
  border-radius: 0;
  color: var(--text);
}

.chat-input-row input::placeholder {
  color: rgba(148, 163, 184, 0.4);
}

.chat-input-row input:focus {
  border: 0;
  box-shadow: none;
}

.chat-input-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: rgba(148, 163, 184, 0.5);
  cursor: pointer;
  transition: color 0.15s ease;
}

.chat-input-emoji:hover {
  color: var(--text);
}

.chat-input-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 5px;
  background: #4165ff;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
  border: none;
  padding: 0;
  margin: 0;
  box-shadow: none;
}

.chat-input-send:hover {
  background: #2563eb;
}

.emoji-picker {
  display: none;
  position: absolute;
  bottom: 62px;
  left: 0;
  right: 0;
  background: #25254A;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.emoji-picker.open {
  display: block;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
}

.emoji-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.1s ease;
}

.emoji-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.chat-login-btn {
  margin: 12px;
  text-align: center;
}

/* ============================================================
   Game Interfaces (Custom, Clean, No-Emoji)
   ============================================================ */

/* --- Playing cards (Blackjack) --- */
.card-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.card-el {
  width: 58px;
  height: 82px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  font-family: var(--font-mono);
  color: #1B1B3A;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  animation: deal-in 0.3s ease backwards;
}

.card-el.red {
  color: var(--red);
}

.card-el.back {
  background: repeating-linear-gradient(45deg, #25254A, #25254A 6px, #1B1B3A 6px, #1B1B3A 12px);
  border-color: #3A3A5E;
  color: transparent;
}

/* --- Coinflip (3D Metallic Disc) --- */
.coin-stage {
  perspective: 600px;
  display: flex;
  justify-content: center;
  margin: 28px 0;
}

.coin-disc {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  background: radial-gradient(circle at 35% 35%, #e9d5ff 0%, #a855f7 55%, #7c3aed 100%);
  color: #2e1065;
  border: 3px solid #d8b4fe;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.45), inset 0 2px 4px rgba(255, 255, 255, 0.6);
  transform-style: preserve-3d;
}

.coin-disc.spinning {
  animation: coin-spin 1.1s cubic-bezier(0.2, 0.6, 0.3, 1) forwards;
}

/* --- Slot Reels (Modern Digital Casino) --- */
.reel-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 24px 0;
}

.reel-box {
  width: 92px;
  height: 92px;
  background: var(--bg-input);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
  color: var(--gold-bright);
}

.reel-box.spinning {
  animation: pulse-slot 0.15s linear infinite;
  border-color: var(--gold);
}

.slot-sym {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.slot-sym svg {
  width: 32px;
  height: 32px;
}

.slot-sym span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* --- Minesweeper Grid --- */
.mine-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-width: 340px;
  margin: 20px 0;
}

.mine-tile {
  aspect-ratio: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-muted);
}

.mine-tile:hover:not(.revealed):not(.mine) {
  border-color: var(--gold);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.mine-tile.revealed {
  background: rgba(16, 185, 129, 0.12);
  border-color: var(--green);
  color: var(--green-bright);
  animation: pop-in 0.25s ease;
}

.mine-tile.mine {
  background: rgba(239, 68, 68, 0.18);
  border-color: var(--red);
  color: var(--red-bright);
  animation: pop-in 0.25s ease, shake 0.4s ease;
}

.mine-tile.disabled {
  cursor: default;
}

.mine-tile svg {
  width: 22px;
  height: 22px;
}

/* --- Crash Game (Bloxflip Style) --- */
.crash-page {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
  min-height: calc(100vh - 80px);
}

.crash-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.crash-panel {
  background: rgba(17, 24, 39, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 20px;
}

.crash-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 2px;
  margin-bottom: 20px;
}

.crash-tab {
  background: none;
  border: none;
  color: rgba(148, 163, 184, 0.6);
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.15s ease;
  flex: 1;
}

.crash-tab.active {
  background: #fff;
  color: #1B1B3A;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.crash-tab:hover:not(.active) {
  color: var(--text);
}

.crash-label {
  font-size: 0.7rem;
  color: rgba(148, 163, 184, 0.5);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.crash-bet-row {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 16px;
}

.crash-bet-icon {
  padding: 0 12px;
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  font-size: 0.7rem;
  font-weight: 700;
}

.crash-bet-icon svg {
  width: 18px;
  height: 18px;
}

.crash-bet-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 12px 4px;
  outline: none;
  font-family: var(--font-mono);
}

.crash-bet-input::placeholder {
  color: rgba(148, 163, 184, 0.3);
}

.crash-bet-half,
.crash-bet-double {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  margin: 0 2px;
}

.crash-bet-half:hover,
.crash-bet-double:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.crash-auto-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.crash-auto-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
}

.crash-auto-input::placeholder {
  color: rgba(148, 163, 184, 0.3);
}

.crash-auto-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.crash-auto-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}

.crash-join-btn {
  width: 100%;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
  margin-top: 4px;
}

.crash-join-btn:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(59, 130, 246, 0.4);
}

.crash-join-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.crash-cashout-btn {
  width: 100%;
  background: linear-gradient(180deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
  margin-top: 4px;
}

.crash-cashout-btn:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.4);
}

.crash-cashout-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.crash-players-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.crash-players-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.crash-players-total {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.crash-players-total svg {
  width: 16px;
  height: 16px;
  color: var(--gold-bright);
}

.crash-player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.crash-player:last-child {
  border-bottom: none;
}

.crash-player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.crash-player-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crash-player-mult {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--green-bright);
}

.crash-player-mult.pending {
  color: var(--text-muted);
  animation: pulse-dots 1.5s infinite;
}

@keyframes pulse-dots {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.crash-player-bet {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.crash-player-bet svg {
  width: 14px;
  height: 14px;
  color: var(--gold-bright);
}

.crash-player-payout {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  gap: 4px;
}

.crash-player-payout svg {
  width: 14px;
  height: 14px;
  color: var(--gold-bright);
}

/* Crash Graph Area */
.crash-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.crash-history-row {
  display: flex;
  gap: 8px;
  padding: 0 4px 12px;
  overflow-x: auto;
}

.crash-history-pill {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.crash-history-pill.low {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.crash-history-pill.mid {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.crash-history-pill.high {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.crash-history-pill.gold {
  background: rgba(234, 179, 8, 0.15);
  color: var(--gold-bright);
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.crash-graph-area {
  flex: 1;
  background: #0d1b2a;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  min-height: 300px;
}

.crash-graph-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.crash-graph-header {
  position: absolute;
  top: 16px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 5;
}

.crash-graph-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.crash-graph-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}

.crash-network {
  position: absolute;
  top: 16px;
  left: 20px;
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
}

.crash-network-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px #10b981; }
  50% { opacity: 0.5; box-shadow: 0 0 4px #10b981; }
}

.crash-y-axis {
  display: none;
}

.crash-y-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.35);
  font-family: var(--font-mono);
}

.crash-x-axis {
  display: none;
}

.crash-x-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.35);
  font-family: var(--font-mono);
}

.crash-center-display {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 4;
  pointer-events: none;
}

.crash-big-mult {
  font-size: 5.5rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  font-family: var(--font-display);
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  letter-spacing: -0.02em;
}

.crash-big-mult.state-rising {
  color: #fff;
  background: linear-gradient(180deg, #fff, #e2e8f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.crash-big-mult.state-crashed {
  color: #ef4444;
  background: linear-gradient(180deg, #ef4444, #f87171);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 40px rgba(239, 68, 68, 0.4);
}

.crash-big-mult.state-waiting {
  font-size: 4.5rem;
  color: var(--text);
}

.crash-big-label {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.5);
  margin-top: 8px;
}

.crash-big-sub {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(148, 163, 184, 0.4);
  margin-top: 4px;
}

.crash-rocket {
  position: absolute;
  z-index: 4;
  transition: left 0.05s linear, top 0.05s linear, transform 0.05s linear;
  filter: drop-shadow(0 6px 16px rgba(249, 115, 22, 0.5));
}

.crash-rocket svg {
  width: 64px;
  height: 64px;
}

.crash-explosion {
  position: absolute;
  z-index: 4;
  width: 160px;
  height: 160px;
  display: none;
  animation: explode-anim 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes explode-anim {
  0% { transform: scale(0.3); opacity: 1; }
  50% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

.crash-trail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  overflow: visible;
}

.crash-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.crash-modal-box {
  background: #25254A;
  border: 1px solid #3A3A5E;
  border-radius: 14px;
  padding: 22px;
  width: 420px;
  max-width: 90vw;
  position: relative;
  color: #f8fafc;
}

.crash-modal-box h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.crash-modal-box p {
  margin: 0 0 14px;
  color: rgba(226, 232, 240, 0.75);
  font-size: 13px;
  line-height: 1.5;
}

.crash-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
}

.crash-modal-close:hover {
  color: #f8fafc;
}

.crash-modal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid #3A3A5E;
  font-size: 13px;
}

.crash-modal-row span {
  color: #94a3b8;
}

.crash-modal-row code {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Crash Game Rebuild --- */
.crash-page {
  display: grid;
  grid-template-columns: minmax(295px, 34%) minmax(440px, 1fr);
  gap: 16px;
  width: 94%;
  max-width: 1320px;
  min-height: 620px;
  margin: 0 auto;
  padding: 0;
}

.crash-left {
  gap: 22px;
  min-width: 0;
}

.crash-panel {
  padding: 20px 22px 22px;
  background: var(--game-surface);
  border: 1px solid rgba(89, 103, 174, 0.08);
  border-radius: 15px;
  box-shadow: none;
}

.crash-left .crash-panel:last-child {
  padding: 0;
  overflow: hidden;
}

.crash-tabs {
  justify-content: flex-start;
  gap: 10px;
  width: max-content;
  margin: 0 0 22px;
  padding: 0;
  background: transparent;
  border: 0;
}

.crash-tab {
  flex: 0 0 auto;
  min-width: 84px;
  margin: 0;
  padding: 11px 16px;
  color: #7d8dc6;
  background: transparent;
  border: 0;
  border-radius: 6px;
  box-shadow: none;
  font-size: 0.9rem;
}

.crash-tab.active {
  color: #fff;
  background: #2E2E55;
  box-shadow: none;
}

.crash-label {
  margin: 0 0 8px;
  color: #5e70aa;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.crash-bet-row,
.crash-auto-row {
  min-height: 47px;
  margin: 0 0 18px;
  padding: 5px 8px;
  gap: 8px;
  background: linear-gradient(135deg, #353568, #2F2F55);
  border: 0;
  border-radius: 7px;
}

.crash-auto-row {
  align-items: center;
}

.crash-bet-icon {
  padding: 0 5px 0 8px;
  color: #8290bf;
}

.crash-bet-icon svg {
  width: 19px;
  height: 19px;
}

.crash-bet-input,
.crash-auto-input {
  min-width: 0;
  height: 35px;
  padding: 0 4px;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
}

.crash-bet-input:focus,
.crash-auto-input:focus {
  border: 0;
  box-shadow: none;
}

.crash-bet-half,
.crash-bet-double,
.crash-auto-btn {
  min-width: 50px;
  margin: 0;
  padding: 7px 10px;
  color: #8c9bcc;
  background: #3F3F72;
  border: 0;
  border-radius: 9px;
  box-shadow: none;
  font-size: 0.75rem;
  font-weight: 500;
}

.crash-auto-btn {
  white-space: nowrap;
}

.crash-bet-half:hover,
.crash-bet-double:hover,
.crash-auto-btn:hover {
  color: #cbd4f4;
  background: #46558d;
  box-shadow: none;
}

.crash-join-btn,
.crash-cashout-btn {
  min-height: 44px;
  margin: 14px 0 0;
  padding: 11px 14px;
  color: #fff;
  background: #3e5cff;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  font-size: 0.9rem;
}

.crash-cashout-btn {
  background: #00aeb8;
}

.crash-join-btn:hover:not(:disabled),
.crash-cashout-btn:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: none;
  box-shadow: none;
}

.crash-join-btn:disabled,
.crash-cashout-btn:disabled {
  opacity: 0.62;
}

.crash-players-header {
  min-height: 66px;
  margin: 0;
  padding: 0 24px;
  background: rgba(34, 34, 70, 0.98);
}

.crash-players-title {
  color: #fff;
  font-size: 0.93rem;
}

.crash-players-total {
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
}

.crash-players-total svg,
.crash-player-bet svg,
.crash-player-result svg {
  width: 17px;
  height: 17px;
  color: #7e8ab8;
}

#crash-players-list {
  max-height: 300px;
  overflow-y: auto;
}

.crash-empty-players {
  padding: 38px 24px;
  color: #6575a8;
  text-align: center;
  font-size: 0.83rem;
}

.crash-player {
  min-height: 54px;
  gap: 10px;
  padding: 7px 20px 7px 24px;
  background: linear-gradient(90deg, #2C2C54, #27274D);
  border: 0;
}

.crash-player:nth-child(even) {
  background: linear-gradient(90deg, #28284F, #24244A);
}

.crash-player.is-you {
  box-shadow: inset 3px 0 #3e5cff;
}

.crash-player-avatar {
  width: 32px;
  height: 32px;
  color: #fff;
  background: linear-gradient(145deg, #e2b33e, #7b5927 48%, #2F2F55 49%);
  border: 1px solid rgba(105, 119, 181, 0.25);
}

.crash-player-name {
  color: #fff;
  font-size: 0.82rem;
}

.crash-player-result {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
  font-size: 0.78rem;
}

.crash-player-result strong {
  color: #fff;
}

.crash-player-result b {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #00c5c9;
  font-weight: 700;
}

.crash-player-result.pending {
  flex: 0 1 90px;
}

.crash-player-bet {
  min-width: 72px;
  justify-content: flex-end;
  color: #8294d3;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.crash-right {
  position: relative;
  min-width: 0;
  min-height: 620px;
  gap: 0;
  padding: 16px 20px 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 51% 68%, rgba(110, 47, 133, 0.2), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(56, 56, 150, 0.13), transparent 38%),
    var(--game-surface);
  border: 1px solid rgba(89, 103, 174, 0.08);
  border-radius: 15px;
}

.crash-history-row {
  min-height: 34px;
  gap: 8px;
  margin: 0;
  padding: 4px 170px 4px 0;
}

.crash-history-pill {
  min-width: 47px;
  padding: 5px 10px;
  color: #fff;
  background: #41416E;
  border: 0;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.77rem;
  text-align: center;
}

.crash-history-pill.normal,
.crash-history-pill.mid,
.crash-history-pill.low {
  color: #fff;
  background: #41416E;
  border: 0;
}

.crash-history-pill.high,
.crash-history-pill.rare {
  color: #fff;
  background: #3856f3;
  border: 0;
}

.crash-history-pill.latest,
.crash-history-pill.gold {
  color: #fff;
  background: #ffb31b;
  border: 0;
}

.crash-graph-area {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.crash-graph-header {
  top: -42px;
  right: -8px;
  gap: 10px;
}

.crash-graph-btn {
  min-width: 42px;
  margin: 0;
  padding: 7px 13px;
  color: #8491c2;
  background: #30305A;
  border: 0;
  border-radius: 9px;
  box-shadow: none;
  font-size: 0.78rem;
}

.crash-network {
  top: 3px;
  right: 4px;
  left: auto;
  color: #fff;
  font-size: 0.7rem;
}

.crash-network-dot {
  width: 15px;
  height: 15px;
  background: transparent;
  border: 2px solid #00d2de;
  box-shadow: inset 0 0 0 3px rgba(0, 210, 222, 0.18), 0 0 8px rgba(0, 210, 222, 0.55);
  animation: pulse-dot 2s infinite;
}

.crash-network.offline {
  color: #ff6b6b;
}

.crash-network.offline .crash-network-dot {
  border-color: #ff6b6b;
  box-shadow: none;
}

.crash-graph-canvas {
  z-index: 2;
}

.crash-y-axis {
  position: absolute;
  z-index: 3;
  top: 75px;
  bottom: 55px;
  left: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.crash-x-axis {
  position: absolute;
  z-index: 3;
  right: 40px;
  bottom: 18px;
  left: 86px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.crash-y-label,
.crash-x-label {
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
}

.crash-center-display {
  z-index: 4;
  justify-content: flex-start;
  padding-top: 58px;
}

.crash-big-mult,
.crash-big-mult.state-waiting {
  color: #fff;
  font-size: clamp(3.4rem, 5vw, 5.5rem);
  font-weight: 800;
  text-shadow: none;
}

.crash-big-mult.state-rising {
  color: #fff;
  background: none;
  -webkit-text-fill-color: currentColor;
}

.crash-big-mult.state-crashed {
  color: #ff7045;
  background: none;
  -webkit-text-fill-color: currentColor;
  text-shadow: none;
}

.crash-big-label {
  margin-top: 14px;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 500;
}

.state-crashed + .crash-big-label {
  color: #ff7045;
}

.crash-big-sub {
  margin-top: 8px;
  color: #fff;
  font-size: 0.9rem;
}

.crash-modal.open {
  display: flex;
}

.crash-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  max-width: 340px;
  padding: 12px 17px;
  color: #fff;
  background: #29294F;
  border: 1px solid rgba(111, 126, 190, 0.3);
  border-radius: 9px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.crash-toast.success {
  border-color: rgba(0, 197, 201, 0.45);
}

.crash-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1350px) {
  .crash-page {
    grid-template-columns: minmax(280px, 36%) minmax(400px, 1fr);
  }
  .crash-panel {
    padding-right: 20px;
    padding-left: 20px;
  }
}

@media (max-width: 920px) {
  .crash-page {
    grid-template-columns: 1fr;
  }
  .crash-right {
    min-height: 560px;
  }
}

/* --- Cases & Case Reel --- */
.case-select {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.case-tile {
  background: linear-gradient(145deg, color-mix(in srgb, var(--case-color) 20%, var(--bg-card)), var(--bg-surface));
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font-display);
  transition: all 0.15s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.case-tile:hover {
  transform: translateY(-3px);
  border-color: var(--case-color);
  box-shadow: 0 8px 20px rgba(0,0,0,0.4), 0 0 14px color-mix(in srgb, var(--case-color) 35%, transparent);
}

.case-icon-box {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--case-color, var(--gold));
}

.case-icon-box svg {
  width: 36px;
  height: 36px;
}

.case-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.case-cost {
  color: var(--gold-bright);
  font-weight: 700;
  font-size: 0.88rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.case-reel-wrap {
  position: relative;
  height: 100px;
  overflow: hidden;
  background: var(--bg-input);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  margin: 20px 0;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.case-reel-track {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  display: flex;
  align-items: center;
  will-change: transform;
}

.case-reel-item {
  width: 104px;
  height: 84px;
  margin: 0 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 700;
  font-size: 0.75rem;
  font-family: var(--font-body);
  flex-shrink: 0;
  text-align: center;
  padding: 6px;
}

.minecraft-item-texture {
  display: block;
  width: 1em;
  height: 1em;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  user-select: none;
}

.case-reel-icon .minecraft-item-texture {
  width: 46px;
  height: 46px;
}

.case-reel-marker {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: var(--gold-bright);
  box-shadow: 0 0 10px var(--gold-bright);
  z-index: 2;
}

/* ============ Case Battles Lobby (CSGORoll-style) ============ */
.cbl-page {
  max-width: 1320px;
  margin: 0 auto;
}

.cbl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.cbl-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.cbl-tab {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.cbl-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.cbl-tab.active {
  color: var(--text);
  background: var(--game-surface);
}

.cbl-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cbl-btn-create {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #4d9bff, var(--blue));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  border: none;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
  transition: filter 0.15s, transform 0.15s;
}

.cbl-btn-create:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.cbl-help-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin: 0;
  padding: 0;
  box-shadow: none;
}

.cbl-help-btn:hover {
  color: var(--text);
  border-color: var(--border-bright);
}

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

.cbl-loading,
.cbl-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  background: var(--game-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.cbl-empty p {
  margin: 0 0 16px;
}

.cbl-cases-card {
  margin-top: 8px;
}

.cbl-row {
  display: grid;
  grid-template-columns: 56px 120px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--game-surface);
  border: 1px solid #1f2736;
  border-radius: var(--radius-md);
  transition: background 0.15s, border-color 0.15s;
}

.cbl-row:hover {
  background: color-mix(in srgb, var(--game-surface) 88%, #3e5df7);
  border-color: rgba(62,93,247,.22);
}

.cbl-round {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.cbl-round-num {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.cbl-round-icons {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.cbl-mode-ico {
  display: inline-flex;
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  opacity: 0.85;
}

.cbl-mode-ico svg {
  width: 100%;
  height: 100%;
}

.cbl-mode-crazy {
  color: var(--red-bright);
}

.cbl-price {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cbl-price-hex {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 38px;
  background: linear-gradient(145deg, #2a3140, #1e2430);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  flex-shrink: 0;
}

.cbl-coin-sm {
  width: 18px;
  height: 18px;
}

.cbl-price-amt {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
}

.cbl-track-wrap {
  min-width: 0;
  overflow: hidden;
}

.cbl-track {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.cbl-case-chip {
  flex-shrink: 0;
  position: relative;
}

.cbl-case-icon {
  position: relative;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid color-mix(in srgb, var(--case-color) 35%, transparent);
}

.cbl-case-icon svg {
  width: 44px;
  height: 44px;
}

.cbl-case-mult {
  position: absolute;
  top: -4px;
  right: -4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--blue);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1.3;
}

.cbl-case-prog {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 700;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.cbl-case-unbox {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.85);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.15;
  padding: 2px;
}

.cbl-track-bar {
  height: 3px;
  margin-top: 6px;
  background: #252d3d;
  border-radius: 999px;
  overflow: hidden;
}

.cbl-track-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), #60a5fa);
  border-radius: 999px;
  transition: width 0.4s ease;
}

.cbl-players {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.cbl-players-team {
  gap: 8px;
}

.cbl-team {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cbl-vs {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  text-transform: uppercase;
  text-shadow: 0 0 8px var(--gold-glow), 0 0 16px rgba(168, 85, 247, 0.3);
  padding: 0 6px;
  position: relative;
}

.cbl-vs::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, transparent 70%);
  z-index: -1;
}

.cbl-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
  background: hsl(var(--av-hue, 210), 55%, 45%);
  border: 2px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.cbl-avatar-empty {
  background: #252d3d;
  border: 2px dashed #3a4558;
  color: #4a5568;
}

.cbl-avatar-empty svg {
  width: 18px;
  height: 18px;
  opacity: 0.5;
}

.cbl-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.cbl-btn-view {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 1px solid #3a4558;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}

.cbl-btn-view svg {
  width: 16px;
  height: 16px;
}

.cbl-btn-view:hover {
  color: var(--text);
  border-color: #4f5d73;
}

.cbl-btn-join {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(180deg, #4d9bff, var(--blue));
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  margin: 0;
}

.cbl-btn-join:hover {
  filter: brightness(1.08);
}

.cbl-btn-eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid #3a4558;
  background: #1e2430;
  color: var(--text-muted);
  text-decoration: none;
  flex-shrink: 0;
}

.cbl-btn-eye svg {
  width: 18px;
  height: 18px;
}

.cbl-btn-eye:hover {
  color: var(--text);
  border-color: #4f5d73;
}

@media (max-width: 1100px) {
  .cbl-row {
    grid-template-columns: 48px 100px minmax(0, 1fr);
    grid-template-rows: auto auto;
  }

  .cbl-players {
    grid-column: 1 / 3;
  }

  .cbl-actions {
    grid-column: 3;
    grid-row: 1 / 3;
    justify-self: end;
    align-self: center;
  }
}

/* ============ Single Cases — catalog and opener ============ */
.single-cases-main,
.single-case-open-main {
  padding: 18px 22px 64px;
}

.sc-page {
  width: 100%;
  color: #eef2ff;
  font-family: var(--font-display);
}

.sc-catalog-header {
  min-height: 54px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.sc-catalog-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sc-search {
  width: 250px;
  height: 48px;
  display: flex;
  align-items: center;
  border-radius: 8px;
  background: rgba(46, 46, 85, 0.9);
  border: 1px solid rgba(102, 119, 189, 0.08);
  color: #7785ba;
}

.sc-search input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 8px 0 18px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: 500 0.86rem var(--font-display);
}

.sc-search input::placeholder {
  color: #7885b7;
}

.sc-search:focus-within {
  box-shadow: 0 0 0 2px rgba(73, 102, 255, 0.2);
}

.sc-search svg {
  width: 21px;
  height: 21px;
  margin-right: 15px;
}

.sc-help {
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(46, 46, 85, 0.9);
  box-shadow: none;
  color: #8c99c9;
  font: 600 1rem var(--font-display);
}

.sc-help:hover {
  background: #383868;
  color: #fff;
  filter: none;
}

.sc-sort-row {
  height: 50px;
  display: flex;
  align-items: center;
  gap: 30px;
  margin: 0 0 8px;
}

.sc-sort {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 5px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #7281bd;
  font: 500 0.84rem var(--font-display);
}

.sc-sort span {
  color: #4667ff;
  font-size: 0.65rem;
}

.sc-sort.active,
.sc-sort:hover {
  color: #aeb9e5;
  background: transparent;
  filter: none;
}

.sc-case-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 28px 18px;
}

.sc-case-card {
  position: relative;
  min-width: 0;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 16px 20px;
  overflow: hidden;
  border: 1px solid rgba(86, 104, 179, 0.07);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 34%, color-mix(in srgb, var(--case-color) 12%, transparent), transparent 45%),
    linear-gradient(var(--game-surface), var(--game-surface));
  color: #fff;
  text-align: center;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.sc-case-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--case-color) 40%, transparent);
  background:
    radial-gradient(circle at 50% 34%, color-mix(in srgb, var(--case-color) 20%, transparent), transparent 50%),
    linear-gradient(180deg, rgba(42, 42, 88, 0.8), rgba(33, 33, 72, 0.66));
  box-shadow: 0 16px 30px rgba(4, 8, 31, 0.25);
}

.sc-case-art {
  position: relative;
  width: 100%;
  height: 168px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 5px;
}

.sc-case-art::before {
  content: '';
  position: absolute;
  width: 150px;
  height: 92px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--case-color) 20%, transparent);
  filter: blur(28px);
}

.sc-case-custom-art {
  position: relative;
  z-index: 3;
  width: 160px;
  height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px color-mix(in srgb, var(--case-color) 35%, transparent));
}

.sc-case-art.has-custom-art .sc-case-fallback-art {
  display: none;
}

.sc-case-fallback-art {
  position: relative;
  z-index: 2;
  width: 150px;
  height: 132px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sc-case-chest {
  width: 112px;
  color: var(--case-color);
  filter: drop-shadow(0 8px 9px rgba(4, 7, 25, 0.48)) drop-shadow(0 0 12px color-mix(in srgb, var(--case-color) 42%, transparent));
}

.sc-case-chest svg {
  width: 100%;
  height: auto;
}

.sc-case-featured-items {
  position: absolute;
  left: 50%;
  top: 3px;
  z-index: 2;
  width: 128px;
  height: 70px;
  transform: translateX(-50%);
}

.sc-case-featured-items > span {
  position: absolute;
  display: block;
}

.sc-case-featured-items > span:nth-child(1) { left: 43px; top: 0; transform: rotate(-5deg); }
.sc-case-featured-items > span:nth-child(2) { left: 10px; top: 24px; transform: rotate(-16deg); }
.sc-case-featured-items > span:nth-child(3) { right: 8px; top: 22px; transform: rotate(16deg); }

.sc-case-featured-items .minecraft-item-texture {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.42));
}

.sc-case-card-name {
  max-width: 100%;
  overflow: hidden;
  color: #8999d2;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-case-card-cost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}

.sc-case-card-cost .gold-token-icon {
  width: 18px;
  height: 18px;
  color: #8594c9;
}

.sc-case-risk {
  position: relative;
  width: 100%;
  height: 4px;
  margin-top: 14px;
  overflow: visible;
  border-radius: 99px;
  background: repeating-linear-gradient(90deg, rgba(71, 84, 139, 0.35) 0 21%, transparent 21% 25%);
}

.sc-case-risk i {
  position: absolute;
  left: 0;
  top: 0;
  height: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, #3c62ff, var(--case-color));
}

.sc-case-risk b {
  position: absolute;
  top: 50%;
  width: 3px;
  height: 12px;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 0 9px var(--case-color);
  transform: translate(-50%, -50%);
}

.sc-case-open-hover {
  position: absolute;
  inset: auto 50% 76px auto;
  z-index: 5;
  min-width: 92px;
  padding: 9px 13px;
  border-radius: 8px;
  background: #3d5dff;
  box-shadow: 0 8px 18px rgba(31, 61, 220, 0.34);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0;
  transform: translate(50%, 8px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.sc-case-card:hover .sc-case-open-hover {
  opacity: 1;
  transform: translate(50%, 0);
}

.sc-no-results,
.sc-empty-state {
  min-height: 340px;
  display: grid;
  place-items: center;
  color: #8290c5;
}

.sc-empty-state {
  align-content: center;
  gap: 16px;
}

.sc-empty-state p {
  margin: 0;
}

.sc-empty-state a {
  padding: 11px 18px;
  border-radius: 8px;
  background: #3d5dff;
  color: #fff;
  text-decoration: none;
}

.sc-more-cases {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 38px 0 8px;
  color: #7483bd;
  font-size: 0.82rem;
  font-weight: 600;
}

.sc-more-cases::before,
.sc-more-cases::after {
  content: '';
  width: 72px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(102, 121, 207, 0.42));
}

.sc-more-cases::after { transform: scaleX(-1); }

/* Dedicated case opening screen */
.sc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  margin-bottom: 16px;
  color: #7181bc;
  font-size: 0.78rem;
}

.sc-breadcrumb a {
  color: #7181bc;
  text-decoration: none;
}

.sc-breadcrumb a:hover { color: #aebbf0; }
.sc-breadcrumb strong { color: #fff; font-weight: 600; }

.sc-count-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.sc-count-btn,
.sc-speed-selector button {
  height: 38px;
  margin: 0;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  background: rgba(46, 46, 85, 0.82);
  box-shadow: none;
  color: #8492c8;
  font: 500 0.84rem var(--font-display);
  transition: background 140ms ease, color 140ms ease;
}

.sc-count-btn:hover,
.sc-count-btn.active,
.sc-speed-selector button:hover,
.sc-speed-selector button.active {
  color: #fff;
  background: #3d5dff;
  filter: none;
}

.sc-count-btn:focus,
.sc-speed-selector button:focus,
.sc-open-button:focus {
  outline: none;
}

.sc-count-btn:focus-visible,
.sc-speed-selector button:focus-visible,
.sc-open-button:focus-visible {
  outline: 2px solid rgba(104, 137, 255, 0.72);
  outline-offset: 2px;
}

.sc-count-btn:disabled,
.sc-speed-selector button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.sc-open-stage {
  position: relative;
  min-height: 520px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 4px 0 24px;
  overflow: hidden;
}

.sc-open-stage::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 145px;
  width: min(820px, 70%);
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--case-color) 10%, transparent), transparent 68%);
  transform: translateX(-50%);
  pointer-events: none;
}

.sc-open-heading {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  text-align: center;
}

.sc-open-case-art { display: none; }

.sc-open-heading h1 {
  margin: 0 0 10px;
  color: #fff;
  font-size: clamp(1.55rem, 2vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.sc-open-price {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
}

.sc-open-price .gold-token-icon {
  width: 20px;
  height: 20px;
}

.sc-adaptive-jackpot {
  position: relative;
  z-index: 4;
  width: min(780px, calc(100% - 24px));
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(230px, 0.82fr);
  align-items: center;
  gap: 10px 22px;
  margin: 5px auto 9px;
  padding: 12px 15px 10px;
  overflow: hidden;
  border: 1px solid rgba(95, 122, 255, 0.2);
  border-radius: 12px;
  background:
    radial-gradient(circle at 8% 20%, rgba(73, 104, 255, 0.13), transparent 34%),
    linear-gradient(110deg, rgba(38, 39, 83, 0.88), rgba(29, 31, 70, 0.8));
  box-shadow: 0 10px 24px rgba(4, 8, 35, 0.16);
  color: #dfe5ff;
  transition: border-color 160ms ease, opacity 160ms ease, background 160ms ease;
}

.sc-adaptive-jackpot.is-unlocked {
  border-color: rgba(45, 212, 191, 0.24);
  background:
    radial-gradient(circle at 8% 20%, rgba(45, 212, 191, 0.11), transparent 35%),
    linear-gradient(110deg, rgba(34, 47, 79, 0.9), rgba(29, 31, 70, 0.8));
}

.sc-adaptive-jackpot.is-unavailable { border-color: rgba(251, 113, 133, 0.18); }
.sc-adaptive-jackpot.is-loading { opacity: 0.82; }

.sc-adaptive-jackpot-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.sc-adaptive-jackpot-main > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sc-adaptive-badge,
.sc-adaptive-result-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 3px 8px;
  border: 1px solid rgba(111, 139, 255, 0.32);
  border-radius: 999px;
  background: rgba(62, 93, 247, 0.15);
  color: #9eb0ff;
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.075em;
  line-height: 1;
  text-transform: uppercase;
}

.sc-adaptive-jackpot-main strong {
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

#sc-adaptive-chance { color: #9fb0ff; }
.sc-adaptive-jackpot.is-unlocked #sc-adaptive-chance { color: #5eead4; }

.sc-adaptive-jackpot-main small,
.sc-adaptive-funding > span:first-child {
  color: #8695ca;
  font-size: 0.67rem;
  line-height: 1.3;
}

.sc-adaptive-funding {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sc-adaptive-funding > span:first-child {
  display: block;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#sc-adaptive-reserve {
  color: #d8def8;
  font-variant-numeric: tabular-nums;
}

.sc-adaptive-meter-track {
  position: relative;
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(113, 129, 190, 0.16);
  box-shadow: inset 0 1px 2px rgba(4, 8, 32, 0.24);
}

#sc-adaptive-meter {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4c6bff, #8ea3ff);
  box-shadow: 0 0 10px rgba(81, 111, 255, 0.34);
  transition: width 260ms ease;
}

.sc-adaptive-jackpot.is-unlocked #sc-adaptive-meter {
  background: linear-gradient(90deg, #3d63ff, #2dd4bf);
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.26);
}

#sc-adaptive-disclosure {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(101, 119, 191, 0.12);
  color: #7584bd;
  font-size: 0.63rem;
  line-height: 1.35;
}

.sc-reels {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  width: 100%;
  min-height: 220px;
  margin: 5px 0 18px;
}

.sc-reels[data-count='2'] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sc-reels[data-count='3'],
.sc-reels[data-count='4'] { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.sc-reel-lane {
  position: relative;
  min-width: 0;
  height: 220px;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(28, 28, 62, 0.12), rgba(38, 38, 78, 0.34), rgba(28, 28, 62, 0.12));
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}

.sc-reels[data-count='3'] .sc-reel-lane,
.sc-reels[data-count='4'] .sc-reel-lane {
  height: 168px;
}

.sc-reels[data-count='3'],
.sc-reels[data-count='4'] {
  min-height: 346px;
}

.sc-reel-track {
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
  align-items: center;
  width: max-content;
  will-change: transform;
}

.sc-reel-item {
  position: relative;
  flex: 0 0 118px;
  width: 118px;
  height: 164px;
  margin: 0 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #7483bc;
  text-align: center;
}

.sc-reels[data-count='3'] .sc-reel-item,
.sc-reels[data-count='4'] .sc-reel-item {
  height: 142px;
}

.sc-reel-item::before {
  content: '';
  position: absolute;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--rarity-color) 11%, transparent);
  filter: blur(15px);
}

.sc-reel-item-icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
}

.sc-reel-item-icon .minecraft-item-texture {
  width: 82px;
  height: 82px;
  filter: drop-shadow(0 7px 9px rgba(4, 7, 24, 0.42));
}

.sc-reel-item small {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
  font-size: 0.68rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.72;
}

.sc-reel-item.is-landing small {
  color: #fff;
  opacity: 1;
}

.sc-reel-marker {
  position: absolute;
  left: 50%;
  top: 17px;
  bottom: 17px;
  z-index: 4;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(81, 111, 255, 0.78), transparent);
  box-shadow: 0 0 12px rgba(62, 93, 255, 0.46);
  pointer-events: none;
}

.sc-open-controls {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.sc-open-button {
  min-width: 190px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 0 20px;
  border: 0;
  border-radius: 7px;
  background: #3d5dff;
  box-shadow: 0 8px 20px rgba(41, 69, 220, 0.25);
  color: #fff;
  font: 700 0.9rem var(--font-display);
}

.sc-open-button:hover:not(:disabled) {
  background: #4c6aff;
  transform: translateY(-1px);
  filter: none;
}

.sc-open-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.sc-open-button-cost {
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 0.82rem;
}

.sc-speed-selector {
  display: flex;
  gap: 8px;
}

.sc-speed-selector button {
  height: 38px;
  padding-inline: 14px;
}

.sc-open-message {
  position: relative;
  z-index: 3;
  min-height: 23px;
  margin-top: 14px;
  color: #8f9bcc;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.sc-open-message.win { color: #2dd4bf; }
.sc-open-message.lose { color: #fb7185; }

.sc-pull-results {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
  margin-top: 2px;
}

.sc-pull-result {
  min-width: 150px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--rarity-color) 26%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--rarity-color) 7%, rgba(27, 36, 77, 0.78));
}

.sc-pull-result > span,
.sc-pull-result > span .minecraft-item-texture {
  width: 38px;
  height: 38px;
}

.sc-pull-result div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sc-pull-result strong {
  max-width: 135px;
  overflow: hidden;
  color: #fff;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-pull-result small {
  color: #91a0d6;
  font-size: 0.7rem;
}

.sc-outcomes-section {
  padding: 22px 0 34px;
  border-top: 1px solid rgba(78, 94, 157, 0.16);
}

.sc-outcomes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.sc-outcomes-header h2 {
  margin: 0;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
}

.sc-rarity-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 14px;
  color: #8291c6;
  font-size: 0.72rem;
}

.sc-rarity-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sc-rarity-legend span::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--dot);
}

.sc-outcomes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}

.sc-outcome-card {
  position: relative;
  min-width: 0;
  min-height: 196px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 18px 12px 16px;
  overflow: hidden;
  border-radius: 13px;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--rarity-color) 13%, transparent), transparent 42%),
    linear-gradient(var(--game-surface), var(--game-surface));
  text-align: center;
}

.sc-outcome-card::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--rarity-color);
  box-shadow: 0 0 12px var(--rarity-color);
}

.sc-outcome-chance {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--rarity-color);
  font-size: 0.68rem;
  font-weight: 700;
}

.sc-outcome-icon {
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 7px;
}

.sc-outcome-icon .minecraft-item-texture {
  width: 86px;
  height: 86px;
  filter: drop-shadow(0 7px 9px rgba(3, 7, 24, 0.4));
}

.sc-outcome-card strong {
  width: 100%;
  overflow: hidden;
  color: #8e9dd2;
  font-size: 0.76rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-outcome-value {
  margin-top: 4px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

@media (max-width: 1500px) {
  .sc-case-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 1240px) {
  .sc-case-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .sc-catalog-header { flex-direction: column; align-items: stretch; }
  .sc-catalog-actions { justify-content: flex-end; }
  .sc-case-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sc-open-stage { min-height: 470px; }
}

@media (max-width: 680px) {
  .single-cases-main,
  .single-case-open-main { padding: 14px 12px 48px; }
  .sc-catalog-actions { width: 100%; }
  .sc-search { flex: 1; width: auto; }
  .sc-case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .sc-case-card { min-height: 245px; padding-inline: 10px; }
  .sc-case-art { height: 142px; }
  .sc-count-selector { overflow-x: auto; }
  .sc-reels[data-count='2'],
  .sc-reels[data-count='3'],
  .sc-reels[data-count='4'] { grid-template-columns: 1fr; }
  .sc-reels[data-count='3'],
  .sc-reels[data-count='4'] { min-height: auto; }
  .sc-outcomes-header { align-items: flex-start; flex-direction: column; }
  .sc-rarity-legend { justify-content: flex-start; }
}

@media (max-width: 720px) {
  .cbl-head {
    flex-direction: column;
    align-items: stretch;
  }

  .cbl-head-actions {
    justify-content: flex-end;
  }

  .cbl-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .cbl-round,
  .cbl-price {
    flex-direction: row;
    justify-content: flex-start;
  }

  .cbl-round {
    flex-direction: row;
    gap: 10px;
  }

  .cbl-players,
  .cbl-actions {
    grid-column: auto;
    grid-row: auto;
  }

  .cbl-actions {
    justify-self: stretch;
    flex-wrap: wrap;
  }

  .cbl-btn-join {
    flex: 1;
    justify-content: center;
  }
}

/* ============ Case Battles Lobby Revamp ============ */
.cbl-page {
  width: 100%;
  max-width: none;
  margin: 0;
}

.cbl-head {
  min-height: 52px;
  margin: 0 0 16px;
  gap: 18px;
  flex-wrap: nowrap;
}

.cbl-tabs {
  gap: 10px;
  flex-wrap: nowrap;
}

.cbl-tab {
  min-height: 50px;
  padding: 0 20px;
  border-radius: 6px;
  color: #8290c5;
  font-size: 0.94rem;
  font-weight: 500;
}

.cbl-tab:hover {
  color: #dce3ff;
  background: rgba(45, 56, 107, 0.56);
}

.cbl-tab.active {
  color: #fff;
  background: #30305A;
  font-weight: 700;
}

.cbl-head-actions {
  margin-left: auto;
  gap: 14px;
}

.cbl-btn-create {
  min-height: 50px;
  padding: 0 24px;
  border-radius: 6px;
  background: #3d5cff;
  box-shadow: 0 7px 18px rgba(38, 65, 219, 0.24);
  font-size: 0.92rem;
}

.cbl-help-btn {
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 8px;
  color: #8491c2;
  background: #30305A;
  font-size: 1.05rem;
}

.cbl-list {
  gap: 14px;
}

.cbl-loading,
.cbl-empty {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px;
  color: #8491c2;
  background: rgba(35, 35, 72, 0.96);
  border: 1px solid rgba(87, 102, 176, 0.09);
  border-radius: 8px;
}

.cbl-row {
  position: relative;
  display: grid;
  grid-template-columns: 72px 148px minmax(230px, 1fr) minmax(180px, 280px) 220px;
  align-items: center;
  gap: 16px;
  min-height: 114px;
  padding: 12px 22px;
  overflow: hidden;
  background: rgba(35, 35, 72, 0.97);
  border: 1px solid rgba(88, 104, 183, 0.08);
  border-radius: 8px;
  box-shadow: 0 9px 24px rgba(8, 12, 39, 0.08);
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.cbl-row::after {
  content: '';
  position: absolute;
  right: 22%;
  bottom: 0;
  left: 18%;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(67, 94, 255, 0.16), transparent);
  pointer-events: none;
}

.cbl-row:hover {
  z-index: 1;
  transform: translateY(-1px);
  background: rgba(40, 40, 82, 0.99);
  border-color: rgba(91, 110, 206, 0.18);
}

.cbl-row-waiting::after {
  background: linear-gradient(90deg, transparent, rgba(64, 94, 255, 0.34), transparent);
}

.cbl-round {
  gap: 5px;
}

.cbl-round-num {
  position: relative;
  isolation: isolate;
  width: 48px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #8297df;
  background: #3A3A6A;
  clip-path: polygon(50% 0, 93% 23%, 93% 77%, 50% 100%, 7% 77%, 7% 23%);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.cbl-round-num::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 3px;
  background: #27274F;
  clip-path: inherit;
}

.cbl-round-icons {
  min-height: 18px;
  max-width: 64px;
  gap: 4px;
}

.cbl-mode-ico {
  width: 15px;
  height: 15px;
  color: #596b9e;
}

.cbl-mode-symbol {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.cbl-mode-degen { color: #a980ff; }
.cbl-mode-crazy { color: #ff7185; }
.cbl-mode-shared { color: #66a0ff; }
.cbl-mode-terminal { color: #57d6dc; }
.cbl-mode-jackpot,
.cbl-mode-gold { color: #ffbf36; }
.cbl-mode-speed { color: #6f8cff; }
.cbl-mode-private { color: #8291c8; }

.cbl-price {
  min-height: 50px;
  padding: 7px 13px;
  gap: 9px;
  background: #31315E;
  border-radius: 8px;
}

.cbl-price-hex {
  width: 32px;
  height: 36px;
  background: #3B3B6A;
}

.cbl-coin-sm {
  width: 17px;
  height: 17px;
  color: #8497cf;
}

.cbl-price-amt {
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.94rem;
  font-weight: 600;
}

.cbl-track-wrap {
  position: relative;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4px 0 7px;
}

.cbl-track {
  min-height: 76px;
  gap: 12px;
  padding: 0 8px 5px;
  overflow-y: hidden;
}

.cbl-track::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 5px;
  left: 0;
  height: 3px;
  background: rgba(55, 69, 126, 0.44);
}

.cbl-case-icon {
  width: 68px;
  height: 68px;
  overflow: visible;
  background: transparent;
  border: 0;
  filter: drop-shadow(0 8px 10px color-mix(in srgb, var(--case-color) 18%, transparent));
}

.cbl-case-artwork {
  position: relative;
  width: 68px;
  height: 68px;
  display: block;
}

.cbl-case-artwork > img,
.cbl-case-artwork-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cbl-case-artwork > img {
  z-index: 2;
  object-fit: contain;
  opacity: 0;
  transition: opacity 140ms ease;
}

.cbl-case-artwork.has-image > img {
  opacity: 1;
}

.cbl-case-artwork.has-image .cbl-case-artwork-fallback {
  opacity: 0;
}

.cbl-case-artwork-fallback svg {
  width: 58px;
  height: 54px;
  filter: drop-shadow(0 5px 8px color-mix(in srgb, var(--case-color) 24%, transparent));
}

.cbl-case-icon svg {
  width: 62px;
  height: 62px;
}

.cbl-case-mult {
  top: auto;
  right: -3px;
  bottom: -2px;
  padding: 3px 7px;
  color: #9eafe7;
  background: #32325E;
  border-radius: 6px;
  font-size: 0.72rem;
}

.cbl-track-bar {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 5px;
  left: 0;
  height: 3px;
  margin: 0;
  background: transparent;
}

.cbl-track-fill {
  background: linear-gradient(90deg, #3f5cff, #6780ff);
  box-shadow: 0 0 8px rgba(67, 94, 255, 0.48);
}

.cbl-players,
.cbl-team {
  gap: 7px;
}

.cbl-players {
  justify-content: center;
}

.cbl-players-team {
  gap: 8px;
}

.cbl-avatar {
  width: 42px;
  height: 42px;
  color: #fff;
  background:
    radial-gradient(circle at 42% 32%, hsla(var(--av-hue, 210), 78%, 74%, 0.9) 0 18%, transparent 19%),
    linear-gradient(145deg, hsl(var(--av-hue, 210), 64%, 50%), #20294f 72%);
  border: 1px solid #35406d;
  box-shadow: inset 0 0 0 2px rgba(14, 20, 58, 0.48);
  font-size: 0.78rem;
}

.cbl-avatar-empty {
  color: #4d5a8c;
  background: #2C2C55;
  border: 2px solid #35406d;
  box-shadow: none;
}

.cbl-avatar-empty svg {
  width: 22px;
  height: 22px;
}

.cbl-vs {
  position: relative;
  isolation: isolate;
  width: 42px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #6f82bf;
  background: #3A3A6A;
  clip-path: polygon(50% 0, 93% 23%, 93% 77%, 50% 100%, 7% 77%, 7% 23%);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: lowercase;
  text-shadow: none;
}

.cbl-vs::before {
  z-index: -1;
  inset: 3px;
  width: auto;
  height: auto;
  border-radius: 0;
  background: #27274F;
  clip-path: inherit;
  transform: none;
}

.cbl-actions {
  justify-content: flex-end;
  gap: 10px;
}

.cbl-btn-view,
.cbl-btn-join {
  min-height: 50px;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: none;
}

.cbl-btn-view {
  width: 210px;
  padding: 0 18px;
  color: #8291c8;
  background: #31315E;
}

.cbl-btn-view:hover {
  color: #cbd5ff;
  background: #3B3B6C;
}

.cbl-btn-view svg,
.cbl-btn-eye svg {
  color: #7182bb;
}

.cbl-btn-join {
  min-width: 172px;
  padding: 0 16px;
  color: #fff;
  background: #3d5cff;
}

.cbl-btn-eye {
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 8px;
  color: #7182bb;
  background: #31315E;
}

.cbl-btn-eye:hover {
  color: #d5dcff;
  background: #3B3B6C;
}

@media (max-width: 1500px) {
  .cbl-row {
    grid-template-columns: 60px 125px minmax(180px, 1fr) 200px;
    grid-template-rows: auto auto;
    min-height: 126px;
    gap: 8px 14px;
  }

  .cbl-round,
  .cbl-price,
  .cbl-actions {
    grid-row: 1 / 3;
  }

  .cbl-round { grid-column: 1; }
  .cbl-price { grid-column: 2; }
  .cbl-track-wrap { grid-column: 3; grid-row: 1; }
  .cbl-players { grid-column: 3; grid-row: 2; justify-content: flex-start; }
  .cbl-actions { grid-column: 4; }

  .cbl-track,
  .cbl-track-wrap {
    min-height: 64px;
  }

  .cbl-case-icon {
    width: 56px;
    height: 56px;
  }

  .cbl-case-icon svg {
    width: 52px;
    height: 52px;
  }

  .cbl-btn-view {
    width: 190px;
  }
}

@media (max-width: 760px) {
  .cbl-head {
    align-items: stretch;
    flex-direction: column;
  }

  .cbl-tabs {
    overflow-x: auto;
  }

  .cbl-tab {
    flex: 0 0 auto;
  }

  .cbl-head-actions {
    margin-left: 0;
  }

  .cbl-btn-create {
    flex: 1;
  }

  .cbl-row {
    grid-template-columns: 58px minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    padding: 14px;
  }

  .cbl-round,
  .cbl-price,
  .cbl-track-wrap,
  .cbl-players,
  .cbl-actions {
    grid-column: auto;
    grid-row: auto;
  }

  .cbl-round { grid-column: 1; grid-row: 1; }
  .cbl-price { grid-column: 2; grid-row: 1; }
  .cbl-track-wrap { grid-column: 1 / 3; grid-row: 2; }
  .cbl-players { grid-column: 1 / 3; grid-row: 3; justify-content: flex-start; }
  .cbl-actions { grid-column: 1 / 3; grid-row: 4; justify-content: stretch; }

  .cbl-btn-view,
  .cbl-btn-join {
    width: auto;
    flex: 1;
  }
}

/* ============ Case Battles (Creator & Arena) ============ */
.cb-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.cb-lobby-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 10px;
}

.cb-lobby-row button, .cb-lobby-view-btn {
  margin-top: 0;
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* --- Battle Creator --- */
.battle-create-main {
  padding: 14px 18px 22px;
}

.cbc-page {
  --cbc-font: var(--font-display);
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  min-height: calc(100vh - 104px);
  color: #f4f6ff;
  font-family: var(--cbc-font);
}

.cbc-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  min-height: 34px;
  margin-bottom: 6px;
}

.cbc-heading h1 {
  margin: 5px 0 0;
  font-family: var(--cbc-font);
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cbc-back-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: rgba(133, 149, 219, 0.48);
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.cbc-back-link span {
  font-size: 1rem;
  line-height: 0.6;
}

.cbc-back-link:hover {
  color: #9dadff;
}

.cbc-total-cost {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 158px;
  height: 42px;
  color: #fff;
  background: rgba(28, 28, 68, 0.86);
  border: 1px solid rgba(75, 93, 178, 0.12);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 700;
}

.cbc-total-coin {
  display: flex;
  width: 16px;
  height: 16px;
  color: #8191cb;
}

.cbc-total-coin svg {
  width: 100%;
  height: 100%;
}

.cbc-case-stage {
  min-height: clamp(220px, 17vw, 310px);
  padding-top: 2px;
}

.cbc-cases-grid,
.cbc-selected-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 9px;
}

.cbc-selected-row {
  display: contents;
}

.cbc-add-case,
.cbc-case-card {
  width: clamp(175px, 19%, 245px);
  height: clamp(260px, 20vw, 305px);
  min-height: 260px;
  aspect-ratio: auto;
  background: rgba(33, 33, 80, 0.24);
  border: 1px solid rgba(105, 121, 190, 0.08);
  border-radius: 18px;
}

.cbc-add-case {
  order: 100;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  color: #4265ff;
  background: rgba(33, 33, 80, 0.28);
  border-color: rgba(105, 121, 190, 0.08);
  box-shadow: none;
  font-family: var(--cbc-font);
  font-size: clamp(0.96rem, 0.76vw, 1.12rem);
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.cbc-add-case:hover {
  color: #6f89ff;
  background: rgba(45, 59, 128, 0.34);
  border-color: rgba(105, 121, 190, 0.1);
  box-shadow: none;
  filter: none;
  transform: none;
}

.cbc-add-plus {
  font-family: var(--cbc-font);
  font-size: 2.5rem;
  font-weight: 300;
  line-height: 1;
}

.cbc-case-card {
  order: 0;
  position: relative;
  padding: 16px 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  background: rgba(33, 33, 80, 0.24);
  border-color: rgba(105, 121, 190, 0.08);
  transition: none;
}

.cbc-case-card:hover {
  background: rgba(35, 47, 105, 0.3);
  border-color: rgba(105, 121, 190, 0.1);
  box-shadow: none;
  transform: none;
}

.cbc-case-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7e8bbb;
  background: rgba(36, 36, 82, 0.72);
  border: 0;
  border-radius: 7px;
  box-shadow: none;
  cursor: pointer;
}

.cbc-case-remove:hover {
  color: #fff;
  background: rgba(61, 93, 255, 0.26);
  border-color: transparent;
}

.cbc-case-remove svg {
  width: 100%;
  height: 100%;
}

.cbc-case-name {
  max-width: 100%;
  overflow: hidden;
  margin-top: 4px;
  color: #91a0d3;
  font-family: var(--cbc-font);
  font-size: 0.94rem;
  font-weight: 500;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cbc-case-cost {
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.94rem;
  font-weight: 700;
}

.cbc-case-cost svg {
  width: 18px;
  height: 18px;
  color: #8d9acb;
}

.cbc-case-art {
  width: clamp(120px, 76%, 158px);
  height: clamp(112px, 10vw, 150px);
  margin: 4px 0 8px;
}

.cbc-case-artwork {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cbc-case-artwork img,
.cbc-case-artwork-fallback {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cbc-case-artwork img {
  position: relative;
  z-index: 2;
  display: block;
  filter: drop-shadow(0 10px 12px color-mix(in srgb, var(--case-color) 24%, transparent));
}

.cbc-case-artwork-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cbc-case-artwork-fallback svg {
  width: 100%;
  height: 100%;
}

.cbc-case-artwork.has-image .cbc-case-artwork-fallback {
  display: none;
}

.cbc-page .cbc-stepper {
  width: 124px;
  max-width: 124px;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 30px 1fr 30px;
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.cbc-page .cbc-stepper .cbm-stepper-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  color: #7f8dbf;
  background: rgba(36, 36, 82, 0.56);
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  font-size: 1rem;
}

.cbc-page .cbc-stepper .cbm-stepper-btn:hover:not(:disabled) {
  color: #fff;
  background: rgba(61, 93, 255, 0.22);
  border-color: transparent;
}

.cbc-page .cbc-stepper .cbm-stepper-val {
  min-width: 0;
  color: #fff;
  font-size: 0.9rem;
  text-align: center;
}

.cbc-settings-section {
  margin-top: 18px;
}

.cbc-settings-section > h2 {
  margin: 0 0 8px;
  color: rgba(120, 139, 213, 0.62);
  font-family: var(--cbc-font);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cbc-speed-section {
  width: clamp(228px, 27.5%, 300px);
  max-width: 100%;
  margin-top: 0;
}

.cbc-speed-control {
  padding: 11px 14px 9px;
  background: #24244A;
  border: 1px solid rgba(74, 92, 177, 0.1);
  border-radius: 8px;
}

.cbc-speed-track {
  position: relative;
  height: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(69, 85, 159, 0.32);
  border-radius: 999px;
}

.cbc-speed-track i {
  position: relative;
  z-index: 2;
  width: 8px;
  height: 8px;
  background: #2E2E62;
  border: 2px solid #37477f;
  border-radius: 50%;
}

.cbc-speed-track i:first-of-type {
  width: 8px;
  height: 8px;
  background: #2E2E62;
  border: 2px solid #37477f;
}

.cbc-speed-track i.active {
  background: #4265ff;
  border-color: #5875f4;
  box-shadow: 0 0 7px rgba(66, 101, 255, 0.55);
}

.cbc-speed-progress {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  display: block;
  background: #4265ff;
  border-radius: inherit;
  transition: width 0.2s ease;
}

.cbc-speed-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 7px;
}

.cbc-speed-option {
  min-width: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #6373af;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-family: var(--cbc-font);
  font-size: 0.7rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.cbc-page .cbc-speed-option,
.cbc-page .cbc-speed-option:hover,
.cbc-page .cbc-speed-option:focus,
.cbc-page .cbc-speed-option:focus-visible,
.cbc-page .cbc-speed-option:active,
.cbc-page .cbc-speed-option.active {
  background: transparent;
  background-image: none;
  border: 0;
  outline: 0;
  box-shadow: none;
  filter: none;
  transform: none;
}

.cbc-speed-option:first-child {
  align-items: flex-start;
}

.cbc-speed-option:last-child {
  align-items: flex-end;
}

.cbc-speed-option.active,
.cbc-speed-option:focus,
.cbc-speed-option:focus-visible {
  color: #eef2ff;
  outline: none;
  box-shadow: none;
}

.cbc-speed-option:hover {
  color: #8da6e8;
}

.cbc-speed-option svg {
  width: 12px;
  height: 12px;
  color: #6d7ab0;
}

.cbc-speed-option.active svg {
  color: #5f7dff;
}

.cbc-option-grid {
  display: grid;
  gap: 9px;
}

.cbc-game-mode-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cbc-extras-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: calc(50% - 4px);
}

.cbc-option-card {
  position: relative;
  min-height: clamp(59px, 3.8vw, 66px);
  padding: 9px 35px 9px 60px;
  display: flex;
  align-items: center;
  color: #eef1ff;
  background: #24244A;
  border: 1px solid rgba(69, 86, 166, 0.1);
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cbc-option-card:hover,
.cbc-option-card:has(input:checked) {
  background: #24244A;
  border-color: rgba(64, 99, 255, 0.36);
}

.cbc-option-card > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.cbc-toggle {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 16px;
  background: #3B3B72;
  border: 0;
  border-radius: 999px;
  transition: background 0.16s ease;
}

.cbc-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: #f5f7ff;
  border-radius: 50%;
  transition: transform 0.16s ease;
}

.cbc-option-card input:checked + .cbc-toggle {
  background: #4265ff;
}

.cbc-option-card input:checked + .cbc-toggle::after {
  transform: translateX(14px);
}

.cbc-option-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cbc-option-copy strong {
  font-family: var(--cbc-font);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
}

.cbc-option-copy small {
  color: rgba(118, 138, 211, 0.64);
  font-size: 0.63rem;
  line-height: 1.2;
}

.cbc-option-icon {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: rgba(72, 91, 169, 0.28);
}

.cbc-option-icon svg {
  width: 100%;
  height: 100%;
}

.cbc-icon-text {
  font-family: var(--cbc-font);
  font-size: 1.22rem;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}

.cbc-new-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  padding: 1px 5px;
  color: #fff;
  background: #4265ff;
  border-radius: 5px;
  font-size: 0.52rem;
  font-weight: 800;
  text-transform: uppercase;
}

.cbc-action-bar {
  position: sticky;
  bottom: 8px;
  z-index: 8;
  width: fit-content;
  max-width: 100%;
  margin: 22px auto 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.cbc-mode-picker {
  display: flex;
  gap: 10px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.cbc-mode-card {
  min-width: 78px;
  height: 42px;
  margin: 0;
  padding: 0 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8c99cb;
  background: #31315A;
  border: 0;
  border-radius: 9px;
  box-shadow: none;
  cursor: pointer;
  font-family: var(--cbc-font);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0;
  transition: color 0.15s ease, background 0.15s ease;
}

.cbc-mode-card:hover {
  color: #fff;
  background: #383868;
  box-shadow: none;
}

.cbc-mode-card.active {
  color: #fff;
  background: #3d5dff;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(61, 93, 255, 0.2);
}

.cbc-mode-card:active {
  transform: none;
  box-shadow: none;
}

.cbc-screen-reader {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cbc-create-btn {
  min-width: 215px;
  height: 48px;
  margin: 0;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #3f62f2;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(63, 98, 242, 0.2);
  font-family: var(--cbc-font);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.cbc-create-btn:focus,
.cbc-create-btn:focus-visible,
.cbc-create-btn:active {
  border-color: transparent;
  outline: none;
}

.cbc-create-btn:hover:not(:disabled) {
  background: #5171ff;
  transform: translateY(-1px);
}

.cbc-create-btn:disabled {
  opacity: 1;
  color: #fff;
  background: #3f62f2;
  border-color: transparent;
  cursor: not-allowed;
  box-shadow: none;
}

.cbc-page .cbm-dialog {
  width: min(820px, calc(100vw - 48px));
  height: min(780px, calc(100vh - 48px));
  max-width: none;
  max-height: none;
  background: #1E1E42;
  border: 0;
  border-radius: 16px;
  box-shadow: 0 28px 80px rgba(5, 8, 30, 0.68);
}

.cbc-page .cbm-modal-overlay {
  background: rgba(10, 10, 28, 0.88);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.cbc-page .cbm-header {
  padding: 28px 36px 20px;
}

.cbc-page .cbm-title {
  font-family: var(--cbc-font);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cbc-page .cbm-close {
  width: 32px;
  height: 32px;
  color: #7883b0;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 2rem;
  font-weight: 300;
}

.cbc-page .cbm-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 36px 13px;
}

.cbc-page .cbm-tab {
  height: 46px;
  margin: 0;
  padding: 0 18px;
  color: #8796d3;
  background: #31315A;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  font-family: var(--cbc-font);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}

.cbc-page .cbm-tab.active {
  color: #fff;
  background: #3d5dff;
  font-weight: 700;
}

.cbc-page .cbm-tab:hover:not(.active) {
  color: #b9c5f4;
  background: #353565;
}

.cbc-page .cbm-toolbar {
  flex-wrap: nowrap;
  gap: 14px;
  padding: 0 36px 17px;
  border-bottom: 0;
}

.cbc-page .cbm-search-wrap {
  min-width: 0;
}

.cbc-page .cbm-search-input,
.cbc-page .cbm-select {
  height: 46px;
  padding-top: 0;
  padding-bottom: 0;
  font-family: var(--cbc-font);
  font-size: 0.96rem;
  font-weight: 500;
  background: #31315A;
  border: 1px solid transparent;
  border-radius: 8px;
}

.cbc-page .cbm-search-input {
  padding-left: 20px;
}

.cbc-page .cbm-select {
  width: 212px;
  min-width: 212px;
  padding: 0 20px;
}

.cbc-page .cbm-risk-select {
  display: none;
}

.cbc-page .cbm-grid-scroll {
  padding: 0 36px 17px;
}

.cbc-page .cbm-grid {
  gap: 14px;
}

.cbc-page .cbm-more-soon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 0 12px;
  color: #7f8dc5;
  font-family: var(--cbc-font);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.cbc-page .cbm-more-soon::before,
.cbc-page .cbm-more-soon::after {
  content: '';
  width: 54px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(116, 137, 224, 0.5));
}

.cbc-page .cbm-more-soon::after {
  transform: scaleX(-1);
}

.cbc-page .cbm-card {
  min-height: 260px;
  padding: 18px 12px 15px;
  justify-content: flex-end;
  background: #24244A;
  border: 2px solid transparent;
  border-radius: 14px;
  box-shadow: none;
  transform: none;
}

.cbc-page .cbm-card::before {
  background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--case-color) 18%, transparent), transparent 60%);
  opacity: 0.72;
}

.cbc-page .cbm-card-icon {
  width: 126px;
  height: 126px;
  margin: 0 0 14px;
}

.cbc-page .cbm-card-icon svg {
  width: 116px;
  height: 98px;
}

.cbc-page .cbm-card-name {
  margin-bottom: 3px;
  font-family: var(--cbc-font);
  color: #91a0dc;
  font-size: 0.96rem;
  font-weight: 500;
}

.cbc-page .cbm-card-cost {
  margin-bottom: 16px;
  padding: 0;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 1rem;
}

.cbc-page .cbm-card-cost svg {
  color: #8b98ca;
}

.cbc-page button:hover {
  filter: none;
}

.cbc-page .cbm-close:hover {
  color: #fff;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.cbc-page .cbm-search-input:focus,
.cbc-page .cbm-select:focus {
  border-color: #607bff;
  box-shadow: 0 0 0 2px rgba(73, 102, 255, 0.18);
  outline: none;
}

.cbc-page .cbm-card:hover,
.cbc-page .cbm-card.active {
  border-color: #607bff;
  background: #2A2A52;
  box-shadow: 0 0 18px rgba(73, 102, 255, 0.14);
  transform: none;
}

.cbc-page .cbm-card.active .cbm-stepper {
  border-color: #607bff;
}

.cbc-page .cbm-card.active .cbm-stepper-val,
.cbc-page .cbm-stepper-btn:hover:not(:disabled) {
  color: #9db0ff;
}

.cbc-page .cbm-stepper-btn:hover:not(:disabled) {
  background: #25305b;
  border-color: #607bff;
}

.cbc-page .cbm-card-badge {
  color: #fff;
  background: #4265ff;
  border-color: #607bff;
  box-shadow: 0 0 12px rgba(66, 101, 255, 0.34);
}

.cbc-page .cbm-risk-meter {
  width: 90%;
  height: 4px;
  background: repeating-linear-gradient(90deg, #303965 0 20%, transparent 20% 24%);
}

.cbc-page .cbm-risk-pin {
  top: -4px;
  width: 12px;
  height: 12px;
  border: 2px solid #fff;
}

.cbc-page .cbm-footer {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(74px, 1fr) 200px 200px minmax(74px, 1fr);
  align-items: center;
  gap: 14px;
  padding: 0 36px 17px;
  background: #1E1E42;
  border-top: 2px solid rgba(105, 121, 190, 0.14);
}

.cbc-page .cbm-footer::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 52px;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, #1E1E42);
}

.cbc-page .cbm-footer-total,
.cbc-page .cbm-clear-btn,
.cbc-page .cbm-add-btn {
  height: 46px;
  border-radius: 8px;
}

.cbc-page .cbm-footer-total {
  grid-column: 1;
  width: fit-content;
  min-width: 68px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #fff;
  background: #31315A;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
}

.cbc-page .cbm-footer-total svg {
  width: 20px;
  height: 20px;
  color: #92a0d3;
}

.cbc-page .cbm-clear-btn,
.cbc-page .cbm-add-btn {
  margin: 0;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  box-shadow: none;
  font-family: var(--cbc-font);
  font-size: 1rem;
  font-weight: 600;
}

.cbc-page .cbm-clear-btn {
  grid-column: 2;
  color: #91a0d6;
  background: #31315A;
}

.cbc-page .cbm-clear-btn svg {
  width: 16px;
  height: 16px;
  color: #7e8cbc;
}

.cbc-page .cbm-clear-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.cbc-page .cbm-clear-btn:hover:not(:disabled) {
  color: #fff;
  background: #383868;
}

.cbc-page .cbm-add-btn {
  grid-column: 3;
  color: #fff;
  background: #3d5dff;
}

.cbc-page .cbm-add-btn:hover {
  background: #4c6aff;
}

.cbc-page .cbm-empty-state {
  grid-column: 1 / -1;
  min-height: 300px;
  display: grid;
  place-items: center;
  color: #8492c8;
  font-size: 1rem;
}

.cbc-page .cbc-case-card:hover {
  background: rgba(35, 47, 105, 0.3);
  border-color: rgba(105, 121, 190, 0.1);
  box-shadow: none;
}

@media (max-width: 1100px) {
  .cbc-game-mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cbc-extras-grid {
    max-width: 100%;
  }
}

@media (max-width: 700px) {
  .battle-create-main {
    padding: 12px 12px 20px;
  }

  .cbc-header {
    padding-bottom: 54px;
  }

  .cbc-total-cost {
    top: 48px;
    left: 0;
    transform: none;
  }

  .cbc-case-stage {
    min-height: 205px;
  }

  .cbc-add-case,
  .cbc-case-card {
    width: 130px;
    height: 220px;
    min-height: 220px;
  }

  .cbc-game-mode-grid,
  .cbc-extras-grid {
    grid-template-columns: 1fr;
  }

  .cbc-action-bar {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }

  .cbc-mode-picker {
    width: 100%;
  }

  .cbc-mode-card {
    flex: 1;
    min-width: 0;
    padding: 0 5px;
  }

  .cbc-create-btn {
    width: 100%;
  }

  .cbc-page .cbm-dialog {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
  }

  .cbc-page .cbm-header {
    padding: 22px 18px 18px;
  }

  .cbc-page .cbm-tabs,
  .cbc-page .cbm-toolbar,
  .cbc-page .cbm-grid-scroll,
  .cbc-page .cbm-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .cbc-page .cbm-toolbar {
    flex-wrap: wrap;
  }

  .cbc-page .cbm-select {
    width: 100%;
    min-width: 0;
  }

  .cbc-page .cbm-card {
    min-height: 250px;
  }

  .cbc-page .cbm-footer {
    grid-template-columns: minmax(68px, auto) 1fr 1fr;
    gap: 8px;
  }

  .cbc-page .cbm-footer-total,
  .cbc-page .cbm-clear-btn,
  .cbc-page .cbm-add-btn {
    grid-column: auto;
    min-width: 0;
  }

  .cbc-page .cbm-clear-btn,
  .cbc-page .cbm-add-btn {
    padding: 0 10px;
    font-size: 0.82rem;
  }
}

/* --- Battle Arena HUD & Live Board --- */
.cba-page {
  max-width: 1400px;
  margin: 0 auto;
}

.cba-hud {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr);
  align-items: center;
  gap: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 22px;
  margin-bottom: 16px;
}

.cba-hud-cost { display: flex; flex-direction: column; gap: 2px; }
.cba-hud-label { font-size: 0.72rem; color: var(--text-dim); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.cba-hud-value { font-size: 1.2rem; font-weight: 800; color: var(--gold-bright); }

.cba-hud-rounds { display: flex; align-items: center; justify-content: center; gap: 8px; }
.cba-hud-case {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
  color: var(--text-muted);
}
.cba-hud-case svg { width: 18px; height: 18px; }
.cba-hud-case.active, .cba-hud-case.done { opacity: 1; border-color: var(--gold); color: var(--gold-bright); }
.cba-hud-case.active { box-shadow: 0 0 12px var(--gold-glow); }
.cba-hud-round-num { font-family: var(--font-mono); font-weight: 700; color: var(--text-dim); margin-left: 6px; }

.cba-hud-meta { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.cba-hud-mode { font-family: var(--font-display); font-weight: 800; font-size: 0.95rem; }
.cba-hud-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  color: var(--text-muted);
}
.cba-hud-badge-crazy { color: var(--red-bright); border-color: var(--red); background: rgba(239, 68, 68, 0.1); }

.cba-status {
  text-align: center;
  color: var(--text-muted);
  min-height: 1.4em;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 1rem;
}

.cba-spin-board {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.cba-arena {
  display: grid;
  position: relative;
}

.cba-col {
  min-height: 580px;
  background: transparent;
  border-right: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  position: relative;
  padding: 0 12px;
}

.cba-arena > .cba-col:last-of-type { border-right: none; }

.cba-arena > .cba-col + .cba-col {
  border-left: none;
}

.cba-team-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 100%;
}

.cba-divider-line {
  position: absolute;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.6) 25%, rgba(255, 255, 255, 0.9) 50%, rgba(255, 255, 255, 0.6) 75%, transparent 100%);
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.cba-divider-text {
  position: relative;
  z-index: 2;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: var(--gold-bright);
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--gold-glow), 0 0 22px rgba(168, 85, 247, 0.45);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(168, 85, 247, 0.45);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.25), inset 0 0 0 1px rgba(192, 132, 252, 0.08);
}

.cba-lane-head {
  min-height: 80px;
  padding: 14px 18px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border-bottom: none;
  font-family: var(--font-display);
  font-weight: 700;
}

.cba-lane-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  border: 2px solid rgba(148, 163, 184, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--gold-bright);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

.cba-lane-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.cba-lane-name small {
  color: var(--text-dim);
  font-size: 0.65rem;
  text-transform: uppercase;
  margin-left: 4px;
}

.cba-lane-score {
  margin-left: auto;
  padding: 7px 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(251, 191, 36, 0.8);
  border-radius: 9px;
  color: var(--gold-bright);
  font-weight: 800;
  font-size: 0.82rem;
  white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.1);
}

.cba-lane-open {
  justify-content: center;
  color: var(--text-muted);
}

.cba-lane-join, .cba-lane-call {
  margin: 0 0 0 10px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.cba-lane-call {
  background: var(--bg-card-hover);
  color: var(--text);
  border: 1px solid var(--border-bright);
  box-shadow: none;
}

.cba-stage-wrap, .cba-mini-reel-mask {
  height: 600px;
  position: relative;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.15);
}

.cba-mini-reel-mask {
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 82%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 82%, transparent 100%);
}

.cba-mini-reel-guides {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.cba-reel-indicator {
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  transform: translateY(-50%);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  filter: drop-shadow(0 0 4px rgba(192, 132, 252, 0.85));
}

.cba-reel-indicator-top {
  left: 4px;
  border-left: 8px solid rgba(192, 132, 252, 0.95);
}

.cba-reel-indicator-center-up {
  display: none;
}

.cba-reel-indicator-center-down {
  display: none;
}

.cba-reel-indicator-vs {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
  text-transform: uppercase;
  text-shadow: 0 0 12px var(--gold-glow), 0 0 22px rgba(168, 85, 247, 0.35);
  z-index: 5;
  pointer-events: none;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.cba-reel-indicator-bottom {
  right: 4px;
  border-right: 8px solid rgba(192, 132, 252, 0.95);
}

.cba-mini-reel-mask::after {
  display: none;
}

.cba-mini-reel-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform;
}

.cba-mini-reel-item {
  width: 100%;
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  padding: 0 12px;
}

.cba-mini-reel-glow {
  position: absolute;
  inset: 10px 15%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--rarity, transparent) 30%, transparent), transparent 70%);
  pointer-events: none;
}

.cba-mini-reel-icon {
  font-size: 2.2rem;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cba-mini-reel-icon svg {
  width: 110px;
  height: 110px;
  display: block;
}

.cba-mini-reel-icon .minecraft-item-texture {
  width: 110px;
  height: 110px;
}

.cba-mini-reel-icon .gold-spin-symbol-image {
  width: 110px;
  height: 110px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(255, 195, 40, 0.48));
}

.cba-hex {
  display: none;
}

.cba-vs {
  display: none;
}

.cba-jackpot {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(90deg, #25254A, #3A3A5E 50%, #25254A);
  border-top: 1px solid var(--border);
  color: #fff;
  padding: 12px 16px;
  font-family: var(--font-display);
  font-weight: 800;
}

.cba-jackpot-label { font-size: 0.75rem; letter-spacing: 0.14em; color: var(--gold-bright); }
.cba-jackpot-val { font-family: var(--font-mono); font-size: 1.15rem; color: var(--gold-bright); }

/* --- Pull History Grid --- */
.cba-results-items {
  display: grid;
  gap: 0;
  margin-top: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.cba-history-column {
  min-width: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
}

.cba-history-column:last-child { border-right: none; }

.cba-history-head {
  display: flex;
  align-items: center;
  padding: 12px 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
}

.cba-history-pulls {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  padding: 14px;
}

.cba-history-pull {
  min-height: 140px;
  padding: 12px 8px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cba-history-icon {
  width: 50px;
  height: 50px;
  margin-bottom: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
}

.cba-history-icon svg,
.cba-history-icon .minecraft-item-texture,
.cba-history-icon .gold-spin-symbol-image { width: 28px; height: 28px; object-fit: contain; }
.cba-history-round { font-weight: 700; font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; }
.cba-history-name { font-size: 0.75rem; font-weight: 600; color: var(--text); margin-top: 2px; }
.cba-history-value { font-family: var(--font-mono); font-weight: 700; color: var(--gold-bright); font-size: 0.82rem; margin-top: 4px; }
.cba-history-pull-pending { opacity: 0.35; border-style: dashed; }

/* --- Results screen --- */
.cba-results-stage {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.cba-results-lanes {
  padding: 36px 14px 16px;
  min-height: 260px;
  align-items: center;
}

.cba-rlane {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.cba-rlane-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid var(--border-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--text);
}

.cba-rlane-winner .cba-rlane-avatar {
  border-color: var(--gold-bright);
  box-shadow: 0 0 20px var(--gold-glow);
}

.cba-rlane-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.cba-rlane-val {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.15rem;
}

.cba-rlane-winner .cba-rlane-val { color: var(--green-bright); }
.cba-rlane-loser .cba-rlane-val { color: var(--red-bright); }

.cba-result-pill {
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.cba-result-pill.won { background: rgba(16, 185, 129, 0.15); color: var(--green-bright); border: 1px solid var(--green); }
.cba-result-pill.lost { background: rgba(239, 68, 68, 0.15); color: var(--red-bright); border: 1px solid var(--red); }

.cba-result-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 20px 14px;
}

.cba-btn-ghost {
  margin: 0;
  padding: 10px 18px;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-bright);
  box-shadow: none;
}

.cba-btn-ghost:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold);
}

.cba-btn-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.cba-feed {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.cba-feed-title {
  font-family: var(--font-display);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  margin-bottom: 12px;
}

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

.cba-feed-row {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.cba-feed-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-bright);
}

.cba-feed-dot.cba-feed-win { background: var(--green); }
.cba-feed-dot.cba-feed-lose { background: var(--red); }
.cba-feed-win { color: var(--green-bright); font-weight: 600; }
.cba-feed-lose { color: var(--red-bright); font-weight: 600; }

/* ============ Live Feed ============ */
.live-feed {
  width: 100%;
  background: transparent;
  border-top: 0;
  padding: 72px 30px 58px;
  margin: 0 auto;
  max-width: 1600px;
  flex-shrink: 0;
}

.live-feed-header {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 30px;
  margin-bottom: 42px;
}

.live-feed-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.08;
  text-transform: none;
  letter-spacing: 0;
  color: #f7f8ff;
  display: flex;
  align-items: center;
}

.live-feed-filters {
  display: flex;
  align-items: center;
  gap: 14px;
}

.feed-filter {
  background: transparent;
  border: none;
  color: #7382b8;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  margin: 0;
  box-shadow: none;
}

.feed-filter:hover {
  background: rgba(45, 56, 104, 0.34);
  color: #dfe4ff;
}

.feed-filter.active {
  background: rgba(40, 40, 82, 0.62);
  border: none;
  color: #fff;
}

.live-feed-table {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: hidden;
}

.feed-table-header {
  display: grid;
  grid-template-columns: 1.2fr 1.35fr 1fr 1fr 1fr 0.72fr;
  column-gap: 24px;
  min-height: 48px;
  padding: 0 28px 12px;
  background: transparent;
  border-bottom: 0;
}

.feed-table-header .feed-col {
  font-size: 0.88rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #6071a9;
}

.feed-table-body {
  max-height: 690px;
  overflow-y: auto;
}

.feed-row {
  display: grid;
  grid-template-columns: 1.2fr 1.35fr 1fr 1fr 1fr 0.72fr;
  column-gap: 24px;
  min-height: 72px;
  padding: 12px 28px;
  border-bottom: 1px solid rgba(65, 78, 135, 0.07);
  border-radius: 10px;
  font-size: 0.98rem;
  transition: background 0.15s ease;
  animation: feed-slide-in 0.3s ease-out;
}

@keyframes feed-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.feed-row:last-child {
  border-bottom: none;
}

.feed-row:hover {
  background: rgba(43, 43, 85, 0.24);
}

.feed-col {
  display: flex;
  align-items: center;
  color: var(--text);
}

.feed-row .feed-col.game {
  font-weight: 500;
  color: #f3f5ff;
  gap: 14px;
}

.feed-game-icon {
  width: 27px;
  height: 27px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6f7dad;
}

.feed-game-icon svg {
  width: 100%;
  height: 100%;
}

.feed-row .feed-col.username {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  gap: 12px;
  color: #8392c8;
}

.feed-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 800;
  flex-shrink: 0;
}

.feed-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.feed-row .feed-col.amount {
  font-family: var(--font-body);
  font-weight: 600;
  gap: 7px;
  color: #f3f5ff;
}

.feed-row .feed-col.multiplier {
  font-family: var(--font-body);
  font-weight: 600;
  color: #6071aa;
}

.feed-row .feed-col.payout {
  font-family: var(--font-body);
  font-weight: 600;
  gap: 7px;
}

.feed-row .feed-col.time {
  color: #c8cfee;
  font-variant-numeric: tabular-nums;
}

.feed-currency-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #7c8bbd;
}

.feed-currency-icon .gold-token-icon,
.feed-currency-icon .gold-token-icon img,
.feed-currency-icon .gold-token-fallback-icon {
  width: 100%;
  height: 100%;
}

.feed-currency-icon .gold-token-icon img,
.feed-currency-icon .gold-token-fallback-icon {
  object-fit: contain;
}

.payout-win {
  color: #08d5df;
}

.payout-lose {
  color: #7784b5;
}

.feed-loading,
.feed-empty {
  padding: 54px 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.site-legal-footer {
  width: 100%;
  max-width: 1600px;
  margin: -10px auto 0;
  padding: 0 30px 72px;
  flex-shrink: 0;
}

.site-legal-inner {
  width: min(100%, 430px);
}

.site-legal-brand {
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
  color: #f7f8ff;
  text-decoration: none;
}

.site-legal-footer p {
  margin: 0;
  color: #697aac;
  font-size: .78rem;
  font-weight: 500;
  line-height: 1.55;
}

.site-legal-footer p a {
  color: #8798d5;
  text-decoration: none;
}

.site-legal-footer p a:hover,
.site-legal-footer p a:focus-visible {
  color: #f6ad20;
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.legal-notice-open {
  overflow: hidden;
}

.legal-notice-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 24px;
  background: rgba(7, 10, 30, 0.9);
  backdrop-filter: blur(8px);
}

.legal-notice-dialog {
  width: min(100%, 560px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 32px;
  border: 1px solid rgba(130, 148, 218, 0.3);
  border-radius: 22px;
  background: linear-gradient(145deg, #232b58 0%, #171d42 100%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.legal-notice-brand {
  display: inline-flex;
  align-items: center;
  margin-bottom: 18px;
}

.legal-notice-eyebrow {
  display: block;
  margin-bottom: 8px;
  color: #f6ad20;
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.legal-notice-dialog h2 {
  margin: 0 0 14px;
  color: #f7f8ff;
  font-family: var(--font-display);
  font-size: 1.75rem;
  line-height: 1.15;
}

.legal-notice-dialog p {
  margin: 0;
  color: #a7b2da;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.65;
}

.legal-notice-dialog p a {
  color: #d7def8;
  text-underline-offset: 3px;
}

.legal-notice-dialog p a:hover,
.legal-notice-dialog p a:focus-visible {
  color: #f6ad20;
}

.legal-notice-dialog form {
  margin-top: 24px;
}

.legal-notice-dialog button {
  width: 100%;
  min-height: 48px;
  border: 1px solid #ffc54f;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8b72d 0%, #e79513 100%);
  color: #171326;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 800;
  box-shadow: 0 9px 22px rgba(236, 158, 24, 0.22);
}

.legal-notice-dialog button:hover {
  filter: brightness(1.06);
}

.legal-notice-dialog button:focus-visible {
  outline: 3px solid rgba(255, 215, 126, 0.65);
  outline-offset: 3px;
}

@media (max-width: 1100px) {
  .feed-table-header,
  .feed-row {
    grid-template-columns: 1.25fr 1.35fr 1fr 0.9fr 1fr;
  }

  .feed-table-header .feed-col:nth-child(6),
  .feed-row .feed-col:nth-child(6) {
    display: none;
  }
}

@media (max-width: 768px) {
  .live-feed {
    padding: 44px 16px 36px;
  }

  .site-legal-footer {
    margin-top: 0;
    padding: 0 16px 46px;
  }

  .legal-notice-overlay {
    padding: 12px;
  }

  .legal-notice-dialog {
    max-height: calc(100vh - 24px);
    padding: 24px 20px;
    border-radius: 18px;
  }

  .legal-notice-dialog h2 {
    font-size: 1.45rem;
  }

  .live-feed-header {
    gap: 22px;
    margin-bottom: 28px;
  }

  .live-feed-title {
    font-size: 1.7rem;
  }

  .live-feed-filters {
    width: 100%;
    gap: 4px;
  }

  .feed-filter {
    min-height: 40px;
    padding: 0 13px;
    font-size: 0.86rem;
  }

  .feed-table-header,
  .feed-row {
    grid-template-columns: 1fr 1fr 1fr;
    column-gap: 12px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .feed-table-header .feed-col:nth-child(4),
  .feed-table-header .feed-col:nth-child(5),
  .feed-table-header .feed-col:nth-child(6),
  .feed-row .feed-col:nth-child(4),
  .feed-row .feed-col:nth-child(5),
  .feed-row .feed-col:nth-child(6) {
    display: none;
  }

  .feed-row {
    min-height: 64px;
    font-size: 0.86rem;
  }

  .feed-avatar {
    width: 28px;
    height: 28px;
  }
}

/* ============ Bloxflip Home Page Components ============ */
.bf-page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 28px 72px;
}

.bf-welcome-card {
  background: linear-gradient(135deg, #25254A 0%, #1B1B3A 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 20px;
}

.bf-welcome-text h2 {
  font-size: 1.3rem;
  margin: 0 0 6px;
  color: var(--text);
}

.bf-welcome-text p {
  margin: 0 0 4px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.bf-balance {
  color: var(--gold-bright) !important;
  font-weight: 800;
}

.bf-hero-banner {
  background: linear-gradient(135deg, #1E1E42 0%, #1B1B3A 50%, #1B1B3A 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  padding: 48px 44px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.bf-hero-content {
  position: relative;
  z-index: 2;
  max-width: 500px;
}

.bf-hero-badge {
  display: inline-block;
  background: #ef4444;
  color: #fff;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 6px;
  margin-bottom: 12px;
}

.bf-hero-subbadge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.bf-hero-banner h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.05;
  margin: 0 0 10px;
  color: #fff;
  letter-spacing: -0.02em;
}

.bf-hero-banner p {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0;
}

.bf-hero-decoration {
  position: absolute;
  top: 20px;
  right: 40px;
  z-index: 1;
}

.bf-hero-coin {
  width: 140px;
  height: 140px;
  color: var(--gold-bright);
  opacity: 0.2;
}

.bf-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.bf-section-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.bf-section-nav {
  display: flex;
  gap: 4px;
}

.bf-nav-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 0.85rem;
  margin: 0;
  box-shadow: none;
}

.bf-nav-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text);
  border-color: var(--border-bright);
}

.bf-view-all {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
}

.bf-view-all:hover {
  color: var(--gold-bright);
}

.bf-games-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.bf-game-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: #fff;
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.bf-game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.bf-game-card-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.bf-game-card-icon {
  position: absolute;
  bottom: 40px;
  right: 14px;
  width: 80px;
  height: 80px;
  opacity: 0.85;
  color: rgba(255, 255, 255, 0.9);
}

.bf-game-card-icon svg {
  width: 100%;
  height: 100%;
}

.bf-game-card-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  width: fit-content;
}

/* Challenges */
.bf-challenges-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.bf-challenge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bf-challenge-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.bf-challenge-info {
  flex: 1;
  min-width: 0;
}

.bf-challenge-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 3px;
}

.bf-challenge-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bf-challenge-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
  text-decoration: none;
  flex-shrink: 0;
  transition: filter 0.15s ease;
}

.bf-challenge-play:hover {
  filter: brightness(1.1);
}

.bf-challenge-progress {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bf-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
}

.bf-progress-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.bf-progress-text {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 600;
  flex-shrink: 0;
}

.bf-challenge-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bf-challenge-minbet {
  font-size: 0.68rem;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.bf-challenge-minbet svg {
  width: 12px;
  height: 12px;
}

.bf-challenge-reward {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--gold-bright);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.bf-challenge-reward svg {
  width: 12px;
  height: 12px;
}

@media (max-width: 1100px) {
  .bf-games-row {
    grid-template-columns: repeat(3, 1fr);
  }
  .bf-challenges-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .bf-games-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .bf-challenges-row {
    grid-template-columns: 1fr;
  }
  .bf-hero-banner h1 {
    font-size: 1.6rem;
  }
  .bf-hero-banner {
    padding: 28px 20px;
  }
}

/* ============ Home showcase ============ */
.home-main {
  background: transparent;
}

.home-page {
  max-width: 1640px;
  padding-top: 16px;
  padding-bottom: 0;
}

.main-col:has(.home-main) > .live-feed {
  max-width: 1640px;
  padding-top: 30px;
}

.home-promo-banner {
  position: relative;
  min-height: 360px;
  margin-bottom: 34px;
  overflow: hidden;
  border: 1px solid rgba(130, 153, 255, 0.16);
  border-radius: 16px;
  background: #171b3d;
  box-shadow: 0 22px 55px rgba(4, 7, 27, 0.3);
  isolation: isolate;
}

.home-promo-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
  opacity: 0.96;
  filter: saturate(1.16) brightness(1.06);
}

.home-promo-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(20, 23, 53, 0.99) 0%, rgba(20, 23, 53, 0.94) 37%, rgba(27, 33, 78, 0.36) 66%, rgba(29, 36, 86, 0.12) 100%),
    linear-gradient(0deg, rgba(11, 14, 39, 0.28), transparent 55%);
}

.home-promo-content {
  position: relative;
  z-index: 3;
  width: min(49%, 590px);
  padding: 48px 0 44px 42px;
}

.home-promo-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-bottom: 18px;
  padding: 0 21px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff334d, #ff175d);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 9px 25px rgba(255, 31, 89, 0.24);
}

.home-promo-content h1 {
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 3.5vw, 4rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-shadow: 0 8px 32px rgba(4, 7, 27, 0.4);
}

.home-promo-content h1 em {
  color: #ffbd31;
  font-style: normal;
}

.home-promo-content p {
  max-width: 500px;
  margin: 18px 0 24px;
  color: #aab8f6;
  font-size: 1rem;
  line-height: 1.55;
}

.home-promo-content > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 190px;
  min-height: 48px;
  border-radius: 9px;
  background: linear-gradient(135deg, #546cff, #3e55f6);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: 0 12px 30px rgba(52, 79, 255, 0.3);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.home-promo-content > a:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.home-promo-art {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 6%;
  width: min(42%, 540px);
  height: 90%;
  transform: translateY(-50%);
  pointer-events: none;
}

.home-promo-glow {
  position: absolute;
  inset: 14% 4% 1%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 183, 29, 0.42), rgba(255, 89, 42, 0.16) 40%, transparent 68%);
  filter: blur(10px);
}

.home-promo-case {
  position: absolute;
  top: 6%;
  left: 50%;
  width: min(92%, 430px);
  height: auto;
  transform: translateX(-50%) rotate(-3deg);
  filter: drop-shadow(0 26px 24px rgba(4, 6, 27, 0.42));
}

.home-promo-gold {
  position: absolute;
  right: 2%;
  bottom: 4%;
  width: min(34%, 150px);
  height: auto;
  transform: rotate(8deg);
  filter: drop-shadow(0 12px 12px rgba(4, 6, 27, 0.45));
}

.home-promo-dots {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 14px;
  display: flex;
  gap: 7px;
  transform: translateX(-50%);
}

.home-promo-dots i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.42);
}

.home-promo-dots i:first-child {
  width: 22px;
  background: #fff;
}

.home-page .bf-section-header {
  margin-bottom: 16px;
}

.home-page .bf-section-header h2 {
  color: #f7f8ff;
  font-size: 1.4rem;
  font-weight: 700;
}

.home-page .bf-games-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
}

.home-page .bf-game-card {
  flex: 0 0 170px;
  width: 170px;
  min-width: 170px;
  max-width: 170px;
  min-height: 0;
  padding: 0;
  aspect-ratio: 425 / 588;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  scroll-snap-align: start;
  box-shadow: 0 14px 34px rgba(3, 5, 24, 0.24);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.home-page .bf-game-card:hover {
  transform: none;
  border-color: transparent;
  box-shadow: 0 14px 34px rgba(3, 5, 24, 0.24);
}

.home-page .bf-game-card::before { display: none; }

.home-page .bf-game-card.missing-poster {
  background: linear-gradient(155deg, #3d55d9 0%, #49318b 58%, #1d234f 100%);
}

.home-page .bf-game-card.missing-poster::before {
  content: attr(data-fallback-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.15), transparent 34%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.08), transparent 46%);
  font: 800 1.1rem var(--font-display);
  letter-spacing: 0.06em;
}

.home-page .bf-game-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  box-shadow: inset 0 0 0 0 rgba(255, 255, 255, 0);
  pointer-events: none;
  transition: box-shadow 0.16s ease;
}

.home-page .bf-game-card:hover::after,
.home-page .bf-game-card:focus-visible::after {
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.88),
    inset 0 0 18px rgba(255, 255, 255, 0.2);
}

.home-page .bf-game-card:focus-visible {
  outline: none;
}

.bf-game-card-crash { background: linear-gradient(155deg, #ff9c72 0%, #ef4e80 57%, #bd20d2 100%); }
.bf-game-card-cases { background: linear-gradient(155deg, #5a75ff 0%, #8855ef 44%, #ee1c9d 100%); }
.bf-game-card-blackjack { background: linear-gradient(155deg, #ff9b76 0%, #f65e81 52%, #c520cf 100%); }
.bf-game-card-mines { background: linear-gradient(155deg, #16d8ce 0%, #08a9c7 52%, #8026d6 100%); }
.bf-game-card-battles { background: linear-gradient(155deg, #ffbc4e 0%, #ff7652 50%, #d92e9a 100%); }
.bf-game-card-coinflip { background: linear-gradient(155deg, #7f70ff 0%, #4365ed 48%, #0faac4 100%); }

.bf-game-card-poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: filter 0.16s ease;
}

.home-page .bf-game-card:hover .bf-game-card-poster {
  transform: none;
  filter: none;
}

.home-page .bf-nav-btn {
  width: 34px;
  height: 34px;
  border: 0;
  background: #2c397e;
  color: #aebcff;
  font-size: 1rem;
}

.home-page .bf-nav-btn:hover {
  background: #4160ff;
  color: #fff;
}

.home-page .bf-challenges-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}

.home-page .bf-challenge-card {
  min-height: 154px;
  border-color: rgba(128, 149, 255, 0.13);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(37, 44, 91, 0.98), rgba(27, 33, 73, 0.98));
  box-shadow: 0 12px 30px rgba(5, 8, 31, 0.2);
}

.bf-challenge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  background: rgba(71, 94, 255, 0.18);
  color: #879bff;
  font-size: 1.05rem;
}

.home-page .bf-progress-bar {
  height: 6px;
}

.home-page .bf-progress-fill {
  background: linear-gradient(90deg, #4263ff, #7187ff);
}

.home-account-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.3fr) repeat(2, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 30px;
}

.home-wallet-card,
.home-overview-card,
.home-login-card,
.home-activity-panel {
  border: 1px solid rgba(124, 146, 255, 0.14);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(37, 44, 91, 0.98), rgba(26, 32, 72, 0.98));
  box-shadow: 0 16px 40px rgba(4, 7, 28, 0.22);
}

.home-wallet-card,
.home-overview-card {
  min-height: 220px;
  padding: 24px;
}

.home-account-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-account-heading > div > span,
.home-overview-kicker,
.home-section-kicker,
.home-login-card span {
  color: #7689e1;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.home-account-heading h2 {
  margin: 2px 0 0;
  font-size: 1.15rem;
}

.home-account-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 183, 36, 0.12);
}

.home-account-icon img {
  width: 31px;
  height: 31px;
  object-fit: contain;
}

.home-wallet-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 20px;
}

.home-wallet-value strong {
  color: #fff;
  font-family: var(--font-mono);
  font-size: 2rem;
}

.home-wallet-value span,
.home-wallet-card p,
.home-overview-card p,
.home-login-card p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.home-wallet-actions {
  display: flex;
  gap: 9px;
  margin-top: 18px;
}

.home-wallet-actions a,
.home-login-card > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 20px;
  border: 1px solid #3c4e9b;
  border-radius: 8px;
  color: #c3cdff;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.home-wallet-actions a.primary,
.home-login-card > a {
  border-color: transparent;
  background: linear-gradient(135deg, #4d68ff, #3652f5);
  color: #fff;
}

.home-overview-card {
  position: relative;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.home-overview-card:hover {
  transform: translateY(-3px);
  border-color: rgba(100, 125, 255, 0.42);
}

.home-overview-card::after {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  right: -56px;
  bottom: -72px;
  border-radius: 50%;
  background: rgba(72, 95, 255, 0.12);
}

.home-level-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 18px 0 15px;
}

.home-level-row > strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border: 3px solid #4a68ff;
  border-radius: 50%;
  color: #fff;
  font-size: 1.3rem;
  box-shadow: 0 0 20px rgba(67, 95, 255, 0.28);
}

.home-level-row h3,
.home-overview-card h3 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 1rem;
}

.home-level-row p,
.home-overview-card p {
  margin: 0;
  line-height: 1.4;
}

.home-overview-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #171c43;
}

.home-overview-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3d5fff, #7588ff);
}

.home-overview-link {
  position: absolute;
  z-index: 2;
  left: 24px;
  bottom: 22px;
  color: #8297ff;
  font-size: 0.75rem;
  font-weight: 700;
}

.home-rakeback-value {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 17px 0 7px;
}

.home-rakeback-value strong {
  color: #ffbd34;
  font-family: var(--font-mono);
  font-size: 2rem;
}

.home-rakeback-value svg {
  width: 24px;
  height: 24px;
  color: #ffbd34;
}

.home-login-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 30px;
  padding: 25px 28px;
}

.home-login-card h2 {
  margin: 4px 0 4px;
}

.home-login-card p {
  margin: 0;
}

.home-activity-panel {
  margin-top: 18px;
  padding: 22px 24px 24px;
}

.home-activity-panel .bf-section-header h2 {
  margin-top: 2px;
  font-size: 1.15rem;
}

.home-activity-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.home-activity-list .activity-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(122, 144, 255, 0.1);
  border-radius: 9px;
  background: #1c234e;
}

.home-activity-list .activity-avatar {
  width: 34px;
  height: 34px;
  overflow: hidden;
  border-radius: 50%;
  background: #303968;
}

.home-activity-list .activity-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-activity-list .activity-name {
  min-width: 0;
  overflow: hidden;
  color: #b9c4ef;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-activity-list .activity-amount {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
}

.home-activity-list .activity-amount.win { color: #2fd7ca; }
.home-activity-list .activity-amount.lose { color: #f16b87; }

@media (max-width: 1380px) {
  .home-page .bf-challenges-row,
  .home-activity-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-account-grid {
    grid-template-columns: 1fr 1fr;
  }

  .home-wallet-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .home-page {
    padding-inline: 16px;
  }

  .home-promo-banner {
    min-height: 390px;
  }

  .home-promo-content {
    width: auto;
    padding: 35px 24px;
  }

  .home-promo-overlay {
    background: linear-gradient(180deg, rgba(20, 23, 53, 0.98) 0%, rgba(20, 23, 53, 0.88) 68%, rgba(20, 23, 53, 0.48) 100%);
  }

  .home-promo-art {
    right: -12%;
    bottom: -20%;
    top: auto;
    width: 68%;
    height: 56%;
    transform: none;
    opacity: 0.44;
  }

  .home-promo-content h1 {
    font-size: 2.35rem;
  }

  .home-page .bf-challenges-row,
  .home-account-grid,
  .home-activity-list {
    grid-template-columns: 1fr;
  }

  .home-wallet-card {
    grid-column: auto;
  }

  .home-login-card {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ============ Animations ============ */
@keyframes deal-in {
  from { opacity: 0; transform: translateY(-20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pop-in {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}

@keyframes coin-spin {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(1800deg); }
}

@keyframes pulse-slot {
  0%, 100% { box-shadow: inset 0 2px 8px rgba(0,0,0,0.5); }
  50% { box-shadow: inset 0 2px 8px rgba(0,0,0,0.5), 0 0 14px var(--gold-glow); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fade-in 0.25s ease;
}

/* ============ Responsive Breakpoints ============ */
@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 138px minmax(0, 1fr);
    grid-template-areas:
      "topbar topbar"
      "sidebar main";
  }
  .sidebar {
    padding: var(--game-ui-gutter) 10px 14px 28px;
  }
  .chat-panel {
    display: none;
  }
}

@media (max-width: 860px) {
  .site-shell {
    grid-template-columns: 1fr;
  }
  .app-shell {
    grid-template-columns: 138px minmax(0, 1fr);
    grid-template-areas:
      "topbar topbar"
      "sidebar main";
  }
  .site-sidebar {
    display: none;
  }
  .sidebar {
    display: flex;
    padding: var(--game-ui-gutter) 10px 14px 28px;
  }
  .container {
    padding: 20px 16px 56px;
  }
  .topbar, .dash-topbar {
    padding: 12px 18px;
  }
  .dash-topbar-nav {
    display: none;
  }
}

/* --- Mines: reference-matched navy layout --- */
body:has(.mines-main) {
  background-color: var(--game-surface);
  background-image:
    radial-gradient(ellipse 1000px 560px at 50% -10%, rgba(59, 130, 246, .08), transparent 70%),
    radial-gradient(ellipse 700px 460px at 85% 20%, rgba(139, 92, 246, .06), transparent 60%),
    url('/images/background/background.png');
}
body:has(.mines-main) .main-col {
  background-color: transparent;
  background-image:
    radial-gradient(circle at 78% 34%, rgba(72, 55, 150, .08), transparent 34%),
    radial-gradient(circle at 28% 80%, rgba(39, 81, 158, .07), transparent 38%);
}
.dash-main.mines-main { min-width: 0; padding: 0; }
.mines-page button:active { transform: none; }
.mines-page {
  display: grid;
  grid-template-columns: minmax(400px, 478px) minmax(0, 1fr);
  gap: 24px;
  width: calc(100% - 32px);
  max-width: 1364px;
  margin: 16px 0 54px 4px;
  align-items: start;
}
.mines-controls-panel,
.mines-board-panel {
  border-radius: 12px;
  background: var(--game-surface);
  box-shadow: 0 12px 28px rgba(7, 12, 39, .12), inset 0 1px rgba(255, 255, 255, .012);
}
.mines-controls-panel { min-height: 542px; padding: 24px; display: flex; flex-direction: column; }
.mines-mode-tabs { display: flex; gap: 8px; margin: 0 0 20px; padding: 0; background: transparent; border-radius: 7px; }
.mines-mode-tabs button {
  flex: 0 0 78px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #7c8dc1;
  font: 600 .8rem var(--font-display);
  box-shadow: none;
  filter: none;
}
.mines-mode-tabs button:hover { background: rgba(53, 62, 111, .56); color: #dfe5ff; filter: none; box-shadow: none; transform: none; }
.mines-mode-tabs button.active { color: #fff; background: #303761; }
.mines-mode-tabs button:disabled { cursor: default; opacity: 1; filter: none; }
.mines-field-label {
  display: block;
  margin: 14px 0 7px;
  color: #6073ac;
  font: 500 .7rem var(--font-display);
  text-transform: none;
  letter-spacing: normal;
}
.mines-field-label:first-of-type { margin-top: 0; }
.mines-bet-field,
.mines-count-field,
.mines-earnings {
  display: flex;
  align-items: center;
  height: 43px;
  gap: 8px;
  border-radius: 8px;
  background: #2a3158;
}
.mines-bet-field { padding: 0 10px 0 14px; }
.mines-bet-field .gold-token-icon,
.mines-earnings .gold-token-icon { width: 20px; height: 20px; color: #8597c9; flex: 0 0 20px; }
.mines-bet-field input,
.mines-count-field > input,
.mines-earnings input {
  width: 0;
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: #fff;
  font: 700 .85rem var(--font-display);
}
.mines-main input:focus { border: 0; outline: 0; box-shadow: none; }
.mines-count-field > input {
  flex: none;
  width: 32px;
  max-width: none;
  text-align: center;
}
.mines-earnings { padding: 0 14px; }
.mines-earnings input { color: #8292c3; }
.mines-bet-field input::-webkit-inner-spin-button,
.mines-bet-field input::-webkit-outer-spin-button,
.mines-count-field input::-webkit-inner-spin-button,
.mines-count-field input::-webkit-outer-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
.mines-bet-field input[type="number"], .mines-count-field input[type="number"] { -moz-appearance: textfield; }
.mines-quick-actions,
.mines-count-actions { display: flex; gap: 4px; }
.mines-quick-actions button,
.mines-count-actions button {
  height: 28px;
  min-width: 32px;
  margin: 0;
  padding: 0 6px;
  border: 0;
  border-radius: 7px;
  background: #3a426f;
  color: #90a1d1;
  font: 600 .7rem var(--font-display);
  box-shadow: none;
  filter: none;
}
.mines-quick-actions button:hover,
.mines-count-actions button:hover,
.mines-count-actions button.selected { background: #4563ff; color: #fff; transform: none; filter: none; box-shadow: none; }
.mines-count-field { padding: 0 6px 0 10px; }
.mines-count-actions { margin-left: auto; display: flex; flex-wrap: wrap; }
.mines-count-actions button { min-width: 24px; padding: 0 4px; flex: 1 1 auto; white-space: nowrap; }
.mines-grid-size {
  padding: 13px 16px 10px;
  border-radius: 8px;
  background: #2a3158;
}
.mines-grid-size input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 18px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  margin: 7px 0 10px;
  position: relative;
  box-shadow: none;
}
.mines-grid-size input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #9aa6ca;
  cursor: pointer;
  margin-top: -8px;
  box-shadow: 0 0 0 3px #2a3158, 0 2px 6px rgba(0, 0, 0, .35);
  position: relative;
  z-index: 2;
}
.mines-grid-size input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  border-radius: 99px;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent calc(12.5% - 1px), #7888b6 calc(12.5% - 1px), #7888b6 12.5%),
    linear-gradient(90deg, #4563ff 0 var(--mines-grid-progress), #414a76 var(--mines-grid-progress) 100%);
}
.mines-grid-size input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: #9aa6ca; box-shadow: 0 0 0 3px #2a3158, 0 2px 6px rgba(0, 0, 0, .35); }
.mines-grid-size input[type=range]::-moz-range-track { height: 6px; border-radius: 99px; background: #414a76; }
.mines-grid-size input[type=range]::-moz-range-progress { height: 6px; border-radius: 99px; background: #4563ff; }
.mines-grid-size > div:last-child { display: flex; justify-content: space-between; color: #5a6b9c; font: 500 .65rem var(--font-display); }
.mines-grid-size strong { color: #aebce5; font: 600 .7rem var(--font-display); }
.mines-primary-button {
  width: 100%;
  height: 42px;
  margin: 32px 0 0;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: #4563ff;
  font: 700 .8rem var(--font-display);
  cursor: pointer;
  transition: all .2s;
}
.mines-primary-button:hover:not(:disabled) { background: #5572ff; filter: none; box-shadow: 0 8px 18px rgba(50, 82, 255, .2); transform: none; }
.mines-primary-button.cashout {
  background: transparent;
  border: 2px solid #3d5cfb;
  color: #3d5cfb;
}
.mines-primary-button.cashout:hover:not(:disabled) {
  background: rgba(61, 92, 251, 0.1);
}
.mines-status { min-height: 28px; margin: 0; padding-top: 10px; text-align: center; color: #9dadcf; font-size: .75rem; }
.mines-board-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 590px;
  padding: 64px 40px 42px;
}
.mines-board-header { position: absolute; top: 0; left: 0; right: 0; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; color: #5c6ea3; font: 600 .75rem var(--font-display); }
.mines-board-header > span { padding: 4px 12px; background: rgba(35, 47, 94, .4); border-radius: 99px; }
.mines-board-header button { height: 26px; margin: 0; padding: 0 11px; border: 0; border-radius: 7px; color: #7c8dc1; background: #303761; font: 600 .65rem var(--font-display); box-shadow: none; filter: none; cursor: pointer; transition: background .15s; }
.mines-board-header button:hover { background: #3b4678; color: #fff; filter: none; box-shadow: none; transform: none; }
.mines-board-header > div { display: flex; gap: 6px; }
.mines-board-header button:first-child { width: 26px; padding: 0; }
.mines-board-container { width: 100%; display: flex; align-items: center; justify-content: center; }
.mines-board {
  display: grid;
  justify-content: center;
  gap: var(--mines-tile-gap, 16px);
  width: 100%;
  max-width: 500px;
}
.mines-tile {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #1a2044;
  color: #6576ab;
  box-shadow: 0 4px 8px rgba(6, 10, 35, .16);
  filter: none;
  transition: all .15s ease;
}
.mines-tile.covered { cursor: pointer; }
.mines-tile.covered:disabled { opacity: 1; filter: none; }
.mines-tile.covered:hover:not(:disabled) { background: #242b56; transform: translateY(-2px); box-shadow: 0 8px 16px rgba(4, 8, 32, .24); filter: none; }
@keyframes tileLoading { 0% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(0.95); } 100% { opacity: 1; transform: scale(1); } }
.mines-tile.loading { animation: tileLoading 0.5s ease infinite; background: #3e5df7; }
.mines-covered-icon { display: grid; width: 58%; height: 58%; place-items: center; }
.mines-covered-icon > img { width: 100%; height: 100%; object-fit: contain; opacity: .8; filter: drop-shadow(0 3px 5px rgba(6, 10, 38, .24)); transition: opacity .2s ease, transform .2s ease; }
.mines-tile.covered:hover:not(:disabled) .mines-covered-icon > img { opacity: 1; transform: scale(1.04); }
.mines-tile-fallback { display: grid; width: 100%; height: 100%; place-items: center; color: #6579b1; opacity: .8; }
.mines-tile-fallback svg { width: 100%; height: 100%; }
.mines-tile.safe,
.mines-tile.mine { opacity: 1; filter: none; background: transparent; box-shadow: none; }
.mines-tile.safe { color: #ffc43d; }
.mines-tile.safe .mines-gold-icon { width: 68%; height: 68%; object-fit: contain; image-rendering: pixelated; filter: drop-shadow(0 0 10px rgba(255, 183, 26, .28)) drop-shadow(0 4px 6px rgba(0, 0, 0, .25)); animation: minesResultPop .28s cubic-bezier(.2, .9, .3, 1.25); }
.mines-tile.mine { color: #ff367c; }
.mines-mine-icon { display: grid; width: 92%; height: 92%; place-items: center; filter: drop-shadow(0 0 12px rgba(238, 43, 119, .28)); animation: minesResultPop .28s cubic-bezier(.2, .9, .3, 1.25); }
.mines-mine-icon > img,
.mines-mine-fallback,
.mines-mine-fallback svg { width: 100%; height: 100%; object-fit: contain; }
.mines-mine-fallback { display: grid; place-items: center; }
.mines-tile.mine.hit { background: linear-gradient(145deg, #ff3c82, #d91d68); box-shadow: 0 0 22px rgba(244, 43, 123, .62), inset 0 1px rgba(255, 255, 255, .18); }
.mines-tile.mine.hit .mines-mine-icon { color: #141934; filter: drop-shadow(0 4px 7px rgba(27, 8, 29, .28)); }
@keyframes minesResultPop { from { opacity: 0; transform: scale(.72); } to { opacity: 1; transform: scale(1); } }
@media (max-width: 1500px) {
  .app-shell:has(.mines-main) { grid-template-columns: 138px minmax(0, 1fr); grid-template-areas: "topbar topbar" "sidebar main"; }
  .app-shell:has(.mines-main) > .chat-panel { display: none; }
  .mines-quick-actions { gap: 5px; }
  .mines-quick-actions button { min-width: 34px; padding-inline: 6px; }
  .mines-count-field { padding-left: 12px; }
  .mines-count-actions { gap: 2px; }
  .mines-count-actions button { min-width: 26px; padding-inline: 0; }
  .mines-count-field > input { flex: 0 0 20px; }
}
@media (max-width: 1220px) {
  .mines-page { grid-template-columns: 1fr; width: calc(100% - 36px); max-width: none; margin: 16px 18px 54px; }
  .mines-board-panel { min-height: auto; }
}
@media (max-width: 620px) {
  .app-shell:has(.mines-main) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "topbar" "main"; }
  .app-shell:has(.mines-main) > .sidebar { display: none; }
  .mines-page { width: calc(100% - 24px); margin: 12px 12px 42px; }
  .mines-controls-panel { min-height: 0; padding: 20px; }
  .mines-board-panel { padding-inline: 15px; }
  .mines-count-actions { gap: 3px; }
  .mines-count-actions button { min-width: 29px; padding: 0 4px; }
}

/* --- Towers: reference-matched navy layout --- */
body:has(.towers-main) {
  background-color: var(--game-surface);
  background-image:
    radial-gradient(ellipse 1000px 560px at 50% -10%, rgba(59, 130, 246, .08), transparent 70%),
    radial-gradient(ellipse 700px 460px at 85% 20%, rgba(139, 92, 246, .06), transparent 60%),
    url('/images/background/background.png');
}

body:has(.towers-main) .main-col {
  background-color: transparent;
  background-image:
    radial-gradient(circle at 78% 34%, rgba(72, 55, 150, .08), transparent 34%),
    radial-gradient(circle at 28% 80%, rgba(39, 81, 158, .07), transparent 38%);
}

.dash-main.towers-main {
  --towers-control: #191f3f;
  --towers-surface: var(--game-surface, #21264a);
  --towers-field: #272e55;
  --towers-field-strong: #2d355f;
  --towers-line: rgba(111, 128, 190, .14);
  --towers-muted: #8190bd;
  --towers-blue: #3e5df7;
  --towers-blue-dark: #2d45cb;
  --towers-win: #28d7ad;
  min-width: 0;
  flex: 0 0 auto;
  padding: 17px 28px 0 4px;
  container: towers-layout / inline-size;
}

.towers-page {
  display: grid;
  grid-template-columns: minmax(340px, .555fr) minmax(560px, 1fr);
  gap: 24px;
  width: 100%;
  max-width: none;
  margin: 0;
  align-items: start;
}

.towers-page button {
  margin: 0;
  outline: 0;
  box-shadow: none;
  transform: none;
  filter: none;
  transition: color .14s ease, background .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.towers-page button:hover,
.towers-page button:disabled { filter: none; }

.towers-page button:focus-visible {
  outline: 2px solid rgba(84, 111, 255, .78);
  outline-offset: 2px;
}

.towers-controls-panel,
.towers-board-panel {
  border: 1px solid rgba(111, 128, 190, .08);
  border-radius: 12px;
  background: linear-gradient(180deg, #22284d 0%, var(--towers-surface) 100%);
  box-shadow: 0 20px 46px rgba(7, 11, 34, .13), inset 0 1px rgba(255, 255, 255, .018);
}

.towers-controls-panel {
  position: relative;
  min-width: 0;
  height: 320px;
  min-height: 320px;
  padding: 24px;
  overflow: hidden;
}

.towers-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  width: 176px;
  margin-bottom: 19px;
  padding: 4px;
  border-radius: 9px;
  background: #121831;
}

.towers-mode-tabs button {
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  color: #7f8fbd;
  background: transparent;
  font: 700 .86rem var(--font-display);
}

.towers-mode-tabs button.active {
  color: #fff;
  background: #2b335c;
  box-shadow: inset 0 1px rgba(255, 255, 255, .04), 0 4px 10px rgba(8, 12, 37, .14);
}

.towers-mode-tabs button:disabled {
  opacity: 1;
  cursor: default;
}

.towers-field-label {
  display: block;
  margin: 0 0 8px;
  color: #7183ba;
  font: 500 .74rem var(--font-display);
  text-transform: none;
  letter-spacing: 0;
}

.towers-bet-field + .towers-field-label {
  margin-top: 19px;
}

.towers-bet-field {
  display: flex;
  align-items: center;
  height: 42px;
  gap: 9px;
  padding: 0 8px 0 14px;
  border: 1px solid rgba(111, 128, 190, .09);
  border-radius: 9px;
  background: var(--towers-field);
  transition: border-color .14s ease, box-shadow .14s ease;
}

.towers-bet-field:focus-within {
  border-color: rgba(84, 111, 255, .5);
  box-shadow: 0 0 0 1px rgba(62, 92, 247, .22), 0 0 18px rgba(62, 92, 247, .08);
}

.towers-bet-field .gold-token-icon {
  width: 21px;
  height: 18px;
  color: #f6bd4f;
  filter: drop-shadow(0 2px 4px rgba(232, 167, 24, .16));
}

.towers-bet-field .gold-token-icon img { image-rendering: pixelated; }

.towers-bet-field input {
  width: 0;
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font: 700 .88rem var(--font-display);
}

.towers-bet-field input:focus { border: 0; box-shadow: none; }

.towers-bet-field input:disabled { opacity: .72; }
.towers-bet-field input::-webkit-inner-spin-button,
.towers-bet-field input::-webkit-outer-spin-button { appearance: none; -webkit-appearance: none; margin: 0; }
.towers-bet-field input[type="number"] { -moz-appearance: textfield; }

.towers-quick-actions {
  display: flex;
  gap: 6px;
}

.towers-quick-actions button,
.towers-difficulty button {
  height: 28px;
  min-width: 44px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  color: #96a4cf;
  background: #39416d;
  font: 700 .76rem var(--font-display);
}

.towers-quick-actions button:hover,
.towers-difficulty button:hover {
  color: #fff;
  background: #485486;
}

.towers-quick-actions button:disabled,
.towers-difficulty button:disabled { opacity: .58; cursor: not-allowed; }

.towers-difficulty {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}

.towers-difficulty button {
  height: 29px;
  min-width: 0;
}

.towers-difficulty button.active {
  color: #fff;
  background: linear-gradient(180deg, #4868ff, var(--towers-blue));
}

.towers-primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 40px;
  margin-top: 32px !important;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(180deg, #4868ff, var(--towers-blue));
  font: 700 .84rem var(--font-display);
  box-shadow: 0 8px 20px rgba(46, 69, 203, .19), inset 0 1px rgba(255, 255, 255, .13);
}

.towers-primary-button:hover {
  background: linear-gradient(180deg, #5573ff, #4967ff);
  box-shadow: 0 9px 24px rgba(46, 69, 203, .24), inset 0 1px rgba(255, 255, 255, .15);
}

.towers-primary-button.cashout {
  border: 1px solid rgba(40, 215, 173, .44);
  color: #b7fff0;
  background: linear-gradient(180deg, rgba(40, 215, 173, .18), rgba(31, 135, 116, .16));
  box-shadow: 0 0 22px rgba(40, 215, 173, .1), inset 0 1px rgba(255, 255, 255, .06);
}

.towers-primary-button:disabled {
  opacity: .58;
  cursor: not-allowed;
}

.towers-primary-button .tower-currency-icon {
  width: 17px;
  height: 14px;
}

.towers-cashout-value { color: #fff; }

.towers-status {
  position: static;
  width: 100%;
  min-height: 15px;
  margin: 7px 0 0;
  overflow: hidden;
  color: var(--towers-muted);
  font: 500 .72rem/15px var(--font-display);
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.towers-status-win { color: var(--towers-win); }
.towers-status-loss { color: #ef718d; }

.towers-board-panel {
  position: relative;
  height: 565px;
  min-height: 565px;
  padding: 0;
  overflow: hidden;
}

.towers-board-panel::after {
  content: '';
  position: absolute;
  inset: 72px 10% 46px;
  background: radial-gradient(circle at 50% 46%, rgba(62, 93, 247, .075), transparent 66%);
  pointer-events: none;
}

.towers-board-hud {
  position: absolute;
  z-index: 3;
  top: 14px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.towers-board-hud strong {
  color: #e9edff;
  font: 700 .82rem var(--font-display);
}

.towers-board-hud span {
  color: #7787b6;
  font: 500 .72rem var(--font-display);
}

.towers-board-tools {
  position: absolute;
  z-index: 2;
  top: 13px;
  right: 17px;
  display: flex;
  gap: 8px;
}

.towers-board-tools button {
  height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  color: #8e9dc9;
  background: #2a3157;
  font: 500 .76rem var(--font-display);
}

.towers-board-tools button:hover {
  color: #dce3ff;
  background: #353f6b;
}

.towers-board-tools button:first-child {
  width: 32px;
  padding: 0;
}

.towers-board-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding-top: 89px;
}

.towers-grid {
  --tower-columns: 3;
  position: relative;
  display: grid;
  grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: 0;
  width: min(436px, calc(100% - 64px));
  height: 385px;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(111, 128, 190, .07);
  border-radius: 13px;
  background: #181e40;
  box-shadow: 0 18px 38px rgba(7, 11, 34, .16), inset 0 1px rgba(255, 255, 255, .018);
}

.tower-row {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--tower-columns), minmax(0, 1fr));
  min-width: 0;
  min-height: 0;
  background: transparent;
  transition: background .16s ease, box-shadow .16s ease;
}

.tower-row.active-row {
  z-index: 1;
  background: #273776;
  box-shadow: 0 0 22px rgba(62, 93, 247, .13), inset 0 1px rgba(90, 116, 255, .08), inset 0 -1px rgba(12, 19, 58, .22);
}

.tower-row.active-row::before,
.tower-row.active-row::after {
  content: '';
  position: absolute;
  z-index: 3;
  top: 50%;
  width: 4px;
  height: 26px;
  border-radius: 2px;
  background: #4263ff;
  box-shadow: 0 0 8px rgba(66, 99, 255, .36);
  transform: translateY(-50%);
  pointer-events: none;
}

.tower-row.active-row::before { left: 0; }
.tower-row.active-row::after { right: 0; }

.tower-row.resolved-row {
  background: linear-gradient(90deg, rgba(88, 49, 63, .17), rgba(122, 74, 42, .2), rgba(88, 49, 63, .17));
  box-shadow: inset 0 1px rgba(255, 164, 44, .025), inset 0 -1px rgba(10, 14, 45, .16);
}

.tower-cell {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0;
  color: #8299dc;
  background: transparent;
  font: 500 .82rem var(--font-display);
  font-variant-numeric: tabular-nums;
  opacity: 1;
  box-shadow: none;
}

.tower-cell-chip {
  display: inline-flex;
  min-width: 78px;
  height: 28px;
  padding: 0 10px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow: visible;
  border-radius: 4px;
  background: transparent;
  white-space: nowrap;
  transition: color .14s ease, background .14s ease, box-shadow .14s ease;
}

.tower-cell-chip b {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tower-cell:disabled { opacity: 1; cursor: default; }

.tower-cell:focus-visible { outline: 0; }
.tower-cell:focus-visible .tower-cell-chip {
  outline: 2px solid rgba(118, 141, 255, .92);
  outline-offset: 2px;
}

.tower-currency-icon {
  display: block;
  width: 17px;
  height: 13px;
  flex: 0 0 auto;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 1px 1px rgba(232, 167, 24, .1));
}

.towers-grid[data-columns="4"] .tower-cell-chip {
  min-width: 66px;
  padding-inline: 6px;
  gap: 3px;
}

.towers-grid[data-columns="4"] .tower-currency-icon {
  width: 13px;
  height: 10px;
}

.tower-cell.playable {
  cursor: pointer;
  color: #fff;
  background: transparent;
  box-shadow: none;
}

.tower-cell.playable .tower-cell-chip {
  background: #3f60ff;
  box-shadow: 0 3px 9px rgba(31, 52, 180, .22), inset 0 1px rgba(255, 255, 255, .11);
}

.tower-cell.playable:hover .tower-cell-chip {
  background: #5573ff;
  box-shadow: 0 4px 12px rgba(31, 52, 180, .3), inset 0 1px rgba(255, 255, 255, .14);
}

.tower-cell.revealed-safe {
  color: #8299dc;
  background: transparent;
  box-shadow: none;
}

.tower-cell.chosen-safe .tower-cell-chip > *,
.tower-cell.chosen-mine .tower-cell-chip > *,
.tower-cell.revealed-mine .tower-cell-chip > * {
  display: none;
}

.tower-cell.chosen-safe .tower-cell-chip {
  min-width: 50px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.tower-cell.chosen-safe .tower-cell-chip::after {
  content: '★';
  color: #ffb31b;
  font: 800 1.85rem/1 Arial, sans-serif;
  text-shadow: 0 0 12px rgba(255, 151, 17, .54);
}

.tower-cell.chosen-mine,
.tower-cell.revealed-mine {
  color: #ff2e78;
  background: transparent;
  box-shadow: none;
}

.tower-cell.chosen-mine .tower-cell-chip::after,
.tower-cell.revealed-mine .tower-cell-chip::after {
  content: '×';
  color: #ff2e78;
  font: 500 2.25rem/1 Arial, sans-serif;
  text-shadow: 0 0 13px rgba(255, 35, 113, .38);
}

.towers-grid[aria-busy="true"] .tower-cell.playable { cursor: wait; }

.game-win-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 10000;
  display: flex;
  width: min(350px, calc(100vw - 48px));
  min-height: 64px;
  padding: 12px 14px 12px 10px;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(111, 128, 190, .16);
  border-radius: 9px;
  color: #f5f7ff;
  background: var(--game-surface, #21264a);
  box-shadow: 0 14px 38px rgba(7, 11, 34, .28), inset 0 1px rgba(255, 255, 255, .018);
  font: 600 .86rem/1.38 var(--font-display);
  opacity: 0;
  transform: translate(-50%, 12px) scale(.98);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}

.game-win-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.game-win-toast-check {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #51cc50;
  box-shadow: 0 0 12px rgba(81, 204, 80, .18);
  font: 800 .78rem/1 Arial, sans-serif;
}

.game-win-toast-message { min-width: 0; }

.app-shell:has(.towers-main) .topbar-wallet strong {
  display: flex;
  align-items: center;
  gap: 5px;
}

.app-shell:has(.towers-main) .topbar-wallet strong::before {
  content: '';
  display: block;
  width: 17px;
  height: 14px;
  background: url('/images/currency/gold.png') center / contain no-repeat;
  image-rendering: pixelated;
  filter: drop-shadow(0 1px 2px rgba(232, 167, 24, .12));
}

.main-col:has(.towers-main) > .live-feed {
  max-width: none;
  padding: 68px 28px 58px 4px;
}

@container towers-layout (max-width: 920px) {
  .towers-page { grid-template-columns: 1fr; }
  .towers-controls-panel { height: 320px; }
  .towers-board-panel { height: 540px; min-height: 540px; }
  .towers-board-stage { padding-top: 78px; }
}

@media (max-width: 1500px) {
  .app-shell:has(.towers-main) {
    grid-template-columns: 138px minmax(0, 1fr);
    grid-template-areas: "topbar topbar" "sidebar main";
  }
  .app-shell:has(.towers-main) > .chat-panel { display: none; }
}

@media (max-width: 960px) {
  .dash-main.towers-main { padding-right: 18px; padding-left: 18px; }
  .towers-page { grid-template-columns: 1fr; }
  .main-col:has(.towers-main) > .live-feed { padding-right: 18px; padding-left: 18px; }
}

@media (max-width: 620px) {
  .app-shell:has(.towers-main) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "topbar" "main";
  }
  .app-shell:has(.towers-main) > .sidebar { display: none; }
  .dash-main.towers-main { padding: 12px; }
  .towers-controls-panel { height: auto; min-height: 310px; padding: 20px; }
  .towers-mode-tabs { margin-bottom: 18px; }
  .towers-primary-button { margin-top: 26px !important; }
  .towers-status { right: 20px; left: 20px; }
  .towers-board-panel { height: 500px; min-height: 500px; }
  .towers-board-stage { padding-top: 70px; }
  .towers-grid { width: calc(100% - 24px); height: 360px; gap: 0; padding: 0; }
  .tower-cell { padding: 0; font-size: .68rem; }
  .tower-cell-chip { min-width: 62px; height: 26px; padding-inline: 6px; gap: 4px; }
  .tower-currency-icon { width: 13px; height: 10px; }
  .towers-grid[data-columns="4"] .tower-cell-chip { min-width: 50px; padding-inline: 3px; }
  .game-win-toast { bottom: 12px; width: calc(100vw - 24px); }
  .main-col:has(.towers-main) > .live-feed { padding: 52px 12px 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .game-win-toast { transition: none; }
}

/* --- Slide (Bloxflip-style) --- */
.slide-main { min-width: 0; }
.slide-page { max-width: 1120px; margin: 18px auto 54px; }

/* -- Reel Panel -- */
.slide-reel-panel {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  padding: 28px 0 28px;
  border-radius: 16px;
  background: rgba(35, 35, 78, 0.9);
  border: 1px solid rgba(100, 100, 180, 0.12);
}

/* History bar */
.slide-history {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 28px;
  flex-wrap: wrap;
}
.slide-history span {
  padding: 5px 14px;
  border-radius: 8px;
  color: #fff;
  font: 700 0.78rem var(--font-display);
  letter-spacing: 0.02em;
}
.slide-history .pill-gold   { background: linear-gradient(135deg, #f5a623, #e08e0b); }
.slide-history .pill-pink   { background: linear-gradient(135deg, #ed3075, #d8106b); }
.slide-history .pill-purple { background: linear-gradient(135deg, #9b59b6, #7c3aed); }
.slide-history .pill-loss   { background: #3a3a5e; color: #8888aa; }

/* Tools (Fairness / ?) */
.slide-tools {
  position: absolute;
  top: 28px;
  right: 28px;
  display: flex;
  gap: 9px;
}
.slide-tools button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: rgba(50, 50, 90, 0.7);
  color: #96a4d1;
  font: 500 0.78rem var(--font-display);
  cursor: pointer;
  transition: background 0.15s;
  box-shadow: none;
}
.slide-tools button:hover { background: rgba(65, 65, 115, 0.8); }

/* Heading */
.slide-heading, .slide-reel-panel h1 {
  text-align: center;
  margin: 20px 0 28px;
  color: #c0c6e0;
  font: 700 1.65rem var(--font-display);
  letter-spacing: -0.01em;
  transition: color 0.3s;
}
.slide-win  { color: #4ade80 !important; text-shadow: 0 0 18px rgba(74, 222, 128, 0.4); }
.slide-lose { color: #f87171 !important; }

/* Reel window & center indicator */
.slide-reel-window {
  position: relative;
  height: 140px;
  overflow: hidden;
  background: rgba(20, 20, 46, 0.6);
  border-top: 2px solid rgba(100, 100, 180, 0.18);
  border-bottom: 2px solid rgba(100, 100, 180, 0.18);
}
/* Center pointer (top) */
.slide-reel-window::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 12px solid #facc15;
  z-index: 5;
  filter: drop-shadow(0 2px 6px rgba(250, 204, 21, 0.5));
}
/* Center pointer (bottom) */
.slide-reel-window::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 12px solid #facc15;
  z-index: 5;
  filter: drop-shadow(0 -2px 6px rgba(250, 204, 21, 0.5));
}
/* Center highlight line */
.slide-reel-window > .slide-reel ~ .slide-center-line,
.slide-reel-window .slide-center-line {
  display: none;
}

/* Reel strip */
.slide-reel {
  display: flex;
  gap: 20px;
  width: max-content;
  padding: 20px 28px;
  will-change: transform;
}

/* Individual tokens */
.slide-reel span {
  display: grid;
  width: 100px;
  height: 100px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font: 800 1.5rem var(--font-display);
  flex-shrink: 0;
  transition: box-shadow 0.3s;
}
.slide-reel span svg {
  width: 48px;
  height: 48px;
}
.slide-reel span img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.slide-reel .token-gold {
  background: linear-gradient(145deg, #f5a623, #d4860a);
  box-shadow: 0 0 16px rgba(245, 166, 35, 0.35);
}
.slide-reel .token-pink {
  background: linear-gradient(145deg, #ff568b, #d8106b);
  box-shadow: 0 0 16px rgba(255, 44, 161, 0.35);
}
.slide-reel .token-purple {
  background: linear-gradient(145deg, #a855f7, #7c3aed);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.35);
}

/* Bet controls */
.slide-reel-panel > label {
  display: block;
  width: 468px;
  max-width: 80%;
  margin: 24px auto 8px;
  color: #7083b9;
  font: 500 0.75rem var(--font-display);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.slide-bet-field {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 468px;
  max-width: 80%;
  height: 52px;
  margin: 0 auto;
  padding: 0 8px 0 16px;
  border-radius: 10px;
  background: rgba(25, 25, 52, 0.8);
  border: 1px solid rgba(100, 100, 180, 0.15);
}
.slide-bet-field .gold-token-icon {
  width: 22px;
  height: 22px;
  color: #facc15;
  flex-shrink: 0;
}
.slide-bet-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: 700 0.95rem var(--font-mono);
}
.slide-bet-field input::-webkit-outer-spin-button,
.slide-bet-field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.slide-bet-field div {
  display: flex;
  gap: 6px;
}
.slide-bet-field button {
  height: 34px;
  min-width: 48px;
  border: 0;
  border-radius: 8px;
  background: rgba(60, 60, 110, 0.6);
  color: #aebce4;
  font: 600 0.78rem var(--font-display);
  cursor: pointer;
  transition: background 0.15s;
  box-shadow: none;
}
.slide-bet-field button:hover {
  background: rgba(75, 75, 130, 0.8);
}

/* -- Lane cards -- */
.slide-lanes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}
.slide-lanes article {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(35, 35, 78, 0.9);
  border: 1px solid rgba(100, 100, 180, 0.1);
}
.slide-lanes article > button {
  width: calc(100% - 32px);
  height: 48px;
  margin: 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font: 700 0.9rem var(--font-display);
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  box-shadow: none;
  letter-spacing: 0.02em;
}
.slide-lanes article > button:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}
.slide-lanes article > button:active {
  transform: translateY(0);
}
.slide-lanes article[data-lane="gold"] > button {
  background: linear-gradient(135deg, #ffb41e, #f5a623);
  color: #422e05;
}
.slide-lanes article[data-lane="pink"] > button {
  background: linear-gradient(135deg, #ff568b, #ed3075);
}
.slide-lanes article[data-lane="purple"] > button {
  background: linear-gradient(135deg, #a855f7, #812bd9);
}

/* Player list inside lane cards */
.slide-player-list {
  flex: 1;
  margin-top: 0;
  border-top: 1px solid rgba(100, 100, 180, 0.12);
  overflow-y: auto;
  position: relative;
}
.slide-empty-lane {
  color: rgba(112, 131, 185, 0.5);
  font: 500 0.85rem var(--font-display);
  text-align: center;
  margin: 40px 0 0 0;
}
.slide-player-list p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(100, 100, 180, 0.08);
  color: #fff;
  font: 0.84rem var(--font-display);
  gap: 10px;
  position: relative;
  transition: background 0.2s;
}
.slide-player-list p.slide-is-you {
  background: rgba(100, 100, 180, 0.1);
}
.slide-player-list p.slide-is-you::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #facc15;
}
.slide-player-list p .slide-player-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(145deg, #737eaa, #27274D 62%);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.slide-player-list p .slide-player-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slide-player-list p .slide-player-bet {
  color: #91a4d7;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  flex-shrink: 0;
}
.slide-player-result {
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-left: 10px;
}
.slide-player-won { color: #4ade80; text-shadow: 0 0 10px rgba(74, 222, 128, 0.3); }
.slide-player-lost { color: #f87171; }

/* Countdown Bar */
.slide-countdown {
  width: 468px;
  max-width: 80%;
  margin: 0 auto 28px;
  height: 6px;
}
.slide-countdown-track {
  width: 100%;
  height: 100%;
  background: rgba(100, 100, 180, 0.15);
  border-radius: 4px;
  overflow: hidden;
}
.slide-countdown-fill {
  height: 100%;
  width: 100%;
  background: #facc15;
  border-radius: 4px;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.5);
}

/* Responsive */
@media (max-width: 1500px) {
  .app-shell:has(.slide-main) {
    grid-template-columns: 138px minmax(0, 1fr);
    grid-template-areas: "topbar topbar" "sidebar main";
  }
  .app-shell:has(.slide-main) > .chat-panel { display: none; }
}
@media (max-width: 900px) {
  .slide-lanes {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .slide-lanes article { min-height: 180px; }
}
@media (max-width: 800px) {
  .slide-page { margin-inline: 14px; }
  .slide-reel-panel { min-height: 420px; }
  .slide-reel span { width: 76px; height: 76px; }
  .slide-reel span svg { width: 36px; height: 36px; }
  .slide-reel-window { height: 110px; }
  .slide-reel { padding: 16px 20px; gap: 14px; }
  .slide-countdown { margin-bottom: 20px; }
}

/* --- Slide: full-width reference layout --- */
body:has(.slide-main) {
  background-color: var(--game-surface);
  background-image:
    radial-gradient(ellipse 1000px 560px at 50% -10%, rgba(59, 130, 246, 0.08), transparent 70%),
    radial-gradient(ellipse 700px 460px at 85% 20%, rgba(139, 92, 246, 0.06), transparent 60%),
    url('/images/background/background.png');
}

body:has(.slide-main) .main-col {
  background-color: transparent;
  background-image:
    radial-gradient(circle at 78% 34%, rgba(72, 55, 150, 0.08), transparent 34%),
    radial-gradient(circle at 28% 80%, rgba(39, 81, 158, 0.07), transparent 38%);
}

.dash-main.slide-main {
  min-width: 0;
  padding: 24px 0 56px;
}

.slide-page {
  width: 100%;
  max-width: none;
  margin: 0;
}

.slide-reel-panel {
  height: 480px;
  min-height: 480px;
  box-sizing: border-box;
  padding: 39px 0 15px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--game-surface) 0 calc(100% - 92px), #1d2244 calc(100% - 92px) 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.012);
}

.slide-history {
  min-height: 26px;
  gap: 8px;
  padding: 0 28px;
  flex-wrap: nowrap;
}

.slide-history span {
  min-width: 39px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 0.72rem;
  letter-spacing: 0;
}

.slide-history .pill-gold { background: #fcb122; }
.slide-history .pill-pink { background: #f03276; }
.slide-history .pill-purple { background: #af3bd8; }

.slide-tools {
  top: 39px;
  right: 28px;
  gap: 9px;
  z-index: 8;
}

.slide-tools button {
  height: 26px;
  margin: 0;
  padding: 0 12px;
  border-radius: 8px;
  color: #7888be;
  background: #2b3567;
  font-size: 0.7rem;
}

.slide-tools button:last-child {
  width: 34px;
  padding: 0;
}

.slide-tools button:hover {
  color: #fff;
  background: #3b477d;
  filter: none;
  box-shadow: none;
}

.slide-heading,
.slide-reel-panel h1 {
  min-height: 38px;
  margin: 12px 0 35px;
  line-height: 38px;
  color: #f7f8ff;
  font: 700 2rem var(--font-display);
  letter-spacing: -0.025em;
}

.slide-countdown {
  position: relative;
  display: block;
  width: 260px;
  max-width: calc(100% - 40px);
  height: 2px;
  margin: 0 auto 19px;
}

.slide-countdown-track {
  position: relative;
  height: 2px;
  overflow: visible;
  border-radius: 0;
  background: linear-gradient(90deg, transparent 0%, #46517c 19%, #46517c 81%, transparent 100%);
}

.slide-countdown-track::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-right: 9px solid transparent;
  border-left: 9px solid transparent;
  border-top: 10px solid #69759f;
}

.slide-countdown-fill {
  height: 2px;
  border-radius: 0;
  background: linear-gradient(90deg, transparent 0%, #6d7aaa 19%, #6d7aaa 81%, transparent 100%);
  box-shadow: 0 0 9px rgba(101, 115, 166, 0.2);
}

.slide-reel-window {
  height: 144px;
  overflow: hidden;
  border: 0;
  background-color: transparent;
  background-image: linear-gradient(90deg, transparent 0%, #46517c 19%, #46517c 81%, transparent 100%);
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 260px 2px;
}

.slide-reel-window::before {
  display: none;
}

.slide-reel-window::after {
  bottom: 0;
  border-right-width: 9px;
  border-bottom: 10px solid #69759f;
  border-left-width: 9px;
  filter: none;
}

.slide-reel {
  gap: 16px;
  padding: 22px 0;
}

.slide-reel span {
  width: 80px;
  height: 80px;
  border-radius: 9px;
}

.slide-reel .token-gold {
  background: linear-gradient(145deg, #ffc13c, #f0a21b);
  box-shadow: 0 0 10px rgba(255, 177, 38, 0.58), 0 0 30px rgba(255, 177, 38, 0.42), inset 0 1px rgba(255, 255, 255, 0.18);
}

.slide-reel .token-pink {
  background: linear-gradient(145deg, #ff417e, #df176d);
  box-shadow: 0 0 10px rgba(238, 38, 116, 0.62), 0 0 30px rgba(238, 38, 116, 0.45), inset 0 1px rgba(255, 255, 255, 0.16);
}

.slide-reel .token-purple {
  background: linear-gradient(145deg, #dc0ce3, #862bd4);
  box-shadow: 0 0 10px rgba(186, 28, 226, 0.62), 0 0 30px rgba(186, 28, 226, 0.45), inset 0 1px rgba(255, 255, 255, 0.16);
}

.slide-token-image {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.slide-reel-panel > label {
  position: absolute;
  left: 50%;
  bottom: 67px;
  z-index: 2;
  width: 400px;
  max-width: calc(100% - 32px);
  margin: 0;
  transform: translateX(-50%);
  color: #6679b1;
  font-size: 0.7rem;
  letter-spacing: 0;
  text-transform: none;
}

.slide-bet-field {
  position: absolute;
  left: 50%;
  bottom: 15px;
  z-index: 2;
  width: 400px;
  max-width: calc(100% - 32px);
  height: 43px;
  box-sizing: border-box;
  margin: 0;
  padding: 0 8px 0 14px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 9px;
  background: #282e54;
}

.slide-bet-field .gold-token-icon {
  width: 19px;
  height: 19px;
  color: #8595c9;
}

.slide-bet-field input {
  height: 100%;
  padding: 0;
  font: 700 0.82rem var(--font-display);
}

.slide-bet-field button {
  min-width: 45px;
  height: 28px;
  margin: 0;
  padding: 0 9px;
  color: #8e9dcd;
  background: #39416d;
  border-radius: 8px;
  font-size: 0.72rem;
}

.slide-bet-field button:hover {
  color: #fff;
  background: #4a578f;
  filter: none;
  box-shadow: none;
}

.slide-main input:focus,
.slide-main select:focus,
.slide-main button:focus {
  outline: 0;
  border-color: transparent;
  box-shadow: none;
}

.slide-main input:focus-visible,
.slide-main select:focus-visible,
.slide-main button:focus-visible {
  outline: 1px solid rgba(62, 92, 255, 0.42);
  outline-offset: 2px;
  box-shadow: none;
}

.slide-lanes {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.slide-lanes article {
  --slide-lane-glow-rgb: 91, 106, 166;
  height: 350px;
  min-height: 350px;
  border: 0;
  border-radius: 15px;
  background: var(--game-surface);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.012);
  transition: box-shadow 0.25s ease, outline-color 0.25s ease;
}

.slide-lanes article[data-lane='gold'] {
  --slide-lane-glow-rgb: 252, 177, 34;
  background: linear-gradient(180deg, rgba(255, 177, 38, 0.14), var(--game-surface) 78px);
}

.slide-lanes article[data-lane='pink'] {
  --slide-lane-glow-rgb: 240, 50, 118;
  background: linear-gradient(180deg, rgba(238, 46, 118, 0.08), var(--game-surface) 78px);
}

.slide-lanes article[data-lane='purple'] {
  --slide-lane-glow-rgb: 151, 48, 220;
  background: linear-gradient(180deg, rgba(151, 48, 220, 0.09), var(--game-surface) 78px);
}

.slide-lanes article.slide-lane-glow {
  outline: 1px solid rgba(var(--slide-lane-glow-rgb), 0.58);
  outline-offset: -1px;
  animation: slide-lane-glow-pulse 1.1s ease-in-out infinite alternate;
}

.slide-lanes article.slide-lane-glow > button {
  box-shadow: 0 0 13px rgba(var(--slide-lane-glow-rgb), 0.55), 0 0 28px rgba(var(--slide-lane-glow-rgb), 0.28);
}

@keyframes slide-lane-glow-pulse {
  from {
    box-shadow: 0 0 16px rgba(var(--slide-lane-glow-rgb), 0.24), inset 0 0 18px rgba(var(--slide-lane-glow-rgb), 0.06);
  }
  to {
    box-shadow: 0 0 34px rgba(var(--slide-lane-glow-rgb), 0.48), inset 0 0 28px rgba(var(--slide-lane-glow-rgb), 0.12);
  }
}

.slide-lanes article > button {
  width: calc(100% - 32px);
  height: 40px;
  margin: 16px;
  border-radius: 6px;
  font-size: 0.78rem;
  letter-spacing: 0;
}

.slide-lanes article[data-lane='gold'] > button {
  color: #493201;
  background: #fcb122;
}

.slide-lanes article[data-lane='pink'] > button {
  background: #f03276;
}

.slide-lanes article[data-lane='purple'] > button {
  background: #7c2edf;
}

.slide-player-list {
  min-height: 0;
  border-top-color: rgba(100, 115, 179, 0.11);
}

.slide-player-list .slide-empty-lane {
  display: none;
}

.slide-player-list p {
  min-height: 54px;
  padding: 10px 30px;
  background: #282e54;
  border-bottom-color: rgba(100, 115, 179, 0.07);
  font-size: 0.8rem;
}

.slide-player-list p .slide-player-avatar {
  width: 30px;
  height: 30px;
}

.slide-player-list p .slide-player-bet {
  color: #8396cf;
  font-size: 0.78rem;
}

@media (max-width: 900px) {
  .dash-main.slide-main { padding-inline: 16px; }
  .slide-lanes { grid-template-columns: 1fr; gap: 16px; }
  .slide-lanes article { height: 220px; min-height: 220px; }
}

@media (max-width: 800px) {
  .slide-page { margin: 0; }
  .slide-reel-panel { height: 450px; min-height: 450px; padding-top: 28px; }
  .slide-tools { top: 28px; right: 16px; }
  .slide-history { justify-content: flex-start; overflow: hidden; }
  .slide-heading, .slide-reel-panel h1 { margin-bottom: 27px; font-size: 1.35rem; }
  .slide-reel-window { height: 126px; }
  .slide-reel { gap: 13px; padding-block: 23px; }
  .slide-reel span { width: 68px; height: 68px; }
  .slide-reel-panel > label { margin: 0; }
  .slide-countdown { width: 220px; }
  .slide-reel-window { background-size: 220px 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .slide-lanes article.slide-lane-glow { animation: none; box-shadow: 0 0 28px rgba(var(--slide-lane-glow-rgb), 0.42), inset 0 0 22px rgba(var(--slide-lane-glow-rgb), 0.1); }
}

/* ============ Case Selection Modal (Popup) ============ */
.cbm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 19, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modal-fade-in 0.2s ease forwards;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cbm-dialog {
  background: #111722;
  border: 1px solid var(--border-bright);
  border-radius: 20px;
  width: 100%;
  max-width: 920px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: modal-scale-in 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  overflow: hidden;
}

@keyframes modal-scale-in {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.cbm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 16px;
}

.cbm-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.cbm-close {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  margin: 0;
  padding: 0;
  transition: all 0.15s ease;
}

.cbm-close:hover {
  color: #fff;
  background: rgba(168, 85, 247, 0.18);
  border-color: var(--gold);
  box-shadow: 0 0 14px var(--gold-glow);
}

.cbm-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.cbm-search-wrap {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.cbm-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
}

.cbm-search-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px 10px 38px;
  font-size: 0.88rem;
  color: var(--text);
}

.cbm-search-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.cbm-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  min-width: 140px;
}

.cbm-grid-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.cbm-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

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

.cbm-card {
  background: #151c28;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cbm-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--case-color, var(--gold)) 15%, transparent), transparent 70%);
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.cbm-card:hover {
  transform: translateY(-4px);
  border-color: var(--case-color, var(--gold));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4), 0 0 16px color-mix(in srgb, var(--case-color, var(--gold)) 25%, transparent);
}

.cbm-card:hover::before {
  opacity: 1;
}

.cbm-card-icon {
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--case-color, var(--gold));
  filter: drop-shadow(0 4px 12px color-mix(in srgb, var(--case-color, var(--gold)) 40%, transparent));
  position: relative;
  z-index: 1;
}

.cbm-card-icon svg {
  width: 54px;
  height: 54px;
}

.cbm-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
  margin-bottom: 10px;
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.cbm-card-cost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #0d121a;
  border: 1px solid var(--border-bright);
  border-radius: 999px;
  padding: 6px 16px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--gold-bright);
  z-index: 1;
  margin-bottom: 14px;
}

.cbm-card-cost svg {
  width: 14px;
  height: 14px;
}

.cbm-risk-meter {
  width: 75%;
  height: 4px;
  background: #242e3f;
  border-radius: 2px;
  position: relative;
  z-index: 1;
}

.cbm-risk-pin {
  position: absolute;
  top: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 6px currentColor;
}

/* --- Modal Quantity Stepper --- */
.cbm-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0e141f;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  width: 100%;
  max-width: 130px;
  margin-bottom: 12px;
  z-index: 2;
  transition: border-color 0.15s ease;
}

.cbm-stepper-btn {
  width: 32px;
  height: 30px;
  padding: 0;
  margin: 0;
  background: #17202e;
  border: 1px solid var(--border-bright);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: none;
  transition: all 0.15s ease;
}

.cbm-stepper-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--gold);
  color: var(--gold-bright);
}

.cbm-stepper-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.cbm-stepper-val {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
  min-width: 24px;
  text-align: center;
  user-select: none;
}

.cbm-card.active .cbm-stepper {
  border-color: var(--case-color, var(--gold));
}

.cbm-card.active .cbm-stepper-val {
  color: var(--gold-bright);
}

/* --- Modal Card States --- */
.cbm-card.active {
  border-color: var(--case-color, var(--gold));
  background: #182232;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px color-mix(in srgb, var(--case-color, var(--gold)) 25%, transparent);
}

.cbm-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 24px;
  text-align: center;
  z-index: 4;
  box-shadow: 0 0 12px var(--gold-glow);
  border: 1px solid var(--gold-bright);
}

.cbm-card[data-disabled="1"] {
  opacity: 0.4;
  cursor: not-allowed;
}
.cbm-card[data-disabled="1"]:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Case contents preview */
.case-tile {
  position: relative;
  overflow: hidden;
}

.case-view-action {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  height: 36px;
  padding: 0 18px;
  border: 1px solid rgba(151, 174, 255, 0.72);
  border-radius: 9px;
  background: linear-gradient(180deg, #5878ff, #3657ec);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 9px 22px rgba(36, 65, 201, 0.38);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -42%) scale(0.94);
  transition: opacity 150ms ease, transform 150ms ease, background 150ms ease;
}

.case-tile:hover .case-view-action,
.cbm-card:hover .case-view-action,
.cbc-case-card:hover .case-view-action,
.case-view-action:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.case-view-action:hover,
.case-view-action:focus-visible {
  background: linear-gradient(180deg, #6b88ff, #4566ff);
  outline: none;
}

.case-contents-overlay {
  position: fixed;
  inset: 0;
  z-index: 10010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 10, 28, 0.78);
}

.case-contents-overlay-nested {
  z-index: 10020;
}

.case-contents-dialog {
  width: min(840px, 100%);
  max-height: min(760px, 84vh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(91, 111, 190, 0.42);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(35, 35, 74, 0.98), rgba(24, 24, 54, 0.99));
  box-shadow: 0 28px 76px rgba(3, 7, 24, 0.62);
  animation: modal-scale-in 180ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.case-contents-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(94, 111, 180, 0.24);
}

.case-contents-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: #7185d7;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.case-contents-header h2 {
  margin: 0;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 800;
}

.case-contents-close {
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: rgba(65, 65, 118, 0.4);
  color: #91a0d5;
  font-size: 1.4rem;
  line-height: 1;
  box-shadow: none;
}

.case-contents-close:hover {
  background: rgba(77, 96, 171, 0.54);
  color: #fff;
  filter: none;
  box-shadow: none;
}

.case-contents-grid {
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 11px;
  padding: 18px 20px 22px;
}

.case-contents-item {
  position: relative;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 24px 10px 13px;
  overflow: hidden;
  border: 1px solid rgba(104, 122, 190, 0.2);
  border-bottom-color: var(--item-rarity);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(58, 58, 105, 0.24), rgba(31, 31, 65, 0.34));
  text-align: center;
}

.case-contents-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--item-rarity) 18%, transparent), transparent 58%);
  pointer-events: none;
}

.case-contents-chance {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 1;
  color: var(--item-rarity);
  font-size: 0.69rem;
  font-weight: 800;
}

.case-contents-icon {
  position: relative;
  z-index: 1;
  width: 62px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 3px;
  filter: drop-shadow(0 7px 13px rgba(0, 0, 0, 0.28));
}

.case-contents-icon .minecraft-item-texture {
  width: 54px;
  height: 54px;
  object-fit: contain;
  image-rendering: pixelated;
}

.case-contents-item strong,
.case-contents-item small,
.case-contents-value {
  position: relative;
  z-index: 1;
}

.case-contents-item strong {
  max-width: 100%;
  overflow: hidden;
  color: #eef2ff;
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-contents-value {
  color: #fff;
  font-size: 0.79rem;
  font-weight: 800;
}

.case-contents-item small {
  color: var(--item-rarity);
  font-size: 0.65rem;
}

@media (hover: none) {
  .case-view-action {
    top: auto;
    bottom: 10px;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) scale(0.9);
  }
}

@media (max-width: 560px) {
  .case-contents-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px;
  }
}

/* ============================================================
   Case-battle room
   ============================================================ */
.app-shell:has(.battle-arena-main) {
  display: grid;
  min-width: 0;
  min-height: 100vh;
  grid-template-columns: 138px minmax(0, 1fr) 340px;
  grid-template-rows: 80px 1fr;
  column-gap: var(--game-ui-gutter);
  grid-template-areas:
    "topbar topbar topbar"
    "sidebar main chat";
  background: transparent;
}

.app-shell:has(.battle-arena-main) > .sidebar {
  display: flex;
}

.app-shell:has(.battle-arena-main) > .dash-topbar {
  display: flex;
}

.app-shell:has(.battle-arena-main) > .chat-panel {
  display: flex;
}

.app-shell:has(.battle-arena-main) > .main-col {
  width: auto;
  min-height: 0;
  overflow-y: auto;
  background-color: transparent;
  background-image:
    radial-gradient(circle at 78% 34%, rgba(72, 55, 150, 0.08), transparent 34%),
    radial-gradient(circle at 28% 80%, rgba(39, 81, 158, 0.07), transparent 38%);
}

.battle-arena-main {
  min-height: calc(100vh - 80px);
  padding: 32px 0 58px;
  overflow-x: auto;
  font-family: var(--font-body);
}

.battle-arena-main .cba-page {
  width: min(84%, 1360px);
  min-width: 0;
  margin: 0 auto;
}

.battle-arena-main .cba-room-header {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(200px, 0.9fr) minmax(330px, 1.45fr) minmax(200px, 0.9fr);
  align-items: start;
  min-height: 114px;
  gap: 12px;
}

.battle-arena-main .cba-room-left {
  padding-top: 4px;
}

.battle-arena-main .cba-back-link {
  display: inline-flex;
  align-items: center;
  color: #7180b7;
  text-decoration: none;
  font-size: 0.78rem;
  line-height: 1;
  transition: color 0.15s ease;
}

.battle-arena-main .cba-back-link:hover {
  color: #c5cdf1;
}

.battle-arena-main .cba-hud-meta {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  justify-content: start;
  gap: 4px 13px;
  margin-top: 26px;
  color: #8492c4;
  font-size: 0.78rem;
  line-height: 1.2;
}

.battle-arena-main .cba-detail {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.battle-arena-main .cba-detail b {
  width: 13px;
  color: #8e9ac8;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.battle-arena-main .cba-room-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  height: 100px;
  margin-top: 5px;
  padding: 0 18px;
  border-radius: 0 0 12px 12px;
  background:
    radial-gradient(circle at 42% 12%, rgba(51, 65, 135, 0.24), transparent 46%),
    linear-gradient(100deg, rgba(35, 35, 78, 0.98) 0%, rgba(29, 29, 64, 0.98) 54%, rgba(20, 20, 44, 0.98) 100%);
  box-shadow: 0 12px 28px rgba(8, 11, 35, 0.12);
}

.battle-arena-main .cba-wait-summary {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  gap: 7px;
  margin-top: 7px;
  overflow: visible;
  background: transparent;
  color: #dbe0f8;
  box-shadow: none;
}

.battle-arena-main .cba-hud-cost {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  height: 31px;
  padding: 0 10px;
  border: 1px solid rgba(73, 87, 151, 0.16);
  border-radius: 8px;
  background: rgba(37, 37, 77, 0.96);
  box-shadow: 0 5px 14px rgba(7, 10, 33, 0.12);
}

.battle-arena-main .cba-hud-cost > svg,
.battle-arena-main .cba-lane-score svg,
.battle-arena-main .cba-lane-join svg {
  width: 15px;
  height: 15px;
  color: #8290c1;
  flex: 0 0 auto;
}

.battle-arena-main .cba-hud-value {
  color: #d7dcf4;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 700;
}

.battle-arena-main .cba-status {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid rgba(73, 87, 151, 0.16);
  border-radius: 8px;
  background: rgba(37, 37, 77, 0.96);
  color: #d7dcf4;
  font-size: 0.84rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 5px 14px rgba(7, 10, 33, 0.12);
}

.battle-arena-main .cba-hud-rounds {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  gap: 6px;
  overflow: hidden;
  transform: translateY(3px);
}

.battle-arena-main .cba-case-art {
  position: relative;
  width: clamp(32px, 2.8vw, 46px);
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  opacity: 0.64;
  filter: saturate(0.8);
  transition: opacity 0.15s ease, filter 0.15s ease, transform 0.15s ease;
}

.battle-arena-main .cba-case-art::after {
  content: '';
  position: absolute;
  inset: 18% 3% 10%;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--case-accent) 24%, transparent), transparent 72%);
  filter: blur(7px);
}

.battle-arena-main .cba-case-art.active,
.battle-arena-main .cba-case-art.done {
  opacity: 1;
  filter: none;
}

.battle-arena-main .cba-case-art.active {
  transform: translateY(2px) scale(1.04);
}

.battle-arena-main .cba-case-art-fallback,
.battle-arena-main .cba-case-art img {
  position: absolute;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.battle-arena-main .cba-case-art-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--case-accent);
}

.battle-arena-main .cba-case-art-fallback svg {
  width: 34px;
  height: 34px;
}

.battle-arena-main .cba-room-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  padding-top: 51px;
}

.battle-arena-main .cba-header-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 29px;
  margin: 0;
  padding: 5px 9px;
  border: 0;
  border-radius: 7px;
  background: rgba(48, 48, 92, 0.58);
  color: #8795c8;
  font-size: 0.78rem;
  font-weight: 500;
  box-shadow: none;
}

.battle-arena-main .cba-header-action:hover,
.battle-arena-main .cba-header-action:focus-visible {
  border: 0;
  outline: 0;
  background: rgba(54, 66, 126, 0.76);
  color: #cbd3f7;
  box-shadow: none;
  transform: none;
}

.battle-arena-main .cba-header-action svg {
  width: 13px;
  height: 13px;
}

.battle-arena-main .cba-spin-board {
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(29, 29, 66, 0.74), rgba(22, 22, 54, 0.54));
  box-shadow: 0 16px 44px rgba(7, 9, 31, 0.14), inset 0 1px 0 rgba(111, 129, 210, 0.05);
}

.battle-arena-main .cba-arena {
  display: grid;
  position: relative;
}

.battle-arena-main .cba-col {
  min-width: 0;
  min-height: 522px;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(30, 30, 68, 0.78), rgba(24, 24, 58, 0.62));
  border-left: 2px solid transparent;
  border-image: linear-gradient(to bottom, transparent 0%, rgba(104, 123, 230, 0.28) 8%, rgba(91, 108, 205, 0.76) 26%, rgba(67, 82, 163, 0.64) 58%, rgba(52, 64, 126, 0.3) 88%, transparent 100%) 1;
}

.battle-arena-main .cba-arena > .cba-col:first-child {
  border-left: 0;
}

.battle-arena-main .cba-arena > .cba-team-divider + .cba-col {
  border-left: 0;
}

.battle-arena-main .cba-arena > .cba-col + .cba-col::before {
  content: '';
  position: absolute;
  z-index: 4;
  left: -5px;
  top: 302px;
  width: 10px;
  height: 10px;
  border: 1px solid rgba(103, 121, 218, 0.76);
  background: linear-gradient(135deg, #34427f, #27315f);
  box-shadow: 0 0 12px rgba(75, 94, 196, 0.22);
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
}

.battle-arena-main .cba-arena > .cba-col + .cba-col::after {
  content: '';
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent 0%, rgba(104, 123, 230, 0.28) 7%, rgba(91, 108, 205, 0.82) 24%, rgba(72, 88, 178, 0.72) 54%, rgba(52, 64, 126, 0.34) 90%, transparent 100%);
  box-shadow: 0 0 8px rgba(73, 91, 189, 0.13);
}

.battle-arena-main .cba-lane-head {
  min-height: 82px;
  height: 82px;
  padding: 0 17px;
  gap: 10px;
  background: linear-gradient(180deg, rgba(38, 38, 74, 0.94), rgba(35, 35, 68, 0.86));
  border: 0;
  border-bottom: 1px solid rgba(65, 76, 132, 0.2);
  color: #f3f5ff;
  font-size: 0.88rem;
}

.battle-arena-main .cba-host-col {
  border-top: 2px solid #8a3fb2;
}

.battle-arena-main .cba-host-col .cba-lane-head {
  height: 80px;
  min-height: 80px;
  border-bottom-color: rgba(138, 63, 178, 0.65);
}

.battle-arena-main .cba-lane-avatar {
  position: relative;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(124, 137, 190, 0.4);
  background: linear-gradient(145deg, #737eaa, #27274D 62%);
  color: #fff;
  font-size: 0.72rem;
  box-shadow: none;
  overflow: hidden;
}

.battle-arena-main .cba-lane-avatar > span {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
}

.battle-arena-main .cba-lane-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.battle-arena-main .cba-lane-name {
  color: #f5f6ff;
  font-size: 0.9rem;
  font-weight: 500;
}

.battle-arena-main .cba-many-lanes .cba-lane-head {
  gap: 6px;
  padding-inline: 9px;
}

.battle-arena-main .cba-many-lanes .cba-lane-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
}

.battle-arena-main .cba-many-lanes .cba-lane-name {
  min-width: 0;
  max-width: 62px;
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-arena-main .cba-many-lanes .cba-lane-score {
  min-width: 54px;
  min-height: 38px;
  padding-inline: 7px;
  font-size: 0.77rem;
}

.battle-arena-main .cba-lane-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 74px;
  min-height: 44px;
  justify-content: center;
  margin-left: auto;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(46, 46, 90, 0.7);
  color: #e2e6fa;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: none;
}

.battle-arena-main .cba-lane-open {
  justify-content: flex-start;
  gap: 12px;
  color: #fff;
}

.battle-arena-main .cba-wait-label {
  max-width: none;
  color: #f4f6ff;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.15;
  white-space: nowrap;
}

.battle-arena-main .cba-many-lanes .cba-wait-spinner {
  width: 23px;
  height: 23px;
  flex-basis: 23px;
}

.battle-arena-main .cba-many-lanes .cba-wait-label {
  min-width: 0;
  max-width: 72px;
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
}

.battle-arena-main .cba-wait-spinner {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 2px solid transparent;
  border-top-color: #4262ff;
  border-right-color: #4262ff;
  border-radius: 50%;
  opacity: 0.9;
  animation: cba-wait-spin 1.05s linear infinite;
}

@keyframes cba-wait-spin {
  to { transform: rotate(360deg); }
}

.battle-arena-main .cba-lane-join,
.battle-arena-main .cba-lane-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 96px;
  min-height: 46px;
  margin: 0 0 0 auto;
  padding: 0 13px;
  border: 0;
  border-radius: 6px;
  background: #3f60ff;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: none;
}

.battle-arena-main .cba-lane-call {
  min-width: 96px;
  background: #3f60ff;
  color: #fff;
}

.battle-arena-main .cba-many-lanes .cba-lane-join,
.battle-arena-main .cba-many-lanes .cba-lane-call {
  min-width: 64px;
  min-height: 40px;
  padding-inline: 8px;
  font-size: 0.74rem;
}

.battle-arena-main .cba-many-lanes .cba-lane-join {
  min-width: 80px;
}

.battle-arena-main .cba-lane-open:not(.cba-first-open) .cba-lane-call {
  opacity: 1;
}

.battle-arena-main .cba-lane-join:hover,
.battle-arena-main .cba-lane-call:hover {
  border: 0;
  background: #536fff;
  color: #fff;
  box-shadow: none;
  transform: none;
}

.battle-arena-main .cba-stage-wrap,
.battle-arena-main .cba-mini-reel-mask {
  height: 440px;
  background: transparent;
}

.battle-arena-main .cba-mini-reel-mask {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 11%, #000 89%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 11%, #000 89%, transparent 100%);
}

.battle-arena-main .cba-mini-reel-item {
  height: 146.6667px;
  background: transparent;
  transform: scale(1);
  transform-origin: center;
  transition: filter 160ms ease, opacity 160ms ease, transform 320ms cubic-bezier(.2, .72, .28, 1);
}

.battle-arena-main .cba-mini-reel-glow {
  inset: 50% auto auto 50%;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--rarity, transparent) 24%, transparent);
  filter: blur(24px);
  opacity: .58;
  transform: translate(-50%, -50%);
  transition: width 180ms ease, height 180ms ease, filter 180ms ease, opacity 160ms ease;
}

.battle-arena-main .cba-mini-reel-icon {
  opacity: .78;
  filter:
    drop-shadow(0 8px 13px rgba(3, 6, 24, .34))
    drop-shadow(0 0 9px color-mix(in srgb, var(--rarity, transparent) 34%, transparent));
  transition: filter 180ms ease, opacity 160ms ease, transform 320ms cubic-bezier(.2, .72, .28, 1);
}

.battle-arena-main .cba-mini-reel-mask.cba-reel-settled .cba-mini-reel-item:not(.cba-reel-selected) {
  z-index: 0;
  opacity: .3;
  filter: blur(3px) saturate(.7);
  transform: scale(.9);
}

.battle-arena-main .cba-mini-reel-mask.cba-reel-settled .cba-mini-reel-item.cba-reel-selected {
  z-index: 3;
  opacity: 1;
  filter: none;
  transform: scale(1.12);
}

.battle-arena-main .cba-mini-reel-item.cba-reel-selected .cba-mini-reel-glow {
  width: 92px;
  height: 92px;
  filter: blur(21px);
  opacity: .86;
}

.battle-arena-main .cba-mini-reel-item.cba-reel-selected .cba-mini-reel-icon {
  opacity: 1;
  filter:
    drop-shadow(0 11px 16px rgba(3, 6, 24, .4))
    drop-shadow(0 0 13px color-mix(in srgb, var(--rarity, transparent) 52%, transparent));
}

.battle-arena-main .cba-mini-reel-item-gold .cba-mini-reel-icon {
  opacity: 1;
}

.battle-arena-main .cba-mini-reel-item-gold .cba-mini-reel-glow {
  inset: 50% auto auto 50%;
  width: 88px;
  height: 88px;
  background: rgba(255, 195, 40, .38);
  filter: blur(22px);
  opacity: .86;
  transform: translate(-50%, -50%);
}

.battle-arena-main .cba-mini-reel-icon svg {
  width: 88px;
  height: 88px;
}

.battle-arena-main .cba-mini-reel-icon .minecraft-item-texture {
  width: 88px;
  height: 88px;
}

.battle-arena-main .cba-mini-reel-icon .gold-spin-symbol-image {
  width: 96px;
  height: 96px;
  opacity: 1;
  filter: drop-shadow(0 0 24px rgba(255, 195, 40, 0.68));
}

.battle-arena-main .cba-mini-reel-item-gold.cba-reel-selected .cba-mini-reel-glow {
  width: 104px;
  height: 104px;
  opacity: 1;
}

.battle-arena-main .cba-col.cba-gold-spin-lane {
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 195, 40, 0.18), transparent 48%),
    linear-gradient(180deg, rgba(70, 52, 20, 0.2), rgba(27, 35, 75, 0.12) 24%, rgba(63, 45, 11, 0.13));
  box-shadow: inset 0 0 48px rgba(255, 195, 40, 0.09);
  transition: background 260ms ease, box-shadow 260ms ease;
}

.battle-arena-main .cba-col.cba-gold-spin-lane .cba-lane-head {
  border-bottom-color: rgba(255, 195, 40, 0.5);
  background: linear-gradient(180deg, rgba(76, 58, 24, 0.72), rgba(39, 39, 70, 0.84));
}

.battle-arena-main .cba-col.cba-gold-spin-lane .cba-stage-wrap::before,
.battle-arena-main .cba-col.cba-gold-spin-lane .cba-stage-wrap::after {
  content: '';
  position: absolute;
  z-index: 8;
  top: 0;
  bottom: 0;
  width: 3px;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent 0%, rgba(255, 195, 40, 0.18) 7%, #ffc328 26%, #ffe27a 50%, #ffc328 74%, rgba(255, 195, 40, 0.18) 93%, transparent 100%);
  box-shadow: 0 0 7px #ffc328, 0 0 18px rgba(255, 174, 0, 0.52), 0 0 34px rgba(255, 174, 0, 0.22);
  animation: cba-gold-rail-pulse 900ms ease-in-out infinite alternate;
}

.battle-arena-main .cba-col.cba-gold-spin-lane .cba-stage-wrap::before {
  left: 0;
}

.battle-arena-main .cba-col.cba-gold-spin-lane .cba-stage-wrap::after {
  right: 0;
}

.battle-arena-main .cba-col.cba-gold-spin-lane .cba-mini-reel-mask::before,
.battle-arena-main .cba-col.cba-gold-spin-lane .cba-mini-reel-mask::after {
  content: '';
  position: absolute;
  z-index: 9;
  display: block;
  top: 50%;
  width: 11px;
  height: 11px;
  border: 1px solid #fff1a1;
  background: linear-gradient(135deg, #fff1a1, #ffc328 48%, #dc8200);
  box-shadow: 0 0 8px #ffc328, 0 0 20px rgba(255, 174, 0, 0.72);
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
}

.battle-arena-main .cba-col.cba-gold-spin-lane .cba-mini-reel-mask::before {
  left: -4px;
}

.battle-arena-main .cba-col.cba-gold-spin-lane .cba-mini-reel-mask::after {
  right: -4px;
}

@keyframes cba-gold-rail-pulse {
  from { opacity: 0.72; filter: brightness(0.92); }
  to { opacity: 1; filter: brightness(1.18); }
}

.battle-arena-main .cba-team-divider {
  width: 2px;
  min-width: 2px;
  height: 100%;
  z-index: 3;
  overflow: visible;
}

.battle-arena-main .cba-divider-line {
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, transparent 0%, rgba(104, 123, 230, 0.34) 8%, rgba(91, 108, 205, 0.88) 26%, rgba(67, 82, 163, 0.78) 58%, rgba(52, 64, 126, 0.36) 88%, transparent 100%);
  box-shadow: 0 0 9px rgba(73, 91, 189, 0.1);
}

.battle-arena-main .cba-divider-text {
  position: absolute;
  top: 302px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(74, 88, 151, 0.48);
  border-radius: 10px;
  background: #2C2C55;
  color: #8d9ac7;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: none;
  box-shadow: none;
}

.battle-arena-main .cba-reel-indicator,
.battle-arena-main .cba-hex {
  display: none;
}

.battle-arena-main .cba-results-items {
  display: grid;
  gap: 0;
  margin: 10px 0 0;
  padding: 7px 4px 3px;
  overflow: visible;
  border: 1px solid rgba(74, 90, 164, 0.1);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(29, 29, 66, 0.3), rgba(23, 23, 54, 0.18));
  box-shadow: 0 18px 38px rgba(7, 9, 31, 0.1);
}

.battle-arena-main .cba-history-column {
  position: relative;
  min-width: 0;
  margin: 5px 4px 9px;
  padding: 8px 8px 14px;
  overflow: visible;
  border: 1px solid rgba(83, 100, 179, 0.12);
  border-radius: 13px;
  border-image: none;
  background: linear-gradient(180deg, rgba(38, 38, 78, 0.4), rgba(30, 30, 66, 0.22));
}

.battle-arena-main .cba-results-items > .cba-history-column:not(:first-child)::before {
  content: '';
  position: absolute;
  z-index: 3;
  top: -6px;
  bottom: -10px;
  left: -5px;
  width: 2px;
  background: linear-gradient(to bottom, transparent, rgba(91, 108, 205, 0.66) 22%, rgba(67, 82, 163, 0.5) 74%, transparent);
  box-shadow: 0 0 8px rgba(73, 91, 189, 0.08);
  pointer-events: none;
}

.battle-arena-main .cba-results-items > .cba-team-divider + .cba-history-column::before {
  display: none;
}

.battle-arena-main .cba-results-items > .cba-history-column:first-child {
  border-left: 1px solid rgba(83, 100, 179, 0.12);
}

.battle-arena-main .cba-results-items > .cba-team-divider + .cba-history-column {
  border-left: 1px solid rgba(83, 100, 179, 0.12);
}

.battle-arena-main .cba-history-head {
  display: none;
}

.battle-arena-main .cba-history-pulls {
  display: grid;
  grid-template-columns: repeat(var(--cba-history-cols, 2), minmax(0, 1fr));
  gap: 10px;
  padding: 0;
}

.battle-arena-main .cba-history-pull {
  position: relative;
  min-width: 0;
  min-height: 176px;
  padding: 14px 8px;
  border: 1px solid rgba(91, 108, 190, 0.09);
  border-radius: 13px;
  border-bottom: 2px solid var(--pull-color, #5869bd);
  background:
    radial-gradient(circle at 50% 24%, color-mix(in srgb, var(--pull-color, #5869bd) 12%, transparent), transparent 48%),
    rgba(38, 38, 74, 0.42);
}

.battle-arena-main .cba-history-chance {
  position: absolute;
  top: 11px;
  right: 11px;
  color: var(--pull-color, #8fa0e4);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.battle-arena-main .cba-history-pull-pending {
  opacity: 0.78;
  border-color: rgba(91, 108, 190, 0.07);
  background: rgba(31, 39, 80, 0.24);
}

.battle-arena-main .cba-history-icon {
  width: 54px;
  height: 54px;
  margin-bottom: 9px;
  border: 0;
  background: transparent;
}

.battle-arena-main .cba-history-icon svg,
.battle-arena-main .cba-history-icon .minecraft-item-texture,
.battle-arena-main .cba-history-icon .gold-spin-symbol-image {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.battle-arena-main .cba-history-pull-gold {
  border-color: rgba(255, 195, 40, 0.2);
  border-bottom-color: #ffc328;
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 195, 40, 0.14), transparent 50%),
    rgba(38, 38, 74, 0.42);
}

.battle-arena-main .cba-history-gold-spin {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 3px 7px 3px 4px;
  border: 1px solid rgba(255, 211, 87, 0.28);
  border-radius: 999px;
  background: rgba(116, 69, 4, 0.28);
  color: #ffd75b;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.battle-arena-main .cba-history-gold-spin .gold-spin-symbol-image {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.battle-arena-main .cba-history-round {
  color: #6174bf;
  font-size: 0.82rem;
  font-weight: 400;
  text-transform: none;
}

.battle-arena-main .cba-history-name {
  max-width: 100%;
  overflow: hidden;
  color: #bec6e8;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-arena-main .cba-history-value {
  color: #dbe0f7;
}

.battle-arena-main .cba-results-items > .cba-team-divider {
  min-height: 100%;
}

.battle-arena-main .cba-feed,
.battle-arena-main .cba-jackpot {
  display: none !important;
}

.battle-arena-main .cba-results-stage {
  position: relative;
  border: 0;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  background: #22224A;
  box-shadow: none;
}

.battle-arena-main .cba-results-lanes {
  min-height: 500px;
  padding: 0;
  align-items: stretch;
}

.battle-arena-main .cba-results-lanes .cba-rlane {
  position: relative;
  min-width: 0;
  min-height: 500px;
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  background: #22224A;
}

.battle-arena-main .cba-results-lanes .cba-divider-text {
  display: none;
}

.battle-arena-main .cba-results-lanes > .cba-rlane + .cba-rlane {
  border-left: 2px solid transparent;
  border-image: linear-gradient(to bottom, rgba(89, 105, 202, 0.18), rgba(82, 98, 190, 0.82) 22%, rgba(57, 70, 139, 0.5) 82%, transparent) 1;
}

.battle-arena-main .cba-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 88px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(63, 76, 143, 0.34);
  background: #27274D;
}

.battle-arena-main .cba-result-head-user {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.battle-arena-main .cba-result-head-avatar {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(119, 134, 195, 0.42);
  border-radius: 50%;
  background: #30305A;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.battle-arena-main .cba-result-head-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.battle-arena-main .cba-result-head-name {
  min-width: 0;
  overflow: hidden;
  color: #f5f6ff;
  font-size: 0.92rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-arena-main .cba-result-head-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  min-height: 48px;
  margin-left: 12px;
  padding: 0 12px;
  gap: 7px;
  border-radius: 9px;
  background: rgba(46, 46, 90, 0.78);
  color: #edf0ff;
  font-family: var(--font-mono);
}

.battle-arena-main .cba-results-lanes.cba-many-lanes .cba-result-head {
  min-height: 74px;
  padding-inline: 7px;
}

.battle-arena-main .cba-results-lanes.cba-many-lanes .cba-result-head-user {
  gap: 6px;
}

.battle-arena-main .cba-results-lanes.cba-many-lanes .cba-result-head-avatar {
  width: 27px;
  height: 27px;
  flex-basis: 27px;
}

.battle-arena-main .cba-results-lanes.cba-many-lanes .cba-result-head-name {
  max-width: 48px;
  font-size: 0.7rem;
}

.battle-arena-main .cba-results-lanes.cba-many-lanes .cba-result-head-score {
  min-width: 47px;
  min-height: 36px;
  margin-left: 5px;
  padding-inline: 5px;
  gap: 3px;
  font-size: 0.7rem;
}

.battle-arena-main .cba-results-lanes.cba-many-lanes .cba-result-head-score .gold-token-icon {
  width: 14px;
  height: 14px;
}

.battle-arena-main .cba-result-body {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 412px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 38px 18px 28px;
  color: #fff;
}

.battle-arena-main .cba-result-rays {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 230px;
  height: 230px;
  background: repeating-conic-gradient(from -4deg, rgba(96, 112, 190, 0.1) 0 7deg, transparent 7deg 15deg);
  border-radius: 50%;
  mask-image: radial-gradient(circle, #000 0 24%, rgba(0, 0, 0, 0.78) 25%, transparent 70%);
  transform: translate(-50%, -52%);
  pointer-events: none;
}

.battle-arena-main .cba-rlane-winner .cba-result-rays {
  background: repeating-conic-gradient(from -4deg, rgba(255, 185, 28, 0.13) 0 7deg, transparent 7deg 15deg);
}

.battle-arena-main .cba-result-crown {
  position: relative;
  z-index: 2;
  width: 34px;
  height: 31px;
  margin-bottom: -2px;
  color: #ffbd22;
}

.battle-arena-main .cba-result-crown svg {
  width: 100%;
  height: 100%;
}

.battle-arena-main .cba-results-lanes .cba-rlane-avatar {
  position: relative;
  z-index: 2;
  width: 82px;
  height: 82px;
  flex: 0 0 82px;
  border: 2px solid #a9b8e5;
  background: #2F2F58;
  box-shadow: 0 0 0 1px rgba(92, 109, 180, 0.3);
}

.battle-arena-main .cba-results-lanes .cba-rlane-winner .cba-rlane-avatar {
  border-color: #ffbd22;
  box-shadow: 0 0 0 1px rgba(255, 189, 34, 0.35), 0 0 28px rgba(255, 177, 24, 0.14);
}

.battle-arena-main .cba-results-lanes.cba-many-lanes .cba-rlane-avatar {
  width: 64px;
  height: 64px;
  flex-basis: 64px;
}

.battle-arena-main .cba-results-lanes.cba-many-lanes .cba-rlane-name {
  max-width: 112px;
  font-size: 0.76rem;
}

.battle-arena-main .cba-results-lanes.cba-many-lanes .cba-rlane-winner .cba-rlane-name {
  min-width: 74px;
  padding: 6px 8px;
}

.battle-arena-main .cba-results-lanes .cba-rlane-name {
  position: relative;
  z-index: 3;
  max-width: 180px;
  margin-top: -2px;
  overflow: hidden;
  color: #f5f6ff;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-arena-main .cba-results-lanes .cba-rlane-winner .cba-rlane-name {
  min-width: 96px;
  margin-top: -8px;
  padding: 7px 13px;
  border-radius: 9px;
  background: linear-gradient(180deg, #ffc332, #ffad17);
  color: #191d36;
}

.battle-arena-main .cba-result-total-label {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  color: #7785b6;
  font-size: 0.88rem;
}

.battle-arena-main .cba-result-total {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: #eef1ff;
  font-family: var(--font-mono);
  font-size: 0.92rem;
}

.battle-arena-main .cba-result-actions {
  position: absolute;
  z-index: 8;
  top: 52%;
  left: 50%;
  padding: 0;
  background: transparent;
  transform: translate(-50%, -50%);
}

.battle-arena-main .cba-result-actions .btn-login,
.battle-arena-main .cba-result-actions .cba-btn-ghost {
  border-color: transparent;
  box-shadow: none;
}

.battle-arena-main .cba-result-actions .btn-login {
  min-width: 108px;
  min-height: 50px;
  margin: 0;
  border-radius: 7px;
  background: #3f60ff;
  color: #fff;
}

.battle-arena-main .cba-result-actions .btn-login:hover,
.battle-arena-main .cba-result-actions .btn-login:focus-visible {
  background: #536fff;
  color: #fff;
  box-shadow: none;
  transform: none;
}

/* Discord profile pictures replace the old single-letter avatar placeholders. */
.activity-avatar,
.cbl-avatar,
.chat-msg-avatar-img,
.crash-player-avatar,
.feed-avatar,
.cba-rlane-avatar {
  position: relative;
  overflow: hidden;
}

.activity-avatar img,
.cbl-avatar img,
.chat-msg-avatar-img img,
.crash-player-avatar img,
.feed-avatar img,
.cba-rlane-avatar img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 1500px) {
  .app-shell:has(.battle-arena-main) {
    grid-template-columns: 138px minmax(0, 1fr);
    grid-template-areas:
      "topbar topbar"
      "sidebar main";
  }

  .app-shell:has(.battle-arena-main) > .chat-panel {
    display: none;
  }

  .battle-arena-main .cba-wait-label {
    display: none;
  }
}

@media (max-width: 1240px) {
  .battle-arena-main .cba-room-header {
    grid-template-columns: minmax(180px, 0.9fr) minmax(300px, 1.4fr) minmax(180px, 0.9fr);
  }

  .battle-arena-main .cba-lane-head {
    padding-inline: 14px;
  }

  .battle-arena-main .cba-lane-join,
  .battle-arena-main .cba-lane-call {
    min-width: 96px;
    padding-inline: 11px;
  }
}

@media (max-width: 1100px) {
  .battle-arena-main .cba-wait-label {
    display: none;
  }

  .battle-arena-main .cba-lane-open {
    justify-content: center;
  }
}

/* ============ Blackjack ============ */
.blackjack-main {
  width: min(100%, 1360px);
  margin: 0 auto;
  padding: 20px 28px 42px;
}

.bj-page {
  display: grid;
  grid-template-columns: minmax(280px, 0.64fr) minmax(560px, 1.36fr);
  gap: 16px;
  align-items: stretch;
}

.bj-controls-panel,
.bj-table-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(120, 139, 224, 0.05);
  border-radius: 15px;
  background: rgba(33, 33, 72, 0.76);
}

.bj-controls-panel {
  min-height: 590px;
  padding: 30px;
}

.bj-mode-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 31px;
}

.bj-mode-tab {
  min-width: 96px;
  height: 50px;
  margin: 0;
  padding: 0 20px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #8492c8;
  box-shadow: none;
  font: 500 0.95rem var(--font-display);
}

.bj-mode-tab.active,
.bj-mode-tab:hover {
  background: rgba(65, 65, 125, 0.5);
  color: #fff;
  transform: none;
  box-shadow: none;
}

.bj-bet-label {
  display: block;
  margin: 0 0 11px;
  color: #7181bc;
  font: 500 0.8rem var(--font-display);
}

.bj-bet-field {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 54px;
  padding: 0 17px;
  border-radius: 9px;
  background: rgba(50, 50, 100, 0.62);
}

.bj-bet-field .gold-token-icon {
  width: 21px;
  height: 21px;
  color: #8091ca;
}

.bj-bet-field input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: 600 1rem var(--font-display);
}

.bj-bet-field input::-webkit-inner-spin-button,
.bj-bet-field input::-webkit-outer-spin-button { opacity: .45; }

.bj-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin-top: 29px;
}

.bj-action-grid button {
  height: 50px;
  margin: 0;
  border: 0;
  border-radius: 6px;
  background: rgba(50, 50, 100, 0.7);
  color: #fff;
  box-shadow: none;
  font: 600 0.95rem var(--font-display);
}

.bj-action-grid button span {
  margin-left: 7px;
  color: #8b9bcf;
  font-size: 1rem;
}

.bj-action-grid button:not(:disabled):hover {
  background: rgba(68, 68, 135, 0.88);
  transform: none;
  box-shadow: none;
}

.bj-action-grid button:disabled {
  cursor: not-allowed;
  color: #6c79ad;
  background: rgba(48, 48, 95, 0.55);
  opacity: 1;
}

.bj-instant-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 31px;
  color: #97a5d0;
  cursor: pointer;
  font: 500 0.88rem var(--font-display);
}

.bj-instant-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.bj-instant-toggle > span {
  position: relative;
  width: 42px;
  height: 23px;
  border-radius: 99px;
  background: #41417E;
  transition: background 160ms ease;
}
.bj-instant-toggle > span::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  transition: transform 160ms ease;
}
.bj-instant-toggle input:checked + span { background: #3d5dff; }
.bj-instant-toggle input:checked + span::after { transform: translateX(19px); }
.bj-instant-toggle b { font-weight: 500; }
.bj-instant-toggle i {
  display: grid;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  place-items: center;
  background: #555582;
  color: #18204a;
  font: 700 0.72rem Inter, sans-serif;
  font-style: normal;
}

.bj-deal-button {
  position: absolute;
  right: 30px;
  bottom: 54px;
  left: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 52px;
  margin: 0;
  border: 0;
  border-radius: 7px;
  background: #3d5dff;
  color: #fff;
  box-shadow: none;
  font: 700 0.92rem var(--font-display);
}

.bj-deal-button span {
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.82rem;
}

.bj-deal-button:hover:not(:disabled) { background: #4c6bff; transform: none; box-shadow: none; }
.bj-deal-button:disabled { opacity: .55; cursor: not-allowed; }

.bj-control-message {
  position: absolute;
  right: 30px;
  bottom: 21px;
  left: 30px;
  margin: 0;
  color: #7181bc;
  text-align: center;
  font: 500 0.74rem var(--font-display);
}

.bj-table-panel {
  min-height: 590px;
  isolation: isolate;
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  padding: 24px 34px 32px;
  background:
    radial-gradient(ellipse 71% 78% at 50% 2%, rgba(62, 62, 145, 0.38) 0 44%, transparent 44.2%),
    radial-gradient(ellipse 74% 70% at 50% 42%, rgba(55, 55, 125, 0.35) 0 47%, transparent 47.2%),
    rgba(35, 35, 78, 0.86);
}

.bj-table-panel::before,
.bj-table-panel::after {
  content: '';
  position: absolute;
  z-index: -1;
  width: 108px;
  height: 108px;
  border: 1px solid rgba(126, 144, 220, .16);
  border-radius: 16px;
  transform: rotate(35deg);
}
.bj-table-panel::before { top: 210px; left: 8%; }
.bj-table-panel::after { right: 8%; bottom: 145px; }

.bj-table-tools {
  position: absolute;
  top: 15px;
  right: 17px;
  display: flex;
  gap: 8px;
}

.bj-table-tools button {
  height: 30px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: rgba(46, 58, 111, .75);
  color: #8e9ac7;
  box-shadow: none;
  font: 500 0.78rem var(--font-display);
}
.bj-table-tools button:first-child,
.bj-table-tools button:nth-child(2) { width: 36px; padding: 0; }
.bj-table-tools button:hover { color: #fff; background: rgba(64, 79, 146, .9); transform: none; box-shadow: none; }

.bj-dealer-area,
.bj-player-area {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 175px;
}

.bj-hand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 132px;
}

.bj-hand .bj-card + .bj-card { margin-left: -28px; }

.bj-card {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: flex-start;
  width: 74px;
  height: 112px;
  padding: 12px 13px;
  border-radius: 7px;
  background: #f8f8fb;
  color: #17171c;
  box-shadow: 0 10px 18px rgba(5, 10, 33, .28);
  animation: bj-deal-in 320ms ease both;
  animation-delay: calc(var(--deal-index, 0) * 70ms);
  font-family: Georgia, serif;
}

.bj-card strong { font-size: 1.55rem; line-height: 1; }
.bj-card span { margin-top: 5px; font-size: 1.55rem; line-height: 1; }
.bj-card.is-red { color: #f0442a; }
.bj-card-back {
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255,255,255,.62);
  background: linear-gradient(145deg, #6d22c8, #e73889 68%, #ffbf43);
  color: #ffd95c;
  font-family: var(--font-display);
}
.bj-card-back::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 4px;
}
.bj-card-back span { position: relative; margin: 0; font-size: 2rem; font-weight: 800; }
.bj-card-preview { opacity: .82; }

.bj-total-chip {
  position: absolute;
  right: calc(50% - 106px);
  top: 50%;
  min-width: 38px;
  padding: 4px 8px;
  border-radius: 5px;
  background: #555582;
  color: #fff;
  text-align: center;
  transform: translateY(-50%);
  font: 700 .78rem var(--font-display);
}

.bj-rules {
  display: grid;
  gap: 19px;
  padding: 11px 0;
  color: #95a4d6;
  text-align: center;
  font: 600 0.82rem var(--font-display);
}

.bj-table-result {
  position: absolute;
  right: 50%;
  bottom: 27px;
  min-height: 22px;
  color: #aab7e5;
  transform: translateX(50%);
  white-space: nowrap;
  font: 600 .84rem var(--font-display);
}
.bj-table-result.win { color: #35dfbd; }
.bj-table-result.lose { color: #ff7080; }
.bj-table-result.push { color: #c5d0f4; }

.bj-page.is-instant .bj-card { animation-duration: 1ms; animation-delay: 0ms; }

@keyframes bj-deal-in {
  from { opacity: 0; transform: translateY(-12px) rotate(-2deg); }
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

@media (max-width: 1160px) {
  .bj-page { grid-template-columns: 300px minmax(0, 1fr); }
  .bj-controls-panel { padding: 24px; }
  .bj-deal-button, .bj-control-message { right: 24px; left: 24px; }
}

@media (max-width: 1500px) {
  .app-shell:has(.blackjack-main) {
    grid-template-columns: 138px minmax(0, 1fr);
    grid-template-areas:
      "topbar topbar"
      "sidebar main";
  }

  .app-shell:has(.blackjack-main) > .chat-panel {
    display: none;
  }
}

@media (max-width: 860px) {
  .bj-page { grid-template-columns: 1fr; }
  .bj-controls-panel { min-height: 445px; }
  .bj-table-panel { min-height: 540px; }
}

@media (max-width: 590px) {
  .blackjack-main { padding: 14px 12px 36px; }
  .bj-controls-panel { padding: 18px; }
  .bj-table-panel { padding-inline: 14px; }
  .bj-deal-button, .bj-control-message { right: 18px; left: 18px; }
  .bj-mode-tab { min-width: 0; flex: 1; }
  .bj-card { width: 62px; height: 96px; padding: 10px; }
  .bj-card strong, .bj-card span { font-size: 1.26rem; }
  .bj-table-tools button:nth-last-child(-n + 2) { padding-inline: 8px; }
}

/* ============ Dice ============ */
.dice-main {
  width: min(100%, 1360px);
  margin: 0 auto;
  padding: 20px 28px 42px;
}

.dice-page {
  display: grid;
  grid-template-columns: minmax(280px, .64fr) minmax(560px, 1.36fr);
  gap: 16px;
  align-items: start;
}

.dice-controls-panel,
.dice-board {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(120, 139, 224, .05);
  border-radius: 15px;
  background: rgba(29, 38, 82, .76);
}

.dice-controls-panel {
  min-height: 450px;
  padding: 30px;
}

.dice-mode-label {
  display: inline-flex;
  align-items: center;
  height: 50px;
  padding: 0 20px;
  margin-bottom: 30px;
  border-radius: 7px;
  background: rgba(59, 76, 139, .5);
  color: #fff;
  font: 600 .95rem var(--font-display);
}

.dice-field-label {
  display: block;
  margin: 0 0 11px;
  color: #7181bc;
  font: 500 .8rem var(--font-display);
}
.dice-field-label span { color: #7181bc; }
.dice-profit-label { margin-top: 27px; }

.dice-bet-field {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 54px;
  padding: 0 17px;
  border-radius: 9px;
  background: rgba(45, 57, 112, .62);
}

.dice-bet-field .gold-token-icon {
  width: 21px;
  height: 21px;
  color: #8091ca;
}

.dice-bet-field input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: 600 1rem var(--font-display);
}

.dice-bet-field input[readonly] { color: #c3cbed; }
.dice-bet-field input::-webkit-inner-spin-button,
.dice-bet-field input::-webkit-outer-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}
.dice-bet-field input[type="number"] { -moz-appearance: textfield; }

.dice-bet-quick-actions { display: flex; gap: 9px; }
.dice-bet-quick-actions button {
  height: 33px;
  min-width: 48px;
  margin: 0;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: #4A4A84;
  color: #94a3d0;
  box-shadow: none;
  font: 500 .78rem var(--font-display);
}
.dice-bet-quick-actions button:hover { background: #555590; color: #fff; transform: none; box-shadow: none; }

.dice-place-bet {
  position: absolute;
  right: 30px;
  bottom: 30px;
  left: 30px;
  height: 52px;
  margin: 0;
  border: 0;
  border-radius: 7px;
  background: #3d5dff;
  color: #fff;
  box-shadow: none;
  font: 700 .92rem var(--font-display);
}
.dice-place-bet:hover:not(:disabled) { background: #4c6bff; transform: none; box-shadow: none; }
.dice-place-bet:disabled { cursor: not-allowed; opacity: .55; }

.dice-result-message {
  position: absolute;
  right: 30px;
  bottom: 8px;
  left: 30px;
  min-height: 16px;
  margin: 0;
  color: #8090c4;
  text-align: center;
  font: 500 .72rem var(--font-display);
}

.dice-board {
  min-height: 410px;
  padding: 56px 34px 20px;
  background: linear-gradient(150deg, rgba(38, 49, 106, .84), rgba(27, 35, 78, .82));
}

.dice-board-tools {
  position: absolute;
  top: 16px;
  right: 17px;
  display: flex;
  gap: 8px;
}
.dice-board-tools button {
  height: 30px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: rgba(46, 58, 111, .75);
  color: #8e9ac7;
  box-shadow: none;
  font: 500 .78rem var(--font-display);
}
.dice-board-tools button:first-child,
.dice-board-tools button:nth-child(2) { width: 36px; padding: 0; }
.dice-board-tools button:hover { background: rgba(64, 79, 146, .9); color: #fff; transform: none; box-shadow: none; }

.dice-slider-wrap {
  padding: 84px clamp(34px, 5%, 52px) 0;
}
.dice-slider-stage {
  position: relative;
  --dice-result-position: 50%;
}
.dice-roll-marker {
  position: absolute;
  z-index: 3;
  bottom: calc(100% + 14px);
  left: var(--dice-result-position);
  display: grid;
  min-width: 62px;
  height: 38px;
  padding: 0 9px;
  place-items: center;
  box-sizing: border-box;
  transform: translate(-50%, 6px) scale(.84);
  pointer-events: none;
  border: 1px solid transparent;
  border-radius: 7px;
  opacity: 0;
  color: #fff;
  font: 800 .8rem/1 var(--font-display);
  letter-spacing: .01em;
  transition: opacity .16s ease, left .42s cubic-bezier(.2, .8, .2, 1), transform .2s ease;
}
.dice-roll-marker::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  width: 0;
  height: 0;
  border-right: 7px solid transparent;
  border-left: 7px solid transparent;
  border-top: 7px solid var(--dice-marker-color);
  transform: translateX(-50%);
}
.dice-roll-marker::after {
  content: '';
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  width: 2px;
  height: 9px;
  border-radius: 99px;
  background: var(--dice-marker-color);
  box-shadow: 0 0 8px var(--dice-marker-glow);
  transform: translateX(-50%);
}
.dice-roll-marker.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
.dice-roll-marker.win {
  --dice-marker-color: #ffb11c;
  --dice-marker-glow: rgba(255, 177, 28, .72);
  border-color: rgba(255, 225, 131, .55);
  background: linear-gradient(180deg, #ffc94b, #f5a313);
  box-shadow: 0 5px 15px rgba(8, 12, 42, .34), 0 0 18px rgba(255, 177, 28, .48);
}
.dice-roll-marker.lose {
  --dice-marker-color: #df3978;
  --dice-marker-glow: rgba(238, 61, 130, .62);
  border-color: rgba(255, 139, 186, .4);
  background: linear-gradient(180deg, #f15891, #d73573);
  box-shadow: 0 5px 15px rgba(8, 12, 42, .34), 0 0 16px rgba(238, 61, 130, .4);
}
.dice-range {
  display: block;
  width: 100%;
  height: 18px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  border-radius: 99px;
  background: linear-gradient(90deg, #e33b7e 0%, #ed3c82 var(--roll-position, 50%), #ffae17 var(--roll-position, 50%), #ff9f13 100%);
}
.dice-range::-webkit-slider-runnable-track { height: 18px; border-radius: 99px; background: transparent; }
.dice-range::-webkit-slider-thumb {
  width: 30px;
  height: 30px;
  margin-top: -6px;
  appearance: none;
  -webkit-appearance: none;
  border: 5px solid #fff;
  border-radius: 8px;
  background: #f8f9ff;
  box-shadow: 0 4px 10px rgba(7, 10, 36, .3);
}
.dice-range::-moz-range-track { height: 18px; border-radius: 99px; background: transparent; }
.dice-range::-moz-range-progress { height: 18px; border-radius: 99px; background: #e93b80; }
.dice-range::-moz-range-thumb { width: 20px; height: 20px; border: 5px solid #fff; border-radius: 8px; background: #f8f9ff; }

.dice-range-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
  padding: 0 2px;
  color: #fff;
  font: 600 .8rem var(--font-display);
}
.dice-range-labels span { position: relative; }
.dice-range-labels span::before {
  content: '';
  position: absolute;
  bottom: 23px;
  left: 50%;
  width: 2px;
  height: 17px;
  background: rgba(127, 143, 205, .38);
  transform: translateX(-50%);
}

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

.dice-metric-grid > label {
  color: #fff;
  font: 600 .78rem var(--font-display);
}

.dice-metric-input {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 59px;
  margin-top: 10px;
  padding: 0 16px;
  border-radius: 8px;
  background: #4A4A82;
}
.dice-metric-input input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font: 600 .9rem var(--font-display);
}
.dice-metric-input b { color: #90a0d0; font: 500 1.35rem/1 var(--font-display); }
.dice-metric-input input::-webkit-inner-spin-button,
.dice-metric-input input::-webkit-outer-spin-button { opacity: 0; }

.dice-roll-result {
  position: absolute;
  right: 50%;
  bottom: 18px;
  min-height: 18px;
  color: #97a5d5;
  transform: translateX(50%);
  white-space: nowrap;
  font: 600 .8rem var(--font-display);
}
.dice-roll-result.win { color: #2ae0ba; }
.dice-roll-result.lose { color: #ff7686; }
.dice-roll-result.rolling { color: #fff; animation: dice-rolling .55s linear infinite alternate; }

@keyframes dice-rolling { to { opacity: .36; transform: translateX(50%) translateY(3px); } }

@media (max-width: 1500px) {
  .app-shell:has(.dice-main) {
    grid-template-columns: 138px minmax(0, 1fr);
    grid-template-areas:
      "topbar topbar"
      "sidebar main";
  }
  .app-shell:has(.dice-main) > .chat-panel { display: none; }
}

@media (max-width: 1160px) {
  .dice-page { grid-template-columns: 300px minmax(0, 1fr); }
  .dice-controls-panel { padding: 24px; }
  .dice-place-bet, .dice-result-message { right: 24px; left: 24px; }
  .dice-bet-quick-actions { gap: 5px; }
  .dice-bet-quick-actions button { min-width: 42px; padding-inline: 7px; }
}

@media (max-width: 860px) {
  .dice-page { grid-template-columns: 1fr; }
  .dice-controls-panel { min-height: 440px; }
}

@media (max-width: 590px) {
  .dice-main { padding: 14px 12px 36px; }
  .dice-controls-panel { padding: 18px; }
  .dice-board { min-height: 420px; padding-inline: 14px; }
  .dice-place-bet, .dice-result-message { right: 18px; left: 18px; }
  .dice-bet-quick-actions button { min-width: 38px; padding-inline: 5px; }
  .dice-slider-wrap { padding-inline: 34px; }
  .dice-roll-marker { min-width: 56px; height: 34px; padding-inline: 7px; font-size: .72rem; }
  .dice-metric-grid { gap: 6px; }
  .dice-metric-input { padding-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .dice-roll-marker { transition: none; }
}

/* Plinko */
.plinko-page{display:grid;grid-template-columns:280px minmax(560px,1fr);gap:28px;max-width:1120px;margin:20px auto}.plinko-controls,.plinko-board{border-radius:16px;background:rgba(31,42,89,.9)}.plinko-controls{padding:30px;min-height:450px}.plinko-tabs{display:flex;gap:15px;margin-bottom:27px}.plinko-tabs button{height:50px;padding:0 20px;border:0;border-radius:6px;color:#8293c6;background:transparent;font:.9rem var(--font-display);box-shadow:none}.plinko-tabs .active{background:#33336E;color:#fff}.plinko-controls label{display:block;margin:17px 0 9px;color:#7285ba;font:.73rem var(--font-display)}#plinko-difficulty,.plinko-bet>div,.plinko-rows>div{display:flex;gap:9px}#plinko-difficulty button,.plinko-bet button,.plinko-rows button{height:34px;min-width:42px;border:0;border-radius:8px;color:#aebce4;background:#4A4A88;box-shadow:none}#plinko-difficulty .active,.plinko-rows .active{color:#fff;background:#3e5df7}.plinko-bet{display:flex;align-items:center;gap:10px;height:53px;padding:0 10px 0 14px;border-radius:9px;background:#33336A}.plinko-bet .gold-token-icon{width:20px;height:20px}.plinko-bet input{min-width:0;flex:1;border:0;background:transparent;color:#fff;font:700 .9rem var(--font-display)}.plinko-rows{display:flex;align-items:center;justify-content:space-between;height:52px;padding:0 15px;border-radius:9px;background:#33336A;color:#fff}.plinko-controls>#plinko-start{width:100%;height:50px;margin-top:40px;border:0;border-radius:8px;color:#fff;background:#3e5df7;font:700 .88rem var(--font-display);box-shadow:none}.plinko-controls p{text-align:center;color:#9dadcf;font-size:.76rem}.plinko-board{position:relative;min-height:650px;padding:70px 45px 40px}.plinko-tools{position:absolute;top:16px;right:18px;display:flex;gap:8px}.plinko-tools button{height:30px;padding:0 12px;border:0;border-radius:8px;color:#9eadcf;background:#33336A;box-shadow:none}.plinko-pegs{display:grid;gap:17px;justify-items:center}.plinko-pegs div{display:flex;justify-content:center;gap:38px}.plinko-pegs i{display:block;width:13px;height:13px;border-radius:50%;background:#7182b5}.plinko-slots{display:grid;grid-template-columns:repeat(11,1fr);gap:7px;margin-top:25px}.plinko-slots span{padding:7px 0;border-radius:5px;color:#fff;background:#8d36d3;text-align:center;font:700 .73rem var(--font-display)}.plinko-slots span:nth-child(n+4):nth-child(-n+8){background:#ff7956}.plinko-slots span:nth-child(6){background:#ffb329}.plinko-slots .hit{outline:3px solid #fff;box-shadow:0 0 15px #fff}@media(max-width:1500px){.app-shell:has(.plinko-main){grid-template-columns:138px minmax(0,1fr);grid-template-areas:"topbar topbar" "sidebar main"}.app-shell:has(.plinko-main)>.chat-panel{display:none}}

/* Cups */
.cups-page{display:grid;grid-template-columns:280px minmax(560px,1fr);gap:28px;max-width:1120px;margin:20px auto}.cups-controls,.cups-board{border-radius:16px;background:rgba(31,42,89,.9)}.cups-controls{padding:30px;min-height:340px}.cups-controls label{display:block;margin:7px 0 9px;color:#7285ba;font:.73rem var(--font-display)}.cups-bet{display:flex;align-items:center;gap:10px;height:53px;padding:0 10px 0 14px;border-radius:9px;background:#33336A}.cups-bet input{min-width:0;flex:1;border:0;background:transparent;color:#fff;font:700 .9rem var(--font-display)}.cups-bet>div,.cups-count,.cups-colors{display:flex;gap:9px}.cups-bet button,.cups-count button{height:34px;min-width:42px;border:0;border-radius:8px;color:#aebce4;background:#4A4A88;box-shadow:none}.cups-count .active{color:#fff;background:#3e5df7}.cups-colors button{width:25px;height:25px;border-radius:50%;box-shadow:none}.cups-colors .pink{background:#ee347a}.cups-colors .purple{background:#4b63f4}.cups-colors .active{outline:2px solid #fff;outline-offset:2px}.cups-controls>#cups-start{width:100%;height:50px;margin-top:40px;border:0;border-radius:8px;color:#fff;background:#3e5df7;font:700 .88rem var(--font-display);box-shadow:none}.cups-controls p{text-align:center;color:#9dadcf;font-size:.76rem}.cups-board{position:relative;min-height:420px}.cups-tools{position:absolute;top:18px;right:20px}.cups-tools button{height:32px;border:0;border-radius:8px;color:#9dadcf;background:#33336A;box-shadow:none}.cups-pot{position:absolute;top:45px;right:220px;color:#fff;font:800 1.2rem var(--font-display)}.cups-avatars{position:absolute;top:80px;left:50px;display:grid;gap:15px;color:#fff}.cups-avatars button{height:44px;border:0;border-radius:5px;color:#fff;background:#3e5df7;font:700 .8rem var(--font-display)}.cups-visual{position:absolute;right:150px;top:100px;display:flex;gap:40px}.cups-visual i{display:block;width:70px;height:90px;border-radius:12px 12px 8px 8px;transform:perspective(100px) rotateX(-8deg);box-shadow:0 15px 25px rgba(246,42,146,.35),inset 0 -10px rgba(255,255,255,.25)}.cups-visual .pink{background:linear-gradient(90deg,#fe6395,#de2173)}.cups-visual .purple{background:linear-gradient(90deg,#8a5cff,#5732cc)}@media(max-width:1500px){.app-shell:has(.cups-main){grid-template-columns:138px minmax(0,1fr);grid-template-areas:"topbar topbar" "sidebar main"}.app-shell:has(.cups-main)>.chat-panel{display:none}}

/* ══════════════════════════════════════════════════════════════
   UPGRADER – Bloxflip-style
   ══════════════════════════════════════════════════════════════ */

/* ── Page layout: 3-column ── */
body:has(.upgrader-main){background-color:var(--game-surface);background-image:radial-gradient(ellipse 1000px 560px at 50% -10%,rgba(59,130,246,.08),transparent 70%),radial-gradient(ellipse 700px 460px at 85% 20%,rgba(139,92,246,.06),transparent 60%),url('/images/background/background.png');color:#f6f7ff}
body:has(.upgrader-main) .main-col{background-color:transparent;background-image:radial-gradient(circle at 78% 34%,rgba(72,55,150,.08),transparent 34%),radial-gradient(circle at 28% 80%,rgba(39,81,158,.07),transparent 38%)}
.dash-main.upgrader-main{padding:24px 0 56px}
.upgrader-page{display:grid;grid-template-columns:minmax(270px,320px) minmax(500px,1fr) 200px;gap:15px;width:100%;max-width:none;margin:0}

/* ── Controls panel (left) ── */
.upgrader-controls{min-width:0;min-height:510px;padding:24px;border-radius:12px;background:var(--game-surface);box-shadow:inset 0 1px rgba(255,255,255,.015);overflow:hidden}
.upgrader-controls label,.upgrader-field-label{display:block;margin:0 0 8px;color:#7183ba;font:500 .72rem var(--font-display);text-transform:none;letter-spacing:0}
.upgrader-controls>.upgrader-mult-display+*{margin-top:10px}

/* Bet field */
.upgrader-bet-field{display:flex;align-items:center;gap:9px;height:43px;margin-bottom:19px;padding:0 8px 0 14px;border-radius:9px;background:#293667;box-shadow:inset 0 1px rgba(255,255,255,.015)}
.upgrader-bet-field .gold-token-icon{width:20px;height:20px;color:#8fa0ce}
.upgrader-bet-field input{min-width:0;flex:1!important;width:0!important;padding:0!important;background:transparent!important;color:#fff;font:700 .88rem var(--font-display);border:0;outline:0}
.upgrader-bet-field>div{display:flex;gap:6px}
.upgrader-bet-field button{height:28px;min-width:40px;margin:0;padding:0 9px;border:0;border-radius:8px;color:#a9b8e6;background:#3b497d;box-shadow:none;cursor:pointer;font:600 .72rem var(--font-display);transition:background .15s,color .15s}
.upgrader-bet-field button:hover{color:#fff;background:#4b5a92;filter:none;box-shadow:none}

/* Multiplier display */
.upgrader-mult-display{display:flex;align-items:center;height:43px;padding:0 14px;border-radius:9px;color:#d2d9f5;background:#293667;font:600 .85rem var(--font-display)}

/* Multiplier preset buttons */
.upgrader-presets{display:flex;flex-wrap:nowrap;gap:7px;margin:10px 0 16px}
.upgrader-presets button{flex:1 1 0;min-width:0;height:28px;margin:0;padding:0 5px;border:0;border-radius:8px;color:#8090c4;background:#344176;box-shadow:none;cursor:pointer;font:600 .72rem var(--font-display);transition:all .15s;white-space:nowrap}
.upgrader-presets button:hover{color:#fff;background:#46558d;filter:none;box-shadow:none}
.upgrader-presets button.active{color:#fff;background:#3e5df7;box-shadow:0 2px 12px rgba(62,93,247,.35)}

/* Upgrade button */
.upgrader-controls>#upgrader-start{width:100%;height:40px;margin-top:0;border:0;border-radius:8px;color:#fff;background:#3e5df7;font:700 .82rem var(--font-display);box-shadow:0 4px 18px rgba(62,93,247,.22);cursor:pointer;transition:all .15s}
.upgrader-controls>#upgrader-start:hover:not(:disabled){background:#5271ff;box-shadow:0 4px 24px rgba(62,93,247,.45);transform:translateY(-1px)}
.upgrader-controls>#upgrader-start:disabled{cursor:not-allowed;opacity:.5}
.upgrader-controls p{min-height:16px;margin:8px 0 0;color:#a4b3dc;font-size:.76rem;text-align:center}

/* Instant mode toggle */
.upgrader-instant{display:flex;align-items:center;gap:9px;margin-top:23px;color:#8fa0ce;font:.76rem var(--font-display)}
.upgrader-instant .upgrader-toggle{margin:0}
.upgrader-toggle{position:relative;display:inline-block;width:38px;height:21px;flex-shrink:0}
.upgrader-toggle input{opacity:0;width:0;height:0}
.upgrader-toggle-slider{position:absolute;cursor:pointer;inset:0;border-radius:21px;background:#3F3F72;transition:.2s}
.upgrader-toggle-slider::before{content:'';position:absolute;height:15px;width:15px;left:3px;bottom:3px;border-radius:50%;background:#8fa0ce;transition:.2s}
.upgrader-toggle input:checked+.upgrader-toggle-slider{background:#3e5df7}
.upgrader-toggle input:checked+.upgrader-toggle-slider::before{transform:translateX(17px);background:#fff}

/* Status text */
.upgrader-status-win{color:#4ade80!important;font-weight:700}
.upgrader-status-lose{color:#f87171!important;font-weight:700}

/* ── Wheel section (center) ── */
.upgrader-dial{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;min-height:510px;border-radius:12px;background:var(--game-surface);padding:18px;box-shadow:inset 0 1px rgba(255,255,255,.015)}

.upgrader-tools{position:absolute;top:12px;right:12px;display:flex;gap:8px;z-index:6}
.upgrader-tools button{display:flex;align-items:center;justify-content:center;gap:5px;height:26px;margin:0;padding:0 12px;border:0;border-radius:8px;color:#8293c7;background:#2a376b;box-shadow:none;cursor:pointer;font:.7rem var(--font-display);transition:background .15s,color .15s}
.upgrader-tools .upgrader-help-btn{width:34px;padding:0}
.upgrader-tools button:hover{color:#fff;background:#3b4a83;filter:none;box-shadow:none}

/* Wheel */
.upgrade-wheel-shell{position:relative;width:min(414px,calc(100% - 34px));aspect-ratio:1;height:auto;transition:filter .4s}
.upgrade-wheel-spinner{--chance:0%;position:absolute;inset:0;border-radius:50%;background:conic-gradient(from 0deg,#3d5cfb 0 var(--chance),#97a6d5 var(--chance) 100%);box-shadow:inset 0 0 0 22px #232f69,0 0 0 3px #151f50,0 0 55px rgba(62,93,247,.12);transition:background .3s}
.upgrade-wheel-spinner::after{content:'';position:absolute;inset:49px;border-radius:50%;background:radial-gradient(circle at 50% 44%,#2f3d7e 0,#29366d 58%,#253064 100%);box-shadow:inset 0 0 42px rgba(8,13,50,.54),0 0 0 3px rgba(19,29,77,.78)}

/* Red wheel on loss */
.wheel-fail .upgrade-wheel-spinner{box-shadow:inset 0 0 0 24px #3d1a1a,0 0 0 4px #2a1010,0 0 70px rgba(248,113,113,.3)!important;background:conic-gradient(#f87171 0 var(--chance),#c8d2e8 var(--chance) 100%)!important}

/* Shake animation */
@keyframes wheelShake{0%,100%{transform:translateX(0)}15%{transform:translateX(-8px)}30%{transform:translateX(7px)}45%{transform:translateX(-6px)}60%{transform:translateX(5px)}75%{transform:translateX(-3px)}90%{transform:translateX(2px)}}
.wheel-shake{animation:wheelShake .5s ease}

/* Center circle */
.upgrade-wheel-center{position:absolute;z-index:3;inset:31%;display:flex;align-items:center;justify-content:center;flex-direction:column;border-radius:50%;color:#fff;text-align:center;background:radial-gradient(circle at 50% 42%,rgba(47,61,126,.97),rgba(30,41,90,.97));box-shadow:0 0 36px rgba(5,9,38,.38),inset 0 1px rgba(255,255,255,.025)}
.upgrade-wheel-center small{color:#7b8fc4;font:.65rem var(--font-display);text-transform:uppercase;letter-spacing:.1em;margin-bottom:6px}
.upgrade-wheel-center strong{font:800 clamp(1.75rem,2.3vw,2.35rem) var(--font-display);letter-spacing:-.035em;background:linear-gradient(180deg,#fff 40%,#a7b6e6);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text}

/* Pointer */
.upgrade-pointer{position:absolute;z-index:5;top:-23px;left:50%;width:20px;height:32px;transform:translateX(-50%);border:0;border-radius:52% 52% 64% 64%;background:linear-gradient(180deg,#fff,#dcd8f7);clip-path:polygon(50% 100%,0 35%,8% 10%,27% 0,73% 0,92% 10%,100% 35%);filter:drop-shadow(0 4px 8px rgba(0,0,0,.38))}

/* Result banner */
.upgrader-result-banner{margin-top:16px;padding:10px 24px;border-radius:10px;font:700 .9rem var(--font-display);text-align:center;letter-spacing:.05em;transition:all .3s}
.upgrader-result-banner.hidden{display:none}
.result-win{color:#4ade80;background:rgba(74,222,128,.1);border:1px solid rgba(74,222,128,.25)}
.result-fail{color:#f87171;background:rgba(248,113,113,.1);border:1px solid rgba(248,113,113,.25)}

/* ── Target panel (right) ── */
.upgrader-target{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;min-height:510px;border-radius:12px;background:var(--game-surface);border:2px dashed rgba(111,128,184,.25);overflow:hidden}
.upgrader-target::before{content:'';position:absolute;inset:86px 10px 0;background:linear-gradient(145deg,transparent 0 44%,rgba(16,28,68,.34) 44% 58%,transparent 58%),linear-gradient(215deg,transparent 0 38%,rgba(16,28,68,.28) 38% 57%,transparent 57%);clip-path:polygon(0 44%,34% 24%,53% 34%,79% 9%,100% 17%,100% 100%,0 100%);opacity:.72}
.upgrader-target-empty{position:relative;z-index:1;color:#7183bb;text-align:center;font:.78rem var(--font-display);line-height:1.55;padding:20px}
.upgrader-target-mark{display:block;width:32px;height:32px;margin:0 auto 16px;border:1px solid rgba(111,128,184,.25);border-radius:10px;background:rgba(23,35,80,.35);box-shadow:inset 0 0 18px rgba(57,80,164,.1)}
.upgrader-target-filled{position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;gap:10px;padding:30px 20px;text-align:center}
.upgrader-target-filled img{width:100px;height:100px;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(0 8px 16px rgba(0,0,0,.45))}
.upgrader-target-name{color:#fff;font:700 .9rem var(--font-display)}
.upgrader-target-value{color:#8fa0ce;font:600 .8rem var(--font-display)}
.upgrader-target-remove{margin-top:8px;height:32px;padding:0 18px;border:1px solid rgba(248,113,113,.4);border-radius:8px;color:#f87171;background:transparent;cursor:pointer;font:.72rem var(--font-display);transition:all .15s}
.upgrader-target-remove:hover{background:rgba(248,113,113,.12);border-color:#f87171}

/* ── Item marketplace ── */
.upgrader-items{width:100%;max-width:none;margin:16px 0 0;padding:16px 16px 18px;border-radius:13px;background:transparent;box-shadow:none}

/* Filter toolbar */
.upgrader-filters{display:flex;gap:8px;margin-bottom:10px;flex-wrap:wrap;align-items:center}
.upgrader-filter-input{height:42px;padding:0 14px;border:0;border-radius:8px;background:#293667;color:#fff;font:.76rem var(--font-display);outline:0;flex:0 0 200px;min-width:120px}
.upgrader-filter-input::placeholder{color:#6b7eb3}
.upgrader-filter-sm{flex:0 0 112px;min-width:90px;max-width:112px}
.upgrader-filter-select{height:42px;padding:0 14px;border:0;border-radius:8px;background:#3a477f;color:#bdc8eb;font:.76rem var(--font-display);outline:0;cursor:pointer;flex:0 0 110px;min-width:110px}
.upgrader-filter-select option{background:#25255A}
.upgrader-main input:focus,.upgrader-main select:focus,.upgrader-main button:focus{outline:0;border-color:transparent;box-shadow:none}
.upgrader-main input:focus-visible,.upgrader-main select:focus-visible,.upgrader-main button:focus-visible{outline:1px solid rgba(62,92,255,.42);outline-offset:2px;border-color:transparent;box-shadow:none}

/* Item grid */
.upgrader-item-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:0}

/* Item card */
.upgrader-item{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;min-width:0;min-height:232px;margin:0;padding:20px 8px 26px;border:1px solid transparent;border-radius:10px;color:#93a8e2;background:transparent;box-shadow:none;cursor:pointer;transition:background .18s,border-color .18s,transform .18s;overflow:hidden}
.upgrader-item::before{content:'';position:absolute;left:50%;top:42px;width:150px;height:120px;transform:translateX(-50%);border-radius:50%;background:radial-gradient(circle,rgba(61,89,170,.3),rgba(61,89,170,.09) 42%,transparent 72%);pointer-events:none}
.upgrader-item:hover{border-color:rgba(75,100,210,.18);background:rgba(43,56,116,.36);transform:translateY(-2px);box-shadow:none;filter:none}
.upgrader-item.selected{border-color:#3e5df7;background:rgba(45,60,125,.6);box-shadow:inset 0 0 24px rgba(62,93,247,.12)}

/* Star icon */
.upgrader-item-star{position:absolute;z-index:2;top:11px;right:13px;color:#3d61ed;font-size:1.55rem;line-height:1;opacity:.9;transition:opacity .15s}
.upgrader-item:hover .upgrader-item-star{opacity:1}

/* Item image */
.upgrader-item > img{position:relative;z-index:1;display:block;width:94px;height:94px;object-fit:contain;image-rendering:pixelated;margin:0 auto 26px;filter:drop-shadow(0 8px 10px rgba(0,0,0,.42));transition:transform .2s}
.upgrader-item:hover > img{transform:scale(1.08)}

/* Item text */
.upgrader-item strong{position:relative;z-index:1;display:block;overflow:hidden;width:100%;padding:0 6px;white-space:nowrap;text-overflow:ellipsis;font:500 .72rem var(--font-display);text-align:center}
.upgrader-item b{position:relative;z-index:1;display:flex;align-items:center;gap:4px;margin-top:4px;color:#fff;font:800 .78rem var(--font-display)}
.upgrader-item b .gold-token-icon{width:14px;height:14px}

/* ── Win Popup Modal ── */
.upgrader-modal-overlay{position:fixed;inset:0;z-index:1000;display:none;align-items:center;justify-content:center;background:rgba(8,12,32,.75);backdrop-filter:blur(6px);opacity:0;transition:opacity .25s}
.upgrader-modal-overlay.open{display:flex;opacity:1}

.upgrader-win-popup{display:flex;flex-direction:column;align-items:center;gap:14px;width:380px;padding:40px 32px 32px;border-radius:18px;background:rgba(26,36,75,.96);box-shadow:0 20px 60px rgba(0,0,0,.5);animation:popupIn .35s ease}
@keyframes popupIn{from{transform:scale(.85);opacity:0}to{transform:scale(1);opacity:1}}
.upgrader-win-popup > img{width:120px;height:120px;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(0 10px 20px rgba(0,0,0,.4))}
.upgrader-win-name{color:#8fa0ce;font:.88rem var(--font-display)}
.upgrader-win-text{color:#fff;font:700 1.05rem var(--font-display);text-align:center}
.upgrader-sell-btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;height:50px;border:0;border-radius:10px;color:#fff;background:#3e5df7;font:700 .9rem var(--font-display);box-shadow:0 4px 20px rgba(62,93,247,.35);cursor:pointer;transition:all .15s}
.upgrader-sell-btn:hover{background:#5271ff;transform:translateY(-1px)}
.upgrader-sell-btn .gold-token-icon{width:18px;height:18px}

/* ── History & Help Modals ── */
.upgrader-modal{width:520px;max-height:80vh;border-radius:16px;background:rgba(26,36,75,.97);box-shadow:0 20px 60px rgba(0,0,0,.5);overflow:hidden;animation:popupIn .3s ease}
.upgrader-modal-header{display:flex;align-items:center;justify-content:space-between;padding:18px 24px;border-bottom:1px solid rgba(115,136,199,.15)}
.upgrader-modal-header h3{color:#fff;font:700 1rem var(--font-display);margin:0}
.upgrader-modal-close{width:32px;height:32px;border:0;border-radius:8px;color:#8fa0ce;background:rgba(115,136,199,.12);cursor:pointer;font-size:1.2rem;transition:background .15s;display:flex;align-items:center;justify-content:center}
.upgrader-modal-close:hover{background:rgba(115,136,199,.25)}
.upgrader-modal-body{padding:20px 24px;max-height:60vh;overflow-y:auto;color:#9cadde;font:.82rem var(--font-display);line-height:1.65}
.upgrader-modal-body p{margin:0 0 10px}

/* History rows */
.upgrader-history-empty{text-align:center;color:#6b7eb3;padding:30px}
.upgrader-history-row{display:flex;align-items:center;gap:14px;padding:12px 0;border-bottom:1px solid rgba(115,136,199,.1)}
.upgrader-history-row:last-child{border-bottom:0}
.history-img{width:40px;height:40px;object-fit:contain;image-rendering:pixelated;border-radius:6px;background:rgba(43,57,118,.5);padding:4px}
.history-info{flex:1;display:flex;flex-direction:column;gap:2px}
.history-info strong{color:#fff;font:.78rem var(--font-display)}
.history-info span{color:#7b8fc4;font:.68rem var(--font-display)}
.history-result{display:flex;flex-direction:column;align-items:flex-end;gap:3px}
.history-badge{padding:3px 10px;border-radius:5px;font:700 .65rem var(--font-display);text-transform:uppercase;letter-spacing:.06em}
.history-win .history-badge{color:#4ade80;background:rgba(74,222,128,.12)}
.history-lose .history-badge{color:#f87171;background:rgba(248,113,113,.12)}
.history-time{color:#6b7eb3;font:.62rem var(--font-display)}

/* ── Confetti canvas ── */
.upgrader-confetti{position:fixed;inset:0;z-index:2000;pointer-events:none;display:none}

/* ── Responsive ── */
@media(max-width:1500px){
  .app-shell:has(.upgrader-main){grid-template-columns:138px minmax(0,1fr);grid-template-areas:"topbar topbar" "sidebar main"}
  .app-shell:has(.upgrader-main)>.chat-panel{display:none}
}
@media(max-width:1660px){
  .upgrader-page{grid-template-columns:minmax(250px,290px) minmax(440px,1fr) 190px}
  .upgrade-wheel-shell{width:min(388px,calc(100% - 30px))}
}
@media(max-width:1100px){
  .dash-main.upgrader-main{padding-inline:16px}
  .upgrader-page{grid-template-columns:240px minmax(350px,1fr);gap:16px}
  .upgrader-target{display:none}
  .upgrader-item-grid{grid-template-columns:repeat(4,1fr)}
}
@media(max-width:900px){
  .upgrader-page{grid-template-columns:1fr;margin-inline:16px}
  .upgrade-wheel-shell{width:320px;height:320px}
  .upgrader-item-grid{grid-template-columns:repeat(3,1fr)}
  .upgrader-items{margin-inline:0}
  .upgrader-filters{flex-direction:column}
  .upgrader-filter-input,.upgrader-filter-select{width:100%;min-width:0}
  .upgrader-modal,.upgrader-win-popup{width:calc(100vw - 32px);max-width:420px}
}
@media(max-width:600px){
  .upgrader-item-grid{grid-template-columns:repeat(2,1fr);gap:10px}
  .upgrade-wheel-shell{width:260px;height:260px}
  .upgrade-wheel-center{inset:29%}
  .upgrade-wheel-center strong{font-size:1.6rem}
}


/* ========== KENO ========== */
.keno-main { min-width: 0; }
.keno-page {
  max-width: 1120px;
  margin: 18px auto 54px;
  display: grid;
  grid-template-columns: minmax(240px, .45fr) minmax(400px, 1fr);
  gap: 24px;
}

/* Controls panel */
.keno-controls {
  background: var(--panel, #1e1e3a);
  border-radius: 14px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.keno-controls > label {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #8888aa;
  margin-top: 6px;
}

/* Risk & picks selectors */
.keno-risk, .keno-picks-select {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.keno-risk button, .keno-picks-select button {
  flex: 1;
  min-width: 38px;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: rgba(55, 55, 100, 0.5);
  color: #ccc;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.keno-risk button.active, .keno-picks-select button.active {
  background: #7c3aed;
  color: #fff;
}
.keno-risk button:hover, .keno-picks-select button:hover {
  background: rgba(124, 58, 237, 0.4);
  color: #fff;
}

/* Bet field */
.keno-bet-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 30, 60, 0.6);
  border-radius: 10px;
  padding: 6px 10px;
}
.keno-bet-field .gold-token-icon { width: 20px; height: 20px; color: #8496ca; }
.keno-bet-field input {
  flex: 1;
  background: none;
  border: none;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  outline: none;
  min-width: 0;
}
.keno-bet-field input::-webkit-outer-spin-button,
.keno-bet-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.keno-bet-field div { display: flex; gap: 4px; }
.keno-bet-field button {
  padding: 5px 10px;
  border: none;
  border-radius: 6px;
  background: rgba(65, 65, 115, 0.55);
  color: #bbb;
  font-weight: 600;
  font-size: .78rem;
  cursor: pointer;
}
.keno-bet-field button:hover { background: rgba(65, 65, 115, 0.8); }

/* Action buttons */
.keno-actions {
  display: flex;
  gap: 8px;
}
.keno-actions button {
  flex: 1;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: rgba(55, 55, 100, 0.5);
  color: #ccc;
  font-weight: 600;
  cursor: pointer;
}
.keno-actions button:hover { background: rgba(65, 65, 115, 0.8); color: #fff; }

/* Play button */
.keno-play-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.keno-play-btn:hover { opacity: .9; }
.keno-play-btn:disabled { opacity: .5; cursor: not-allowed; }

/* Status */
#keno-status {
  text-align: center;
  font-weight: 700;
  font-size: .95rem;
  min-height: 1.4em;
}
.keno-win  { color: #4ade80 !important; text-shadow: 0 0 12px rgba(74, 222, 128, 0.4); }
.keno-lose { color: #f87171 !important; }

/* Paytable */
.keno-paytable {
  max-height: 220px;
  overflow-y: auto;
  border-radius: 8px;
  background: rgba(20, 20, 45, 0.5);
}
.keno-pt-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 12px;
  font-size: .8rem;
  color: #666;
}
.keno-pt-header {
  font-weight: 700;
  color: #999;
  border-bottom: 1px solid rgba(100, 100, 140, 0.2);
  position: sticky;
  top: 0;
  background: rgba(20, 20, 45, 0.95);
}
.keno-pt-active { color: #ccc; }

/* Board */
.keno-board {
  background: var(--panel, #1e1e3a);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Grid */
.keno-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 520px;
}
.keno-tile {
  aspect-ratio: 1;
  border: none;
  border-radius: 10px;
  background: rgba(55, 55, 100, 0.45);
  color: #999;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s, box-shadow .2s;
}
.keno-tile:hover {
  background: rgba(80, 80, 140, 0.6);
  color: #fff;
  transform: scale(1.05);
}
.keno-tile.keno-selected {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
}
.keno-tile.keno-drawn {
  background: rgba(40, 40, 75, 0.7);
  color: #666;
  box-shadow: inset 0 0 0 2px rgba(100, 100, 140, 0.3);
}
.keno-tile.keno-hit {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  color: #fff !important;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.5);
  animation: keno-pop .3s ease;
}
@keyframes keno-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Responsive */
@media (max-width: 800px) {
  .keno-page {
    grid-template-columns: 1fr;
  }
  .keno-grid {
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
  }
}
@media (max-width: 1500px) {
  .app-shell:has(.keno-main) {
    grid-template-columns: 138px minmax(0, 1fr);
    grid-template-areas: "topbar topbar" "sidebar main";
  }
  .app-shell:has(.keno-main) > .chat-panel { display: none; }
}

/* ========== KENO — STAKE-INSPIRED NAVY REDESIGN ========== */
body:has(.keno-main) {
  background-color: var(--game-surface);
  background-image:
    radial-gradient(ellipse 900px 520px at 52% -12%, rgba(62, 92, 255, 0.12), transparent 68%),
    radial-gradient(ellipse 680px 440px at 92% 28%, rgba(124, 46, 223, 0.07), transparent 62%),
    url('/images/background/background.png');
}

body:has(.keno-main) .main-col {
  background-color: transparent;
  background-image:
    radial-gradient(circle at 78% 32%, rgba(75, 61, 168, 0.08), transparent 34%),
    radial-gradient(circle at 24% 86%, rgba(45, 90, 180, 0.07), transparent 40%);
}

.dash-main.keno-main {
  --keno-control: #191f3f;
  --keno-surface: var(--game-surface, #21264a);
  --keno-field: #272e55;
  --keno-field-strong: #2d355f;
  --keno-line: rgba(111, 128, 190, 0.14);
  --keno-muted: #8190bd;
  --keno-blue: #3e5df7;
  --keno-blue-dark: #2d45cb;
  --keno-hit: #28d7ad;
  min-width: 0;
  padding: 24px 0 56px;
}

.keno-page {
  display: block;
  min-width: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  grid-template-columns: none;
  gap: 0;
  container: keno-layout / inline-size;
}

.keno-game-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 720px;
  overflow: hidden;
  border: 1px solid rgba(111, 128, 190, 0.08);
  border-radius: 14px;
  background: var(--keno-surface);
  box-shadow: 0 18px 50px rgba(7, 11, 32, 0.18), inset 0 1px rgba(255, 255, 255, 0.015);
}

.keno-controls {
  min-width: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: 0;
  border-right: 1px solid var(--keno-line);
  border-radius: 0;
  background: var(--keno-control);
}

.keno-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #121831;
}

.keno-mode-tabs button {
  height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #7786b5;
  font: 700 0.78rem var(--font-display);
  cursor: pointer;
  box-shadow: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.keno-mode-tabs button:hover:not(:disabled) {
  color: #fff;
  background: rgba(61, 74, 132, 0.42);
}

.keno-mode-tabs button.active {
  color: #fff;
  background: #2b335c;
  box-shadow: 0 2px 8px rgba(5, 8, 26, 0.25);
}

.keno-controls-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.keno-field-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 18px;
  margin-top: 2px;
  gap: 12px;
  color: #a3add0;
  font: 600 0.72rem var(--font-display);
}

.keno-field-heading label,
.keno-field-heading > span:first-child {
  color: #a3add0;
}

.keno-field-heading > span:last-child {
  color: #6676aa;
  font-weight: 500;
  text-align: right;
}

.keno-field-heading b {
  color: #9eabd4;
  font-weight: 700;
}

.keno-difficulty-heading {
  margin-top: 6px;
}

.keno-bet-field,
.keno-auto-field {
  width: 100%;
  min-height: 45px;
  padding: 5px 6px 5px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  border: 1px solid rgba(111, 128, 190, 0.09);
  border-radius: 9px;
  background: var(--keno-field);
}

.keno-bet-field .gold-token-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: #8c9bc9;
}

.keno-bet-field input,
.keno-auto-field input {
  min-width: 0;
  height: 34px;
  flex: 1;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f6f8ff;
  font: 700 0.85rem var(--font-display);
  appearance: textfield;
}

.keno-bet-field input::-webkit-outer-spin-button,
.keno-bet-field input::-webkit-inner-spin-button,
.keno-auto-field input::-webkit-outer-spin-button,
.keno-auto-field input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.keno-bet-actions,
.keno-auto-field > div {
  display: flex;
  gap: 4px;
}

.keno-bet-field button,
.keno-auto-field button {
  min-width: 43px;
  height: 31px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: #39416d;
  color: #96a4cf;
  font: 700 0.7rem var(--font-display);
  cursor: pointer;
  box-shadow: none;
}

.keno-bet-field button:hover:not(:disabled),
.keno-auto-field button:hover:not(:disabled) {
  color: #fff;
  background: #485486;
}

.keno-risk {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.keno-risk button {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #262d52;
  color: #8190bd;
  font: 700 0.74rem var(--font-display);
  cursor: pointer;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.keno-risk button:hover:not(:disabled) {
  color: #fff;
  background: #303961;
}

.keno-risk button.active {
  color: #fff;
  border-color: rgba(88, 112, 255, 0.5);
  background: rgba(62, 93, 247, 0.2);
  box-shadow: inset 0 0 0 1px rgba(62, 93, 247, 0.08);
}

.keno-selection-summary {
  margin-top: 7px;
  padding: 13px 14px;
  border: 1px solid var(--keno-line);
  border-radius: 9px;
  background: rgba(35, 42, 79, 0.58);
}

.keno-selection-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.keno-selection-summary span {
  color: #8998c5;
  font: 600 0.74rem var(--font-display);
}

.keno-selection-summary strong {
  color: #fff;
  font: 800 0.82rem var(--font-display);
}

.keno-selection-summary small {
  display: block;
  margin-top: 5px;
  color: #596a9f;
  font: 500 0.66rem var(--font-display);
}

.keno-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.keno-actions button {
  min-width: 0;
  height: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: #2a3157;
  color: #9aa7ce;
  font: 700 0.72rem var(--font-display);
  cursor: pointer;
  box-shadow: none;
}

.keno-actions button:hover:not(:disabled) {
  color: #fff;
  background: #353f6b;
}

.keno-actions button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.keno-auto-panel {
  margin-top: 2px;
  padding-top: 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--keno-line);
}

.keno-auto-panel[hidden] {
  display: none;
}

.keno-auto-field input {
  padding-left: 2px;
}

.keno-play-btn {
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: linear-gradient(180deg, #4868ff, var(--keno-blue));
  color: #fff;
  font: 800 0.85rem var(--font-display);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(31, 55, 194, 0.22), inset 0 1px rgba(255, 255, 255, 0.14);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.keno-play-btn:hover:not(:disabled) {
  opacity: 1;
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.keno-play-btn:active:not(:disabled) {
  transform: translateY(0);
}

.keno-play-btn.is-stopping {
  background: #b64662;
  box-shadow: 0 8px 20px rgba(132, 35, 58, 0.18);
}

.keno-play-btn:disabled {
  opacity: 0.56;
  cursor: wait;
}

#keno-status {
  min-height: 36px;
  margin: 0;
  display: grid;
  place-items: center;
  color: #7585b5;
  font: 600 0.7rem/1.35 var(--font-display);
  text-align: center;
}

#keno-status.keno-status-win { color: var(--keno-hit); text-shadow: 0 0 12px rgba(40, 215, 173, 0.24); }
#keno-status.keno-status-return { color: #f6bd4f; }
#keno-status.keno-status-loss { color: #ef718d; }
#keno-status.keno-status-warning { color: #f3b65b; }

.keno-board {
  min-width: 0;
  padding: 30px 34px 22px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  border: 0;
  border-radius: 0;
  background: var(--keno-surface);
}

.keno-board-header {
  min-height: 64px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.keno-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: #6374aa;
  font: 700 0.62rem var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.keno-board-header h1 {
  margin: 0;
  color: #f7f8ff;
  font: 800 1.65rem/1.1 var(--font-display);
  letter-spacing: -0.03em;
}

.keno-board-header p {
  margin: 7px 0 0;
  color: #7483b2;
  font: 500 0.72rem var(--font-display);
}

.keno-board-history {
  min-height: 28px;
  max-width: 48%;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.keno-history-empty {
  color: #58699e;
  font: 600 0.68rem var(--font-display);
}

.keno-history-pill {
  min-width: 44px;
  height: 25px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #2b335c;
  color: #7888ba;
  font: 800 0.66rem var(--font-display);
}

.keno-history-pill.win { color: #071f1b; background: var(--keno-hit); }
.keno-history-pill.returned { color: #4a3104; background: #e9ad3f; }
.keno-history-pill.loss { color: #9ba7cf; background: #2a3053; }

.keno-grid {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}

.keno-tile {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgba(113, 128, 184, 0.08);
  border-radius: 10px;
  background: #30385f;
  color: #9aa6cd;
  font: 800 clamp(0.8rem, 1.35vw, 1.05rem) var(--font-display);
  cursor: pointer;
  box-shadow: 0 4px 0 #1a2040, inset 0 1px rgba(255, 255, 255, 0.025);
  transition: transform 0.2s ease, background 0.24s ease, color 0.24s ease, box-shadow 0.24s ease;
}

.keno-tile span {
  position: relative;
  z-index: 2;
}

.keno-tile:hover:not(:disabled) {
  color: #fff;
  background: #39436e;
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #1a2040, 0 8px 18px rgba(6, 9, 29, 0.16);
}

.keno-tile.keno-selected {
  border-color: rgba(111, 132, 255, 0.48);
  background: linear-gradient(145deg, #5873ff, var(--keno-blue));
  color: #fff;
  box-shadow: 0 4px 0 var(--keno-blue-dark), 0 8px 20px rgba(47, 72, 212, 0.22), inset 0 1px rgba(255, 255, 255, 0.15);
}

.keno-tile.keno-drawn {
  border-color: rgba(115, 128, 177, 0.1);
  background: #181e3d;
  color: #65739f;
  box-shadow: 0 3px 0 #11162f, inset 0 0 0 1px rgba(111, 128, 190, 0.04);
}

.keno-tile.keno-drawn::after {
  content: attr(data-draw-order);
  position: absolute;
  top: 5px;
  right: 6px;
  z-index: 3;
  color: #53618e;
  font: 700 0.5rem var(--font-display);
}

.keno-tile.keno-hit {
  border-color: rgba(93, 255, 217, 0.55);
  background: linear-gradient(145deg, #36e7be, #20cda4);
  color: #071f1b;
  box-shadow: 0 4px 0 #15977d, 0 0 24px rgba(40, 215, 173, 0.34), inset 0 1px rgba(255, 255, 255, 0.24);
  animation: keno-hit-pop 0.55s cubic-bezier(.2, .9, .3, 1.2);
}

.keno-tile.keno-hit::after {
  color: rgba(7, 31, 27, 0.58);
}

.keno-tile:disabled {
  cursor: default;
}

@keyframes keno-hit-pop {
  0% { transform: scale(0.9); }
  55% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.keno-paytable-heading {
  min-height: 37px;
  margin-top: 23px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.keno-paytable-heading > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.keno-paytable-heading span {
  color: #7383b6;
  font: 600 0.7rem var(--font-display);
}

.keno-paytable-heading strong {
  overflow: hidden;
  color: #9aa7ce;
  font: 700 0.72rem var(--font-display);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.keno-paytable {
  width: 100%;
  min-height: 74px;
  max-height: none;
  margin-top: 9px;
  padding: 0 0 5px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(76px, 1fr);
  gap: 7px;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 0;
  background: transparent;
}

.keno-paytable-empty {
  min-width: min(520px, 100%);
  min-height: 69px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 1px dashed rgba(111, 128, 190, 0.16);
  border-radius: 9px;
  color: #5f70a4;
  background: rgba(31, 37, 74, 0.34);
  font: 600 0.7rem var(--font-display);
  text-align: center;
}

.keno-payout-card {
  min-width: 0;
  min-height: 69px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(111, 128, 190, 0.08);
  border-radius: 9px;
  background: #292f54;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.018);
}

.keno-payout-card strong {
  color: #6877a7;
  font: 800 0.78rem var(--font-display);
}

.keno-payout-card span {
  color: #566698;
  font: 600 0.61rem var(--font-display);
}

.keno-payout-card.is-paying strong { color: #b0bbe0; }
.keno-payout-card.is-paying span { color: #7887b5; }

.keno-payout-card.is-result {
  border-color: rgba(40, 215, 173, 0.5);
  background: rgba(40, 215, 173, 0.16);
  box-shadow: 0 0 18px rgba(40, 215, 173, 0.12), inset 0 0 0 1px rgba(40, 215, 173, 0.08);
}

.keno-payout-card.is-result strong,
.keno-payout-card.is-result span {
  color: var(--keno-hit);
}

.keno-board-footer {
  min-height: 34px;
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  color: #536598;
  font: 600 0.62rem var(--font-display);
}

.keno-board-footer span:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
}

.keno-board-footer i {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  background: var(--keno-hit);
  box-shadow: 0 0 10px rgba(40, 215, 173, 0.55);
}

.keno-main button:focus,
.keno-main input:focus {
  outline: 0;
  box-shadow: none;
}

.keno-main button:focus-visible,
.keno-main input:focus-visible {
  outline: 2px solid rgba(84, 111, 255, 0.78);
  outline-offset: 2px;
}

@media (max-width: 1650px) {
  .keno-game-shell { grid-template-columns: 300px minmax(0, 1fr); }
  .keno-board { padding-inline: 28px; }
  .keno-grid { max-width: 720px; gap: 9px; }
}

@media (max-width: 1150px) {
  .keno-game-shell { grid-template-columns: 286px minmax(0, 1fr); }
  .keno-board { padding: 26px 22px 20px; }
  .keno-grid { gap: 7px; }
}

@media (max-width: 950px) {
  .dash-main.keno-main { padding-inline: 16px; }
  .keno-game-shell { grid-template-columns: 1fr; min-height: 0; }
  .keno-controls { border-right: 0; border-bottom: 1px solid var(--keno-line); }
  .keno-board { min-height: 650px; }
}

@container keno-layout (max-width: 820px) {
  .keno-game-shell {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .keno-controls {
    border-right: 0;
    border-bottom: 1px solid var(--keno-line);
  }

  .keno-board {
    min-height: 650px;
    padding: 24px 20px 18px;
  }
}

@container keno-layout (max-width: 560px) {
  .keno-board {
    min-height: 590px;
    padding: 20px 12px 16px;
  }

  .keno-board-header {
    gap: 12px;
  }

  .keno-grid {
    gap: 5px;
  }

  .keno-tile {
    border-radius: 7px;
    font-size: clamp(0.68rem, 3.1cqw, 0.9rem);
  }
}

@media (max-width: 700px) {
  .app-shell:has(.keno-main) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "topbar" "main";
  }
  .app-shell:has(.keno-main) > .sidebar { display: none; }
  .dash-main.keno-main { padding: 12px; }
  .keno-game-shell { border-radius: 10px; }
  .keno-board { min-height: 590px; padding: 20px 12px 16px; }
  .keno-board-header { gap: 12px; }
  .keno-board-header p { max-width: 280px; }
  .keno-board-history { max-width: 42%; }
  .keno-grid { gap: 5px; }
  .keno-tile { border-radius: 7px; box-shadow: 0 3px 0 #1a2040; font-size: clamp(0.68rem, 2.8vw, 0.9rem); }
  .keno-tile.keno-selected { box-shadow: 0 3px 0 var(--keno-blue-dark), 0 5px 14px rgba(47, 72, 212, 0.18); }
  .keno-tile.keno-hit { box-shadow: 0 3px 0 #15977d, 0 0 16px rgba(40, 215, 173, 0.25); }
  .keno-tile.keno-drawn::after { display: none; }
  .keno-board-footer { align-items: flex-start; flex-direction: column; gap: 5px; }
}

@media (max-width: 480px) {
  .keno-controls { padding: 14px; }
  .keno-board-header { min-height: 74px; }
  .keno-board-header h1 { font-size: 1.35rem; }
  .keno-board-header p { font-size: 0.65rem; }
  .keno-board-history { display: none; }
  .keno-paytable-heading > div { align-items: flex-start; flex-direction: column; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .keno-tile,
  .keno-mode-tabs button,
  .keno-play-btn { transition: none; }
  .keno-tile.keno-hit { animation: none; }
}

/* ============ Shared Game Shell Spacing ============ */
/* Keep every playable game aligned with the sidebar and chat top edge. */
.dash-main:is(
  .coinflip-main,
  .blackjack-main,
  .dice-main,
  .mines-main,
  .towers-main,
  .slide-main,
  .upgrader-main,
  .keno-main,
  .single-cases-main,
  .single-case-open-main,
  .case-battles-main,
  .battle-create-main,
  .battle-arena-main,
  .crash-main
) {
  padding-top: var(--game-ui-gutter);
}

/* Mines previously added a second top gap inside its game main. */
.dash-main.mines-main > .mines-page {
  margin-top: 0;
}

/* ============ Account & Settings ============ */
.topbar-user-avatar {
  text-decoration: none;
  cursor: pointer;
}

.topbar-user-avatar:focus-visible {
  outline: 3px solid #4262ff;
  outline-offset: 4px;
}

.account-main {
  min-width: 0;
  padding: var(--game-ui-gutter) 0 32px;
}

.account-page {
  display: grid;
  grid-template-columns: minmax(310px, 430px) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 112px);
  align-items: start;
  width: calc(100% - (var(--game-ui-gutter) * 2));
  max-width: 1365px;
  margin: 0 auto 40px;
}

.account-summary-card {
  min-height: 322px;
  padding: 36px 40px 26px;
  border: 1px solid rgba(108, 126, 210, .06);
  border-radius: 12px;
  background: rgba(33, 38, 74, .94);
  box-shadow: 0 16px 42px rgba(4, 8, 32, .14);
}

.account-identity {
  display: flex;
  align-items: center;
  gap: 22px;
}

.account-avatar {
  position: relative;
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(99, 116, 205, .28);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #f0b73f, #a54d28 55%, #25254a 56%);
  box-shadow: 0 0 0 4px rgba(13, 18, 56, .35);
  font: 800 1.25rem var(--font-display);
}

.account-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-identity h1 {
  margin: 0 0 4px;
  color: #fff;
  font: 500 1.45rem var(--font-display);
}

.account-copy-id {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
  color: #7789c4;
  background: transparent;
  box-shadow: none;
  font: 500 .76rem var(--font-display);
}

.account-copy-id span {
  color: #4d6cff;
  opacity: 0;
  transition: opacity .15s ease;
}

.account-copy-id:hover,
.account-copy-id:focus-visible {
  color: #a9b6e5;
  transform: none;
  box-shadow: none;
}

.account-copy-id:hover span,
.account-copy-id:focus-visible span { opacity: 1; }

.account-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 42px;
  margin: 46px 0 0;
}

.account-stats div { min-width: 0; }
.account-stats dt {
  margin: 0 0 2px;
  color: #8292c6;
  font: 500 .82rem var(--font-display);
}

.account-stats dd {
  margin: 0;
  color: #fff;
  font: 500 1.76rem/1.2 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.account-stats dd.positive { color: #13d9d8; }
.account-stats dd.negative { color: #f06388; }
.account-summary-note {
  margin: 26px 0 0;
  color: #7382b8;
  text-align: center;
  font-size: .7rem;
}

.account-workspace {
  min-width: 0;
}

.account-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  margin: 0 0 34px;
  overflow-x: auto;
}
.account-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #8293cc;
  text-decoration: none;
  white-space: nowrap;
  font: 500 .82rem var(--font-display);
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.account-tabs a:hover { color: #fff; }
.account-tabs a.active {
  border-color: rgba(255, 255, 255, .92);
  color: #fff;
  background: rgba(42, 53, 103, .76);
  font-weight: 700;
}

.account-panel[hidden] { display: none !important; }
.account-panel { min-width: 0; }
.account-panel-header {
  display: flex;
  min-height: 54px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.account-panel-header > div > span {
  display: block;
  margin-bottom: 5px;
  color: #596ca9;
  font: 700 .62rem var(--font-display);
  letter-spacing: .13em;
}

.account-panel-header h2 {
  margin: 0;
  color: #fff;
  font: 500 1.45rem var(--font-display);
}

.account-filter-form select,
.account-refresh {
  min-width: 138px;
  height: 41px;
  padding: 0 14px;
  border: 1px solid rgba(101, 119, 196, .28);
  border-radius: 5px;
  outline: 0;
  color: #fff;
  background: rgba(32, 40, 81, .9);
  font: 600 .78rem var(--font-display);
}

.account-filter-form select:focus-visible { border-color: #4262ff; }
.account-refresh {
  display: grid;
  min-width: 41px;
  width: 41px;
  padding: 0;
  place-items: center;
  color: #8a9ad0;
  text-decoration: none;
  font-size: 1.25rem;
}
.account-refresh:hover { color: #fff; border-color: #526fff; }

.account-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 8px;
}

.account-table {
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0 2px;
}

.account-table th {
  height: 42px;
  padding: 0 13px;
  color: #6577b2;
  text-align: left;
  white-space: nowrap;
  font: 500 .76rem var(--font-display);
}

.account-table td {
  height: 56px;
  padding: 8px 13px;
  color: #8999cc;
  background: rgba(29, 37, 79, .38);
  vertical-align: middle;
  font-size: .78rem;
}

.account-table td:first-child { border-radius: 7px 0 0 7px; }
.account-table td:last-child { border-radius: 0 7px 7px 0; }
.account-table td > strong { color: #f7f8ff; font-weight: 700; }
.account-record-id { font-family: var(--font-mono); font-size: .76rem; }
.account-row-subtitle {
  display: block;
  margin-top: 2px;
  color: #6475ae;
  font-size: .67rem;
}

.account-amount {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #a5afd2;
  white-space: nowrap;
  font: 700 .8rem var(--font-display);
  font-variant-numeric: tabular-nums;
}
.account-amount.positive { color: #0ed8df; }
.account-amount.negative { color: #9ba6cf; }
.account-amount .gold-token-icon { width: 16px; height: 16px; }

.account-details { position: relative; }
.account-details summary {
  list-style: none;
  color: #f8f9ff;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 700;
}
.account-details summary::-webkit-details-marker { display: none; }
.account-details[open] > div {
  position: relative;
  display: grid;
  min-width: 225px;
  gap: 9px;
  margin-top: 9px;
  padding: 14px;
  border: 1px solid rgba(91, 109, 191, .28);
  border-radius: 8px;
  background: #171d42;
  box-shadow: 0 14px 30px rgba(4, 7, 28, .42);
}
.account-details div span { display: flex; justify-content: space-between; gap: 18px; }
.account-details div b { color: #7889c0; }

.account-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 26px;
  padding-left: 13px;
}
.account-pagination a,
.account-pagination span {
  display: grid;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  place-items: center;
  border-radius: 7px;
  color: #6073b4;
  text-decoration: none;
  font: 600 .78rem var(--font-display);
}
.account-pagination a:hover { color: #fff; background: #2b376e; }
.account-pagination a.active { color: #fff; background: #4262ff; }

.account-empty-state {
  display: flex;
  min-height: 128px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #687ab7;
  text-align: center;
}
.account-empty-state strong { color: #aab5dc; font-size: .84rem; }
.account-empty-state span { max-width: 360px; font-size: .74rem; }

.account-status {
  display: inline-flex;
  align-items: center;
  color: #8d9ac7;
  font: 700 .7rem var(--font-display);
  letter-spacing: .03em;
}
.account-status.completed { color: #0fd8df; }
.account-status.pending { color: #ffbc35; }
.account-status.processing { color: #7d94ff; }
.account-status.cancelled { color: #f06d8d; }
.account-status.rejected { color: #ff7189; }

.account-info-card,
.account-action-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(91, 108, 190, .18);
  border-radius: 9px;
  background: rgba(31, 40, 84, .58);
}
.account-info-card > div,
.account-action-card > div:first-child { display: grid; gap: 4px; }
.account-info-card strong,
.account-action-card label { color: #fff; font: 700 .84rem var(--font-display); }
.account-info-card span,
.account-action-card span { color: #7688c0; font-size: .72rem; }

.web-deposit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.web-deposit-planner,
.web-deposit-instructions,
.web-verification-card {
  min-width: 0;
  min-height: 288px;
  padding: 22px;
  border: 1px solid rgba(91, 110, 196, .16);
  border-radius: 10px;
  background:
    radial-gradient(circle at 100% 0, rgba(66, 98, 255, .1), transparent 32%),
    rgba(30, 38, 80, .66);
  box-shadow: 0 14px 34px rgba(4, 8, 32, .1);
}

.web-deposit-card-heading > span,
.account-deposit-history-heading > div > span {
  display: block;
  color: #5e73b6;
  font: 800 .59rem var(--font-display);
  letter-spacing: .13em;
}

.web-deposit-card-heading h3,
.account-deposit-history-heading h3 {
  margin: 5px 0 0;
  color: #fff;
  font: 700 1rem var(--font-display);
}

.web-deposit-card-heading p {
  margin: 7px 0 0;
  color: #7586bd;
  font-size: .7rem;
  line-height: 1.5;
}

.web-deposit-planner > label,
.web-verification-start label {
  display: block;
  margin: 18px 0 7px;
  color: #8a9acb;
  font: 600 .69rem var(--font-display);
}

.web-deposit-quantity-row,
.web-verification-start > div,
.web-verification-command {
  display: flex;
  min-height: 42px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(96, 115, 200, .25);
  border-radius: 7px;
  background: #222b5d;
}

.web-deposit-quantity-row:focus-within,
.web-verification-start > div:focus-within {
  border-color: #4d6cff;
  box-shadow: 0 0 0 3px rgba(66, 98, 255, .1);
}

.web-deposit-quantity-row input,
.web-verification-start input {
  min-width: 0;
  flex: 1;
  height: 40px;
  padding: 0 13px;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font: 700 .8rem var(--font-display);
}

.web-deposit-quantity-row > span {
  max-width: 50%;
  padding: 0 12px;
  overflow: hidden;
  color: #7587c1;
  font-size: .67rem;
  text-overflow: ellipsis;
  text-transform: capitalize;
  white-space: nowrap;
}

.web-deposit-estimate {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 0 13px;
  border-radius: 7px;
  background: rgba(19, 26, 61, .48);
}

.web-deposit-estimate > span { color: #6d7fbb; font-size: .67rem; }
.web-deposit-estimate strong {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #ffbd35;
  font: 800 .94rem var(--font-display);
}
.web-deposit-estimate strong b { font: inherit; }
.web-deposit-estimate .gold-token-icon { width: 18px; height: 18px; }

.web-deposit-planner > button,
.web-verification-start button,
.web-verification-actions button {
  width: 100%;
  height: 42px;
  margin: 12px 0 0;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: #4262ff;
  box-shadow: none;
  font: 700 .75rem var(--font-display);
}

.web-deposit-planner > button:hover,
.web-verification-start button:hover,
.web-verification-actions button:hover { background: #5672ff; transform: none; box-shadow: none; }
.web-deposit-planner > button:disabled { cursor: wait; opacity: .55; }

.web-deposit-instructions ol {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.web-deposit-instructions li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.web-deposit-instructions li > b {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 7px;
  color: #aebcff;
  background: #2e3c7c;
  font: 800 .67rem var(--font-display);
}

.web-deposit-instructions li > span {
  color: #7f90c7;
  font-size: .7rem;
  line-height: 1.35;
}
.web-deposit-instructions li strong { color: #dce3ff; }

.web-deposit-monitor {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 64px;
  align-items: center;
  gap: 13px;
  margin-bottom: 16px;
  padding: 11px 14px;
  border: 1px solid rgba(255, 188, 53, .23);
  border-radius: 9px;
  background: rgba(133, 89, 19, .12);
}
.web-deposit-monitor[hidden] { display: none; }
.web-deposit-monitor.success { border-color: rgba(34, 211, 166, .25); background: rgba(19, 128, 96, .12); }
.web-deposit-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 188, 53, .2);
  border-top-color: #ffbd35;
  border-radius: 50%;
  animation: web-deposit-spin .85s linear infinite;
}
.web-deposit-monitor.success .web-deposit-spinner { border: 0; background: #24c99c; animation: none; }
.web-deposit-monitor.success .web-deposit-spinner::after { content: '✓'; display: grid; height: 100%; place-items: center; color: #fff; font-size: .7rem; }
@keyframes web-deposit-spin { to { transform: rotate(360deg); } }
.web-deposit-monitor strong { display: block; color: #fff; font-size: .76rem; }
.web-deposit-monitor p { margin: 3px 0 0; color: #8191c5; font-size: .68rem; }
.web-deposit-monitor > button {
  margin: 0;
  padding: 6px 9px;
  border: 0;
  color: #9cabd7;
  background: transparent;
  box-shadow: none;
  font-size: .67rem;
}

.web-verification-card {
  min-height: 0;
  margin-bottom: 16px;
}
.web-verification-card.active { border-color: rgba(75, 101, 255, .28); }
.web-verification-start { max-width: 560px; }
.web-verification-start > div { overflow: visible; background: transparent; border: 0; gap: 9px; box-shadow: none !important; }
.web-verification-start input { border: 1px solid rgba(96, 115, 200, .25); border-radius: 7px; background: #222b5d; }
.web-verification-start button { width: auto; min-width: 150px; margin: 0; }
.web-verification-command {
  max-width: 640px;
  margin-top: 18px;
}
.web-verification-command code {
  min-width: 0;
  flex: 1;
  padding: 0 14px;
  overflow: hidden;
  color: #ffcb57;
  font: 700 .78rem var(--font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.web-verification-command button {
  align-self: stretch;
  min-width: 78px;
  margin: 0;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: #344990;
  box-shadow: none;
  font: 700 .7rem var(--font-display);
}
.web-verification-actions { display: flex; gap: 9px; margin-top: 12px; }
.web-verification-actions form { margin: 0; }
.web-verification-actions button { width: auto; margin: 0; }
.web-verification-actions button.secondary { color: #9ca9d4; background: #303966; }
.web-verification-expiry { margin: 12px 0 0; color: #6678b1; font-size: .66rem; }

.account-deposit-history-heading {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 2px;
}
.account-deposit-history-heading h3 { font-size: .9rem; }
.account-deposit-history-heading small { color: #6476b0; font-size: .65rem; text-transform: capitalize; }

.account-action-controls { display: flex; align-items: center; gap: 10px; }
.account-gold-input {
  display: flex;
  width: 150px;
  height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid rgba(96, 115, 200, .25);
  border-radius: 6px;
  background: #242d62;
}
.account-gold-input .gold-token-icon { width: 19px; height: 19px; }
.account-gold-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font: 700 .84rem var(--font-display);
}
.account-action-controls > button,
.account-settings-actions button,
.account-xp-package button {
  height: 42px;
  margin: 0;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: #4262ff;
  box-shadow: none;
  font: 700 .78rem var(--font-display);
}
.account-action-controls > button:hover,
.account-settings-actions button:hover,
.account-xp-package button:hover { background: #5571ff; transform: none; box-shadow: none; }
.account-action-controls > button:disabled,
.account-xp-package button:disabled { cursor: not-allowed; opacity: .42; }
.withdrawal-request-form {
  width: 100%;
  max-width: none;
  align-items: stretch;
  flex-direction: column;
  box-sizing: border-box;
}
.withdrawal-request-heading strong {
  color: #fff;
  font: 700 .9rem var(--font-display);
}
.withdrawal-request-fields {
  display: grid;
  grid-template-columns: minmax(120px, .65fr) minmax(160px, 1fr);
  align-items: end;
  gap: 12px;
  width: 100%;
}
.withdrawal-request-field {
  display: grid;
  min-width: 0;
  gap: 7px;
}
.account-action-card .withdrawal-request-field > span:first-child {
  min-height: 15px;
  color: #91a0cf;
  font: 600 .67rem var(--font-display);
}
.withdrawal-request-field > input,
.withdrawal-request-field > select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(96, 115, 200, .25);
  border-radius: 6px;
  outline: 0;
  color: #fff;
  background: #242d62;
  font: 700 .76rem var(--font-display);
}
.withdrawal-request-field > input:focus,
.withdrawal-request-field > select:focus,
.withdrawal-request-field .account-gold-input:focus-within {
  border-color: #4d6cff;
  box-shadow: 0 0 0 3px rgba(66, 98, 255, .1);
}
.withdrawal-request-field .account-gold-input { width: 100%; }
.withdrawal-request-field > select { cursor: pointer; }
.withdrawal-request-fields > button {
  grid-column: 1 / -1;
  height: 42px;
  margin: 0;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: #4262ff;
  box-shadow: none;
  font: 700 .78rem var(--font-display);
}
.withdrawal-request-fields > button:hover { background: #5571ff; transform: none; box-shadow: none; }
.withdrawal-request-fields > button:disabled { cursor: not-allowed; opacity: .42; }
.account-disclaimer { margin: 8px 0 16px; color: #6576ae; font-size: .7rem; }
.account-link-button {
  margin: 0;
  padding: 0;
  border: 0;
  color: #6d85ff;
  background: transparent;
  box-shadow: none;
  font: 700 .75rem var(--font-display);
}
.account-link-button:hover { color: #fff; transform: none; box-shadow: none; }

.account-notice {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -18px 0 20px;
  padding: 0 14px;
  border: 1px solid rgba(34, 197, 94, .26);
  border-radius: 7px;
  color: #baf5d1;
  background: rgba(22, 126, 79, .16);
  font-size: .76rem;
}
.account-notice.error { border-color: rgba(239, 68, 68, .28); color: #ffc1ce; background: rgba(164, 42, 71, .16); }
.account-notice button { margin: 0; padding: 0; border: 0; color: inherit; background: transparent; box-shadow: none; font-size: 1.15rem; }

.withdrawal-success-dialog {
  width: min(430px, calc(100% - 28px));
  max-width: none;
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
}
.withdrawal-success-dialog::backdrop {
  background: rgba(5, 8, 28, .76);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.withdrawal-success-card {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 34px 34px 30px;
  overflow: hidden;
  border: 1px solid rgba(106, 127, 224, .22);
  border-radius: 16px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0, rgba(79, 103, 224, .2), transparent 40%),
    #202650;
  box-shadow: 0 28px 80px rgba(2, 5, 22, .62), 0 0 0 1px rgba(255, 255, 255, .025) inset;
  animation: withdrawal-dialog-in 220ms cubic-bezier(.16, 1, .3, 1);
}
@keyframes withdrawal-dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.withdrawal-success-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  color: #8997c7;
  background: transparent;
  box-shadow: none;
  font-size: 1.3rem;
}
.withdrawal-success-close:hover { color: #fff; background: transparent; box-shadow: none; transform: none; }
.withdrawal-success-icon {
  display: grid;
  width: 66px;
  height: 66px;
  margin-bottom: 19px;
  place-items: center;
  border: 1px solid rgba(99, 124, 255, .34);
  border-radius: 18px;
  color: #8fa3ff;
  background: rgba(66, 98, 255, .13);
  box-shadow: 0 0 32px rgba(66, 98, 255, .14);
}
.withdrawal-success-icon svg { width: 38px; height: 38px; }
.withdrawal-success-eyebrow {
  color: #7f92ed;
  font: 700 .68rem var(--font-display);
  letter-spacing: .13em;
  text-transform: uppercase;
}
.withdrawal-success-card h2 {
  margin: 7px 0 10px;
  color: #fff;
  font: 800 1.3rem var(--font-display);
}
.withdrawal-success-card p {
  max-width: 330px;
  margin: 0;
  color: #d8def8;
  font-size: .88rem;
  line-height: 1.55;
}
.withdrawal-success-card small {
  max-width: 320px;
  margin-top: 10px;
  color: #7989bd;
  font-size: .7rem;
  line-height: 1.5;
}
.withdrawal-success-confirm {
  width: 100%;
  height: 43px;
  margin: 24px 0 0;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: #4262ff;
  box-shadow: 0 10px 24px rgba(31, 54, 179, .25);
  font: 700 .78rem var(--font-display);
}
.withdrawal-success-confirm:hover { background: #5571ff; box-shadow: 0 10px 24px rgba(31, 54, 179, .3); transform: none; }
.withdrawal-success-close:focus-visible,
.withdrawal-success-confirm:focus-visible {
  outline: 2px solid #9aabff;
  outline-offset: 3px;
}

@media (max-width: 480px) {
  .withdrawal-success-card { padding: 30px 22px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .withdrawal-success-card { animation: none; }
}

.account-settings-form {
  display: grid;
  gap: 10px;
  max-width: 720px;
}
.account-setting-row {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 13px 17px;
  border: 1px solid rgba(91, 109, 191, .15);
  border-radius: 9px;
  background: rgba(31, 40, 84, .58);
  cursor: pointer;
}
.account-setting-row > span { display: grid; gap: 4px; }
.account-setting-row strong { color: #fff; font: 700 .84rem var(--font-display); }
.account-setting-row small { color: #7586bd; font-size: .72rem; }
.account-setting-row input { position: absolute; opacity: 0; pointer-events: none; }
.account-setting-row i {
  position: relative;
  width: 42px;
  height: 23px;
  flex: 0 0 42px;
  border-radius: 99px;
  background: #313b70;
  transition: background .15s ease;
}
.account-setting-row i::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #a4b0dc;
  transition: transform .15s ease, background .15s ease;
}
.account-setting-row input:checked + i { background: #4262ff; }
.account-setting-row input:checked + i::after { background: #fff; transform: translateX(19px); }
.account-setting-row input:focus-visible + i { outline: 2px solid #8fa3ff; outline-offset: 3px; }
.account-settings-actions { display: flex; align-items: center; gap: 18px; margin-top: 12px; }
.account-settings-actions a { color: #f27691; text-decoration: none; font: 700 .76rem var(--font-display); }

.account-level-badge {
  padding: 8px 13px;
  border-radius: 7px;
  color: #fff;
  background: #32468f;
  font: 700 .76rem var(--font-display);
}
.account-level-progress {
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid rgba(91, 109, 191, .15);
  border-radius: 9px;
  background: rgba(31, 40, 84, .58);
}
.account-level-progress > div { display: flex; justify-content: space-between; margin-bottom: 10px; color: #8d9dcc; font-size: .74rem; }
.account-level-progress > div span { color: #fff; font-weight: 700; }
.account-level-progress i { display: block; height: 8px; overflow: hidden; border-radius: 99px; background: #202958; }
.account-level-progress b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4262ff, #09c9df); }
.account-xp-packages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.account-xp-package {
  position: relative;
  display: flex;
  min-height: 220px;
  flex-direction: column;
  padding: 20px;
  border: 1px solid rgba(91, 109, 191, .16);
  border-radius: 10px;
  background: rgba(31, 40, 84, .62);
}
.account-xp-package.featured { border-color: rgba(66, 98, 255, .62); box-shadow: 0 0 24px rgba(66, 98, 255, .12); }
.account-package-badge { position: absolute; top: 11px; right: 11px; color: #93a7ff; font: 800 .57rem var(--font-display); letter-spacing: .08em; }
.account-xp-package > span { color: #8292c7; font: 600 .75rem var(--font-display); }
.account-xp-package > strong { margin-top: 10px; color: #fff; font: 700 1.45rem var(--font-display); }
.account-xp-package p { flex: 1; color: #7182b8; font-size: .7rem; }
.account-xp-package form,
.account-xp-package button { width: 100%; }

/* Saved account preferences apply across every dashboard page. */
html[data-animations-enabled='false'] *,
html[data-animations-enabled='false'] *::before,
html[data-animations-enabled='false'] *::after {
  scroll-behavior: auto !important;
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
}

html[data-chat-visible='false'] .app-shell {
  grid-template-columns: 138px minmax(0, 1fr);
  grid-template-areas: 'topbar topbar' 'sidebar main';
}
html[data-chat-visible='false'] .chat-panel { display: none !important; }
html[data-compact-mode='true'] .sidebar-link { min-height: 68px; gap: 4px; }
html[data-compact-mode='true'] .dash-main { padding-top: 12px; }
html[data-compact-mode='true'] .live-feed { padding-top: 20px; }

@media (max-width: 1500px) {
  .app-shell:has(.account-main) {
    grid-template-columns: 138px minmax(0, 1fr);
    grid-template-areas: 'topbar topbar' 'sidebar main';
  }
  .app-shell:has(.account-main) > .chat-panel { display: none; }
  .account-page { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 28px; }
  .account-summary-card { padding-inline: 30px; }
}

@media (max-width: 1120px) {
  .account-page { grid-template-columns: 1fr; }
  .account-summary-card { width: 100%; min-height: 0; }
  .account-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 30px; }
  .account-summary-note { text-align: left; }
}

@media (max-width: 760px) {
  .app-shell:has(.account-main) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'topbar' 'main';
  }
  .app-shell:has(.account-main) > .sidebar { display: none; }
  .account-main { padding-top: 12px; }
  .account-page { width: calc(100% - 24px); gap: 20px; }
  .account-summary-card { padding: 24px 20px; }
  .account-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-tabs { margin-bottom: 22px; }
  .account-panel-header { align-items: center; }
  .account-action-card,
  .account-info-card { align-items: stretch; flex-direction: column; }
  .account-action-controls { align-items: stretch; flex-direction: column; }
  .account-gold-input { width: 100%; }
  .withdrawal-request-fields { grid-template-columns: 1fr; }
  .withdrawal-request-fields > button { grid-column: auto; }
  .account-xp-packages { grid-template-columns: 1fr; }
  .account-xp-package { min-height: 190px; }
  .web-deposit-grid { grid-template-columns: 1fr; }
  .web-deposit-planner,
  .web-deposit-instructions { min-height: 0; }
  .web-verification-start > div { align-items: stretch; flex-direction: column; }
  .web-verification-start button { width: 100%; }
}

@media (max-width: 480px) {
  .account-stats { gap: 18px; }
  .account-stats dd { font-size: 1.4rem; }
  .account-tabs a { padding-inline: 12px; }
  .account-setting-row { align-items: flex-start; }
  .web-deposit-monitor { grid-template-columns: auto minmax(0, 1fr); }
  .web-deposit-monitor > button { grid-column: 2; justify-self: start; padding-left: 0; }
  .web-verification-actions { align-items: stretch; flex-direction: column; }
  .web-verification-actions form,
  .web-verification-actions button { width: 100%; }
  .account-deposit-history-heading { align-items: flex-start; flex-direction: column; justify-content: center; }
}

/* ============ Affiliates ============ */
.affiliate-main {
  min-width: 0;
  padding: var(--game-ui-gutter) 0 44px;
}

.affiliate-page {
  width: calc(100% - (var(--game-ui-gutter) * 2));
  max-width: 1380px;
  margin: 0 auto;
}

.affiliate-layout {
  display: grid;
  grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.affiliate-side {
  display: grid;
  gap: 14px;
}

.affiliate-card,
.affiliate-hero-grid article {
  border: 1px solid rgba(92, 108, 188, .12);
  border-radius: 12px;
  background: rgba(33, 38, 74, .94);
  box-shadow: 0 18px 40px rgba(4, 8, 32, .14);
}

.affiliate-card {
  padding: 24px;
}

.affiliate-code-card header,
.affiliate-list-header,
.affiliate-balance-card > div:first-child,
.affiliate-redeem-card > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.affiliate-card header > div:first-child > span,
.affiliate-balance-card > div:first-child > span,
.affiliate-redeem-card > div:first-child > span,
.affiliate-list-header > div:first-child > span {
  color: #5f72af;
  font: 700 .61rem var(--font-display);
  letter-spacing: .14em;
}

.affiliate-code-card h1,
.affiliate-card h2,
.affiliate-list-header h2 {
  margin: 4px 0 0;
  color: #fff;
  font: 500 1.22rem var(--font-display);
}

.affiliate-profile-avatar {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  overflow: visible;
  border: 2px solid rgba(103, 119, 203, .3);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #eeb943, #a64c28 55%, #25254a 56%);
  box-shadow: 0 0 0 4px rgba(13, 18, 56, .35);
  font: 800 1rem var(--font-display);
}

.affiliate-profile-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.affiliate-profile-avatar b {
  position: absolute;
  top: -5px;
  right: -7px;
  z-index: 2;
  display: grid;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  place-items: center;
  border: 2px solid #22294f;
  border-radius: 99px;
  color: #fff;
  background: #7684b5;
  font: 800 .62rem var(--font-display);
}

.affiliate-code-card label,
.affiliate-redeem-card label {
  display: block;
  margin: 19px 0 7px;
  color: #8292c8;
  font: 500 .74rem var(--font-display);
}

.affiliate-code-form > div,
.affiliate-copy-field,
.affiliate-redeem-card form > div {
  display: flex;
  height: 44px;
  overflow: hidden;
  border: 1px solid rgba(92, 111, 199, .24);
  border-radius: 7px;
  background: #252e61;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.affiliate-code-form > div:focus-within,
.affiliate-redeem-card form > div:focus-within {
  border-color: #4d6cff;
  box-shadow: 0 0 0 3px rgba(66, 98, 255, .12);
}

.affiliate-code-form input,
.affiliate-copy-field input,
.affiliate-redeem-card input {
  min-width: 0;
  flex: 1;
  padding: 0 13px;
  border: 0;
  outline: 0;
  color: #f6f8ff;
  background: transparent;
  font: 700 .78rem var(--font-display);
}

.affiliate-copy-field input {
  color: #aeb9df;
  font-weight: 500;
}

.affiliate-code-form button,
.affiliate-copy-field button,
.affiliate-redeem-card form button {
  min-width: 70px;
  margin: 0;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: #354c9f;
  box-shadow: none;
  font: 700 .72rem var(--font-display);
}

.affiliate-code-form button:hover,
.affiliate-copy-field button:hover,
.affiliate-redeem-card form button:hover {
  background: #4262ff;
  transform: none;
  box-shadow: none;
}

.affiliate-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.affiliate-stat-grid article {
  display: grid;
  min-height: 100px;
  grid-template-columns: auto 1fr;
  align-content: center;
  padding: 17px 20px;
  border: 1px solid rgba(92, 108, 188, .12);
  border-radius: 10px;
  background: rgba(33, 38, 74, .9);
}

.affiliate-stat-grid span {
  grid-column: 1 / -1;
  color: #8293c9;
  font-size: .73rem;
}

.affiliate-stat-grid strong {
  color: #fff;
  font: 500 1.7rem var(--font-display);
}

.affiliate-stat-grid small {
  align-self: end;
  margin: 0 0 5px 8px;
  color: #6173ae;
  font-size: .66rem;
}

.affiliate-redeem-card form { margin-top: 14px; }
.affiliate-connected-code {
  display: flex;
  height: 46px;
  align-items: center;
  justify-content: space-between;
  margin-top: 17px;
  padding: 0 14px;
  border: 1px solid rgba(39, 205, 193, .2);
  border-radius: 7px;
  background: rgba(20, 151, 151, .09);
}
.affiliate-connected-code span { color: #7e90c7; font-size: .72rem; }
.affiliate-connected-code strong { color: #24d6d3; font: 800 .78rem var(--font-display); }

.affiliate-balance-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 22px 0 18px;
}

.affiliate-balance-card dl div { min-width: 0; }
.affiliate-balance-card dt { color: #8090c5; font-size: .71rem; }
.affiliate-balance-card dd {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 3px 0 0;
  color: #fff;
  font: 600 1.34rem var(--font-display);
}
.affiliate-balance-card dd .gold-token-icon { width: 18px; height: 18px; }
.affiliate-balance-card form,
.affiliate-balance-card form button { width: 100%; }
.affiliate-balance-card form button {
  height: 44px;
  margin: 0;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: #4262ff;
  box-shadow: none;
  font: 700 .77rem var(--font-display);
}
.affiliate-balance-card form button:hover { background: #5571ff; transform: none; box-shadow: none; }
.affiliate-balance-card form button:disabled { cursor: not-allowed; opacity: .38; }

.affiliate-workspace { min-width: 0; }
.affiliate-hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.affiliate-hero-grid article {
  position: relative;
  min-height: 230px;
  overflow: hidden;
  padding: 28px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(66, 98, 255, .18), transparent 34%),
    rgba(33, 38, 74, .92);
}

.affiliate-hero-grid article::after {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  top: -92px;
  right: -65px;
  border: 26px solid rgba(105, 81, 219, .08);
  border-radius: 50%;
}

.affiliate-hero-icon {
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #ffb329;
  filter: drop-shadow(0 10px 18px rgba(255, 162, 27, .18));
}
.affiliate-hero-icon .gold-token-icon { width: 58px; height: 58px; transform: rotate(-11deg); }
.affiliate-hero-icon .gold-token-icon:last-child { width: 45px; height: 45px; transform: rotate(13deg) translateY(12px); }
.affiliate-hero-icon b { color: #ffcf51; font-size: 1.5rem; }
.affiliate-rate {
  min-height: 86px;
  color: #ffad27;
  text-shadow: 0 0 26px rgba(255, 155, 25, .24);
  font: 800 4.2rem/1 var(--font-display);
}
.affiliate-rate span { font-size: 1.65rem; }
.affiliate-hero-grid h2 { margin: 12px 0 5px; color: #fff; font: 600 1rem var(--font-display); }
.affiliate-hero-grid p { max-width: 380px; margin: 0 auto; color: #8293ca; font-size: .73rem; }

.affiliate-tabs {
  display: flex;
  min-height: 66px;
  align-items: flex-end;
  gap: 8px;
  border-bottom: 1px solid rgba(89, 108, 192, .18);
}
.affiliate-tabs span,
.affiliate-tabs strong {
  display: inline-flex;
  height: 42px;
  align-items: center;
  padding: 0 16px;
  color: #7385c0;
  font: 600 .74rem var(--font-display);
}
.affiliate-tabs strong { border-radius: 6px 6px 0 0; color: #fff; background: rgba(42, 53, 103, .78); }

.affiliate-list-header {
  min-height: 86px;
}
.affiliate-list-header > div:last-child { text-align: right; }
.affiliate-list-header > div:last-child span { display: block; color: #6476b0; font-size: .67rem; }
.affiliate-list-header > div:last-child strong { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 4px; color: #fff; font-size: .8rem; }
.affiliate-list-header .gold-token-icon { width: 15px; height: 15px; }

.affiliate-table-wrap { width: 100%; overflow-x: auto; border-radius: 10px; }
.affiliate-table { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0 3px; }
.affiliate-table th { height: 38px; padding: 0 14px; color: #6375b1; text-align: left; font: 500 .7rem var(--font-display); }
.affiliate-table td { height: 58px; padding: 8px 14px; color: #8999cd; background: rgba(29, 37, 79, .5); font-size: .74rem; }
.affiliate-table td:first-child { display: flex; align-items: center; gap: 10px; border-radius: 7px 0 0 7px; }
.affiliate-table td:last-child { border-radius: 0 7px 7px 0; }
.affiliate-table td > strong { color: #fff; }
.affiliate-table td .gold-token-icon { width: 15px; height: 15px; }
.affiliate-table .affiliate-earned { color: #18d9d4; font-weight: 700; }
.affiliate-user-avatar { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: #fff; background: #34427d; font: 800 .72rem var(--font-display); }
.affiliate-empty { display: flex; min-height: 140px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; text-align: center; }
.affiliate-empty strong { color: #aab5dc; font-size: .82rem; }
.affiliate-empty span { color: #6678b3; font-size: .71rem; }

.affiliate-notice {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 0 16px;
  border: 1px solid rgba(34, 197, 94, .28);
  border-radius: 8px;
  color: #c2f5d4;
  background: rgba(22, 126, 79, .18);
  font-size: .75rem;
}
.affiliate-notice.error { border-color: rgba(239, 68, 68, .28); color: #ffc2cf; background: rgba(164, 42, 71, .18); }
.affiliate-notice button { margin: 0; padding: 0; border: 0; color: inherit; background: transparent; box-shadow: none; font-size: 1.15rem; }

@media (max-width: 1600px) {
  .app-shell:has(.affiliate-main) { grid-template-columns: 138px minmax(0, 1fr); grid-template-areas: 'topbar topbar' 'sidebar main'; }
  .app-shell:has(.affiliate-main) > .chat-panel { display: none; }
}

@media (max-width: 1120px) {
  .affiliate-layout { grid-template-columns: 1fr; }
  .affiliate-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .affiliate-code-card { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .app-shell:has(.affiliate-main) { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'topbar' 'main'; }
  .app-shell:has(.affiliate-main) > .sidebar { display: none; }
  .affiliate-main { padding-top: 12px; }
  .affiliate-page { width: calc(100% - 24px); }
  .affiliate-side,
  .affiliate-hero-grid { grid-template-columns: 1fr; }
  .affiliate-stat-grid { grid-column: 1; }
  .affiliate-code-card { grid-column: auto; }
  .affiliate-hero-grid article { min-height: 210px; }
}

@media (max-width: 480px) {
  .affiliate-card { padding: 20px; }
  .affiliate-stat-grid { grid-template-columns: 1fr; }
  .affiliate-balance-card dl { gap: 12px; }
  .affiliate-balance-card dd { font-size: 1.08rem; }
  .affiliate-tabs span,
  .affiliate-tabs strong { padding-inline: 11px; }
}

/* ============ Rewards ============ */
.rewards-main {
  min-width: 0;
  padding: var(--game-ui-gutter) 0 48px;
}

.rewards-page {
  width: calc(100% - (var(--game-ui-gutter) * 2));
  max-width: 1380px;
  margin: 0 auto;
}

.rewards-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-bottom: 20px;
}

.rewards-tabs a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #8293cc;
  text-decoration: none;
  font: 600 .78rem var(--font-display);
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.rewards-tabs a:hover { color: #fff; }
.rewards-tabs a.active {
  color: #fff;
  background: rgba(44, 54, 103, .88);
  border-color: rgba(99, 116, 198, .12);
  box-shadow: 0 8px 22px rgba(5, 8, 30, .14);
}

.rewards-panel {
  min-width: 0;
}

.rakeback-hero {
  display: flex;
  min-height: 190px;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 18px;
  padding: 34px 40px;
  overflow: hidden;
  border: 1px solid rgba(94, 110, 191, .12);
  border-radius: 13px;
  background:
    radial-gradient(circle at 82% 22%, rgba(72, 100, 255, .2), transparent 27%),
    radial-gradient(circle at 12% 115%, rgba(89, 61, 176, .2), transparent 32%),
    rgba(32, 38, 76, .94);
  box-shadow: 0 18px 42px rgba(4, 8, 32, .14);
}

.rakeback-hero > div:first-child { max-width: 600px; }
.rakeback-hero > div:first-child > span,
.level-progress-kicker,
.level-rewards-heading > div > span {
  display: block;
  margin-bottom: 6px;
  color: #6377b9;
  font: 800 .62rem var(--font-display);
  letter-spacing: .14em;
}
.rakeback-hero h1,
.level-rewards-heading h1 {
  margin: 0;
  color: #fff;
  font: 600 1.6rem var(--font-display);
}
.rakeback-hero p { max-width: 560px; margin: 10px 0 0; color: #8797ca; font-size: .76rem; }
.rakeback-hero-value {
  display: grid;
  min-width: 245px;
  min-height: 105px;
  align-content: center;
  padding: 20px 24px;
  border: 1px solid rgba(83, 108, 224, .28);
  border-radius: 10px;
  background: rgba(29, 38, 84, .78);
  box-shadow: inset 0 1px rgba(255, 255, 255, .025), 0 0 28px rgba(53, 77, 192, .1);
}
.rakeback-hero-value > span { color: #8192c7; font-size: .72rem; }
.rakeback-hero-value > strong { display: flex; align-items: center; gap: 9px; margin-top: 5px; color: #fff; font: 700 1.55rem var(--font-display); }
.rakeback-hero-value .gold-token-icon { width: 24px; height: 24px; }

.rakeback-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.rakeback-grid article {
  position: relative;
  min-height: 205px;
  overflow: hidden;
  padding: 24px;
  border: 1px solid rgba(94, 110, 191, .12);
  border-radius: 11px;
  background: rgba(33, 38, 74, .94);
  box-shadow: 0 16px 36px rgba(4, 8, 32, .12);
}

.rakeback-grid article::after {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  top: -76px;
  right: -60px;
  border: 22px solid rgba(76, 96, 213, .07);
  border-radius: 50%;
}

.rakeback-main-card {
  display: flex;
  flex-direction: column;
}
.rakeback-card-icon { position: absolute; top: 20px; right: 20px; opacity: .22; filter: drop-shadow(0 0 12px rgba(255, 178, 34, .28)); }
.rakeback-card-icon .gold-token-icon { width: 52px; height: 52px; }
.rakeback-grid article > span { color: #8394ca; font: 600 .74rem var(--font-display); }
.rakeback-grid article > strong { display: flex; align-items: center; gap: 7px; margin-top: 9px; color: #fff; font: 700 1.35rem var(--font-display); }
.rakeback-grid article > strong .gold-token-icon { width: 19px; height: 19px; }
.rakeback-grid article > p { margin: 8px 0 0; color: #6477b4; font-size: .69rem; }
.rakeback-main-card form { width: 100%; margin-top: auto; padding-top: 18px; }
.rakeback-main-card button {
  width: 100%;
  height: 42px;
  margin: 0;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: #4262ff;
  box-shadow: none;
  font: 700 .76rem var(--font-display);
}
.rakeback-main-card button:hover { background: #5571ff; transform: none; box-shadow: none; }
.rakeback-main-card button:disabled { cursor: not-allowed; opacity: .38; }

.rakeback-period-card {
  transition: border-color .2s ease, box-shadow .2s ease;
}

.rakeback-period-card.claimable {
  border-color: rgba(57, 211, 169, .3);
  box-shadow: 0 16px 36px rgba(4, 8, 32, .12), inset 0 0 30px rgba(32, 190, 149, .035);
}

.rakeback-period-card.locked .rakeback-card-icon {
  filter: grayscale(.45) drop-shadow(0 0 12px rgba(99, 116, 198, .2));
  opacity: .13;
}

.rakeback-unlock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 35px;
  margin-top: 14px;
  padding: 0 10px;
  border: 1px solid rgba(100, 119, 204, .14);
  border-radius: 6px;
  background: rgba(20, 27, 62, .52);
}

.rakeback-unlock-row > span {
  color: #6578b6;
  font: 800 .56rem var(--font-display);
  letter-spacing: .1em;
}

.rakeback-unlock-row time {
  color: #9dacdd;
  font: 700 .67rem var(--font-mono);
  white-space: nowrap;
}

.rakeback-period-card.claimable .rakeback-unlock-row {
  border-color: rgba(48, 204, 159, .2);
  background: rgba(25, 115, 91, .12);
}

.rakeback-period-card.claimable .rakeback-unlock-row > span,
.rakeback-period-card.claimable .rakeback-unlock-row time {
  color: #54d7b1;
}

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

.rakeback-summary-grid article {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 17px;
  border: 1px solid rgba(94, 110, 191, .1);
  border-radius: 8px;
  background: rgba(29, 35, 72, .76);
}

.rakeback-summary-grid span {
  color: #6f80bb;
  font-size: .65rem;
}

.rakeback-summary-grid strong {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #c7d0f4;
  font: 700 .76rem var(--font-display);
}

.rakeback-summary-grid .gold-token-icon {
  width: 14px;
  height: 14px;
}

.level-progress-hero {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid rgba(94, 110, 191, .1);
  border-radius: 13px;
  background:
    radial-gradient(circle at 50% 40%, rgba(65, 91, 255, .19), transparent 29%),
    linear-gradient(90deg, rgba(34, 42, 86, .94), rgba(30, 38, 80, .9));
  box-shadow: 0 18px 42px rgba(4, 8, 32, .12);
}

.level-progress-orb {
  display: grid;
  width: 74px;
  height: 74px;
  margin-top: 4px;
  place-items: center;
  border: 3px solid #4262ff;
  border-radius: 50%;
  color: #fff;
  background: #293778;
  box-shadow: 0 0 0 4px rgba(13, 19, 59, .72), 0 0 34px rgba(66, 98, 255, .36);
}
.level-progress-orb strong { font: 700 1.5rem var(--font-display); }
.level-progress-hero > b { margin-top: 13px; padding: 5px 15px; border-radius: 7px; color: #fff; background: #4262ff; font: 700 .72rem var(--font-display); }
.level-progress-track { width: min(440px, calc(100% - 48px)); margin-top: 24px; }
.level-progress-track i { display: block; height: 9px; overflow: hidden; border-radius: 99px; background: #171e4a; }
.level-progress-track i span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #536df8, #4262ff); box-shadow: 0 0 12px rgba(66, 98, 255, .34); }
.level-progress-track > div { display: flex; justify-content: space-between; margin-top: 9px; color: #6578b5; font-size: .7rem; }
.level-progress-track > div strong { color: #fff; }
.level-progress-hero > p { margin: 12px 0 0; color: #697bb8; font-size: .68rem; }

.level-rewards-heading {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 16px;
}
.level-rewards-heading p { margin: 0; color: #6577b2; font-size: .7rem; }

.level-rewards-list {
  display: grid;
  gap: 7px;
}

.level-reward-row {
  display: grid;
  grid-template-columns: 50px minmax(160px, 1fr) minmax(120px, auto) 130px;
  min-height: 68px;
  align-items: center;
  gap: 14px;
  padding: 8px 15px;
  border: 1px solid rgba(88, 106, 192, .11);
  border-radius: 9px;
  background: rgba(29, 37, 79, .58);
  transition: border-color .15s ease, background .15s ease;
}
.level-reward-row.unlocked { border-color: rgba(66, 98, 255, .31); background: rgba(37, 48, 103, .74); }
.level-reward-row.claimed { opacity: .62; }
.level-reward-marker {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 2px solid #53659e;
  border-radius: 50%;
  color: #92a2d0;
  background: #202959;
  font: 800 .76rem var(--font-display);
}
.level-reward-row.unlocked .level-reward-marker { border-color: #4262ff; color: #fff; box-shadow: 0 0 16px rgba(66, 98, 255, .2); }
.level-reward-copy { display: grid; gap: 2px; }
.level-reward-copy strong { color: #f5f7ff; font: 700 .8rem var(--font-display); }
.level-reward-copy span { color: #687ab6; font-size: .67rem; }
.level-reward-prize { display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: #fff; font: 700 .86rem var(--font-display); }
.level-reward-prize .gold-token-icon { width: 18px; height: 18px; }
.level-reward-action { display: flex; justify-content: flex-end; }
.level-reward-action form { width: 100%; }
.level-reward-action button {
  width: 100%;
  height: 36px;
  margin: 0;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: #4262ff;
  box-shadow: none;
  font: 700 .71rem var(--font-display);
}
.level-reward-action button:hover { background: #5571ff; transform: none; box-shadow: none; }
.level-reward-action button:disabled { color: #8998c8; background: #303a6d; opacity: .78; cursor: default; }
.rewards-locked-label { color: #6678b4; text-align: right; font-size: .67rem; }

.rewards-notice {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 0 16px;
  border: 1px solid rgba(34, 197, 94, .28);
  border-radius: 8px;
  color: #c2f5d4;
  background: rgba(22, 126, 79, .18);
  font-size: .75rem;
}
.rewards-notice.error { border-color: rgba(239, 68, 68, .28); color: #ffc2cf; background: rgba(164, 42, 71, .18); }
.rewards-notice button { margin: 0; padding: 0; border: 0; color: inherit; background: transparent; box-shadow: none; font-size: 1.15rem; }

@media (max-width: 1600px) {
  .app-shell:has(.rewards-main) { grid-template-columns: 138px minmax(0, 1fr); grid-template-areas: 'topbar topbar' 'sidebar main'; }
  .app-shell:has(.rewards-main) > .chat-panel { display: none; }
}

@media (max-width: 1120px) {
  .rakeback-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rakeback-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app-shell:has(.rewards-main) { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'topbar' 'main'; }
  .app-shell:has(.rewards-main) > .sidebar { display: none; }
  .rewards-main { padding-top: 12px; }
  .rewards-page { width: calc(100% - 24px); }
  .rakeback-hero { align-items: stretch; flex-direction: column; padding: 28px 24px; }
  .rakeback-hero-value { min-width: 0; }
  .level-reward-row { grid-template-columns: 44px 1fr auto; }
  .level-reward-prize { grid-column: 2; justify-content: flex-start; }
  .level-reward-action { grid-column: 3; grid-row: 1 / span 2; }
}

@media (max-width: 520px) {
  .rakeback-grid { grid-template-columns: 1fr; }
  .rakeback-summary-grid { grid-template-columns: 1fr; }
  .level-rewards-heading { align-items: flex-start; flex-direction: column; gap: 5px; padding-block: 15px; }
  .level-reward-row { grid-template-columns: 42px 1fr; gap: 10px; }
  .level-reward-prize { grid-column: 2; }
  .level-reward-action { grid-column: 1 / -1; grid-row: auto; }
  .rewards-locked-label { width: 100%; text-align: left; padding-left: 52px; }
}

/* ============ Public User Profile Modal ============ */
.public-profile-trigger {
  cursor: pointer;
}

button.chat-msg-avatar,
button.chat-msg-user,
.feed-profile-trigger,
.affiliate-user-trigger {
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  color: inherit;
  background: transparent;
  box-shadow: none;
  text-align: inherit;
}

button.chat-msg-avatar:hover,
button.chat-msg-user:hover,
.feed-profile-trigger:hover,
.affiliate-user-trigger:hover {
  color: #fff;
  background: transparent;
  box-shadow: none;
  transform: none;
}

button.chat-msg-avatar:focus-visible,
button.chat-msg-user:focus-visible,
.feed-profile-trigger:focus-visible,
.affiliate-user-trigger:focus-visible {
  outline: 2px solid #5873ff;
  outline-offset: 3px;
}

button.chat-msg-avatar { display: block; }
button.chat-msg-user { font-family: inherit; }
.feed-profile-trigger {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 12px;
  font: inherit;
}
.feed-profile-trigger > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.affiliate-user-trigger { display: flex; align-items: center; gap: 10px; font: inherit; }
.affiliate-user-trigger strong { color: #fff; }

.user-profile-dialog {
  width: min(440px, calc(100% - 28px));
  max-width: none;
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
}

.user-profile-dialog::backdrop {
  background: rgba(6, 9, 31, .68);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.user-profile-card {
  position: relative;
  min-height: 338px;
  padding: 42px 46px 38px;
  overflow: hidden;
  border: 1px solid rgba(97, 114, 199, .14);
  border-radius: 13px;
  background:
    radial-gradient(circle at 20% 10%, rgba(71, 88, 180, .12), transparent 28%),
    #20264f;
  box-shadow: 0 28px 80px rgba(3, 6, 25, .52);
}

.user-profile-card::after {
  content: '';
  position: absolute;
  width: 150px;
  height: 150px;
  right: -96px;
  bottom: -95px;
  border: 26px solid rgba(67, 91, 211, .055);
  border-radius: 50%;
  pointer-events: none;
}

.user-profile-close {
  position: absolute;
  top: 25px;
  right: 31px;
  z-index: 2;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  color: #7888bd;
  background: transparent;
  box-shadow: none;
  font: 400 1.75rem/1 var(--font-body);
}
.user-profile-close:hover { color: #fff; background: rgba(75, 94, 180, .16); transform: none; box-shadow: none; }

.user-profile-header {
  display: flex;
  align-items: center;
  gap: 22px;
}

.user-profile-avatar {
  position: relative;
  display: grid;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  place-items: center;
  overflow: hidden;
  border: 2px solid rgba(101, 116, 196, .34);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #e1ac41, #9f4b2d 54%, #25264e 55%);
  box-shadow: 0 0 0 5px rgba(13, 19, 55, .35);
  font: 800 1.25rem var(--font-display);
}
.user-profile-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.user-profile-header h2 { margin: 0 0 5px; color: #fff; font: 500 1.45rem var(--font-display); }
.user-profile-header p { display: flex; align-items: center; gap: 7px; margin: 0; color: #91a0d5; font-size: .78rem; }
.user-profile-header p b { padding-left: 7px; border-left: 1px solid rgba(113, 130, 199, .25); color: #6f82c1; font-size: .68rem; font-weight: 600; }
.user-profile-rank-icon { color: #8898ca; font-size: 1rem; transform: rotate(45deg); }

.user-profile-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 42px;
  margin: 40px 0 0;
}
.user-profile-stats div { min-width: 0; }
.user-profile-stats dt { margin-bottom: 5px; color: #8697ce; font: 500 .78rem var(--font-display); }
.user-profile-stats dd { display: flex; align-items: center; gap: 7px; margin: 0; color: #fff; font: 500 1.65rem var(--font-display); font-variant-numeric: tabular-nums; }
.user-profile-stats .gold-token-icon { width: 18px; height: 18px; opacity: .75; }

.user-profile-loading,
.user-profile-error {
  display: grid;
  min-height: 250px;
  place-items: center;
  color: #7d8ec6;
  text-align: center;
  font-size: .8rem;
}
.user-profile-error { color: #f19aae; }
.user-profile-loading[hidden],
.user-profile-error[hidden],
.user-profile-content[hidden] { display: none !important; }

@media (max-width: 500px) {
  .user-profile-card { min-height: 320px; padding: 38px 26px 30px; }
  .user-profile-close { top: 18px; right: 20px; }
  .user-profile-header { gap: 16px; }
  .user-profile-avatar { width: 56px; height: 56px; flex-basis: 56px; }
  .user-profile-header h2 { font-size: 1.25rem; }
  .user-profile-stats { gap: 24px 18px; margin-top: 34px; }
  .user-profile-stats dd { font-size: 1.3rem; }
}
