:root {
  --bg-dark: #080c10;
  --bg-card: #121820;
  --felt-green: #0a3d24;
  --felt-border: #165b37;
  --gold-primary: #dfb15b;
  --gold-glow: rgba(223, 177, 91, 0.4);
  --gold-gradient: linear-gradient(135deg, #f7d98b 0%, #dfb15b 50%, #9e7428 100%);
  --accent-red: #e63946;
  --accent-black: #1e2229;
  --accent-green: #2a9d8f;
  --text-light: #f8f9fa;
  --text-muted: #8b9bb4;
  --border-gold: 1px solid rgba(223, 177, 91, 0.3);
  --font-serif: 'Cinzel', serif;
  --font-sans: 'Montserrat', sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-light);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 50% 20%, rgba(10, 61, 36, 0.5) 0%, rgba(8, 12, 16, 0.95) 70%),
    radial-gradient(circle at 80% 80%, rgba(223, 177, 91, 0.05) 0%, transparent 50%);
  overflow-x: hidden;
}

/* Wrapper Layout */
.casino-wrapper {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* VIP Header */
.vip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 16px 28px;
  border-radius: 16px;
  border: var(--border-gold);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand .crown {
  font-size: 2rem;
  filter: drop-shadow(0 0 8px var(--gold-glow));
}

.brand h1 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  letter-spacing: 2px;
  font-weight: 700;
}

.gold-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 12px rgba(223, 177, 91, 0.3);
}

.sub-badge {
  background: rgba(223, 177, 91, 0.15);
  color: var(--gold-primary);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--gold-primary);
  font-weight: 600;
  letter-spacing: 1px;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 18px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bankroll-box {
  border-color: rgba(223, 177, 91, 0.4);
  background: rgba(223, 177, 91, 0.08);
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  font-weight: 700;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold-primary);
}

.audio-controls {
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-light);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: rgba(223, 177, 91, 0.2);
  border-color: var(--gold-primary);
}

/* Arena Main Layout */
.game-arena {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 24px;
}

@media (max-width: 1100px) {
  .game-arena {
    grid-template-columns: 1fr;
  }
}

/* Left Column: Wheel & Croupier */
.wheel-croupier-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.wheel-stage {
  background: var(--bg-card);
  border-radius: 20px;
  border: var(--border-gold);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8);
}

.wheel-bezel {
  width: 420px;
  height: 420px;
  border-radius: 50%;
  padding: 12px;
  background: radial-gradient(circle, #5c3c1e 0%, #2b180a 70%, #150b04 100%);
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.9), 0 0 15px var(--gold-glow);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

#roulette-wheel {
  border-radius: 50%;
  background: #111;
}

.wheel-center-cap {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--gold-gradient);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

.winning-display {
  margin-top: 15px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--gold-primary);
  padding: 10px 24px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 0 20px var(--gold-glow);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.winning-display.hidden {
  display: none;
}

.win-num {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  background: var(--accent-red);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(230, 57, 70, 0.5);
}

.win-details {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--gold-primary);
}

/* Croupier Narration Box */
.croupier-box {
  background: var(--bg-card);
  border-radius: 16px;
  border: var(--border-gold);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 340px;
}

.croupier-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.croupier-avatar {
  font-size: 1.8rem;
  background: rgba(223, 177, 91, 0.1);
  padding: 6px;
  border-radius: 50%;
  border: 1px solid var(--gold-primary);
}

.croupier-info h3 {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--gold-primary);
}

