/* ============================================================================
   Retro's Casino - Styles
   ============================================================================ */

:root {
  --primary-color: #00ff88;
  --secondary-color: #ff0066;
  --bg-dark: #0a0a0f;
  --bg-card: #1a1a2e;
  --text-light: #ffffff;
  --text-gray: #a0a0a0;
  --border-color: #2a2a3e;
  --success: #00ff88;
  --error: #ff0066;
  --warning: #ffaa00;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-light);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ============================================================================
   Loading Screen
   ============================================================================ */

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loader {
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================================================
   Auth Screen
   ============================================================================ */

.auth-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.auth-container {
  background: var(--bg-card);
  padding: 40px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 400px;
  text-align: center;
}

.auth-container h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.subtitle {
  color: var(--text-gray);
  margin-bottom: 30px;
}

.auth-form {
  text-align: left;
}

.auth-form h2 {
  margin-bottom: 20px;
  color: var(--text-light);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-gray);
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 12px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  color: var(--text-light);
  font-size: 1rem;
  transition: border-color 0.3s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: var(--text-gray);
  font-size: 0.8rem;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--bg-dark);
  width: 100%;
}

.btn-primary:hover {
  background: #00cc6a;
  transform: translateY(-2px);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.form-switch {
  margin-top: 20px;
  text-align: center;
  color: var(--text-gray);
}

.form-switch a {
  color: var(--primary-color);
  text-decoration: none;
}

.form-switch a:hover {
  text-decoration: underline;
}

.error-message {
  background: rgba(255, 0, 102, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
  padding: 12px;
  border-radius: 5px;
  margin-top: 20px;
}

.success-message {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
  padding: 12px;
  border-radius: 5px;
  margin-top: 20px;
}

.reset-step {
  margin-bottom: 20px;
}

.reset-step p {
  margin-bottom: 15px;
  color: var(--text-muted);
}

/* ============================================================================
   Main App
   ============================================================================ */

.app-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 {
  font-size: 1.5rem;
  color: var(--primary-color);
}

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

.balance-display {
  background: var(--bg-dark);
  padding: 10px 20px;
  border-radius: 5px;
  border: 1px solid var(--border-color);
}

.balance-label {
  color: var(--text-gray);
  margin-right: 10px;
}

.balance-amount {
  color: var(--success);
  font-weight: bold;
  font-size: 1.2rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Navigation */
.nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 30px;
  display: flex;
  gap: 10px;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-gray);
  padding: 15px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
}

.nav-btn:hover {
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* Content */
.content {
  flex: 1;
  padding: 30px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.screen h2 {
  margin-bottom: 20px;
  color: var(--primary-color);
}

/* Stats Cards */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.stat-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  text-align: center;
}

.stat-card h3 {
  color: var(--text-gray);
  font-size: 0.9rem;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
}

/* Notifications */
.notifications {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.notification {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  padding: 15px;
  animation: slideIn 0.3s ease;
}

.notification.success {
  border-left: 4px solid var(--success);
}

.notification.error {
  border-left: 4px solid var(--error);
}

.notification.warning {
  border-left: 4px solid var(--warning);
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================================================
   Games
   ============================================================================ */

/* Game Tabs */
.game-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
}

.game-tab {
  background: transparent;
  border: none;
  color: var(--text-gray);
  padding: 15px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
}

.game-tab:hover {
  color: var(--text-light);
}

.game-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.game-container {
  display: none;
}

.game-container.active {
  display: block;
}

/* Slots Game */
.slots-machine {
  max-width: 600px;
  margin: 0 auto;
}

.slots-display {
  background: var(--bg-card);
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.reels {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.reel {
  background: var(--bg-dark);
  border: 2px solid var(--border-color);
  border-radius: 10px;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  transition: all 0.3s;
}

.reel.spinning {
  animation: spin-reel 0.1s linear infinite;
}

.reel.result {
  animation: bounce 0.5s ease;
  border-color: var(--primary-color);
}

@keyframes spin-reel {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.result-message {
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
  min-height: 30px;
}

.result-message.win {
  color: var(--success);
  animation: pulse 0.5s ease;
}

.result-message.loss {
  color: var(--text-gray);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Slots Controls */
.slots-controls {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.bet-section h3 {
  margin-bottom: 15px;
  color: var(--text-light);
}

.bet-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.bet-btn {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  color: var(--text-light);
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
}

.bet-btn:hover {
  border-color: var(--primary-color);
  background: rgba(0, 255, 136, 0.1);
}

.bet-btn.active {
  background: var(--primary-color);
  color: var(--bg-dark);
  border-color: var(--primary-color);
}

.custom-bet {
  margin-bottom: 15px;
}

.custom-bet label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-gray);
}

.custom-bet input {
  width: 100%;
  padding: 10px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  color: var(--text-light);
  font-size: 1rem;
}

.custom-bet input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.current-bet {
  text-align: center;
  color: var(--text-gray);
  font-size: 1.1rem;
  margin-top: 10px;
}

.current-bet span {
  color: var(--primary-color);
  font-weight: bold;
}

.spin-btn {
  width: 100%;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary-color), #00cc6a);
  border: none;
  border-radius: 10px;
  color: var(--bg-dark);
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 15px;
}

.spin-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 255, 136, 0.5);
}

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

/* Paytable */
.slots-paytable {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
}

.slots-paytable h4 {
  margin-bottom: 15px;
  color: var(--text-light);
  text-align: center;
}

.paytable-grid {
  display: grid;
  gap: 10px;
}

.paytable-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: var(--bg-dark);
  border-radius: 5px;
}

.paytable-row span:first-child {
  font-size: 1.5rem;
}

.paytable-row span:last-child {
  color: var(--primary-color);
  font-weight: bold;
}

/* Big Win Overlay */
.big-win-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.5s ease;
}

.big-win-overlay.fade-out {
  animation: fadeOut 0.5s ease;
}

.big-win-content {
  text-align: center;
  animation: zoomIn 0.5s ease;
}

.big-win-content h1 {
  font-size: 4rem;
  color: var(--primary-color);
  margin-bottom: 20px;
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.8);
}

