/**
 * Market Rocket - NADO COLORS + CASINO ENERGY
 * Dark Nado palette with gambling excitement retained
 */

/* ===== CASINO KEYFRAME ANIMATIONS ===== */
@keyframes subtle-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes slide-up {
    from { 
        transform: translateY(20px); 
        opacity: 0; 
    }
    to { 
        transform: translateY(0); 
        opacity: 1; 
    }
}

@keyframes multiplier-grow {
    0% { 
        transform: translate(-50%, -50%) scale(0.9);
        opacity: 0.8;
    }
    100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

@keyframes rocket-glow {
    0%, 100% {
        box-shadow: 
            0 8px 32px rgba(229, 62, 62, 0.15),
            0 4px 16px rgba(0,0,0,0.3),
            inset 0 1px 0 rgba(255,255,255,0.1);
    }
    50% {
        box-shadow: 
            0 12px 48px rgba(229, 62, 62, 0.25),
            0 6px 24px rgba(0,0,0,0.4),
            inset 0 1px 0 rgba(255,255,255,0.15);
    }
}

@keyframes multiplier-pulse {
    0%, 100% { 
        text-shadow: 0 0 20px rgba(229, 62, 62, 0.8), 0 0 40px rgba(229, 62, 62, 0.4);
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        text-shadow: 0 0 30px rgba(229, 62, 62, 1), 0 0 60px rgba(229, 62, 62, 0.6);
        transform: translate(-50%, -50%) scale(1.05);
    }
}

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

/* ===== BASE STRUCTURE ===== */
#crash-container {
  background: #000000 !important;
  min-height: calc(100vh - 200px);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #ffffff;
  padding: 0;
  overflow-x: hidden;
}

/* ===== MAIN LAYOUT ===== */
.crash-main {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 200px);
}

.crash-game-area {
  flex: 1;
  padding: 32px;
  background: #000000;
  position: relative;
}

.crash-sidebar {
  width: 380px;
  background: #0a0b0d;
  border-left: 1px solid rgba(255,255,255,0.04);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  box-shadow: inset 4px 0 8px rgba(0,0,0,0.3);
}

/* ===== GAME HEADER ===== */
.crash-header {
  background: #0a0b0d;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}

.crash-header h1,
.crash-header h2,
.game-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: 0.02em;
  text-shadow: 0 0 15px rgba(229, 62, 62, 0.6);
}

.game-subtitle {
  color: #9ca3af;
  font-size: 1rem;
  font-weight: 500;
  margin: 8px 0 0 0;
}

/* ===== GAME CANVAS AREA ===== */
.game-canvas-container,
.canvas-container {
  background: #000000;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 12px;
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.5), 0 4px 16px rgba(0,0,0,0.3);
}

#crash-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 12px;
}

/* ===== GAME STATUS ===== */
.game-status {
  background: #0f1012;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 16px 20px;
  text-align: center;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}

.game-status.waiting { 
  color: #eab308; 
  text-shadow: 0 0 10px rgba(234, 179, 8, 0.6);
  animation: subtle-pulse 2s ease-in-out infinite;
}
.game-status.crashed { 
  color: #ef4444; 
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}
.game-status.flying { 
  color: #22c55e; 
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
}

/* ===== MULTIPLIER DISPLAY ===== */
.multiplier-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  pointer-events: none;
}

.multiplier-value {
  font-family: 'Inter', sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  color: #ffffff;
  text-align: center;
  letter-spacing: -0.02em;
  text-shadow: 0 0 20px rgba(229, 62, 62, 0.8), 0 0 40px rgba(229, 62, 62, 0.4);
  animation: multiplier-pulse 2s ease-in-out infinite;
}

.multiplier-value.crashed {
  color: #ef4444;
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.8), 0 0 40px rgba(239, 68, 68, 0.4);
  animation: none;
}

/* ===== COUNTDOWN OVERLAY ===== */
.countdown-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(229, 62, 62, 0.3);
  border-radius: 16px;
  padding: 32px 48px;
  text-align: center;
  z-index: 20;
  box-shadow: 0 8px 32px rgba(229, 62, 62, 0.4);
}

.countdown-text {
  font-family: 'Inter', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: #9ca3af;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.countdown-number {
  font-family: 'Inter', sans-serif;
  font-size: 4rem;
  font-weight: 800;
  color: #e53e3e;
  margin: 0;
  text-shadow: 0 0 20px rgba(229, 62, 62, 0.8), 0 0 40px rgba(229, 62, 62, 0.4);
  animation: subtle-pulse 1s ease-in-out infinite;
}

/* ===== BETTING PANEL ===== */
.betting-panel {
  background: #0a0b0d;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.03);
}

.betting-panel h3,
.bet-panel h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 20px 0;
  text-align: center;
  text-shadow: 0 0 10px rgba(229, 62, 62, 0.5);
}

/* ===== BET INPUT ===== */
.bet-input-group {
  margin-bottom: 20px;
}

