/* ═══════════════════════════════════════════════════
   CM Casino — Dark Casino Theme
   ═══════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────── */
:root {
  --bg:         #0d0d0d;
  --bg2:        #141414;
  --bg3:        #1c1c1c;
  --bg4:        #252525;
  --border:     #2e2e2e;
  --gold:       #c9a227;
  --gold-light: #f0c040;
  --green:      #1a5c2e;
  --green-dark: #0f3a1d;
  --red:        #c0392b;
  --text:       #e8e8e8;
  --text-muted: #888;
  --success:    #27ae60;
  --warning:    #e67e22;
  --info:       #2980b9;
  --radius:     10px;
  --radius-sm:  6px;
  --shadow:     0 4px 24px rgba(0,0,0,0.5);
  --transition: 0.2s ease;
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}
a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }
img { max-width: 100%; }
ul { list-style: none; }

/* ── Header ────────────────────────────────────── */
.site-header {
  background: linear-gradient(135deg, #0a1f0e 0%, #0d150f 100%);
  border-bottom: 2px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(201,162,39,0.15);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold);
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(201,162,39,0.4);
}
.site-logo span { letter-spacing: 1px; }
.header-nav { display: flex; gap: 4px; flex: 1; }
.header-nav a {
  color: #ccc;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: all var(--transition);
  white-space: nowrap;
}
.header-nav a:hover { color: var(--gold); background: rgba(201,162,39,0.08); }
.header-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.balance-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}
.balance-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.balance-amount { font-size: 1.1rem; font-weight: 700; color: var(--gold); }
.header-username { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; }
.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.1rem;
  margin-left: auto;
}
.mobile-nav {
  display: none;
  flex-direction: column;
  background: #0a1f0e;
  border-top: 1px solid var(--border);
  padding: 8px 0;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 12px 20px;
  color: var(--text);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.95rem;
}
.mobile-nav a:hover { background: rgba(201,162,39,0.08); color: var(--gold); }