.big-win-amount {
  font-size: 3rem;
  color: var(--text-light);
  font-weight: bold;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes zoomIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ============================================================================
   Roulette Game
   ============================================================================ */

.roulette-game {
  max-width: 900px;
  margin: 0 auto;
}

/* Wheel Display */
.roulette-wheel-container {
  text-align: center;
  margin-bottom: 30px;
}

.roulette-wheel {
  font-size: 6rem;
  margin-bottom: 15px;
  display: inline-block;
}

.roulette-wheel.spinning {
  animation: spin-wheel 0.5s linear infinite;
}

@keyframes spin-wheel {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.roulette-result {
  font-size: 1.2rem;
  font-weight: bold;
  min-height: 60px;
}

.roulette-result .red {
  color: #ff0000;
}

.roulette-result .black {
  color: #000000;
  background: #ffffff;
  padding: 2px 8px;
  border-radius: 3px;
}

.roulette-result .green {
  color: #00ff00;
}

.roulette-result .result-win {
  color: var(--success);
}

.roulette-result .result-loss {
  color: var(--text-gray);
}

/* Roulette Table */
.roulette-table-wrapper {
  background: var(--bg-card);
  padding: 20px;
  border-radius: 10px;
  border: 2px solid var(--primary-color);
  overflow-x: auto;
  margin-bottom: 20px;
}

.roulette-table {
  display: inline-block;
  min-width: 600px;
}

.number-grid {
  display: flex;
  gap: 5px;
  margin-bottom: 5px;
}

.zero-cell {
  background: #00aa00;
  color: white;
  font-weight: bold;
  font-size: 1.2rem;
  width: 60px;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-color);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  writing-mode: vertical-rl;
  text-orientation: upright;
}

.zero-cell:hover {
  transform: scale(1.05);
  border-color: var(--primary-color);
}

.numbers-section {
  flex: 1;
}

.number-row {
  display: flex;
  gap: 5px;
  margin-bottom: 5px;
}

.number-cell {
  width: 60px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border: 2px solid var(--border-color);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.number-cell.red {
  background: #cc0000;
  color: white;
}

.number-cell.black {
  background: #000000;
  color: white;
}

.number-cell:hover {
  transform: scale(1.05);
  border-color: var(--primary-color);
  z-index: 10;
}

.number-cell.winning {
  animation: pulse-win 1s ease infinite;
  border-color: gold;
  box-shadow: 0 0 20px gold;
}

@keyframes pulse-win {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.column-bets {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.column-bet {
  background: var(--bg-dark);
  color: var(--text-light);
  font-weight: bold;
  width: 60px;
  height: 113px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-color);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.column-bet:hover {
  border-color: var(--primary-color);
  background: rgba(0, 255, 136, 0.1);
}

/* Outside Bets */
.outside-bets {
  display: flex;
  gap: 5px;
  margin-bottom: 5px;
}

.outside-bet {
  background: var(--bg-dark);
  color: var(--text-light);
  font-weight: bold;
  flex: 1;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border-color);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.outside-bet:hover {
  border-color: var(--primary-color);
  background: rgba(0, 255, 136, 0.1);
}

.outside-bet.red-bet {
  background: #cc0000;
}

.outside-bet.black-bet {
  background: #000000;
}

/* Chips on table */
.chip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--primary-color);
  color: var(--bg-dark);
  font-size: 0.7rem;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 50%;
  border: 2px solid white;
  z-index: 100;
  pointer-events: none;
  min-width: 35px;
  text-align: center;
}

/* Roulette Controls */
.roulette-controls {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
}

.chip-selection h3 {
  margin-bottom: 15px;
  color: var(--text-light);
}

.chip-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.chip-btn {
  background: var(--bg-dark);
  border: 2px solid var(--border-color);
  color: var(--text-light);
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
}

.chip-btn:hover {
  border-color: var(--primary-color);
  background: rgba(0, 255, 136, 0.1);
}

.chip-btn.active {
  background: var(--primary-color);
  color: var(--bg-dark);
  border-color: var(--primary-color);
}

.bet-info {
  margin-bottom: 20px;
  text-align: center;
}

.total-bet {
  font-size: 1.2rem;
  color: var(--text-gray);
}

.total-bet span {
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.4rem;
}

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

.btn-clear,
.btn-spin {
  flex: 1;
  padding: 15px;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-clear {
  background: var(--bg-dark);
  color: var(--text-light);
  border: 2px solid var(--border-color);
}

.btn-clear:hover:not(:disabled) {
  border-color: var(--error);
  color: var(--error);
}

.btn-spin {
  background: linear-gradient(135deg, var(--primary-color), #00cc6a);
  color: var(--bg-dark);
}

.btn-spin:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 255, 136, 0.5);
}

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

/* ============================================================================
   Blackjack Game
   ============================================================================ */

.blackjack-game {
  max-width: 800px;
  margin: 0 auto;
}

/* Betting Area */
.bj-betting-area {
  background: var(--bg-card);
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  padding: 30px;
  text-align: center;
}

.bj-betting-area h3 {
  margin-bottom: 20px;
  color: var(--primary-color);
}

.bj-bet-btn {
  background: var(--bg-dark);
  border: 2px solid var(--border-color);
  color: var(--text-light);
  padding: 12px 24px;
  margin: 5px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
}

.bj-bet-btn:hover {
  border-color: var(--primary-color);
  background: rgba(0, 255, 136, 0.1);
}

.bj-bet-btn.active {
  background: var(--primary-color);
  color: var(--bg-dark);
}

.btn-deal,
.btn-new-game {
  background: linear-gradient(135deg, var(--primary-color), #00cc6a);
  color: var(--bg-dark);
  border: none;
  padding: 15px 40px;
  border-radius: 8px;
  font-size: 1.3rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 20px;
}

.btn-deal:hover,
.btn-new-game:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 255, 136, 0.5);
}

/* Game Area */
.bj-game-area {
  background: var(--bg-card);
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  padding: 30px;
}

.bj-dealer-section,
.bj-player-section {
  margin-bottom: 30px;
}

.bj-dealer-section h3,
.bj-player-section h3 {
  color: var(--text-light);
  margin-bottom: 15px;
}

.hand-value {
  color: var(--primary-color);
  font-weight: bold;
  margin-left: 10px;
}

.bj-cards-area {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 120px;
}

/* Player Hands */
.bj-player-hands {
  display: flex;
  gap: 30px;
  justify-content: center;
  flex-wrap: wrap;
}

.bj-hand {
  background: var(--bg-dark);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  min-width: 200px;
}

.bj-hand.active {
  border-color: var(--primary-color);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.bj-hand-label {
  color: var(--text-gray);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.bj-hand .bj-cards {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 10px;
}

.bj-hand-value {
  color: var(--primary-color);
  font-weight: bold;
  text-align: center;
  font-size: 1.2rem;
}

/* Cards */
.card {
  background: white;
  border: 2px solid #333;
  border-radius: 8px;
  width: 80px;
  height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s;
}

.card:hover {
  transform: translateY(-5px);
}

.card.red {
  color: #cc0000;
}

.card.black {
  color: #000000;
}

.card-back {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 3rem;
}

.card-rank {
  position: absolute;
  top: 5px;
  left: 8px;
  font-size: 1.2rem;
}

.card-suit {
  font-size: 2.5rem;
}

/* Action Buttons */
.bj-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.bj-action-btn {
  background: var(--bg-dark);
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 120px;
}

.bj-action-btn:hover:not(:disabled) {
  background: var(--primary-color);
  color: var(--bg-dark);
  transform: translateY(-2px);
}

.bj-action-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: var(--border-color);
  color: var(--text-gray);
}

/* Result Area */
.bj-result-area {
  background: var(--bg-card);
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  padding: 40px;
  text-align: center;
}

.bj-result-message {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 30px;
}

.bj-result-message.win {
  color: var(--success);
}

.bj-result-message.loss {
  color: var(--error);
}

.bj-result-message.push {
  color: var(--warning);
}

.bj-result-message.blackjack {
  color: var(--primary-color);
  font-size: 2rem;
  animation: pulse 1s ease infinite;
}

.bj-results-details {
  background: var(--bg-dark);
  border-radius: 5px;
  padding: 15px;
  margin-top: 15px;
}

.result-row {
  padding: 8px;
  margin: 5px 0;
  border-radius: 3px;
}

.result-row.win,
.result-row.blackjack {
  background: rgba(0, 255, 136, 0.1);
  color: var(--success);
}

.result-row.loss {
  background: rgba(255, 0, 102, 0.1);
  color: var(--error);
}

.result-row.push {
  background: rgba(255, 170, 0, 0.1);
  color: var(--warning);
}

.result-main {
  font-size: 1.8rem;
  margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 15px;
  }

  .header-right {
    flex-direction: column;
    width: 100%;
  }

  .balance-display,
  .user-info {
    width: 100%;
    justify-content: center;
  }

  .nav {
    overflow-x: auto;
  }

  .content {
    padding: 20px;
  }

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

  .reels {
    gap: 10px;
  }

  .reel {
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
  }

  .bet-buttons {
    justify-content: center;
  }

  .big-win-content h1 {
    font-size: 2.5rem;
  }

  .big-win-amount {
    font-size: 2rem;
  }

  /* Roulette responsive */
  .roulette-table {
    min-width: 400px;
  }

  .number-cell {
    width: 45px;
    height: 35px;
    font-size: 0.9rem;
  }

  .zero-cell {
    width: 45px;
    min-height: 300px;
  }

  .column-bet {
    width: 45px;
    height: 95px;
    font-size: 0.8rem;
  }

  .outside-bet {
    font-size: 0.8rem;
    height: 40px;
  }

  .roulette-wheel {
    font-size: 4rem;
  }

  .chip-buttons {
    justify-content: center;
  }

  .action-buttons {
    flex-direction: column;
  }

  /* Blackjack responsive */
  .card {
    width: 60px;
    height: 85px;
    font-size: 1.5rem;
  }

  .card-rank {
    font-size: 1rem;
  }

  .card-suit {
    font-size: 2rem;
  }

  .bj-player-hands {
    flex-direction: column;
    gap: 15px;
  }

  .bj-hand {
    min-width: auto;
  }

  .bj-actions {
    flex-direction: column;
  }

  .bj-action-btn {
    width: 100%;
  }

  .result-main {
    font-size: 1.3rem;
  }

  /* Leaderboard responsive */
  .leaderboard-tabs {
    flex-wrap: wrap;
  }

  .profile-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .breakdown-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================
   Leaderboard
   ============================================================================ */

.leaderboard-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
}

.lb-tab {
  background: transparent;
  border: none;
  color: var(--text-gray);
  padding: 15px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.3s;
  font-size: 0.95rem;
}

.lb-tab:hover {
  color: var(--text-light);
}

.lb-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.your-rank-card {
  background: var(--bg-card);
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 30px;
  text-align: center;
}

.your-rank-card h3 {
  color: var(--text-light);
  margin-bottom: 15px;
}

.rank-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.rank-number {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
}

.rank-value {
  font-size: 1.5rem;
  color: var(--text-light);
}

.leaderboard-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  overflow-x: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th {
  color: var(--text-gray);
  text-align: left;
  padding: 15px;
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.leaderboard-table td {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-light);
}

.leaderboard-table tr:last-child td {
  border-bottom: none;
}

.leaderboard-table .rank {
  font-weight: bold;
  width: 100px;
}

.leaderboard-table .username {
  font-weight: 600;
}

.leaderboard-table .value {
  text-align: right;
  color: var(--primary-color);
  font-weight: bold;
}

.leaderboard-table .top-1 {
  background: rgba(255, 215, 0, 0.1);
}

.leaderboard-table .top-2 {
  background: rgba(192, 192, 192, 0.1);
}

.leaderboard-table .top-3 {
  background: rgba(205, 127, 50, 0.1);
}

.leaderboard-table .loading,
.leaderboard-table .error,
.leaderboard-table .empty {
  text-align: center;
  color: var(--text-gray);
  padding: 30px;
}

.leaderboard-table .error {
  color: var(--error);
}

/* ============================================================================
   Profile
   ============================================================================ */

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.profile-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
}

