/* Base reset & global styles for Roulette */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

body {
  background-color: #111;
  color: #fff;
  overflow-x: hidden;
}

.hidden { display: none }

/* Utility classes */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-red { color: var(--red); }
.text-green { color: var(--win); }

/* Season Badge removed */

/* ===== UNIFIED BUTTON SYSTEM ===== */

/* Base button styles - applied to all buttons */
button, .btn {
  padding: 10px 20px;
  border: 2px solid transparent;
  border-radius: 8px;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 80px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  user-select: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Button variants */
.btn-primary {
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
}

.btn-secondary {
  background: #4a5568;
  color: var(--white);
  border-color: #4a5568;
}

.btn-success {
  background: #48bb78;
  color: var(--white);
  border-color: #48bb78;
}

.btn-danger {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

.btn-warning {
  background: #ed8936;
  color: var(--white);
  border-color: #ed8936;
}

.btn-info {
  background: #4299e1;
  color: var(--white);
  border-color: #4299e1;
}

.btn-outline {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Button sizes */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  min-height: 32px;
  min-width: 60px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.1rem;
  min-height: 48px;
  min-width: 120px;
}

.btn-xl {
  padding: 18px 36px;
  font-size: 1.2rem;
  min-height: 56px;
  min-width: 160px;
}

/* Button states */
button:hover:not(:disabled), .btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

button:active:not(:disabled), .btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

button:disabled, .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* Specific hover effects for each variant */
.btn-primary:hover:not(:disabled) {
  background: #ffd700;
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.btn-secondary:hover:not(:disabled) {
  background: #5a6570;
  box-shadow: 0 6px 20px rgba(74, 85, 104, 0.4);
}

.btn-success:hover:not(:disabled) {
  background: #56c596;
  box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

.btn-danger:hover:not(:disabled) {
  background: #ff4444;
  box-shadow: 0 6px 20px rgba(220, 20, 60, 0.4);
}

.btn-warning:hover:not(:disabled) {
  background: #f6ad55;
  box-shadow: 0 6px 20px rgba(237, 137, 54, 0.4);
}

.btn-info:hover:not(:disabled) {
  background: #63b3ed;
  box-shadow: 0 6px 20px rgba(66, 153, 225, 0.4);
}

.btn-outline:hover:not(:disabled) {
  background: var(--gold);
  color: var(--black);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
}

/* Special button types */
.btn-chip {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  padding: 0;
  min-width: 50px;
  min-height: 50px;
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
  font-weight: bold;
  font-size: 0.9rem;
}

.btn-chip:hover:not(:disabled) {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.btn-chip.selected {
  background: var(--black);
  color: var(--gold);
  border-color: var(--white);
}

.btn-close {
  background: none;
  border: none;
  color: var(--gold);
  padding: 8px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 50%;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover:not(:disabled) {
  background: rgba(255, 215, 0, 0.2);
  color: #ffd700;
  transform: scale(1.1);
}

/* Game HUD */
.game-hud {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 15px;
  background: var(--felt-green);
  border-radius: 12px;
  border: 2px solid var(--gold);
  box-shadow: var(--shadow-medium);
}

.chips-count, .key-count {
  font-size: 1.1rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.chips-count {
  color: var(--gold);
}

.key-count {
  color: var(--red);
}


/* Game HUD buttons - now using unified button system */
#join-btn {
  padding: 10px 20px;
  border: 2px solid var(--gold);
  border-radius: 8px;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 100px;
  height: 36px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  user-select: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  background: var(--gold);
  color: var(--black);
}

#join-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
  background: #ffd700;
}

#join-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#join-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

#leave-btn {
  padding: 10px 20px;
  border: 2px solid var(--red);
  border-radius: 8px;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 100px;
  height: 36px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  user-select: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  background: var(--red);
  color: var(--white);
}

#leave-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(220, 20, 60, 0.4);
  background: #ff4444;
}

#leave-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#leave-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.shop-button {
  padding: 10px 20px;
  border: 2px solid var(--gold);
  border-radius: 8px;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 80px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  user-select: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  background: var(--gold);
  color: var(--black);
}

.shop-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
  background: #ffd700;
}

.shop-button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.shop-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* Info button styling */
.info-button {
  padding: 8px 12px;
  border: 2px solid var(--gold);
  border-radius: 8px;
  background: var(--cell-bg);
  color: var(--white);
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
}

.info-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
  background: #ffd700;
  color: var(--black);
}

.info-button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.info-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}


