/* =========================================================
   小创游戏厅 (Casino) - P3R 沉浸式牌桌样式表
   Visual Truth: P3R Dark Hour Navy, Electric Blue, Cyan & Barlow
   Zero NPM runtime · Pure CSS3 · Fully Responsive
   ========================================================= */

@font-face {
  font-family: Barlow;
  src: url('./assets/display.ttf') format('truetype');
  font-weight: 800;
  font-display: swap;
}

:root {
  /* P3R Color Palette */
  --blue: #0055ff;
  --blue-hover: #0044cc;
  --blue-deep: #002b80;
  --cyan: #79e7ff;
  --cyan-dim: #3eb5d6;
  --gold: #ffd000;
  --gold-dim: #b89600;
  --crimson: #ff385c;
  --crimson-dim: #991b32;
  --green: #00e599;
  --green-dim: #008f5d;

  /* Surfaces & Backgrounds */
  --bg-void: #030814;
  --bg-felt: #06132b;
  --bg-felt-deep: #040c1d;
  --bg-panel: #0b1a38;
  --bg-card: #0e2147;
  --bg-input: #08152e;

  /* Borders & Dividers (Full borders, never single side-stripes) */
  --border-subtle: #162c54;
  --border-bright: #2b5496;
  --border-focus: #ff9d00;

  /* Text Ramps (Verified Contrast >= 4.5:1 against dark backgrounds) */
  --text-pure: #ffffff;
  --text-heading: #eef4ff;
  --text-body: #c5d7f5;
  --text-muted: #7e95bd;
  --text-dim: #546a8f;

  /* Geometry & Spacing */
  --top-height: 74px;
  --control-height: 140px;
  --radius-sm: 4px;
  --radius-md: 8px;
}

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

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-void);
  color: var(--text-body);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Accessibility Focus Visible */
:focus-visible {
  outline: 3px solid var(--border-focus);
  outline-offset: 3px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-void);
}
::-webkit-scrollbar-thumb {
  background: var(--border-bright);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--cyan-dim);
}

/* Typography & Numbers */
.num-font {
  font-family: Barlow, "PingFang SC", sans-serif;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

h1, h2, h3, h4, p {
  margin: 0;
}

.brand,
.brand span,
.product-badge,
.game-tab,
.game-tab-name,
.drawer-btn,
.drawer-btn-text,
.stat-pill,
.stat-meta,
.stat-label,
.stat-val,
.user-badge,
.user-name,
.user-avatar,
.logout-btn,
.auth-btn,
.chip-btn,
.lev-btn,
.stepper-btn,
.toggle-math-btn,
.primary-play-btn,
.btn-play-text,
.drawer-tab,
.drawer-tab span,
.drawer-tab small,
.segment-label,
.segment-label span,
.payout-tag,
.payout-rate,
.history-label,
.history-pill {
  white-space: nowrap !important;
  flex-shrink: 0;
}

button, input, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: transparent;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
button:active {
  transform: scale(0.98);
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none !important;
}

/* Accessible Skip Link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  padding: 10px 16px;
  background: var(--cyan);
  color: var(--bg-void);
  font-weight: 800;
  z-index: 999;
}
.skip-link:focus {
  top: 10px;
}

/* =========================================================
   1. TOP NAVIGATION & STATUS BAR
   ========================================================= */
.casino-top {
  height: var(--top-height);
  background: var(--bg-void);
  border-bottom: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Brand */
.brand-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.brand {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-pure);
  text-decoration: none;
  display: flex;
  align-items: center;
  letter-spacing: -0.03em;
}
.brand span {
  color: var(--cyan);
}
.brand i {
  display: inline-block;
  background: var(--blue);
  width: 14px;
  height: 22px;
  transform: skew(-18deg);
  margin-left: 8px;
}
.product-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-felt);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  white-space: nowrap;
}

/* Center Game Navigation */
.game-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-felt-deep);
  padding: 4px;
  border: 1px solid var(--border-subtle);
}
.game-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: var(--text-muted);
  position: relative;
  transition: all 0.18s ease;
}
.game-tab-icon {
  font-size: 16px;
}
.game-tab-name {
  font-weight: 800;
  font-size: 14px;
}
.game-tab small {
  font-family: Barlow, sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.05em;
  opacity: 0.7;
}
.game-tab:hover:not(.active) {
  color: var(--text-pure);
  background: var(--bg-panel);
}
.game-tab.active {
  background: var(--blue);
  color: var(--text-pure);
}
.game-tab.active small {
  color: var(--cyan);
  opacity: 1;
}