.profile-stat-card h3 {
  color: var(--text-gray);
  font-size: 0.9rem;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.profile-stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--primary-color);
}

.profile-stat-card .stat-value.success {
  color: var(--success);
}

.profile-stat-card .stat-value.error {
  color: var(--error);
}

.game-breakdown,
.recent-games {
  margin-bottom: 30px;
}

.game-breakdown h3,
.recent-games h3 {
  color: var(--text-light);
  margin-bottom: 20px;
}

.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.game-breakdown-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
}

.game-breakdown-card h4 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.breakdown-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.breakdown-stat {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
}

.breakdown-stat .stat-label {
  color: var(--text-gray);
  font-size: 0.9rem;
}

.breakdown-stat .stat-value {
  color: var(--text-light);
  font-weight: 600;
}

.breakdown-stat .stat-value.success {
  color: var(--success);
}

.breakdown-stat .stat-value.error {
  color: var(--error);
}

.games-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-history-item {
  background: var(--bg-card);
  border-left: 4px solid var(--border-color);
  border-radius: 5px;
  padding: 15px;
  transition: all 0.3s;
}

.game-history-item:hover {
  transform: translateX(5px);
  border-left-color: var(--primary-color);
}

.game-history-item.success {
  border-left-color: var(--success);
}

.game-history-item.error {
  border-left-color: var(--error);
}