.bet-input-label {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #9ca3af;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#bet-amount,
.bet-amount-input {
  width: 100%;
  background: #000000;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 8px;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 16px;
  box-sizing: border-box;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
}

#bet-amount:focus,
.bet-amount-input:focus {
  outline: none;
  border-color: #e53e3e;
  box-shadow: 0 0 0 2px rgba(229, 62, 62, 0.15), inset 0 2px 4px rgba(0,0,0,0.3);
}

/* ===== QUICK BET BUTTONS ===== */
.quick-bets {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.quick-bet,
.quick-bet-btn {
  flex: 1;
  background: #111214;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 6px;
  color: #9ca3af;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.quick-bet:hover,
.quick-bet-btn:hover {
  background: #171a21;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(229, 62, 62, 0.2);
  transform: translateY(-2px);
}

/* ===== AUTO CASHOUT ===== */
.auto-cashout-group {
  margin-top: 20px;
}

.auto-cashout-input {
  width: 100%;
  background: #000000;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 8px;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 16px;
  box-sizing: border-box;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.auto-cashout-input:focus {
  outline: none;
  border-color: #e53e3e;
  box-shadow: 0 0 0 2px rgba(229, 62, 62, 0.15), inset 0 2px 4px rgba(0,0,0,0.3);
}

/* ===== ACTION BUTTONS ===== */
.place-bet-btn {
  width: 100%;
  background: #e53e3e;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 6px 20px rgba(229, 62, 62, 0.4), 0 0 20px rgba(229, 62, 62, 0.2);
  animation: rocket-glow 3s ease-in-out infinite;
}

.place-bet-btn:hover {
  background: #c53030;
  box-shadow: 0 8px 28px rgba(229, 62, 62, 0.5), 0 0 30px rgba(229, 62, 62, 0.3);
  transform: translateY(-2px);
}

.place-bet-btn:disabled {
  background: #374151;
  color: #6b7280;
  cursor: not-allowed;
  box-shadow: none;
  animation: none;
}

.cashout-btn {
  width: 100%;
  background: #ef4444;
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4), 0 0 20px rgba(239, 68, 68, 0.2);
  animation: rocket-glow 3s ease-in-out infinite;
}

.cashout-btn:hover {
  background: #dc2626;
  box-shadow: 0 8px 28px rgba(239, 68, 68, 0.5), 0 0 30px rgba(239, 68, 68, 0.3);
  transform: translateY(-2px);
}

/* ===== CURRENT BET INFO ===== */
.current-bet-info {
  background: #000000;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 16px;
  margin-top: 20px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.current-bet-info h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #9ca3af;
  margin: 0 0 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bet-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.bet-info-item {
  text-align: center;
}

.bet-info-label {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bet-info-value {
  font-size: 1rem;
  color: #ffffff;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
}

.bet-info-value.profit {
  color: #22c55e;
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
}

.bet-info-value.loss {
  color: #ef4444;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

/* ===== GAME STATISTICS ===== */
.game-stats,
.stats-section {
  background: #0f1012;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.03);
}

.game-stats h4,
.stats-section h4,
.stats-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #6b7280;
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stat-item {
  text-align: center;
}

.stat-label {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.1rem;
  color: #e53e3e;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  text-shadow: 0 0 10px rgba(229, 62, 62, 0.5);
}

/* ===== CRASH HISTORY ===== */
.crash-history {
  margin-top: 20px;
}

.crash-history h4,
.history-title {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #6b7280;
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-item,
.crash-history span,
.result-item {
  background: #111214;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: #c4c9d4;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}

.history-item.high {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.2);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}

.history-item.crashed {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* ===== LIVE BETS ===== */
.live-bets {
  margin-top: 20px;
}

.live-bets h4 {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #6b7280;
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.live-bets-list {
  max-height: 200px;
  overflow-y: auto;
}

.live-bet-item,
.player-bet {
  background: #0f1012;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: all 0.2s ease;
}

.live-bet-item:hover,
.player-bet:hover {
  background: #111214;
  transform: translateY(-1px);
}

.player-name,
.player-name-text {
  color: #c4c9d4;
  font-weight: 500;
  font-size: 0.85rem;
}

.player-bet-amount {
  color: #ffffff;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
}

.player-multiplier {
  color: #e53e3e;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  text-shadow: 0 0 8px rgba(229, 62, 62, 0.5);
}

/* ===== BALANCE DISPLAY ===== */
.balance-info {
  background: #000000;
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.balance-label {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.balance-value,
.session-profit {
  font-size: 1.2rem;
  color: #ffffff;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
}

.balance-value.profit,
.session-profit.positive {
  color: #22c55e;
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
}

.balance-value.loss,
.session-profit.negative {
  color: #ef4444;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
  .crash-main {
    flex-direction: column;
  }
  
  .crash-sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,0.04);
    order: 2;
  }
  
  .crash-game-area {
    order: 1;
  }
}

@media (max-width: 768px) {
  .crash-game-area,
  .crash-sidebar {
    padding: 20px 16px;
  }
  
  .crash-header {
    padding: 20px;
  }
  
  .crash-header h1,
  .crash-header h2 {
    font-size: 1.3rem;
  }
  
  .game-canvas-container {
    height: 350px;
  }
  
  .multiplier-value {
    font-size: 2.5rem;
  }
  
  .countdown-number {
    font-size: 3rem;
  }
  
  .betting-panel {
    padding: 20px;
  }
  
  .quick-bets {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .bet-info-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .crash-header h1,
  .crash-header h2 {
    font-size: 1.2rem;
  }
  
  .game-canvas-container {
    height: 280px;
  }
  
  .multiplier-value {
    font-size: 2rem;
  }
  
  .countdown-overlay {
    padding: 24px 32px;
  }
  
  .countdown-number {
    font-size: 2.5rem;
  }
  
  .betting-panel {
    padding: 16px;
  }
  
  .quick-bets {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ===== SCROLLBAR STYLING ===== */
.live-bets-list::-webkit-scrollbar,
.crash-sidebar::-webkit-scrollbar {
  width: 4px;
}

.live-bets-list::-webkit-scrollbar-track,
.crash-sidebar::-webkit-scrollbar-track {
  background: #000000;
}

.live-bets-list::-webkit-scrollbar-thumb,
.crash-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}

.live-bets-list::-webkit-scrollbar-thumb:hover,
.crash-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.15);
}