/* Table Info Section */
.table-info {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  border: 2px solid #333;
}

.players-section, .bets-section {
  flex: 1;
  min-width: 200px;
}

.players-section h3, .bets-section h3 {
  margin: 0 0 10px 0;
  color: #fff;
  font-size: 1.1rem;
  text-align: center;
}

.players-list {
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid #555;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
}

.player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #444;
}

.player-item:last-child {
  border-bottom: none;
}

.player-name {
  color: #fff;
  font-weight: bold;
}

.player-chips {
  color: #ffd700;
  font-size: 0.9rem;
}

.no-players, .no-bets {
  color: #888;
  text-align: center;
  font-style: italic;
  padding: 10px;
}

.all-bets-display {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #555;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
}

.player-bets {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #444;
}

.player-bets:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.player-bets-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-weight: bold;
  margin-bottom: 8px;
  font-size: 0.9rem;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.player-bets-header .player-name {
  color: var(--gold);
}

.player-bets-header .player-total {
  color: var(--white);
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
}

.player-bets-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bet-item {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.bet-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(2px);
}

.bet-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.bet-type {
  font-weight: bold;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bet-amount {
  color: var(--gold);
  font-weight: bold;
  font-size: 0.9rem;
}

.bet-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 4px;
}

.bet-numbers {
  color: var(--white);
  font-weight: 500;
}

.bet-payout {
  color: var(--gold);
  font-weight: 500;
}

/* Bet type specific styling */
.bet-item.bet-red {
  border-left-color: #ff4444;
}

.bet-item.bet-black {
  border-left-color: #333333;
}

.bet-item.bet-straight_up {
  border-left-color: #ffd700;
}

.bet-item.bet-even {
  border-left-color: #4CAF50;
}

.bet-item.bet-odd {
  border-left-color: #FF9800;
}

.bet-item.bet-high {
  border-left-color: #2196F3;
}

.bet-item.bet-low {
  border-left-color: #9C27B0;
}

.bet-item.bet-dozen_first,
.bet-item.bet-dozen_second,
.bet-item.bet-dozen_third {
  border-left-color: #E91E63;
}

.bet-item.bet-column_first,
.bet-item.bet-column_second,
.bet-item.bet-column_third {
  border-left-color: #FF5722;
}


/* Mobile navigation */
.mobile-nav {
  display: none;
}

@media (max-width: 600px) {
  .table-info {
    flex-direction: column;
    gap: 15px;
  }
  
  .players-section, .bets-section {
    min-width: unset;
  }
  
  .mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(15px);
    border-bottom: 2px solid #333;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
  }
  
  .mobile-nav button {
    padding: 10px 20px;
    border: 2px solid #4299e1;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    min-width: 70px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    background: #4299e1;
    color: var(--white);
  }
  
  .mobile-nav button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.4);
    background: #63b3ed;
  }
  
  .mobile-nav button.secondary {
    background: var(--red);
    border-color: var(--red);
  }
  
  .mobile-nav button.secondary:hover:not(:disabled) {
    background: #ff4444;
    box-shadow: 0 6px 20px rgba(220, 20, 60, 0.4);
  }
  
  .desktop-nav {
    display: none;
  }
}

/* Leaderboard */
.leaderboard {
  position: fixed;
  top: 70px;
  right: 20px;
  background: rgba(0,0,0,0.7);
  padding: 15px;
  border-radius: 10px;
  width: 200px;
  z-index: 100;
}

.leaderboard h2 { 
  margin-bottom: 10px; 
  text-align: center; 
  font-size: 1.2rem; 
}

#leaderboard-list { 
  list-style: none; 
  max-height: 300px; 
  overflow-y: auto; 
}

#leaderboard-list li { 
  padding: 5px 0; 
  border-bottom: 1px solid #333; 
  font-size: .9rem; 
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.modal-content {
  background: #222;
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  min-width: 300px;
}

.modal-content h2 {
  margin-bottom: 20px;
  color: var(--gold);
}

.modal-content input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 2px solid #444;
  border-radius: 5px;
  background: #333;
  color: #fff;
  font-size: 1rem;
}

.modal-content input:focus {
  outline: none;
  border-color: var(--gold);
}

.modal-content button {
  padding: 10px 20px;
  border: 2px solid var(--gold);
  border-radius: 8px;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 80px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  user-select: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  background: var(--gold);
  color: var(--black);
  width: 100%;
  margin-top: 10px;
}

.modal-content button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
  background: #ffd700;
}

.modal-content button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.modal-content button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}