.game-history-item.warning {
  border-left-color: var(--warning);
}

.game-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.game-icon {
  font-size: 1.5rem;
}

.game-name {
  color: var(--text-light);
  font-weight: 600;
  flex: 1;
}

.game-time {
  color: var(--text-gray);
  font-size: 0.85rem;
}

.game-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.game-bet {
  color: var(--text-gray);
}

.game-result {
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 3px;
}

.game-result.success {
  background: rgba(0, 255, 136, 0.1);
  color: var(--success);
}

.game-result.error {
  background: rgba(255, 0, 102, 0.1);
  color: var(--error);
}

.game-result.warning {
  background: rgba(255, 170, 0, 0.1);
  color: var(--warning);
}

.game-payout {
  font-weight: bold;
}

.game-payout.success {
  color: var(--success);
}

.game-payout.error {
  color: var(--error);
}

.empty-message {
  text-align: center;
  color: var(--text-gray);
  padding: 30px;
}

/* Profile Settings */
.profile-settings {
  margin-bottom: 30px;
}

.profile-settings h3 {
  color: var(--text-light);
  margin-bottom: 20px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.settings-grid .btn {
  width: 100%;
}

/* Avatar Grid */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.avatar-option {
  width: 80px;
  height: 80px;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 50%;
  transition: all 0.3s;
}

.avatar-option:hover {
  border-color: var(--primary-color);
  transform: scale(1.1);
}

/* ============================================================================
   Admin Panel
   ============================================================================ */

.admin-only {
  background: linear-gradient(135deg, var(--error), var(--secondary-color));
}

.admin-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.admin-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-light);
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.admin-tab:hover {
  background: var(--border-color);
}