/* Right Actions & Stats */
.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.stats-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
}
.stat-icon {
  font-size: 16px;
}
.stat-meta {
  display: flex;
  flex-direction: column;
}
.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.1;
}
.stat-val {
  font-size: 16px;
  line-height: 1.2;
}
.balance-pill .stat-val {
  color: var(--cyan);
}
.debt-pill .stat-val {
  color: var(--text-pure);
}
.debt-pill.debt-warning {
  border-color: var(--crimson);
  background: #260c14;
}
.debt-pill.debt-warning .stat-val {
  color: var(--crimson);
}

/* Drawer Trigger Button */
.drawer-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-panel);
  border: 1px solid var(--border-bright);
  color: var(--text-pure);
  padding: 8px 14px;
  font-weight: 800;
  font-size: 13px;
  position: relative;
}
.drawer-btn:hover {
  background: var(--border-subtle);
  border-color: var(--cyan);
}
.badge-dot {
  width: 8px;
  height: 8px;
  background: var(--crimson);
  border-radius: 50%;
  position: absolute;
  top: 5px;
  right: 5px;
}

/* Profile / Login Guide */
.profile-zone {
  display: flex;
  align-items: center;
}
.auth-btn {
  border: 1px solid var(--border-bright);
  color: var(--text-body);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
}
.auth-btn:hover {
  background: var(--border-subtle);
  color: var(--text-pure);
}
.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-avatar {
  width: 28px;
  height: 28px;
  background: var(--blue);
  color: var(--text-pure);
  font-weight: 900;
  display: grid;
  place-items: center;
  font-size: 12px;
}
.user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-heading);
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.logout-btn {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: underline;
  padding: 4px;
}
.logout-btn:hover {
  color: var(--crimson);
}

/* Anonymous Guide Banner */
.anon-banner {
  background: #0d1e3d;
  border-bottom: 1px solid var(--cyan-dim);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 40;
}
.anon-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.anon-badge {
  background: var(--blue);
  color: var(--text-pure);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
}
.anon-text {
  font-size: 13px;
  color: var(--text-heading);
}
.anon-text strong {
  color: var(--cyan);
}
.anon-btns {
  display: flex;
  align-items: center;
  gap: 10px;
}
.text-btn {
  background: transparent;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 8px;
  text-decoration: underline;
}
.text-btn:hover {
  color: var(--text-pure);
}

/* Network Retry Box */
.network-retry-box {
  background: #331500;
  border-bottom: 2px solid var(--border-focus);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 45;
}
.retry-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffc97a;
  font-size: 13px;
}
.retry-btn {
  background: #ff9d00;
  color: #000;
  font-weight: 800;
  padding: 6px 14px;
  font-size: 12px;
}

/* =========================================================
   2. MAIN IMMERSIVE TABLE FELT
   ========================================================= */
.casino-main {
  min-height: calc(100vh - var(--top-height));
  display: flex;
  flex-direction: column;
  position: relative;
  background: radial-gradient(circle at 50% 30%, var(--bg-felt) 0%, var(--bg-felt-deep) 65%, var(--bg-void) 100%);
  overflow: hidden;
}

/* P3R Geometric Background Felt Art */
.table-felt {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.felt-line.ring-line {
  position: absolute;
  width: 760px;
  height: 760px;
  border: 1px solid rgba(121, 231, 255, 0.08);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scaleX(1.35);
}
.felt-line.slant-slash {
  position: absolute;
  width: 200px;
  height: 1800px;
  background: linear-gradient(180deg, rgba(0, 85, 255, 0.04) 0%, rgba(0, 85, 255, 0) 100%);
  transform: rotate(28deg);
  left: 15%;
  top: -400px;
}
.felt-glow {
  position: absolute;
  width: 600px;
  height: 350px;
  background: radial-gradient(ellipse, rgba(0, 85, 255, 0.12) 0%, transparent 70%);
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
}

/* Stage Container */
.stage-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 5;
  padding: 24px 32px 240px; /* bottom space for persistent console */
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}


.game-screen {
  display: none;
  flex-direction: column;
  flex: 1;
}
.game-screen.active {
  display: flex;
}

.screen-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.screen-title {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-pure);
  text-wrap: balance;
}
.screen-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.screen-desc strong {
  color: var(--cyan);
}

/* Outcome Banners */
.outcome-banner {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  padding: 10px 18px;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.outcome-status {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-heading);
}
.outcome-details {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 12px;
}
.outcome-banner.win {
  border-color: var(--green);
  background: #04241a;
}
.outcome-banner.win .outcome-status {
  color: var(--green);
}
.outcome-banner.loss {
  border-color: var(--crimson-dim);
  background: #240a12;
}
.outcome-banner.loss .outcome-status {
  color: var(--crimson);
}
.outcome-banner.jackpot {
  border-color: var(--gold);
  background: #292004;
}
.outcome-banner.jackpot .outcome-status {
  color: var(--gold);
}

