@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@400;700&display=swap');

:root {
  --bg: #080810;
  --panel: #0e0e18;
  --line: #2a2a40;
  --muted: #7a7a90;
  --gold: #dfbd79;
  --gold-bright: #f5d79e;
  --gold-dim: #a08950;
  --red: #e63946;
  --red-light: #ff6b7a;
  --green: #2d6a4f;
  --green-light: #4ade80;
  --text: #f0f0f0;
  --card: #16162a;
  --glow-gold: rgba(223, 189, 121, 0.3);
  --glow-red: rgba(230, 57, 70, 0.3);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: 
    radial-gradient(ellipse at 30% 20%, rgba(223, 189, 121, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(230, 57, 70, 0.04) 0%, transparent 50%);
  z-index: 0;
}

/* ── Top Bar ── */
.topbar {
  height: 88px;
  border-bottom: 1px solid var(--line);
  padding: 20px 5%;
  display: flex;
  align-items: center;
  gap: 32px;
  position: relative;
  z-index: 10;
  background: rgba(8, 8, 16, 0.95);
  backdrop-filter: blur(20px);
}
.brand { font-size: 26px; font-weight: 900; letter-spacing: -1px; text-decoration: none; color: var(--text); }
.brand span { color: var(--gold); }
.brand small { display: block; font-size: 8px; letter-spacing: 3.3px; margin-top: 4px; color: var(--muted); }
.topbar a:nth-child(2) { margin-left: auto; font-size: 13px; color: var(--muted); text-decoration: none; }
.tag { font-size: 10px; letter-spacing: 1.4px; border: 1px solid rgba(255,255,255,0.15); border-radius: 20px; padding: 9px 12px; white-space: nowrap; }

/* ── Game Container ── */
.game-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px;
  position: relative;
  z-index: 1;
}

.game-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 30px;
}
.game-heading h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 400;
  font-size: 44px;
  letter-spacing: -1.5px;
  margin: 8px 0;
}
.game-heading h1 em { color: var(--gold); font-style: italic; }
.game-heading p { color: var(--muted); margin: 0; font-size: 13px; }
.eyebrow { color: var(--gold); font-size: 10px; letter-spacing: 2.4px; font-weight: bold; }
.game-number { text-align: right; }
.game-number small { display: block; font-size: 9px; letter-spacing: 2px; color: var(--muted); }
.game-number strong { font-size: 32px; font-family: 'Bebas Neue', sans-serif; color: var(--gold); }

/* ── Horizontal Layout ── */
.game-layout-horizontal {
  display: grid;
  grid-template-columns: 440px 1fr;
  gap: 28px;
  align-items: start;
}

/* ── LEFT: Wheel Panel ── */
.wheel-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.wheel-area {
  position: relative;
  width: 400px;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
}

#wheelCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: drop-shadow(0 0 40px rgba(223, 189, 121, 0.2)) drop-shadow(0 0 80px rgba(0,0,0,0.7));
  z-index: 1;
}

#ballCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
}

/* Outer decorative rings */
.wheel-outer-ring {
  position: absolute;
  width: 412px;
  height: 412px;
  border-radius: 50%;
  border: 4px solid rgba(223, 189, 121, 0.5);
  box-shadow: inset 0 0 30px rgba(0,0,0,0.6), 0 0 40px rgba(0,0,0,0.5);
  pointer-events: none;
  z-index: 2;
}

.wheel-outer-ring::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1px solid rgba(223, 189, 121, 0.15);
}

.wheel-outer-ring::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid rgba(223, 189, 121, 0.08);
}

.wheel-middle-ring {
  position: absolute;
  width: 385px;
  height: 385px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.05);
  pointer-events: none;
  z-index: 1;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
}

.wheel-inner-ring {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  border: 1px solid rgba(223, 189, 121, 0.12);
  pointer-events: none;
  z-index: 1;
}

/* Wheel pointer */
.wheel-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 24px solid var(--gold);
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.7)) drop-shadow(0 0 10px rgba(223,189,121,0.4));
  z-index: 20;
}

.wheel-pointer::after {
  content: '';
  position: absolute;
  top: 6px;
  left: -12px;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 16px solid rgba(223,189,121,0.3);
}

/* Wheel center */
.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  background: radial-gradient(circle at 35% 35%, #fff5e0 0%, #f5d79e 30%, #dfbd79 60%, #b8963a 100%);
  border-radius: 50%;
  box-shadow: 0 0 25px rgba(223, 189, 121, 0.5), inset 0 -4px 10px rgba(0,0,0,0.4), inset 0 2px 6px rgba(255,255,255,0.4);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  color: #1a1a2e;
  border: 2.5px solid rgba(255,255,255,0.35);
  text-shadow: 0 1px 2px rgba(255,255,255,0.3);
}

/* Ball indicator */
.ball-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  padding: 10px 18px;
  background: var(--panel);
  border-radius: 20px;
  border: 1px solid var(--line);
  transition: all 0.3s;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.ball-status.spinning {
  color: var(--red-light);
  border-color: rgba(230, 57, 70, 0.3);
  animation: pulse-glow 0.5s ease-in-out infinite alternate;
}