/* ── Buttons ───────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, #a8831e 100%);
  color: #0d0d0d;
  border-color: var(--gold);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(201,162,39,0.4);
  color: #0d0d0d;
}
.btn-outline {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}
.btn-outline:hover:not(:disabled) { background: rgba(201,162,39,0.1); color: var(--gold-light); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover:not(:disabled) { background: #2ecc71; color: #fff; }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover:not(:disabled) { background: #f39c12; color: #fff; }
.btn-info { background: var(--info); color: #fff; border-color: var(--info); }
.btn-info:hover:not(:disabled) { background: #3498db; color: #fff; }
.btn-ghost { background: var(--bg4); color: var(--text); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--border); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; border-radius: var(--radius); }
.btn-full { width: 100%; }

/* ── Auth Pages ────────────────────────────────── */
.auth-page { background: radial-gradient(ellipse at center, #0a1f0e 0%, #050a06 100%); }
.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  min-height: 100vh;
}
.auth-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.logo-icon { font-size: 3rem; display: block; margin-bottom: 8px; }
.auth-logo h1 { font-size: 2rem; color: var(--gold); text-shadow: 0 0 20px rgba(201,162,39,0.4); }
.auth-logo p { color: var(--text-muted); margin-top: 4px; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth-footer { text-align: center; margin-top: 24px; color: var(--text-muted); font-size: 0.9rem; }

/* ── Form Elements ─────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"] {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: border-color var(--transition);
  width: 100%;
}
input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(201,162,39,0.15); }
input[type="number"].bet-input {
  width: 100px;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
}

/* ── Alerts ────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border: 1px solid;
}
.alert-error { background: rgba(192,57,43,0.15); border-color: #c0392b; color: #e74c3c; }
.alert-success { background: rgba(39,174,96,0.15); border-color: #27ae60; color: #2ecc71; }

/* ── Lobby ─────────────────────────────────────── */
.lobby { flex: 1; max-width: 1200px; margin: 0 auto; padding: 32px 20px; width: 100%; }

/* Jackpot Banner */
.jackpot-banner {
  background: linear-gradient(135deg, #1a0a00 0%, #2e1a00 50%, #1a0a00 100%);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 24px 32px;
  margin-bottom: 40px;
  text-align: center;
  box-shadow: 0 0 40px rgba(201,162,39,0.2), inset 0 0 40px rgba(0,0,0,0.3);
  animation: jackpotGlow 3s ease-in-out infinite;
}
@keyframes jackpotGlow {
  0%,100% { box-shadow: 0 0 30px rgba(201,162,39,0.2), inset 0 0 40px rgba(0,0,0,0.3); }
  50%      { box-shadow: 0 0 60px rgba(201,162,39,0.4), inset 0 0 40px rgba(0,0,0,0.3); }
}
.jackpot-label { display: block; font-size: 0.9rem; color: var(--gold); letter-spacing: 3px; text-transform: uppercase; margin-bottom: 8px; }
.jackpot-amount { display: block; font-size: 3rem; font-weight: 900; color: var(--gold-light); text-shadow: 0 0 20px rgba(240,192,64,0.6); letter-spacing: 2px; }
.jackpot-sub { display: block; font-size: 0.85rem; color: var(--text-muted); margin-top: 6px; }

/* Games Grid */
.section-title { font-size: 1.3rem; color: var(--gold); margin-bottom: 20px; text-transform: uppercase; letter-spacing: 2px; }
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}
.game-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  color: var(--text);
}
.game-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(201,162,39,0) 0%, rgba(201,162,39,0.05) 100%);
  opacity: 0;
  transition: opacity 0.25s;
}
.game-card:hover { border-color: var(--gold); transform: translateY(-4px); box-shadow: 0 8px 32px rgba(201,162,39,0.15); color: var(--text); }
.game-card:hover::before { opacity: 1; }
.game-icon { font-size: 3rem; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5)); }
.game-info h3 { font-size: 1.1rem; color: var(--gold); margin-bottom: 4px; }
.game-info p { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }
.game-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  background: var(--bg4);
  color: var(--gold);
  border: 1px solid var(--gold);
  margin-top: 4px;
}
.jackpot-badge { background: rgba(201,162,39,0.2); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
}
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { border-color: var(--gold); transform: translateY(-2px); }
.stat-icon { font-size: 2rem; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.stat-value { font-size: 1.2rem; font-weight: 700; color: var(--text); }

/* ── Game Pages ────────────────────────────────── */
.game-page { flex: 1; display: flex; justify-content: center; align-items: flex-start; padding: 32px 20px; }
.game-container {
  width: 100%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.game-title { font-size: 2rem; color: var(--gold); text-align: center; text-shadow: 0 0 20px rgba(201,162,39,0.3); }
.game-subtitle { color: var(--text-muted); text-align: center; font-size: 0.9rem; }

/* Result display */
.result-display {
  min-height: 48px;
  padding: 12px 24px;
  border-radius: var(--radius);
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  transition: all var(--transition);
}
.result-win {
  background: rgba(39,174,96,0.15);
  border: 1px solid var(--success);
  color: #2ecc71;
  animation: winPop 0.4s ease;
}
@keyframes winPop {
  0%  { transform: scale(0.9); opacity: 0; }
  60% { transform: scale(1.05); }
  100%{ transform: scale(1); opacity: 1; }
}
.result-lose { background: rgba(192,57,43,0.15); border: 1px solid var(--red); color: #e74c3c; }
.result-push { background: rgba(52,73,94,0.3); border: 1px solid #5d6d7e; color: #85929e; }
.result-jackpot {
  background: rgba(201,162,39,0.2);
  border: 2px solid var(--gold);
  color: var(--gold-light);
  font-size: 1.3rem;
  animation: winPop 0.4s ease, jackpotGlow 1s infinite;
}

/* Bet controls */
.bet-controls { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.bet-controls label { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; }
.bet-row { display: flex; align-items: center; gap: 8px; }
.quick-bets { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

/* Jackpot ticker */
.jackpot-ticker {
  background: rgba(201,162,39,0.1);
  border: 1px solid rgba(201,162,39,0.3);
  border-radius: var(--radius);
  padding: 10px 24px;
  font-size: 1rem;
  color: var(--gold);
  text-align: center;
  font-weight: 700;
  width: 100%;
}
#jackpot-val { font-size: 1.2rem; color: var(--gold-light); margin-left: 6px; }

/* ── Slot Machine ───────────────────────────────── */
.slots-machine {
  background: linear-gradient(135deg, #1a0a00 0%, #2a1200 100%);
  border: 3px solid var(--gold);
  border-radius: 16px;
  padding: 32px;
  position: relative;
  box-shadow: 0 0 40px rgba(201,162,39,0.2);
  width: 100%;
  max-width: 440px;
}
.slots-reels { display: flex; gap: 12px; justify-content: center; }
.reel {
  width: 100px;
  height: 100px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.reel-symbol {
  font-size: 2.8rem;
  display: block;
  text-align: center;
  line-height: 100px;
  transition: transform 0.1s;
}
.slots-line {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 2px;
  background: rgba(201,162,39,0.3);
  pointer-events: none;
}
.spin-btn { min-width: 200px; font-size: 1.2rem; }

/* Pay table */
.paytable {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  width: 100%;
  max-width: 440px;
}
.paytable h3 { color: var(--gold); margin-bottom: 12px; font-size: 1rem; text-align: center; }
.paytable table { width: 100%; border-collapse: collapse; }
.paytable td { padding: 6px 12px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.paytable td:last-child { text-align: right; color: var(--gold); font-weight: 700; }

/* ── Blackjack ─────────────────────────────────── */
.bj-table {
  background: radial-gradient(ellipse at center, #1e4d2b 0%, #0d2b16 100%);
  border: 3px solid var(--gold);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
}
.bj-section h3 { color: rgba(255,255,255,0.7); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 12px; }
.hand-value { color: var(--gold); font-size: 1rem; font-weight: 700; margin-left: 6px; }
.bj-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 20px 0; }
.card-hand { display: flex; gap: 8px; flex-wrap: wrap; min-height: 90px; }
.playing-card {
  width: 60px;
  height: 84px;
  background: #fff;
  color: #1a1a1a;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
  animation: cardSlide 0.3s ease;
  line-height: 1.2;
}
.playing-card span { font-size: 0.8rem; display: block; }
.red-card { color: #c0392b; }
.card-back { background: linear-gradient(135deg, #1a2e9e, #0d1f6e); color: #fff; font-size: 1.5rem; }
@keyframes cardSlide { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.bj-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.game-rules {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  width: 100%;
  max-width: 440px;
}
.game-rules h3 { color: var(--gold); margin-bottom: 12px; }
.game-rules li { padding: 4px 0; color: var(--text-muted); font-size: 0.9rem; padding-left: 16px; position: relative; }
.game-rules li::before { content: '•'; position: absolute; left: 0; color: var(--gold); }

/* ── Roulette ──────────────────────────────────── */
.roulette-wheel-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#roulette-canvas { border-radius: 50%; border: 4px solid var(--gold); box-shadow: 0 0 40px rgba(201,162,39,0.3); }
.wheel-pointer {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold);
  font-size: 1.5rem;
  text-shadow: 0 0 10px rgba(201,162,39,0.8);
}
.wheel-result {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.3);
  z-index: 10;
}
.roulette-bets { width: 100%; }
.roulette-bets h3 { color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.bet-type-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.bet-type-btn {
  padding: 8px 16px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition);
}
.bet-type-btn:hover { border-color: var(--gold); color: var(--gold); }
.bet-type-btn.active { background: rgba(201,162,39,0.15); border-color: var(--gold); color: var(--gold); font-weight: 700; }

/* ── Coin Flip ─────────────────────────────────── */
.coin-wrap { perspective: 600px; }
.coin {
  width: 120px;
  height: 120px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
}
.coin-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  backface-visibility: hidden;
  border: 4px solid var(--gold);
  box-shadow: 0 0 20px rgba(201,162,39,0.3);
}
.coin-heads { background: linear-gradient(135deg, #c9a227, #8b6914); color: #0d0d0d; }
.coin-tails { background: linear-gradient(135deg, #4a4a4a, #2a2a2a); color: #fff; transform: rotateY(180deg); }
.coin.spinning { animation: coinSpin 0.9s ease-in-out; }
.coin.show-heads { transform: rotateY(0deg); }
.coin.show-tails { transform: rotateY(180deg); }
@keyframes coinSpin {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(1080deg); }
}
.choice-buttons { display: flex; gap: 16px; }
.choice-btn {
  padding: 14px 32px;
  background: var(--bg3);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  transition: all var(--transition);
  min-width: 140px;
  text-align: center;
}
.choice-btn:hover { border-color: var(--gold); color: var(--gold); }
.choice-btn.active { background: rgba(201,162,39,0.15); border-color: var(--gold); color: var(--gold); }

/* ── Dice ──────────────────────────────────────── */
.dice-wrap { display: flex; align-items: center; justify-content: center; padding: 20px; }
.dice {
  width: 100px;
  height: 100px;
  background: #fff;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), inset 0 -4px 8px rgba(0,0,0,0.1);
}
.dice-face { font-size: 3.5rem; }
.dice.rolling { animation: diceRoll 0.5s ease-in-out; }
@keyframes diceRoll {
  0%,100%{ transform: rotate(0deg); }
  25%    { transform: rotate(-20deg) scale(1.1); }
  75%    { transform: rotate(20deg) scale(1.1); }
}
.dice-number-grid { display: flex; gap: 8px; }
.dice-num-btn {
  width: 44px;
  height: 44px;
  background: var(--bg3);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  transition: all var(--transition);
}
.dice-num-btn:hover { border-color: var(--gold); color: var(--gold); }
.dice-num-btn.active { background: rgba(201,162,39,0.15); border-color: var(--gold); color: var(--gold); }

/* ── Page Content (leaderboard, jackpot, profile) ── */
.page-content { flex: 1; max-width: 1100px; margin: 0 auto; padding: 32px 20px; width: 100%; }
.page-title { font-size: 2rem; color: var(--gold); margin-bottom: 28px; }

/* Leaderboard */
.leaderboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.lb-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.lb-card h2 { color: var(--gold); font-size: 1.1rem; margin-bottom: 16px; }
.lb-full { grid-column: 1 / -1; }
.lb-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.lb-table thead th {
  padding: 10px 12px;
  text-align: left;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
}
.lb-table tbody td { padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.lb-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.lb-table .empty { text-align: center; color: var(--text-muted); padding: 24px; }
.top-1 td { color: var(--gold-light); font-weight: 700; }
.top-2 td { color: #c0c0c0; }
.top-3 td { color: #cd7f32; }
.gold { color: var(--gold); font-weight: 700; }
.amount-pos { color: var(--success); font-weight: 600; }
.amount-neg { color: var(--red); font-weight: 600; }

/* Transaction badges */
.txn-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
}
.txn-bet  { background: rgba(192,57,43,0.2); color: #e74c3c; }
.txn-win  { background: rgba(39,174,96,0.2); color: #2ecc71; }
.txn-bonus{ background: rgba(201,162,39,0.2); color: var(--gold); }
.txn-adjustment{ background: rgba(41,128,185,0.2); color: #3498db; }

/* Jackpot Hero */
.jackpot-hero {
  text-align: center;
  background: linear-gradient(135deg, #1a0a00 0%, #2e1a00 50%, #1a0a00 100%);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 48px 32px;
  margin-bottom: 32px;
  animation: jackpotGlow 3s ease-in-out infinite;
}
.jackpot-hero-icon { font-size: 4rem; display: block; margin-bottom: 12px; }
.jackpot-hero-label { color: var(--gold); letter-spacing: 3px; text-transform: uppercase; font-size: 0.9rem; }
.jackpot-hero-amount {
  font-size: 4rem;
  font-weight: 900;
  color: var(--gold-light);
  text-shadow: 0 0 30px rgba(240,192,64,0.6);
  margin: 8px 0;
  display: block;
}
.jackpot-hero-sub { color: var(--text-muted); font-size: 0.9rem; }
.jackpot-last-won { margin-top: 12px; color: var(--text-muted); font-size: 0.85rem; }

/* Info steps */
.info-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.info-card h2 { color: var(--gold); margin-bottom: 20px; font-size: 1.1rem; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.info-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
}
.info-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold);
  color: #0d0d0d;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  flex-shrink: 0;
}
.info-step p { font-size: 0.85rem; color: var(--text-muted); }

/* Profile */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.profile-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.profile-card h2 { color: var(--gold); font-size: 1.1rem; margin-bottom: 16px; }
.profile-full { grid-column: 1 / -1; }
.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #8b6914);
  color: #0d0d0d;
  font-size: 1.6rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.profile-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.profile-table th {
  width: 35%;
  text-align: left;
  padding: 8px 0;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
.profile-table td { padding: 8px 0 8px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); }

/* Stat grid */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-box {
  background: var(--bg3);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.stat-box-val { font-size: 1.2rem; font-weight: 700; color: var(--gold); }
.stat-box-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }

/* Admin */
.admin-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.admin-card h2 { color: var(--gold); font-size: 1.1rem; margin-bottom: 16px; }
.admin-table { font-size: 0.85rem; }
.admin-table td, .admin-table th { white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.inline-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.inline-form label { color: var(--text-muted); font-size: 0.85rem; }

/* ── Footer ────────────────────────────────────── */
.site-footer {
  background: #050a06;
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-inner p { color: var(--text-muted); font-size: 0.8rem; }
.footer-nav { display: flex; gap: 16px; }
.footer-nav a { color: var(--text-muted); font-size: 0.8rem; }
.footer-nav a:hover { color: var(--gold); }

/* ── Responsive ────────────────────────────────── */
@media (max-width: 768px) {
  .header-nav { display: none; }
  .header-right .btn { display: none; }
  .header-right .balance-display { display: flex; }
  .header-right .header-username { display: none; }
  .hamburger { display: block; }

  .jackpot-amount { font-size: 2rem; }
  .jackpot-hero-amount { font-size: 2.5rem; }

  .games-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .game-icon { font-size: 2rem; }

  .slots-reels { gap: 8px; }
  .reel { width: 80px; height: 80px; }
  .reel-symbol { font-size: 2rem; line-height: 80px; }

  .bj-actions { gap: 8px; }
  .bj-actions .btn { padding: 10px 16px; font-size: 0.9rem; }

  .profile-grid { grid-template-columns: 1fr; }
  .leaderboard-grid { grid-template-columns: 1fr; }
  .lb-full { grid-column: auto; }
  .footer-inner { flex-direction: column; text-align: center; }

  #roulette-canvas { width: 260px; height: 260px; }
  .choice-buttons { flex-direction: column; width: 100%; }
  .choice-btn { min-width: unset; width: 100%; }

  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; }
  .game-container { gap: 16px; }
  .slots-machine { padding: 20px; }
  .reel { width: 70px; height: 70px; }
  .reel-symbol { font-size: 1.8rem; line-height: 70px; }
  .stats-row { grid-template-columns: 1fr; }
  .paytable { font-size: 0.85rem; }
}

/* ═══════════════════════════════════════════════════
   CM Casino — 3D Animation Layer
   All wrapped in prefers-reduced-motion: no-preference
   ═══════════════════════════════════════════════════ */

/* ── Floating particle background ─────────────────── */
.particle-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.particle-bg .particle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201,162,39,0.6) 0%, transparent 70%);
  will-change: transform, opacity;
}

/* ── Neon glow text ────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .game-title, .page-title {
    animation: neonGlow 3s ease-in-out infinite alternate;
  }
  @keyframes neonGlow {
    0%   { text-shadow: 0 0 10px rgba(201,162,39,0.3), 0 0 20px rgba(201,162,39,0.2); }
    100% { text-shadow: 0 0 20px rgba(201,162,39,0.7), 0 0 40px rgba(201,162,39,0.4), 0 0 60px rgba(201,162,39,0.2); }
  }
}

/* ── Page entrance fadeInUp ────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  @keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px) translateZ(0); }
    to   { opacity: 1; transform: translateY(0) translateZ(0); }
  }
  .lobby > *, .game-container > *, .page-content > * {
    animation: fadeInUp 0.5s ease both;
    will-change: transform, opacity;
  }
  .lobby > *:nth-child(1) { animation-delay: 0.05s; }
  .lobby > *:nth-child(2) { animation-delay: 0.15s; }
  .lobby > *:nth-child(3) { animation-delay: 0.25s; }
  .game-container > *:nth-child(1) { animation-delay: 0.05s; }
  .game-container > *:nth-child(2) { animation-delay: 0.12s; }
  .game-container > *:nth-child(3) { animation-delay: 0.19s; }
  .game-container > *:nth-child(4) { animation-delay: 0.26s; }
  .game-container > *:nth-child(5) { animation-delay: 0.33s; }
  .game-container > *:nth-child(6) { animation-delay: 0.40s; }
}

/* ── 3D Game card hover ────────────────────────────── */
.game-card {
  perspective: 1000px;
  transform-style: preserve-3d;
  transform: translateZ(0);
  will-change: transform;
  cursor: pointer;
}
@media (prefers-reduced-motion: no-preference) {
  /* JS-driven tilt is applied via inline style; CSS handles transition */
  .game-card {
    transition: transform 0.15s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  }
  .game-card:hover {
    box-shadow: 0 20px 48px rgba(201,162,39,0.25);
    border-color: var(--gold);
  }
}

/* ── Gold shimmer on buttons ───────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .btn-primary, .btn-success, .btn-warning {
    position: relative;
    overflow: hidden;
  }
  .btn-primary::after, .btn-success::after, .btn-warning::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0s;
  }
  .btn-primary:hover:not(:disabled)::after,
  .btn-success:hover:not(:disabled)::after,
  .btn-warning:hover:not(:disabled)::after {
    left: 160%;
    transition: left 0.55s ease;
  }
}

/* ── 3D button press ───────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .btn:active:not(:disabled) {
    transform: translateY(2px) translateZ(-4px) scale(0.97);
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
    transition: transform 0.07s ease, box-shadow 0.07s ease;
  }
}

/* ── Jackpot counter pulse ─────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .jackpot-amount, .jackpot-hero-amount {
    display: inline-block;
    animation: jackpotPulse 2s ease-in-out infinite;
    will-change: transform;
    transform: translateZ(0);
  }
  @keyframes jackpotPulse {
    0%, 100% { transform: scale(1) translateZ(0); filter: drop-shadow(0 0 8px rgba(240,192,64,0.4)); }
    50%       { transform: scale(1.04) translateZ(0); filter: drop-shadow(0 0 24px rgba(240,192,64,0.8)); }
  }
}

/* ── Balance counter animation class ──────────────── */
.balance-amount.counting {
  animation: balanceCount 0.4s ease-out;
  will-change: transform;
}
@keyframes balanceCount {
  0%   { transform: scale(1.2) translateZ(0); color: #fff; }
  100% { transform: scale(1) translateZ(0); }
}

/* ── Chip bounce loading animation ────────────────── */
.chip-loader {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: conic-gradient(
    var(--gold) 0deg 60deg,
    #8b6914 60deg 120deg,
    var(--gold) 120deg 180deg,
    #8b6914 180deg 240deg,
    var(--gold) 240deg 300deg,
    #8b6914 300deg 360deg
  );
  border: 4px solid var(--gold);
  box-shadow: 0 0 16px rgba(201,162,39,0.4);
  display: inline-block;
}
@media (prefers-reduced-motion: no-preference) {
  .chip-loader {
    animation: chipBounce 0.8s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
    will-change: transform;
  }
  @keyframes chipBounce {
    0%, 100% { transform: translateY(0) rotateZ(0deg) translateZ(0); }
    30%      { transform: translateY(-16px) rotateZ(180deg) translateZ(0); }
    60%      { transform: translateY(-4px) rotateZ(320deg) translateZ(0); }
    80%      { transform: translateY(-8px) rotateZ(340deg) translateZ(0); }
  }
}

/* ── Leaderboard row slide-in stagger ─────────────── */
@media (prefers-reduced-motion: no-preference) {
  .lb-table tbody tr {
    animation: rowSlideIn 0.35s ease both;
    will-change: transform, opacity;
  }
  @keyframes rowSlideIn {
    from { transform: translateX(-24px) translateZ(0); opacity: 0; }
    to   { transform: translateX(0) translateZ(0); opacity: 1; }
  }
  .lb-table tbody tr:nth-child(1)  { animation-delay: 0.05s; }
  .lb-table tbody tr:nth-child(2)  { animation-delay: 0.10s; }
  .lb-table tbody tr:nth-child(3)  { animation-delay: 0.15s; }
  .lb-table tbody tr:nth-child(4)  { animation-delay: 0.20s; }
  .lb-table tbody tr:nth-child(5)  { animation-delay: 0.25s; }
  .lb-table tbody tr:nth-child(6)  { animation-delay: 0.30s; }
  .lb-table tbody tr:nth-child(7)  { animation-delay: 0.35s; }
  .lb-table tbody tr:nth-child(8)  { animation-delay: 0.40s; }
  .lb-table tbody tr:nth-child(9)  { animation-delay: 0.45s; }
  .lb-table tbody tr:nth-child(10) { animation-delay: 0.50s; }
}

/* ── Logo float ────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .site-logo {
    display: inline-block;
    animation: logoFloat 4s ease-in-out infinite;
    will-change: transform;
  }
  @keyframes logoFloat {
    0%, 100% { transform: translateY(0) translateZ(0); }
    50%       { transform: translateY(-4px) translateZ(0); }
  }
}

/* ── Nav link 3D underline ─────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .header-nav a {
    position: relative;
    overflow: hidden;
  }
  .header-nav a::after {
    content: '';
    position: absolute;
    left: -100%;
    bottom: 2px;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    transition: left 0.3s ease;
    transform: translateZ(2px);
  }
  .header-nav a:hover::after { left: 0; }
}

/* ── Casino chip corner decorations ───────────────── */
.chip-corner {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: conic-gradient(
    var(--gold) 0deg 60deg,
    #8b6914 60deg 120deg,
    var(--gold) 120deg 180deg,
    #8b6914 180deg 240deg,
    var(--gold) 240deg 300deg,
    #8b6914 300deg 360deg
  );
  border: 3px solid var(--gold);
  opacity: 0.4;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .chip-corner {
    animation: chipSpin 8s linear infinite;
    will-change: transform;
  }
  .chip-corner:nth-child(2) { animation-duration: 10s; animation-direction: reverse; }
  .chip-corner:nth-child(3) { animation-duration: 12s; }
  .chip-corner:nth-child(4) { animation-duration: 9s; animation-direction: reverse; }
  @keyframes chipSpin {
    from { transform: rotate(0deg) translateZ(0); }
    to   { transform: rotate(360deg) translateZ(0); }
  }
}

/* ── 3D Slot Drum Reel ─────────────────────────────── */
.slots-reel-3d-wrap {
  width: 100px;
  height: 100px;
  perspective: 400px;
  position: relative;
  flex-shrink: 0;
}
.slots-drum {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(0deg);
  will-change: transform;
  cursor: default;
}
.drum-face {
  position: absolute;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  line-height: 1;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  backface-visibility: hidden;
  will-change: transform;
}
/* 6-face drum: each face = 100px tall, cylinder radius = 100/(2*tan(PI/6)) ≈ 86.6px */
.drum-face:nth-child(1) { transform: rotateX(  0deg) translateZ(86px); }
.drum-face:nth-child(2) { transform: rotateX( 60deg) translateZ(86px); }
.drum-face:nth-child(3) { transform: rotateX(120deg) translateZ(86px); }
.drum-face:nth-child(4) { transform: rotateX(180deg) translateZ(86px); }
.drum-face:nth-child(5) { transform: rotateX(240deg) translateZ(86px); }
.drum-face:nth-child(6) { transform: rotateX(300deg) translateZ(86px); }

/* Win-line flash */
.slots-winline {
  position: absolute;
  left: 0; right: 0;
  top: calc(50% - 2px);
  height: 4px;
  background: transparent;
  pointer-events: none;
  border-radius: 2px;
  z-index: 10;
  transition: background 0.2s;
}
@media (prefers-reduced-motion: no-preference) {
  .slots-winline.win-flash {
    background: var(--gold);
    animation: winLineFlash 0.6s ease-in-out 3;
    will-change: opacity, box-shadow;
  }
  @keyframes winLineFlash {
    0%, 100% { opacity: 1; box-shadow: 0 0 12px var(--gold), 0 0 24px rgba(201,162,39,0.6); }
    50%       { opacity: 0.3; box-shadow: none; }
  }
}

/* Jackpot particle explosion */
.jackpot-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  display: none;
}
.jackpot-particles.active { display: block; }
.jp-particle {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  will-change: transform, opacity;
}
@media (prefers-reduced-motion: no-preference) {
  @keyframes jpParticleExplode {
    0%   { transform: translate(0,0) scale(1) translateZ(0); opacity: 1; }
    100% { transform: translate(var(--tx), var(--ty)) scale(0) translateZ(0); opacity: 0; }
  }
}

/* 3D Slot Lever */
.slot-lever-wrap {
  position: absolute;
  right: -28px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.lever-shaft {
  width: 8px;
  flex: 1;
  background: linear-gradient(90deg, #6b4f1c, #c9a227, #6b4f1c);
  border-radius: 4px;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.5);
}
.lever-ball {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f0c040, #8b6914);
  box-shadow: 0 3px 8px rgba(0,0,0,0.5), inset 0 -2px 4px rgba(0,0,0,0.3);
  will-change: transform;
}
@media (prefers-reduced-motion: no-preference) {
  .slot-lever-wrap.pulling .lever-ball {
    animation: leverPull 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) forwards;
    will-change: transform;
  }
  @keyframes leverPull {
    0%   { transform: translateY(0) translateZ(0); }
    40%  { transform: translateY(60px) translateZ(0) rotate(15deg); }
    70%  { transform: translateY(50px) translateZ(0); }
    100% { transform: translateY(0) translateZ(0); }
  }
}

/* ── 3D Blackjack Cards ────────────────────────────── */
.card-3d-wrap {
  perspective: 600px;
  display: inline-block;
}
.playing-card-3d {
  width: 60px;
  height: 84px;
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  cursor: default;
}
.card-3d-front, .card-3d-back {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}
.card-3d-front {
  background: #fff;
  color: #1a1a1a;
  transform: rotateY(0deg);
}
.card-3d-front.red-card { color: #c0392b; }
.card-3d-back {
  background: linear-gradient(135deg, #1a2e9e, #0d1f6e);
  color: #fff;
  font-size: 1.5rem;
  transform: rotateY(180deg);
}
@media (prefers-reduced-motion: no-preference) {
  .playing-card-3d.deal-in {
    animation: cardDealIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    will-change: transform, opacity;
  }
  @keyframes cardDealIn {
    0%   { transform: translateY(-60px) translateX(30px) rotateY(180deg) scale(0.7) translateZ(0); opacity: 0; }
    60%  { opacity: 1; }
    100% { transform: translateY(0) translateX(0) rotateY(0deg) scale(1) translateZ(0); opacity: 1; }
  }
  .playing-card-3d.flip-reveal {
    animation: cardFlipReveal 0.6s ease both;
    will-change: transform;
  }
  @keyframes cardFlipReveal {
    0%   { transform: rotateY(180deg) translateZ(0); }
    100% { transform: rotateY(0deg) translateZ(0); }
  }
  .playing-card-3d:hover {
    transform: rotateX(-8deg) rotateY(5deg) translateY(-4px) translateZ(8px);
    transition: transform 0.2s ease;
    z-index: 5;
  }
}

/* Dealer thinking dots */
.dealer-thinking {
  display: none;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}
.dealer-thinking.visible { display: flex; }
.think-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  will-change: transform, opacity;
}
@media (prefers-reduced-motion: no-preference) {
  .think-dot {
    animation: thinkPulse 1.2s ease-in-out infinite;
  }
  .think-dot:nth-child(2) { animation-delay: 0.2s; }
  .think-dot:nth-child(3) { animation-delay: 0.4s; }
  @keyframes thinkPulse {
    0%, 80%, 100% { transform: scale(1) translateZ(0); opacity: 0.4; }
    40%            { transform: scale(1.5) translateZ(0); opacity: 1; }
  }
}

/* BJ result overlay */
.bj-result-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
  pointer-events: none;
}
.bj-result-overlay.show { display: flex; }
.bj-overlay-text {
  font-size: 4rem;
  font-weight: 900;
  text-shadow: 0 4px 20px rgba(0,0,0,0.8);
  will-change: transform, opacity;
}
@media (prefers-reduced-motion: no-preference) {
  .bj-result-overlay.show .bj-overlay-text {
    animation: resultZoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
  }
  @keyframes resultZoomIn {
    0%   { transform: scale(0.3) translateZ(0); opacity: 0; }
    70%  { transform: scale(1.1) translateZ(0); opacity: 1; }
    100% { transform: scale(1) translateZ(0); opacity: 1; }
  }
}

/* ── 3D Roulette enhancements ──────────────────────── */
.roulette-wheel-wrap {
  filter: drop-shadow(0 8px 24px rgba(201,162,39,0.3));
  will-change: filter;
}
@media (prefers-reduced-motion: no-preference) {
  .roulette-wheel-wrap {
    transition: filter 0.3s ease;
  }
  .roulette-wheel-wrap.spinning-glow {
    filter: drop-shadow(0 8px 40px rgba(201,162,39,0.6));
  }
}

/* Winning number spotlight */
#wheel-number {
  will-change: transform, box-shadow;
}
@media (prefers-reduced-motion: no-preference) {
  #wheel-number.spotlight {
    animation: winnerSpotlight 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    will-change: transform, box-shadow;
  }
  @keyframes winnerSpotlight {
    0%   { transform: translate(-50%, -50%) scale(0.5) translateZ(0); box-shadow: none; }
    60%  { transform: translate(-50%, -50%) scale(1.3) translateZ(0); }
    100% { transform: translate(-50%, -50%) scale(1) translateZ(0); box-shadow: 0 0 30px 10px rgba(240,192,64,0.5); }
  }
}

/* Chip placement animation */
.bet-chip-anim {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: conic-gradient(var(--gold) 0 50%, #8b6914 50% 100%);
  border: 2px solid var(--gold);
  pointer-events: none;
  will-change: transform, opacity;
}
@media (prefers-reduced-motion: no-preference) {
  .bet-chip-anim {
    animation: chipPlace 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  }
  @keyframes chipPlace {
    0%   { transform: scale(0) translateZ(0); opacity: 0; }
    70%  { transform: scale(1.2) translateZ(0); opacity: 1; }
    100% { transform: scale(1) translateZ(0); opacity: 1; }
  }
}

/* ── 3D Coin Flip enhanced ─────────────────────────── */
.coin-wrap { perspective: 800px; }
.coin {
  width: 140px;
  height: 140px;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(0deg);
  transition: transform 0.8s ease;
  will-change: transform;
}
.coin-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  backface-visibility: hidden;
  border: 6px solid var(--gold);
  box-shadow: 0 0 20px rgba(201,162,39,0.3);
  will-change: transform;
}
.coin-heads {
  background:
    radial-gradient(circle at 30% 30%, #f0c040 0%, #c9a227 40%, #8b6914 100%);
  color: #3a2500;
}
.coin-tails {
  background:
    radial-gradient(circle at 30% 30%, #888 0%, #555 40%, #222 100%);
  color: #ddd;
  transform: rotateY(180deg);
}
/* Shimmer overlay on coin faces */
.coin-face::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.35) 0%, transparent 50%, rgba(255,255,255,0.1) 100%);
  pointer-events: none;
}
/* Edge ring */
.coin::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(
    var(--gold) 0deg 30deg, #8b6914 30deg 60deg,
    var(--gold) 60deg 90deg, #8b6914 90deg 120deg,
    var(--gold) 120deg 150deg, #8b6914 150deg 180deg,
    var(--gold) 180deg 210deg, #8b6914 210deg 240deg,
    var(--gold) 240deg 270deg, #8b6914 270deg 300deg,
    var(--gold) 300deg 330deg, #8b6914 330deg 360deg
  );
  transform: translateZ(-2px);
  border-radius: 50%;
  will-change: transform;
}
@media (prefers-reduced-motion: no-preference) {
  .coin.spinning {
    animation: coinFlip3D 1.1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    will-change: transform;
  }
  @keyframes coinFlip3D {
    0%   { transform: rotateY(0deg) translateZ(0); }
    15%  { transform: rotateY(360deg) translateY(-20px) translateZ(0); }
    30%  { transform: rotateY(720deg) translateY(-30px) translateZ(0); }
    45%  { transform: rotateY(1080deg) translateY(-20px) translateZ(0); }
    60%  { transform: rotateY(1440deg) translateY(-8px) translateZ(0); }
    75%  { transform: rotateY(1710deg) translateY(-2px) translateZ(0); }
    88%  { transform: rotateY(1770deg) scaleZ(0.85) translateZ(0); }
    100% { transform: rotateY(1800deg) translateZ(0); }
  }
  /* Win/lose glow ring */
  .coin.result-win::after {
    box-shadow: 0 0 0 8px rgba(39,174,96,0.6), 0 0 40px rgba(39,174,96,0.4);
    animation: winGlowRing 0.6s ease-out forwards;
  }
  .coin.result-lose::after {
    box-shadow: 0 0 0 8px rgba(192,57,43,0.6), 0 0 40px rgba(192,57,43,0.4);
    animation: winGlowRing 0.6s ease-out forwards;
  }
  @keyframes winGlowRing {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
  }
  /* Landing clink compress */
  .coin.landing {
    animation: coinLand 0.25s ease-out forwards;
    will-change: transform;
  }
  @keyframes coinLand {
    0%   { transform: scaleZ(1) translateZ(0); }
    40%  { transform: scaleZ(0.7) scaleX(1.1) scaleY(1.1) translateZ(0); }
    70%  { transform: scaleZ(1.05) translateZ(0); }
    100% { transform: scaleZ(1) translateZ(0); }
  }
}

/* ── 3D CSS Dice ────────────────────────────────────── */
.dice-scene {
  display: flex;
  gap: 32px;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: radial-gradient(ellipse at center, #0f3a1d 0%, #071a0e 100%);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: inset 0 4px 20px rgba(0,0,0,0.4);
}
.dice-3d-wrap {
  perspective: 400px;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}
.dice-3d {
  width: 80px;
  height: 80px;
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  transform: rotateX(-20deg) rotateY(30deg);
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
/* 6 faces of a cube — each 80px, translateZ = 40px */
.d-face {
  position: absolute;
  width: 80px;
  height: 80px;
  background: #fff;
  border-radius: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 8px;
  gap: 4px;
  box-shadow: inset 0 0 8px rgba(0,0,0,0.15);
  backface-visibility: hidden;
  will-change: transform;
}
.d-face-1 { transform: rotateX(  0deg) translateZ(40px); }
.d-face-2 { transform: rotateX(180deg) translateZ(40px); }
.d-face-3 { transform: rotateY( 90deg) translateZ(40px); }
.d-face-4 { transform: rotateY(-90deg) translateZ(40px); }
.d-face-5 { transform: rotateX( 90deg) translateZ(40px); }
.d-face-6 { transform: rotateX(-90deg) translateZ(40px); }
.pip {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #1a1a1a;
}
.pip.empty { background: transparent; }

/* Face-1 (1 pip center) */
.d-face-1 .pip:nth-child(1) { grid-column:1; grid-row:1; background:transparent; }
.d-face-1 .pip:nth-child(2) { grid-column:1; grid-row:2; background:transparent; }
.d-face-1 .pip:nth-child(3) { grid-column:1; grid-row:3; background:transparent; }
.d-face-1 .pip:nth-child(4) { grid-column:2; grid-row:1; background:transparent; }
.d-face-1 .pip:nth-child(5) { grid-column:2; grid-row:2; }
.d-face-1 .pip:nth-child(6) { grid-column:2; grid-row:3; background:transparent; }
.d-face-1 .pip:nth-child(7) { grid-column:3; grid-row:1; background:transparent; }
.d-face-1 .pip:nth-child(8) { grid-column:3; grid-row:2; background:transparent; }
.d-face-1 .pip:nth-child(9) { grid-column:3; grid-row:3; background:transparent; }

/* Face-2 (2 pips diagonal) */
.d-face-2 .pip:nth-child(1) { grid-column:1; grid-row:1; }
.d-face-2 .pip:nth-child(2) { grid-column:1; grid-row:2; background:transparent; }
.d-face-2 .pip:nth-child(3) { grid-column:1; grid-row:3; background:transparent; }
.d-face-2 .pip:nth-child(4) { grid-column:2; grid-row:1; background:transparent; }
.d-face-2 .pip:nth-child(5) { grid-column:2; grid-row:2; background:transparent; }
.d-face-2 .pip:nth-child(6) { grid-column:2; grid-row:3; background:transparent; }
.d-face-2 .pip:nth-child(7) { grid-column:3; grid-row:1; background:transparent; }
.d-face-2 .pip:nth-child(8) { grid-column:3; grid-row:2; background:transparent; }
.d-face-2 .pip:nth-child(9) { grid-column:3; grid-row:3; }

/* Face-3 (3 pips diagonal) */
.d-face-3 .pip:nth-child(1) { grid-column:1; grid-row:1; }
.d-face-3 .pip:nth-child(2) { grid-column:1; grid-row:2; background:transparent; }
.d-face-3 .pip:nth-child(3) { grid-column:1; grid-row:3; background:transparent; }
.d-face-3 .pip:nth-child(4) { grid-column:2; grid-row:1; background:transparent; }
.d-face-3 .pip:nth-child(5) { grid-column:2; grid-row:2; }
.d-face-3 .pip:nth-child(6) { grid-column:2; grid-row:3; background:transparent; }
.d-face-3 .pip:nth-child(7) { grid-column:3; grid-row:1; background:transparent; }
.d-face-3 .pip:nth-child(8) { grid-column:3; grid-row:2; background:transparent; }
.d-face-3 .pip:nth-child(9) { grid-column:3; grid-row:3; }

/* Face-4 (4 pips corners) */
.d-face-4 .pip:nth-child(1) { grid-column:1; grid-row:1; }
.d-face-4 .pip:nth-child(2) { grid-column:1; grid-row:2; background:transparent; }
.d-face-4 .pip:nth-child(3) { grid-column:1; grid-row:3; }
.d-face-4 .pip:nth-child(4) { grid-column:2; grid-row:1; background:transparent; }
.d-face-4 .pip:nth-child(5) { grid-column:2; grid-row:2; background:transparent; }
.d-face-4 .pip:nth-child(6) { grid-column:2; grid-row:3; background:transparent; }
.d-face-4 .pip:nth-child(7) { grid-column:3; grid-row:1; }
.d-face-4 .pip:nth-child(8) { grid-column:3; grid-row:2; background:transparent; }
.d-face-4 .pip:nth-child(9) { grid-column:3; grid-row:3; }

/* Face-5 (5 pips) */
.d-face-5 .pip:nth-child(1) { grid-column:1; grid-row:1; }
.d-face-5 .pip:nth-child(2) { grid-column:1; grid-row:2; background:transparent; }
.d-face-5 .pip:nth-child(3) { grid-column:1; grid-row:3; }
.d-face-5 .pip:nth-child(4) { grid-column:2; grid-row:1; background:transparent; }
.d-face-5 .pip:nth-child(5) { grid-column:2; grid-row:2; }
.d-face-5 .pip:nth-child(6) { grid-column:2; grid-row:3; background:transparent; }
.d-face-5 .pip:nth-child(7) { grid-column:3; grid-row:1; }
.d-face-5 .pip:nth-child(8) { grid-column:3; grid-row:2; background:transparent; }
.d-face-5 .pip:nth-child(9) { grid-column:3; grid-row:3; }

/* Face-6 (6 pips) */
.d-face-6 .pip:nth-child(1) { grid-column:1; grid-row:1; }
.d-face-6 .pip:nth-child(2) { grid-column:1; grid-row:2; }
.d-face-6 .pip:nth-child(3) { grid-column:1; grid-row:3; }
.d-face-6 .pip:nth-child(4) { grid-column:3; grid-row:1; }
.d-face-6 .pip:nth-child(5) { grid-column:3; grid-row:2; }
.d-face-6 .pip:nth-child(6) { grid-column:3; grid-row:3; }
.d-face-6 .pip:nth-child(7) { grid-column:2; grid-row:1; background:transparent; }
.d-face-6 .pip:nth-child(8) { grid-column:2; grid-row:2; background:transparent; }
.d-face-6 .pip:nth-child(9) { grid-column:2; grid-row:3; background:transparent; }

@media (prefers-reduced-motion: no-preference) {
  .dice-3d.rolling-anim {
    animation: dice3DRoll 1.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    will-change: transform;
  }
  @keyframes dice3DRoll {
    0%   { transform: rotateX(-20deg) rotateY(30deg) translateZ(0); }
    15%  { transform: rotateX(120deg) rotateY(240deg) rotateZ(60deg) translateZ(0); }
    30%  { transform: rotateX(300deg) rotateY(120deg) rotateZ(180deg) translateZ(0); }
    50%  { transform: rotateX(540deg) rotateY(360deg) rotateZ(90deg) translateZ(0); }
    70%  { transform: rotateX(660deg) rotateY(480deg) rotateZ(270deg) translateZ(0); }
    85%  { transform: rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) rotateZ(10deg) translateZ(0); }
    95%  { transform: rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) rotateZ(-5deg) translateZ(0); }
    100% { transform: rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) rotateZ(0deg) translateZ(0); }
  }
}

/* Table felt under dice */
.dice-scene::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: repeating-conic-gradient(
    rgba(255,255,255,0.01) 0deg 90deg,
    transparent 90deg 180deg
  ) 0 0 / 20px 20px;
  pointer-events: none;
}
.dice-scene { position: relative; }

/* ── Responsive overrides for new elements ─────────── */
@media (max-width: 768px) {
  .slots-reel-3d-wrap { width: 80px; height: 80px; }
  .drum-face { width: 80px; height: 80px; font-size: 2rem; }
  .drum-face:nth-child(1) { transform: rotateX(  0deg) translateZ(69px); }
  .drum-face:nth-child(2) { transform: rotateX( 60deg) translateZ(69px); }
  .drum-face:nth-child(3) { transform: rotateX(120deg) translateZ(69px); }
  .drum-face:nth-child(4) { transform: rotateX(180deg) translateZ(69px); }
  .drum-face:nth-child(5) { transform: rotateX(240deg) translateZ(69px); }
  .drum-face:nth-child(6) { transform: rotateX(300deg) translateZ(69px); }
  .dice-scene { gap: 16px; padding: 20px; }
  .coin { width: 110px; height: 110px; }
}
@media (max-width: 480px) {
  .slots-reel-3d-wrap { width: 70px; height: 70px; }
  .drum-face { width: 70px; height: 70px; font-size: 1.8rem; }
  .drum-face:nth-child(1) { transform: rotateX(  0deg) translateZ(60px); }
  .drum-face:nth-child(2) { transform: rotateX( 60deg) translateZ(60px); }
  .drum-face:nth-child(3) { transform: rotateX(120deg) translateZ(60px); }
  .drum-face:nth-child(4) { transform: rotateX(180deg) translateZ(60px); }
  .drum-face:nth-child(5) { transform: rotateX(240deg) translateZ(60px); }
  .drum-face:nth-child(6) { transform: rotateX(300deg) translateZ(60px); }
}