/* =========================================================
   3. GAME 1: SLOTS (老虎机)
   ========================================================= */
.payout-card {
  display: flex;
  gap: 12px;
  background: var(--bg-felt-deep);
  border: 1px solid var(--border-subtle);
  padding: 8px 16px;
}
.payout-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.payout-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  background: var(--border-subtle);
  color: var(--text-body);
}
.payout-tag.gold-tag {
  background: var(--gold);
  color: var(--bg-void);
  font-weight: 900;
}
.payout-rate {
  font-size: 18px;
  color: var(--cyan);
}

.slots-machine {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px auto;
  width: 100%;
  max-width: 680px;
}
.slots-bezel {
  position: relative;
  background: linear-gradient(180deg, #091a38 0%, #050e21 100%);
  border: 4px solid var(--border-bright);
  padding: 24px;
  width: 100%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
.slots-reels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  background: #020712;
  border: 2px solid var(--border-subtle);
  padding: 12px;
}
.reel-window {
  height: 180px;
  overflow: hidden;
  position: relative;
  background: #040d21;
  border: 1px solid var(--border-bright);
}
.reel-strip {
  display: flex;
  flex-direction: column;
  will-change: transform;
}
.reel-item {
  height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  user-select: none;
}
.reel-icon {
  font-size: 64px;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 85, 255, 0.4));
}
.reel-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: 0.05em;
}
.reel-glass-shadow {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 7, 18, 0.85) 0%, transparent 25%, transparent 75%, rgba(2, 7, 18, 0.85) 100%);
  pointer-events: none;
  border-top: 1px solid rgba(121, 231, 255, 0.15);
  border-bottom: 1px solid rgba(121, 231, 255, 0.15);
}
.slots-payline {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 50%;
  height: 2px;
  background: rgba(121, 231, 255, 0.35);
  pointer-events: none;
  transform: translateY(-50%);
}

/* =========================================================
   4. GAME 2: ROULETTE (选颜色轮盘)
   ========================================================= */
.roulette-stat-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-felt-deep);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  font-size: 12px;
}
.history-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}
.history-pill {
  padding: 2px 7px;
  font-weight: 800;
  font-size: 11px;
}
.history-pill.red { background: var(--crimson); color: white; }
.history-pill.black { background: #16243d; color: white; border: 1px solid var(--border-bright); }
.history-pill.gold { background: var(--gold); color: #000; }
.history-pill.init-pill { color: var(--text-muted); }

.roulette-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
}

/* Centerpiece Wheel */
.wheel-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
}
.wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 18px solid var(--cyan);
  z-index: 10;
  filter: drop-shadow(0 2px 6px rgba(0, 85, 255, 0.8));
}
.wheel-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  will-change: transform;
}
.wheel-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.wheel-result-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--bg-void);
  border: 2px solid var(--cyan);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.center-num {
  font-size: 22px;
  line-height: 1;
  color: var(--text-pure);
}
.center-color {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

/* Color Bets Buttons */
.color-bets-area {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  width: 100%;
}
.color-bet-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-panel);
  border: 2px solid var(--border-subtle);
  position: relative;
  text-align: left;

}
.color-bet-btn:hover {
  background: var(--bg-card);
  border-color: var(--border-bright);
}
.bet-color-swatch {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.swatch-red { background: var(--crimson); }
.swatch-black { background: #08152e; border: 2px solid var(--border-bright); }
.swatch-gold { background: var(--gold); }

.bet-btn-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.bet-color-name {
  font-size: 15px;
  font-weight: 900;
  color: var(--text-pure);
}
.bet-odds-badge {
  font-size: 11px;
  color: var(--text-muted);
}
.bet-active-mark {
  font-size: 12px;
  font-weight: 800;
  color: var(--cyan);
  display: none;
}
.color-bet-btn.active {
  border-color: var(--cyan);
  background: #081e42;
}
.color-bet-btn.active .bet-active-mark {
  display: block;
}

/* =========================================================
   5. GAME 3: BLACKJACK (21点牌桌)
   ========================================================= */
.bj-status-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 6px 12px;
  background: var(--bg-felt-deep);
  border: 1px solid var(--border-subtle);
  color: var(--cyan);
}

.blackjack-table {
  display: flex;
  flex-direction: column;
  gap: 28px;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  position: relative;
}
.bj-area {
  background: rgba(11, 26, 56, 0.6);
  border: 2px solid var(--border-subtle);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.bj-area-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.bj-role-label {
  font-size: 15px;
  font-weight: 900;
  color: var(--text-heading);
}
.bj-rule-pill {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-void);
  padding: 2px 8px;
  border: 1px solid var(--border-subtle);
}
.bj-score-tag {
  font-size: 22px;
  color: var(--cyan);
}

/* Cards Row */
.bj-cards-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 110px;
  flex-wrap: wrap;
}
.card-placeholder {
  color: var(--text-dim);
  font-size: 13px;
  padding: 30px 20px;
}