.croupier-info .title {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.table-status {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 12px;
  background: rgba(42, 157, 143, 0.2);
  color: #2a9d8f;
  border: 1px solid #2a9d8f;
  letter-spacing: 1px;
}

.croupier-transcript {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 6px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.transcript-entry {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--gold-primary);
  padding: 10px 14px;
  border-radius: 0 10px 10px 0;
  animation: fadeIn 0.4s ease;
}

.sfx-tag {
  color: #5bc0de;
  font-weight: 700;
  font-size: 0.8rem;
  font-style: italic;
  display: inline-block;
  margin-right: 4px;
}

/* Right Column: Betting Felt */
.betting-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chip-tray {
  background: var(--bg-card);
  padding: 16px 24px;
  border-radius: 16px;
  border: var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.tray-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1.5px;
}

.chips-container {
  display: flex;
  gap: 14px;
}

.chip {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px dashed rgba(255, 255, 255, 0.7);
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.5);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chip:hover, .chip.active {
  transform: translateY(-6px) scale(1.1);
  box-shadow: 0 12px 20px rgba(223, 177, 91, 0.4);
}

.chip.active {
  border-style: solid;
  border-color: #fff;
  outline: 3px solid var(--gold-primary);
}

.chip-5 { background: radial-gradient(circle, #e63946, #800f2f); color: white; }
.chip-25 { background: radial-gradient(circle, #2a9d8f, #1d3557); color: white; }
.chip-100 { background: radial-gradient(circle, #2b2d42, #111); color: var(--gold-primary); }
.chip-500 { background: radial-gradient(circle, #7209b7, #3a0ca3); color: white; }

.action-buttons {
  display: flex;
  gap: 12px;
}

.btn-primary-spin {
  background: var(--gold-gradient);
  color: #0d1117;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  letter-spacing: 1px;
  box-shadow: 0 6px 20px var(--gold-glow);
  transition: all 0.2s ease;
}

.btn-primary-spin:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(223, 177, 91, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-light);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Inside Bets Bar */
.inside-bets-bar {
  background: rgba(223, 177, 91, 0.08);
  border: 1px solid rgba(223, 177, 91, 0.2);
  border-radius: 12px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.bar-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-primary);
  letter-spacing: 1px;
}

.preset-buttons {
  display: flex;
  gap: 8px;
}

.preset-btn {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--gold-primary);
  color: var(--gold-primary);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  background: var(--gold-gradient);
  color: #000;
}

/* Interactive Table Felt */
.table-felt {
  background: var(--felt-green);
  border: 12px solid #3d2314;
  border-radius: 20px;
  padding: 16px;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.7), 0 15px 35px rgba(0, 0, 0, 0.6);
  display: grid;
  grid-template-columns: 70px 1fr 80px;
  grid-template-rows: auto auto auto;
  gap: 6px;
  user-select: none;
}

.zero-cell {
  grid-row: 1 / span 1;
  grid-column: 1 / span 1;
  background: var(--accent-green);
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  min-height: 180px;
}

.zero-cell:hover {
  background: #38b000;
}

.numbers-grid {
  grid-row: 1 / span 1;
  grid-column: 2 / span 1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(3, 60px);
  gap: 4px;
}

.num-cell {
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
}

.num-cell.red-bg { background: var(--accent-red); }
.num-cell.black-bg { background: var(--accent-black); }

.num-cell:hover {
  transform: scale(1.04);
  border-color: var(--gold-primary);
  box-shadow: 0 0 12px var(--gold-glow);
  z-index: 5;
}

.column-bets {
  grid-row: 1 / span 1;
  grid-column: 3 / span 1;
  display: grid;
  grid-template-rows: repeat(3, 60px);
  gap: 4px;
}

.dozens-row {
  grid-row: 2 / span 1;
  grid-column: 2 / span 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 4px;
}

.even-money-row {
  grid-row: 3 / span 1;
  grid-column: 2 / span 1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-top: 4px;
}

.outside-cell {
  background: rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  text-align: center;
}

.outside-cell:hover {
  background: rgba(223, 177, 91, 0.2);
  border-color: var(--gold-primary);
}

/* Chip Overlay on Felt */
.chip-stack {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.felt-chip {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.9);
  background: var(--gold-gradient);
  color: #000;
  font-weight: 800;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.8);
  animation: chipDrop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Ledger History Table */
.ledger-container {
  background: var(--bg-card);
  border-radius: 16px;
  border: var(--border-gold);
  padding: 18px;
}

.ledger-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ledger-tabs .active-tab {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--gold-primary);
  font-weight: 700;
}

.history-pills {
  display: flex;
  gap: 6px;
}

.pill {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.pill-red { background: var(--accent-red); color: white; }
.pill-black { background: var(--accent-black); color: white; }
.pill-green { background: var(--accent-green); color: white; }

.ledger-table-wrapper {
  max-height: 180px;
  overflow-y: auto;
}

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.ledger-table th {
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
}

.ledger-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.net-pos { color: #2a9d8f; font-weight: 700; }
.net-neg { color: #e63946; font-weight: 700; }
.empty-ledger { text-align: center; color: var(--text-muted); padding: 20px; }

/* Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.hidden { display: none; }

.modal-content {
  background: var(--bg-card);
  border: var(--border-gold);
  padding: 24px 32px;
  border-radius: 20px;
  width: 400px;
  max-width: 90%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8);
}

.modal-content h3 {
  font-family: var(--font-serif);
  color: var(--gold-primary);
  font-size: 1.2rem;
}

.modal-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-inputs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-select {
  background: #080c10;
  border: 1px solid var(--gold-primary);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  flex: 1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.game-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes chipDrop {
  from { transform: translate(-50%, -70%) scale(1.4); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

@keyframes popIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