.admin-tab.active {
  background: var(--primary-color);
  color: var(--bg-dark);
  border-color: var(--primary-color);
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

/* Admin Stats Grid */
.admin-stats-grid,
.admin-economy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 8px;
}

.admin-stat-card.wide {
  grid-column: span 2;
}

.admin-stat-card h4 {
  color: var(--primary-color);
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.admin-stat-value {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--text-light);
}

.admin-stat-value.success {
  color: var(--success);
}

.admin-stat-value.error {
  color: var(--error);
}

.balance-stats p,
.game-stats p {
  margin: 8px 0;
  color: var(--text-light);
}

.balance-stats span,
.game-stats span {
  color: var(--primary-color);
  font-weight: bold;
}

/* Admin Search Bar */
.admin-search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.admin-search-bar input,
.admin-search-bar select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-light);
  padding: 10px;
  border-radius: 5px;
  flex: 1;
  min-width: 150px;
}

.admin-search-bar input:focus,
.admin-search-bar select:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Admin Tables */
.admin-users-table-container,
.admin-logs-table-container {
  overflow-x: auto;
  margin-bottom: 20px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
}

.admin-table thead {
  background: var(--border-color);
}

.admin-table th,
.admin-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.admin-table th {
  color: var(--primary-color);
  font-weight: bold;
}

.admin-table td {
  color: var(--text-light);
}

.admin-table tbody tr:hover {
  background: rgba(0, 255, 136, 0.05);
}

.admin-table .empty {
  text-align: center;
  color: var(--text-gray);
  padding: 30px;
}

.admin-badge {
  background: var(--error);
  color: var(--text-light);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: bold;
}

.mod-badge {
  background: var(--warning);
  color: var(--bg-dark);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: bold;
}

.btn-small {
  background: var(--primary-color);
  color: var(--bg-dark);
  border: none;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: bold;
}

.btn-small:hover {
  opacity: 0.8;
}

/* Admin Pagination */
.admin-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

#admin-users-page-info {
  color: var(--text-gray);
}

/* Broadcast Form */
.broadcast-form {
  max-width: 600px;
}

.broadcast-form .form-group {
  margin-bottom: 20px;
}

.broadcast-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--primary-color);
  font-weight: bold;
}

.broadcast-form select,
.broadcast-form textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-light);
  padding: 10px;
  border-radius: 5px;
  font-family: inherit;
}

.broadcast-form select:focus,
.broadcast-form textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* User Detail 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: var(--bg-card);
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  padding: 30px;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2rem;
  color: var(--text-gray);
  cursor: pointer;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--error);
}

.user-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.detail-section {
  background: var(--bg-dark);
  padding: 15px;
  border-radius: 5px;
  border: 1px solid var(--border-color);
}