/* Single Playing Card */
.bj-card {
  width: 75px;
  height: 105px;
  background: #ffffff;
  color: #0b1a38;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 8px;
  font-family: Barlow, sans-serif;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  position: relative;
  user-select: none;
  will-change: transform, opacity;
}
.bj-card.red-suit {
  color: #d11534;
}
.card-corner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}
.card-rank {
  font-size: 16px;
}
.card-suit {
  font-size: 14px;
}
.card-center-suit {
  font-size: 28px;
  align-self: center;
}
.card-corner.bottom-corner {
  transform: rotate(180deg);
}

/* Hidden Hole Card */
.bj-card.card-hidden {
  background: #002266;
  border: 2px solid var(--cyan);
  box-shadow: 0 6px 16px rgba(0, 85, 255, 0.3);
}
.card-back-pattern {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(45deg, #001f5c, #001f5c 5px, #003399 5px, #003399 10px);
  border: 1px solid rgba(121, 231, 255, 0.4);
}

/* Center Outcome Notification */
.bj-center-outcome {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  pointer-events: none;
}
.bj-outcome-box {
  background: var(--bg-void);
  border: 2px solid var(--cyan);
  padding: 16px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}
.bj-outcome-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--cyan);
}
.bj-outcome-desc {
  font-size: 13px;
  color: var(--text-body);
  margin-top: 4px;
}

/* Relocated In-Play Hit / Stand Bar (Inside fixed bottom console) */
.bj-controls-bar {
  background: var(--bg-card);
  border: 2px solid var(--cyan);
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 0 20px rgba(0, 85, 255, 0.25), inset 0 0 15px rgba(121, 231, 255, 0.08);
}
.bj-inplay-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-body);
}
.bj-inplay-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: rgba(0, 85, 255, 0.25);
  border: 1px solid var(--cyan);
  color: var(--cyan);
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
}
.bj-inplay-prompt {
  font-weight: 600;
  color: var(--text-pure);
}
.bj-inplay-info strong {
  color: var(--cyan);
  font-size: 18px;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(121, 231, 255, 0.4);
}
.bj-action-btns {
  display: flex;
  align-items: center;
  gap: 14px;
}
.bj-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 26px;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.05em;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none;
}
.bj-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.bj-action-btn.btn-hit {
  background: var(--blue);
  border: 1px solid var(--cyan);
  color: var(--text-pure);
  box-shadow: 0 0 15px rgba(0, 85, 255, 0.4);
}
.bj-action-btn.btn-hit:not(:disabled):hover {
  background: var(--blue-hover);
  box-shadow: 0 0 25px rgba(121, 231, 255, 0.6);
  transform: translateY(-1px);
}
.bj-action-btn.btn-hit:not(:disabled):active {
  transform: translateY(1px);
}
.bj-action-btn.btn-stand {
  background: #183258;
  border: 1px solid var(--border-bright);
  color: var(--text-pure);
  box-shadow: 0 0 10px rgba(27, 57, 106, 0.3);
}
.bj-action-btn.btn-stand:not(:disabled):hover {
  background: #254b85;
  border-color: var(--cyan);
  box-shadow: 0 0 20px rgba(121, 231, 255, 0.3);
  transform: translateY(-1px);
}
.bj-action-btn.btn-stand:not(:disabled):active {
  transform: translateY(1px);
}

/* Standard Betting Controls Container */
.standard-bet-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* =========================================================
   6. PERSISTENT BETTING CONTROLS CONSOLE
   ========================================================= */
.bet-console {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(3, 8, 20, 0.96);
  border-top: 2px solid var(--border-bright);
  backdrop-filter: blur(8px);
  z-index: 30;
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
}
.console-body {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Quick Chips */
.chip-select-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.row-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.chip-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.chip-btn {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  color: var(--text-pure);
  font-family: Barlow, sans-serif;
  font-weight: 800;
  font-size: 13px;
  padding: 5px 12px;
}
.chip-btn:hover {
  border-color: var(--border-bright);
  background: var(--bg-card);
}
.chip-btn.active {
  background: var(--blue);
  border-color: var(--cyan);
}
.chip-btn.max-btn {
  color: var(--gold);
  border-color: var(--gold-dim);
}

/* Inputs & Math Grid */
.inputs-and-math-row {
  display: grid;
  grid-template-columns: 220px 240px 1fr 220px;
  gap: 18px;
  align-items: center;
}
.input-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.col-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.input-hint {
  font-size: 10px;
  color: var(--text-dim);
}

/* Stepper Input */
.input-with-stepper {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-bright);
}
.input-with-stepper input {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 8px 10px;
  color: var(--text-pure);
  font-size: 18px;
  text-align: center;
  width: 80px;
}
.input-with-stepper input:focus {
  outline: none;
}
.stepper-btn {
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  background: var(--bg-panel);
}
.stepper-btn:hover {
  background: var(--border-bright);
  color: var(--text-pure);
}