.ball-status.winner {
  color: var(--green-light);
  border-color: rgba(74, 222, 128, 0.3);
  animation: pulse-green 0.8s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
  from { box-shadow: 0 0 5px rgba(230,57,70,0.2); }
  to { box-shadow: 0 0 20px rgba(230,57,70,0.4); }
}
@keyframes pulse-green {
  from { box-shadow: 0 0 5px rgba(74,222,128,0.2); }
  to { box-shadow: 0 0 20px rgba(74,222,128,0.4); }
}

/* ── RIGHT: Betting Panel ── */
.bet-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* Balance bar */
.bet-info-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: var(--bg);
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--line);
}

.balance-item { text-align: center; }
.balance-item span { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.balance-item strong { font-family: 'Bebas Neue', sans-serif; font-size: 22px; color: var(--gold); }
.win-item strong { color: var(--green-light); }

/* Chip Section */
.chip-section { }

.bet-group-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.chip-selector { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.2);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  position: relative;
  box-shadow: 0 3px 12px rgba(0,0,0,0.5), inset 0 -3px 8px rgba(0,0,0,0.4), inset 0 2px 4px rgba(255,255,255,0.15);
}

.chip::before {
  content: '';
  position: absolute;
  top: 22%;
  left: 14%;
  width: 32%;
  height: 22%;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  transform: rotate(-15deg);
}

.chip::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60%;
  height: 60%;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.08);
  transform: translate(-50%, -50%);
}

.chip:hover { transform: scale(1.18); }
.chip.active { transform: scale(1.18); box-shadow: 0 0 20px rgba(255,255,255,0.35), 0 3px 12px rgba(0,0,0,0.5); }