.detail-section.wide {
  grid-column: span 2;
}

.detail-section h3 {
  color: var(--primary-color);
  margin-bottom: 10px;
  font-size: 1rem;
}

.detail-section p {
  margin: 5px 0;
  color: var(--text-light);
}

.detail-section strong {
  color: var(--text-gray);
}

/* Modal Actions */
.modal-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.action-group {
  background: var(--bg-dark);
  padding: 20px;
  border-radius: 5px;
  border: 1px solid var(--border-color);
}

.action-group h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 1rem;
}

.action-group input,
.action-group select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-light);
  padding: 8px;
  border-radius: 3px;
  margin-bottom: 10px;
}

.action-group input:focus,
.action-group select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.action-group button {
  width: 100%;
  margin-top: 10px;
}

.btn-danger {
  background: var(--error);
  color: var(--text-light);
}

.btn-danger:hover {
  opacity: 0.8;
}

.btn-success {
  background: var(--success);
  color: var(--bg-dark);
}

.btn-success:hover {
  opacity: 0.8;
}

/* Economy Details */
.admin-economy-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

/* Game Settings */
.game-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.game-setting-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  transition: transform 0.3s, border-color 0.3s;
}

.game-setting-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
}

.game-setting-card.warning {
  border-color: var(--warning);
}

.game-setting-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.game-setting-header h4 {
  color: var(--text-light);
  font-size: 1.2rem;
  margin: 0;
}

.game-status {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}

.game-status.success {
  background: rgba(0, 255, 136, 0.15);
  color: var(--success);
}

.game-status.error {
  background: rgba(255, 0, 102, 0.15);
  color: var(--error);
}

.game-setting-body {
  margin-bottom: 15px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-row span {
  color: var(--text-gray);
}

.setting-row .value {
  color: var(--text-light);
  font-weight: 600;
}

.setting-row.maintenance-warning {
  color: var(--warning);
  font-weight: 600;
  justify-content: center;
}

.game-config-logs {
  margin-top: 40px;
}

.game-config-logs h4 {
  color: var(--text-light);
  margin-bottom: 20px;
}

.tab-description {
  color: var(--text-gray);
  margin-bottom: 20px;
}

/* Log Details */
.log-details {
  font-size: 0.85rem;
  color: var(--text-gray);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .admin-stats-grid,
  .admin-economy-grid {
    grid-template-columns: 1fr;
  }

  .admin-stat-card.wide {
    grid-column: span 1;
  }

  .user-detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-section.wide {
    grid-column: span 1;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }

  .admin-economy-details {
    grid-template-columns: 1fr;
  }

  .admin-search-bar {
    flex-direction: column;
  }

  .admin-search-bar input,
  .admin-search-bar select {
    width: 100%;
  }
}
/* ============================================================================
   Achievements
   ============================================================================ */

.achievement-stats-bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.achievement-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.achievement-stat .stat-label {
  color: var(--text-gray);
  font-size: 0.9rem;
}

.achievement-stat .stat-value {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
}

.progress-bar {
  width: 200px;
  height: 20px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--success));
  transition: width 0.5s ease;
}

#achievements-progress-text {
  font-weight: bold;
  color: var(--primary-color);
  margin-top: 5px;
}

/* Category Filter */
.achievement-categories {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.category-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-light);
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.category-btn:hover {
  background: var(--border-color);
}

.category-btn.active {
  background: var(--primary-color);
  color: var(--bg-dark);
  border-color: var(--primary-color);
}

/* Achievements Grid */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.achievement-card {
  background: var(--bg-card);
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  gap: 15px;
  align-items: flex-start;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.achievement-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 255, 136, 0.2);
}

.achievement-card.locked {
  border-color: var(--border-color);
  opacity: 0.6;
}

.achievement-card.locked:hover {
  transform: none;
  box-shadow: none;
}

.achievement-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.achievement-card.locked .achievement-icon {
  filter: grayscale(1);
  opacity: 0.5;
}

.achievement-info {
  flex: 1;
}

.achievement-name {
  color: var(--primary-color);
  margin-bottom: 5px;
  font-size: 1.1rem;
}

.achievement-card.locked .achievement-name {
  color: var(--text-gray);
}

.achievement-desc {
  color: var(--text-gray);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.achievement-requirement {
  color: var(--text-light);
  font-size: 0.85rem;
  background: var(--bg-dark);
  padding: 5px 10px;
  border-radius: 3px;
  display: inline-block;
  margin-bottom: 5px;
}

.achievement-reward {
  color: var(--success);
  font-weight: bold;
  font-size: 0.9rem;
  margin-top: 5px;
}

.achievement-unlocked-date {
  color: var(--text-gray);
  font-size: 0.8rem;
  margin-top: 5px;
  font-style: italic;
}

.achievement-checkmark {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--success);
  color: var(--bg-dark);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
}