/* Leverage Selector */
.lev-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.lev-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
}
.lev-btn strong {
  font-family: Barlow, sans-serif;
  font-size: 14px;
}
.lev-btn small {
  font-size: 9px;
  color: var(--text-muted);
  line-height: 1;
}
.lev-btn:hover {
  background: var(--bg-panel);
}
.lev-btn.active {
  background: var(--blue);
  border-color: var(--cyan);
  color: var(--text-pure);
}
.lev-btn.active small {
  color: var(--cyan);
}

/* Mobile Compact Quick Summary Strip (Hidden on Desktop) */
.mobile-compact-strip {
  display: none;
}

/* Live Pre-Bet Math Box */
.math-summary-col {
  background: var(--bg-felt-deep);
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.math-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}
.math-item {
  display: flex;
  flex-direction: column;
}
.m-label {
  font-size: 10px;
  color: var(--text-muted);
}
.m-val {
  font-size: 16px;
  color: var(--text-pure);
}
.math-item.highlight-item .m-val {
  color: var(--cyan);
  font-size: 18px;
}
.math-debt-preview {
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
  padding-top: 4px;
  display: flex;
  justify-content: space-between;
}
.math-debt-preview strong {
  color: var(--text-pure);
}
.math-debt-preview.warning strong {
  color: var(--crimson);
}

/* Primary Play CTA */
.action-cta-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.primary {
  background: var(--blue);
  color: var(--text-pure);
  border: 0;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.primary:hover {
  background: var(--blue-hover);
}
.primary-play-btn {
  width: 100%;
  height: 52px;
  font-size: 17px;
  letter-spacing: 0.02em;
}
.validation-msg {
  font-size: 11px;
  color: var(--crimson);
  text-align: center;
}

/* =========================================================
   7. RIGHT / BOTTOM SLIDING DRAWER (账本与借贷)
   ========================================================= */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 16, 0.75);
  backdrop-filter: blur(4px);
  z-index: 60;
  transition: opacity 0.25s ease;
}
.casino-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 500px;
  max-width: 100%;
  background: var(--bg-void);
  border-left: 2px solid var(--border-bright);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
  z-index: 70;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.casino-drawer.open {
  transform: translateX(0);
}

/* Drawer Header */
.drawer-header {
  padding: 20px 24px;
  background: var(--bg-felt);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.drawer-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--text-pure);
}
.drawer-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.drawer-close-btn {
  font-size: 22px;
  color: var(--text-muted);
  padding: 4px;
}
.drawer-close-btn:hover {
  color: var(--text-pure);
}

/* Drawer Nav Tabs */
.drawer-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg-felt-deep);
  border-bottom: 1px solid var(--border-subtle);
}
.drawer-tab {
  padding: 12px 6px;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.drawer-tab span {
  font-weight: 800;
  font-size: 13px;
}
.drawer-tab small {
  font-family: Barlow, sans-serif;
  font-size: 9px;
  opacity: 0.7;
}
.drawer-tab:hover:not(.active) {
  background: var(--bg-panel);
  color: var(--text-body);
}
.drawer-tab.active {
  color: var(--cyan);
  background: var(--bg-void);
  border-bottom: 2px solid var(--cyan);
}

/* Drawer Body & Panels */
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.drawer-panel {
  display: none;
  flex-direction: column;
  gap: 20px;
}
.drawer-panel.active {
  display: flex;
}

.drawer-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-pure);
}
.card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Forms in Drawer */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-body);
}
.form-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.segment-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.segment-label input[type="radio"]:checked + span {
  color: var(--cyan);
}
.form-input-group {
  display: flex;
  gap: 8px;
}
.form-input-group select {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-bright);
  padding: 8px;
  color: var(--text-pure);
}
.form-input-group input {
  width: 150px;
  background: var(--bg-input);
  border: 1px solid var(--border-bright);
  padding: 8px;
  color: var(--text-pure);
}
.field-hint {
  font-size: 11px;
  color: var(--text-dim);
}
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.range-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-bright);
  padding: 0 8px;
}
.range-wrap input {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 8px 0;
  color: var(--text-pure);
}
.range-wrap input:focus {
  outline: none;
}
.range-unit {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-muted);
}
.form-checkbox-row {
  justify-content: center;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-heading);
}
.loan-calc-preview {
  background: var(--bg-felt-deep);
  padding: 10px 14px;
  font-size: 12px;
  color: var(--cyan);
  border: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}