.chip.val-1 { background: #ffffff; color: #111; border-color: #ccc; }
.chip.val-5 { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.chip.val-10 { background: linear-gradient(135deg, #ef4444, #dc2626); }
.chip.val-25 { background: linear-gradient(135deg, #10b981, #059669); }
.chip.val-100 { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.chip.val-500 { background: linear-gradient(135deg, #f59e0b, #d97706); }

/* Total bet display */
.bet-total-display {
  text-align: center;
  margin-top: 10px;
  padding: 8px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
}
.bet-total-display strong { color: var(--gold); font-family: 'Bebas Neue', sans-serif; font-size: 20px; }

/* ── Number Grid ── */
.number-grid { display: flex; flex-direction: column; gap: 5px; }

.grid-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.grid-zero { grid-column: span 2; }

.bet-btn {
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  min-height: 40px;
  touch-action: manipulation;
  position: relative;
  overflow: hidden;
}

.bet-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.bet-btn:hover {
  border-color: var(--gold);
  background: rgba(223, 189, 121, 0.08);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.bet-btn:active { transform: translateY(0); }

.bet-btn.active-bet {
  border-color: var(--gold);
  background: rgba(223, 189, 121, 0.15);
  box-shadow: 0 0 12px rgba(223, 189, 121, 0.3);
}

.bet-btn.red-num { color: var(--red-light); text-shadow: 0 0 8px rgba(230,57,70,0.3); }
.bet-btn.black-num { color: #c8c8d8; }
.bet-btn.green-num { color: var(--green-light); text-shadow: 0 0 8px rgba(74,222,128,0.3); }

.bet-btn.col-red { border-color: rgba(230,57,70,0.2); }
.bet-btn.col-black { border-color: rgba(170,170,170,0.1); }
.bet-btn.col-green { border-color: rgba(45,106,79,0.2); }

.grid-quick { grid-template-columns: repeat(6, 1fr); }
.grid-quick .bet-btn { font-size: 11px; padding: 8px 4px; color: var(--text); }

/* ── Action Buttons ── */
.action-row { display: flex; gap: 10px; margin-top: 4px; }

.btn-spin {
  flex: 1;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--red), #c1121f);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 24px;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  box-shadow: 0 4px 20px rgba(230, 57, 70, 0.4), 0 0 40px rgba(230, 57, 70, 0.15);
  position: relative;
  overflow: hidden;
}

.btn-spin::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.1) 50%, transparent 60%);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

.btn-spin:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 30px rgba(230, 57, 70, 0.6), 0 0 60px rgba(230, 57, 70, 0.2);
}

.btn-spin:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-clear {
  padding: 16px 20px;
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-clear:hover { border-color: var(--red); color: var(--red); }

/* ── Quick Stats ── */
.quick-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-box { background: var(--bg); border-radius: 10px; padding: 10px; text-align: center; border: 1px solid var(--line); }
.stat-val { font-family: 'Bebas Neue', sans-serif; font-size: 20px; color: var(--gold); }
.stat-label { font-size: 9px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }

/* ── History ── */
.history-section { margin-top: 4px; }
.history-row { display: flex; gap: 4px; flex-wrap: wrap; padding: 10px; background: var(--bg); border-radius: 10px; border: 1px solid var(--line); min-height: 40px; align-items: center; }
.history-dot { width: 26px; height: 26px; border-radius: 50%; font-size: 9px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; animation: fadeIn 0.3s ease-out; }
.history-dot.red { background: var(--red); }
.history-dot.black { background: #1a1a2e; border: 2px solid #444; }
.history-dot.green { background: var(--green); }

/* ── Status Messages ── */
.status-msg {
  text-align: center;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 15px;
  letter-spacing: 1px;
  margin-bottom: 8px;
  transition: all 0.3s;
  width: 100%;
}
.status-msg.waiting { background: rgba(223,189,121,0.1); color: var(--gold); }
.status-msg.spinning { background: rgba(230,57,70,0.1); color: var(--red-light); }
.status-msg.win { background: rgba(74,222,128,0.1); color: var(--green-light); }
.status-msg.lose { background: rgba(255,255,255,0.05); color: var(--muted); }

/* ── Rules ── */
.rules { margin-top: auto; }
details summary { cursor: pointer; color: var(--gold); font-size: 13px; font-weight: 600; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rules-content { padding: 10px 0; color: var(--muted); font-size: 12px; line-height: 1.7; }

/* ── Win Modal ── */
.win-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.win-overlay.show { display: flex; }

.win-modal {
  background: linear-gradient(135deg, #1a1a2e, #0e0e16);
  border: 2px solid var(--gold);
  border-radius: 24px;
  padding: 40px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 0 80px rgba(223, 189, 121, 0.2);
  animation: winAppear 0.5s cubic-bezier(.16,1,.3,1);
}
@keyframes winAppear { from { opacity: 0; transform: scale(0.8) translateY(30px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.win-kicker { font-size: 11px; letter-spacing: 4px; color: var(--gold); text-transform: uppercase; }
.win-number { font-family: 'Bebas Neue', sans-serif; font-size: 96px; line-height: 1; margin: 10px 0; }
.win-color { font-size: 16px; font-weight: 600; margin-bottom: 20px; }
.win-payout { font-family: 'Bebas Neue', sans-serif; font-size: 36px; color: #4ade80; margin-bottom: 10px; }
.win-details { color: var(--muted); font-size: 13px; margin-bottom: 30px; }
.win-btn { padding: 14px 40px; background: linear-gradient(135deg, var(--gold), #b8963a); color: #1a1a2e; border: none; border-radius: 12px; font-family: 'Bebas Neue', sans-serif; font-size: 18px; letter-spacing: 2px; cursor: pointer; transition: all 0.3s; }
.win-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 25px var(--glow-gold); }

/* ── Sound Toggle ── */
.sound-toggle {
  position: absolute;
  top: 100px;
  right: 20px;
  z-index: 100;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  font-size: 18px;
  transition: all 0.3s;
}
.sound-toggle:hover { border-color: var(--gold); color: var(--gold); }
.sound-toggle.muted { color: var(--red); }
.sound-toggle.muted::after { content: '🔇'; font-size: 16px; }

/* ── Footer ── */
.game-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.game-footer a { color: var(--gold); text-decoration: none; }
.game-footer a:hover { text-decoration: underline; }

/* ── Animations ── */
@keyframes fadeIn { from { opacity: 0; transform: scale(0.8); } to { opacity: 1; transform: scale(1); } }
@keyframes confettiFall { to { top: 110vh; transform: rotate(720deg) translateX(100px); opacity: 0; } }

/* ── Responsive ── */
@media (max-width: 900px) {
  .game-layout-horizontal { grid-template-columns: 1fr; }
  .wheel-area { width: 320px; height: 320px; }
  #wheelCanvas { width: 320px; height: 320px; }
  .wheel-outer-ring { width: 332px; height: 332px; }
  .wheel-middle-ring { width: 305px; height: 305px; }
  .wheel-inner-ring { width: 280px; height: 280px; }
  .wheel-center { width: 50px; height: 50px; font-size: 18px; }
}
@media (max-width: 500px) {
  .game-wrap { padding: 16px; }
  .game-heading h1 { font-size: 32px; }
  .game-layout-horizontal { gap: 16px; }
  .wheel-area { width: 280px; height: 280px; }
  #wheelCanvas { width: 280px; height: 280px; }
  .wheel-outer-ring { width: 292px; height: 292px; }
  .wheel-middle-ring { width: 265px; height: 265px; }
  .wheel-inner-ring { width: 240px; height: 240px; }
  .grid-row { gap: 3px; }
  .bet-btn { padding: 7px 3px; font-size: 12px; min-height: 34px; }
  .btn-spin { font-size: 20px; padding: 14px 20px; letter-spacing: 2px; }
  .chip { width: 36px; height: 36px; font-size: 12px; }
}
.wallet-scope-note{margin:8px 0 16px;padding:10px 12px;border:1px solid rgba(242,197,105,.24);border-radius:8px;background:rgba(242,197,105,.07);color:#e4dcc9;font-size:.76rem;line-height:1.55;text-align:center}.wallet-scope-note a{color:#f2c569;font-weight:700;text-decoration:underline;text-underline-offset:2px}