/* Recent Achievements */
.recent-achievements {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
}

.recent-achievements h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recent-achievement-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-dark);
  border-radius: 5px;
  border-left: 3px solid var(--primary-color);
}

.recent-icon {
  font-size: 1.5rem;
}

.recent-player {
  font-weight: bold;
  color: var(--primary-color);
}

.recent-name {
  color: var(--text-light);
  flex: 1;
}

.recent-time {
  color: var(--text-gray);
  font-size: 0.85rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .achievement-stats-bar {
    flex-direction: column;
  }

  .achievements-grid {
    grid-template-columns: 1fr;
  }

  .achievement-categories {
    justify-content: center;
  }

  .progress-bar {
    width: 100%;
  }
}
/* ============================================================================
   Chat Widget
   ============================================================================ */

/* Chat Toggle Button */
.chat-toggle-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--success));
  border: none;
  color: var(--bg-dark);
  font-size: 1.8rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 255, 136, 0.4);
  z-index: 999;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chat-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 255, 136, 0.6);
}

/* Chat Container */
.chat-container {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 350px;
  height: 500px;
  background: var(--bg-card);
  border: 2px solid var(--primary-color);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  z-index: 998;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.chat-container.open {
  transform: translateX(0);
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, var(--primary-color), var(--success));
  color: var(--bg-dark);
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 8px 8px 0 0;
}

.chat-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.chat-close-btn {
  background: none;
  border: none;
  color: var(--bg-dark);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.chat-close-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-dark);
}

.chat-empty,
.chat-messages .loading {
  text-align: center;
  color: var(--text-gray);
  padding: 20px;
}

.chat-message {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px;
  position: relative;
}

.chat-msg-own {
  background: rgba(0, 255, 136, 0.1);
  border-color: var(--primary-color);
}

.chat-msg-admin {
  border-left: 3px solid var(--error);
}

.chat-msg-mod {
  border-left: 3px solid var(--warning);
}

.chat-msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.chat-msg-username {
  font-weight: bold;
  color: var(--primary-color);
  font-size: 0.9rem;
}

.chat-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: bold;
}

.chat-badge.admin {
  background: var(--error);
  color: var(--text-light);
}

.chat-badge.mod {
  background: var(--warning);
  color: var(--bg-dark);
}

.chat-msg-time {
  font-size: 0.75rem;
  color: var(--text-gray);
  margin-left: auto;
}

.chat-delete-btn {
  background: var(--error);
  color: var(--text-light);
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  margin-left: 5px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.chat-delete-btn:hover {
  opacity: 1;
}

.chat-msg-content {
  color: var(--text-light);
  font-size: 0.9rem;
  word-wrap: break-word;
  line-height: 1.4;
}

/* Chat Input */
.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 15px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  border-radius: 0 0 8px 8px;
}

#chat-input {
  flex: 1;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  color: var(--text-light);
  padding: 10px;
  border-radius: 5px;
  font-size: 0.9rem;
}

#chat-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.chat-send-btn {
  background: var(--primary-color);
  color: var(--bg-dark);
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: opacity 0.3s ease;
}

.chat-send-btn:hover {
  opacity: 0.8;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .chat-container {
    width: 90%;
    right: 5%;
    bottom: 80px;
    height: 400px;
  }

  .chat-toggle-btn {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }
}
/* ============================================================================
   Economy (Properties, Stocks, Crypto)
   ============================================================================ */

.economy-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.economy-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-light);
  padding: 12px 24px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.economy-tab:hover {
  background: var(--border-color);
}

.economy-tab.active {
  background: var(--primary-color);
  color: var(--bg-dark);
  border-color: var(--primary-color);
  font-weight: bold;
}

.economy-tab-content {
  display: none;
}

.economy-tab-content.active {
  display: block;
}

.economy-stats-bar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}

.economy-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.economy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stocks-table-container,
.crypto-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
}

.crypto-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .economy-stats-bar {
    flex-direction: column;
  }

  .economy-grid {
    grid-template-columns: 1fr;
  }

  .economy-tabs {
    justify-content: center;
  }
}

/* ============================================================================
   CRASH GAME STYLES
   ============================================================================ */

.crash-game {
  padding: 30px;
  max-width: 800px;
  margin: 0 auto;
}