.submit-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 800;
}
.form-error {
  background: #240a10;
  border: 1px solid var(--crimson);
  color: var(--crimson);
  padding: 8px 12px;
  font-size: 12px;
  margin-top: 8px;
}

/* Loan List */
.list-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.loan-items-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.loan-item {
  background: var(--bg-felt-deep);
  border: 1px solid var(--border-subtle);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.loan-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.loan-parties {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-pure);
}
.loan-state-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
}
.loan-state-pill.proposed { background: #26200a; color: var(--gold); border: 1px solid var(--gold-dim); }
.loan-state-pill.active { background: #08241b; color: var(--green); border: 1px solid var(--green-dim); }
.loan-state-pill.closed { background: #131c2b; color: var(--text-muted); border: 1px solid var(--border-subtle); }
.loan-state-pill.rejected, .loan-state-pill.cancelled { background: #240b12; color: var(--crimson); border: 1px solid var(--crimson-dim); }
.loan-item-math {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}
.loan-item-math strong {
  color: var(--text-pure);
}
.loan-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.small-action-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
}
.small-action-btn.accept { background: var(--green); color: #000; }
.small-action-btn.reject { background: #30111a; color: var(--crimson); border: 1px solid var(--crimson-dim); }
.small-action-btn.cancel { background: var(--bg-panel); color: var(--text-muted); border: 1px solid var(--border-subtle); }
.small-action-btn.repay { background: var(--blue); color: #fff; }

/* Bank & Daily Panel */
.daily-card {
  gap: 16px;
}
.daily-header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.daily-icon, .debt-icon {
  font-size: 32px;
}
.daily-action-box {
  background: var(--bg-felt-deep);
  border: 1px solid var(--border-subtle);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.daily-status {
  font-size: 13px;
  color: var(--text-body);
}
.daily-claim-btn {
  padding: 12px;
  font-size: 14px;
}

.debt-summary-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-felt-deep);
  border: 1px solid var(--border-subtle);
  padding: 14px;
}
.debt-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}
.debt-highlight {
  font-size: 20px;
  color: var(--cyan);
}
.debt-progress-bar {
  height: 8px;
  background: var(--bg-void);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}
.debt-fill {
  height: 100%;
  background: var(--cyan);
  transition: width 0.3s ease;
}
.input-with-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.input-with-actions input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-bright);
  padding: 10px;
  color: var(--text-pure);
  font-size: 16px;
}

/* Ledger Panel */
.ledger-table-wrap {
  overflow-x: auto;
}
.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}
.ledger-table th {
  padding: 10px 8px;
  background: var(--bg-felt-deep);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 700;
}
.ledger-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-body);
}
.delta-pos {
  color: var(--green);
  font-weight: 800;
}
.delta-neg {
  color: var(--text-pure);
}
.empty-td {
  text-align: center;
  color: var(--text-dim);
  padding: 30px !important;
}

/* Rules Panel */
.rule-section {
  margin-bottom: 16px;
}
.rule-section h4 {
  font-size: 14px;
  font-weight: 800;
  color: var(--cyan);
  margin-bottom: 6px;
}
.rule-section p {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-body);
}

/* =========================================================
   8. ACCESSIBLE DIALOGS & MODALS
   ========================================================= */
.accessible-dialog {
  padding: 0;
  border: 2px solid var(--border-bright);
  background: var(--bg-void);
  color: var(--text-body);
  max-width: 480px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
}
.accessible-dialog::backdrop {
  background: rgba(2, 6, 16, 0.85);
  backdrop-filter: blur(4px);
}
.dialog-box {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}
.dialog-close-corner {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 20px;
  color: var(--text-muted);
}
.dialog-close-corner:hover {
  color: var(--text-pure);
}
.dialog-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--text-pure);
}
.dialog-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}
.dialog-details {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  padding: 12px 16px;
  font-size: 13px;
}
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}
.dialog-cancel {
  color: var(--text-muted);
}
.dialog-confirm {
  padding: 10px 20px;
}

/* Login Guide Modal */
.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-felt-deep);
  border: 1px solid var(--border-subtle);
  padding: 12px;
}
.step-num {
  width: 24px;
  height: 24px;
  background: var(--blue);
  color: var(--text-pure);
  font-weight: 900;
  display: grid;
  place-items: center;
  font-size: 12px;
  flex-shrink: 0;
}
.guide-step p {
  font-size: 13px;
  line-height: 1.5;
}
.code-copy {
  color: var(--cyan);
  font-size: 15px;
}
.dialog-notice {
  font-size: 11px;
  color: var(--text-dim);
}