.crash-display {
  background: var(--bg2);
  border-radius: 12px;
  padding: 40px;
  margin-bottom: 30px;
  text-align: center;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.crash-multiplier-container {
  margin-bottom: 20px;
}

.crash-multiplier {
  font-size: 72px;
  font-weight: bold;
  color: var(--success);
  text-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
  transition: all 0.1s ease;
}

.crash-multiplier.success {
  color: var(--success);
  animation: pulse 0.5s ease;
}

.crash-multiplier.crashed {
  color: var(--error);
  text-shadow: 0 0 20px rgba(244, 67, 54, 0.5);
  animation: shake 0.5s ease;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.crash-controls {
  background: var(--bg2);
  border-radius: 12px;
  padding: 30px;
}

.auto-cashout {
  margin-top: 20px;
  padding: 15px;
  background: var(--bg1);
  border-radius: 8px;
}

.auto-cashout label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}

.auto-cashout input {
  width: 100%;
  padding: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 16px;
}

.auto-cashout small {
  display: block;
  margin-top: 5px;
  color: var(--text-dim);
  font-size: 12px;
}

/* ============================================================================
   COINFLIP GAME STYLES
   ============================================================================ */

.coinflip-game {
  padding: 30px;
  max-width: 800px;
  margin: 0 auto;
}

.coinflip-display {
  background: var(--bg2);
  border-radius: 12px;
  padding: 40px;
  margin-bottom: 30px;
  text-align: center;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.coinflip-coin {
  font-size: 120px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.coinflip-coin.flipping {
  animation: flip 1.5s ease-in-out;
}

.coinflip-coin.win {
  color: var(--success);
  animation: bounce 0.6s ease;
}

.coinflip-coin.lose {
  color: var(--error);
  opacity: 0.6;
}

@keyframes flip {
  0%, 100% { transform: rotateY(0deg); }
  50% { transform: rotateY(1800deg); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.coinflip-controls {
  background: var(--bg2);
  border-radius: 12px;
  padding: 30px;
}

.choice-section {
  margin: 20px 0;
}

.choice-section h3 {
  text-align: center;
  margin-bottom: 15px;
  color: var(--text);
}

.choice-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.choice-btn {
  flex: 1;
  max-width: 200px;
  padding: 15px 25px;
  font-size: 18px;
  font-weight: bold;
  background: var(--bg1);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.choice-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.choice-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(33, 150, 243, 0.5);
}

/* ============================================================================
   PLINKO GAME STYLES
   ============================================================================ */

.plinko-game {
  padding: 30px;
  max-width: 900px;
  margin: 0 auto;
}

.plinko-board {
  background: var(--bg2);
  border-radius: 12px;
  padding: 40px 20px;
  margin-bottom: 30px;
  min-height: 400px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.plinko-pegs {
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  height: 280px;
  background-image: 
    radial-gradient(circle, var(--border) 4px, transparent 4px);
  background-size: 50px 40px;
  background-position: center;
}

.plinko-ball {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(33, 150, 243, 0.8);
  z-index: 10;
}

.plinko-slots {
  display: flex;
  gap: 2px;
  justify-content: space-between;
  padding: 0 10px;
}

.plinko-slot {
  flex: 1;
  padding: 15px 5px;
  text-align: center;
  font-weight: bold;
  font-size: 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.plinko-slot.high {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  color: white;
}

.plinko-slot.medium {
  background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
  color: var(--bg1);
}

.plinko-slot.normal {
  background: linear-gradient(135deg, #48dbfb 0%, #0abde3 100%);
  color: white;
}

.plinko-slot.low {
  background: linear-gradient(135deg, #c8d6e5 0%, #8395a7 100%);
  color: var(--bg1);
}

.plinko-slot.highlight {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
  animation: glow 0.5s ease-in-out infinite alternate;
}

@keyframes glow {
  from { box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }
  to { box-shadow: 0 0 20px rgba(255, 255, 255, 1); }
}

.plinko-controls {
  background: var(--bg2);
  border-radius: 12px;
  padding: 30px;
}

/* ============================================================================
   SHARED GAME CONTROLS
   ============================================================================ */

.bet-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin: 15px 0;
}

.bet-input-group input {
  width: 150px;
  padding: 10px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  background: var(--bg1);
  border: 2px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

.btn-small {
  width: 40px;
  height: 40px;
  font-size: 20px;
  font-weight: bold;
}

.play-btn {
  width: 100%;
  padding: 18px;
  margin-top: 20px;
  font-size: 20px;
  font-weight: bold;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.play-btn:hover:not(:disabled) {
  background: #1976D2;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
}

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

.current-bet {
  text-align: center;
  font-size: 16px;
  margin: 15px 0;
  color: var(--text);
}

.current-bet span {
  font-weight: bold;
  color: var(--success);
}

/* Result messages */
.result-message {
  margin-top: 20px;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

.result-win {
  background: rgba(76, 175, 80, 0.1);
  border: 2px solid var(--success);
}

.result-win h3 {
  color: var(--success);
  margin-bottom: 10px;
}

.result-loss {
  background: rgba(244, 67, 54, 0.1);
  border: 2px solid var(--error);
}

.result-loss h3 {
  color: var(--error);
  margin-bottom: 10px;
}

.result-profit {
  font-size: 24px;
  font-weight: bold;
  color: var(--success);
  margin-top: 10px;
}