/* Toast - Compact notification under top header */
.toast {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-panel);
  border: 2px solid var(--cyan);
  color: var(--text-pure);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  z-index: 999;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
  white-space: nowrap !important;
}
.toast.show {
  visibility: visible;
  opacity: 1;
}

/* =========================================================
   9. RESPONSIVE BREAKPOINTS (Mobile & Tablet)
   ========================================================= */
@media (max-width: 1024px) {
  .inputs-and-math-row {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }
  .math-summary-col {
    grid-column: span 2;
  }
  .action-cta-col {
    grid-column: span 2;
  }
  .stage-container {
    padding-bottom: 250px;
  }
}

@media (max-width: 768px) {
  :root {
    --top-height: 66px;
  }
  
  /* Compact Mobile Header with 3 Dedicated Rows (Brand+Actions / Full Stats / Game Nav) */
  .casino-top {
    height: auto;
    min-height: auto;
    max-height: none;
    padding: 5px 8px;
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-rows: auto auto auto;
    row-gap: 4px;
    column-gap: 6px;
    align-items: center;
    box-sizing: border-box;
  }
  .brand-zone {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
  }
  .brand {
    font-size: 14px;
    letter-spacing: -0.01em;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .product-badge {
    display: none; /* Long chips notice hidden from top bar on mobile; visible on desk & rules */
  }
  .top-actions {
    display: contents;
  }
  .drawer-btn {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    padding: 3px 8px;
    font-size: 11px;
    height: 24px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .drawer-btn-text {
    font-size: 11px;
  }
  .profile-zone {
    grid-column: 3 / 4;
    grid-row: 1 / 2;
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .auth-btn, .user-badge {
    padding: 2px 6px;
    font-size: 11px;
    height: 24px;
    white-space: nowrap;
  }
  .user-badge {
    max-width: 120px;
    overflow: hidden;
  }
  .user-name {
    max-width: 55px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .user-avatar {
    width: 18px;
    height: 18px;
    font-size: 10px;
    flex-shrink: 0;
  }
  .logout-btn {
    padding: 1px 4px;
    font-size: 10px;
    flex-shrink: 0;
  }
  .stats-group {
    grid-column: 1 / -1;
    grid-row: 2 / 3;
    display: flex;
    gap: 6px;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: visible;
  }
  .stats-group .stat-pill {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 8px;
    font-size: 11px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    overflow: visible;
    box-sizing: border-box;
  }
  .stat-label {
    display: none;
  }
  .balance-pill::before {
    content: "筹:";
    color: var(--cyan);
    font-weight: 700;
    margin-right: 4px;
    font-size: 11px;
    flex-shrink: 0;
  }
  .debt-pill::before {
    content: "借:";
    color: var(--crimson);
    font-weight: 700;
    margin-right: 4px;
    font-size: 11px;
    flex-shrink: 0;
  }
  .stat-val {
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
  }
  .game-nav {
    grid-column: 1 / -1;
    grid-row: 3 / 4;
    width: 100%;
    display: flex;
    gap: 4px;
    justify-content: space-between;
    margin: 0;
  }
  .game-tab {
    flex: 1;
    height: 24px;
    padding: 1px 4px;
    font-size: 12px;
    justify-content: center;
    white-space: nowrap;
  }
  .game-tab-name {
    font-size: 12px;
  }

  /* Drawer slides from bottom on mobile */
  .casino-drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 85vh;
    border-left: 0;
    border-top: 2px solid var(--border-bright);
    transform: translateY(100%);
  }
  .casino-drawer.open {
    transform: translateY(0);
  }

  /* Screen layouts & Stage Container */
  .stage-container {
    padding: 6px 8px 115px;
  }
  .screen-header {
    margin-bottom: 6px;
  }
  .screen-title {
    font-size: 14px;
  }
  .screen-desc {
    font-size: 11px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .payout-card {
    padding: 2px 6px;
    gap: 6px;
  }
  .payout-row {
    font-size: 10px;
  }

  /* Slots machine mobile compact */
  .slots-bezel {
    padding: 6px;
    max-width: 320px;
    margin: 0 auto;
  }
  .slots-reels {
    gap: 6px;
    padding: 6px;
  }
  .reel-window {
    height: 96px;
  }
  .reel-item {
    height: 96px;
  }
  .reel-icon {
    font-size: 36px;
  }
  .outcome-banner {
    padding: 4px 8px;
    font-size: 11px;
    margin-top: 6px;
  }

  /* Color Roulette mobile compact */
  .wheel-wrapper {
    width: 160px;
    height: 160px;
    margin: 0 auto;
  }
  .wheel-result-center {
    width: 52px;
    height: 52px;
  }
  .center-num {
    font-size: 17px;
  }
  .center-color {
    font-size: 9px;
  }
  .color-bets-area {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-top: 8px;
  }
  .color-bet-btn {
    padding: 4px 2px;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-height: 52px;
  }
  .bet-color-name {
    font-size: 10px;
  }
  .bet-odds-badge {
    font-size: 8px;
  }

  /* 21点 Blackjack mobile compact */
  .bj-cards-row {
    min-height: 72px;
    gap: 4px;
  }
  .bj-card {
    width: 46px;
    height: 68px;
    padding: 2px 3px;
  }
  .card-rank { font-size: 11px; }
  .card-suit { font-size: 9px; }
  .card-center-suit { font-size: 15px; }
  .bj-center-badge {
    padding: 4px 10px;
    font-size: 11px;
  }
  /* Relocated In-Play Bar on mobile (Height ~44px, total console ~52px <= 120px) */
  .bj-controls-bar {
    padding: 4px 8px;
    gap: 6px;
    clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
    border-width: 1.5px;
    height: 44px;
    box-sizing: border-box;
  }
  .bj-inplay-info {
    gap: 3px;
    font-size: 11px;
    min-width: 0;
    flex: 1;
  }
  .bj-inplay-badge {
    display: none;
  }
  .bj-inplay-prompt {
    display: none; /* Hide on mobile so score tip has ample space */
  }
  .bj-inplay-info strong {
    font-size: 13px;
    white-space: nowrap;
  }
  .bj-action-btns {
    gap: 5px;
    flex-shrink: 0;
  }
  .bj-action-btn {
    padding: 4px 10px;
    font-size: 11px;
    height: 32px;
    gap: 3px;
    clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
  }
  .bj-action-btn .action-icon {
    font-size: 10px;
  }

  /* Standard controls container on Mobile */
  .standard-bet-controls {
    gap: 4px;
  }

  /* Console on Mobile (Height ~100px) */
  .bet-console {
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
    background: rgba(8, 21, 46, 0.96);
  }
  .console-body {
    gap: 4px;
  }
  .quick-chips-row {
    gap: 4px;
  }
  .chip-buttons {
    gap: 3px;
    width: 100%;
    justify-content: space-between;
  }
  .chip-btn {
    padding: 2px 6px;
    font-size: 10px;
    height: 22px;
    flex: 1;
  }

  /* 2x2 grid for betting inputs & cta */
  .inputs-and-math-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    align-items: center;
  }
  .input-col.stake-col {
    grid-column: 1 / 2;
    gap: 2px;
  }
  .input-col.lev-col {
    grid-column: 2 / 3;
    gap: 2px;
  }
  .col-label, .input-hint {
    display: none; /* Save space on mobile */
  }
  .input-with-stepper {
    height: 30px;
  }
  .input-with-stepper input {
    font-size: 14px;
    padding: 2px 4px;
    width: 44px;
  }
  .stepper-btn {
    padding: 2px 6px;
    font-size: 10px;
  }
  .lev-buttons {
    gap: 2px;
  }
  .lev-btn {
    padding: 2px 1px;
    height: 30px;
    justify-content: center;
  }
  .lev-btn strong {
    font-size: 11px;
  }
  .lev-btn small {
    display: none;
  }

  /* Row 2 on mobile: compact summary strip + primary CTA */
  .mobile-compact-strip {
    grid-column: 1 / 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 6px;
    height: 32px;
    font-size: 10px;
    box-sizing: border-box;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
  }
  .toggle-math-btn {
    font-size: 10px;
    padding: 2px 4px;
    background: var(--bg-panel);
    border: 1px solid var(--border-bright);
    color: var(--cyan);
    cursor: pointer;
  }
  .action-cta-col {
    grid-column: 2 / 3;
  }
  .primary-play-btn {
    height: 32px;
    font-size: 12px;
    padding: 0 6px;
  }
  .btn-play-icon {
    display: none;
  }

  /* Collapsible Math summary */
  .math-summary-col {
    grid-column: span 2;
    display: none;
    padding: 6px 8px;
    margin-top: 2px;
  }
  .math-summary-col.expanded {
    display: flex !important;
  }
  .math-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }
  .math-item .m-label {
    font-size: 9px;
  }
  .math-item .m-val {
    font-size: 12px;
  }
  .math-debt-preview {
    font-size: 10px;
    margin-top: 4px;
  }

  /* Validation message */
  .validation-msg {
    font-size: 10px;
    padding: 2px 4px;
  }
}

/* Authoritative hidden rule at bottom */
[hidden] {
  display: none !important;
}

/* Reduced Motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .casino-drawer {
    transition: none !important;
  }
}
