@keyframes neonPulse {
  0%, 100% { text-shadow: 0 0 10px #ff1493, 0 0 20px #ff1493, 0 0 30px #ff1493; }
  50% { text-shadow: 0 0 20px #ff1493, 0 0 40px #ff1493, 0 0 60px #ff1493; }
}

@keyframes winPulse {
  0%, 100% { box-shadow: 0 0 20px #00ff88, 0 0 40px #00ff88; }
  50% { box-shadow: 0 0 40px #00ff88, 0 0 80px #00ff88; }
}

@keyframes lossPulse {
  0%, 100% { box-shadow: 0 0 20px #ff4444, 0 0 40px #ff4444; }
  50% { box-shadow: 0 0 40px #ff4444, 0 0 80px #ff4444; }
}

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

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

@keyframes confettiFall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

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

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Orbitron', sans-serif;
  background: linear-gradient(135deg, #0a0015 0%, #1a0a2e 50%, #0d0520 100%);
  min-height: 100vh;
  color: white;
}

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

.app-header {
  background: linear-gradient(180deg, rgba(255,20,147,0.2) 0%, transparent 100%);
  padding: 1rem;
  text-align: center;
  border-bottom: 2px solid rgba(255,20,147,0.5);
  position: relative;
}

.title {
  font-family: 'Staatliches', cursive;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  margin: 0 0 0.5rem 0;
  background: linear-gradient(90deg, #ff1493, #00ffff, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: neonPulse 2s infinite;
  letter-spacing: 2px;
}

.bankroll {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0,0,0,0.5);
  border: 3px solid #ffd700;
  border-radius: 12px;
  padding: 0.5rem 1.5rem;
  transition: all 0.3s ease;
}

.bankroll.win-pulse {
  animation: winPulse 0.5s ease;
  border-color: #00ff88;
}

.bankroll.loss-pulse {
  animation: lossPulse 0.5s ease;
  border-color: #ff4444;
}

.bankroll-label {
  font-size: 0.7rem;
  color: #ffd700;
  letter-spacing: 2px;
}

.bankroll-amount {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 900;
  color: #00ff88;
  text-shadow: 0 0 10px #00ff88;
}

.header-actions {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 0.5rem;
}

.icon-btn {
  background: rgba(255,255,255,0.1);
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.icon-btn:hover {
  background: rgba(255,20,147,0.3);
  border-color: #ff1493;
  transform: scale(1.1);
}

.game-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  flex-wrap: wrap;
  background: rgba(0,0,0,0.3);
}

.game-tab {
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
}

.game-tab:hover {
  background: rgba(255,20,147,0.2);
  border-color: #ff1493;
  transform: translateY(-2px);
}

.game-tab.active {
  background: linear-gradient(135deg, rgba(255,20,147,0.4), rgba(0,255,255,0.2));
  border-color: #00ffff;
  box-shadow: 0 0 20px rgba(0,255,255,0.5);
}

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

.tab-name {
  font-size: 0.7rem;
  margin-top: 0.25rem;
  letter-spacing: 1px;
}

.game-area {
  flex: 1;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.game-panel {
  background: rgba(0,0,0,0.5);
  border: 2px solid rgba(255,20,147,0.5);
  border-radius: 20px;
  padding: 1.5rem;
  max-width: 500px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 30px rgba(255,20,147,0.2);
}

.game-title {
  font-family: 'Staatliches', cursive;
  font-size: 1.8rem;
  margin: 0 0 1rem 0;
  color: #00ffff;
  text-shadow: 0 0 10px #00ffff;
}

.neon-text {
  color: #00ffff;
  text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
}

/* Slot Machine */
.slot-machine {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.slot-reel {
  width: 70px;
  height: 90px;
  background: linear-gradient(180deg, #1a1a2e, #0a0a1e);
  border: 3px solid #ffd700;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

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

/* Roulette */
.roulette-wheel {
  display: flex;
  justify-content: center;
}

.roulette-number {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: bold;
  border: 4px solid #ffd700;
  box-shadow: 0 0 20px rgba(255,215,0,0.5);
  transition: all 0.3s ease;
}

.roulette-number.spinning {
  animation: spin 0.2s linear infinite;
}

.roulette-choice, .dice-choice {
  background: rgba(255,255,255,0.05);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 0.75rem;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
}

.roulette-choice:hover, .dice-choice:hover {
  background: rgba(255,20,147,0.2);
  border-color: #ff1493;
}

.roulette-choice.active, .dice-choice.active {
  background: linear-gradient(135deg, rgba(255,20,147,0.4), rgba(0,255,255,0.2));
  border-color: #00ffff;
  box-shadow: 0 0 15px rgba(0,255,255,0.5);
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
  padding: 0.5rem;
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
}

.number-btn {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
}

.number-btn.red { background: #c41e3a; }
.number-btn.black { background: #1a1a2e; }
.number-btn.green { background: #228b22; }

.number-btn.selected {
  box-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
  border-color: #00ffff;
  transform: scale(1.2);
  z-index: 1;
}

/* Blackjack */
.playing-card {
  width: 50px;
  height: 70px;
  background: linear-gradient(135deg, #ffffff, #e0e0e0);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  color: #1a1a2e;
}

.card-back {
  background: linear-gradient(135deg, #c41e3a, #8b0000);
  color: white;
  font-size: 2rem;
}

.action-btn {
  background: linear-gradient(135deg, #4a1a6b, #2a0a4b);
  border: 2px solid #9b59b6;
  border-radius: 12px;
  padding: 0.75rem 1.5rem;
  color: white;
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #6a2a8b, #4a1a6b);
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(155,89,182,0.5);
}

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

.action-btn.double {
  background: linear-gradient(135deg, #ffd700, #b8860b);
  border-color: #ffd700;
  color: #1a1a2e;
}

/* Dice */
.dice-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dice {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #ffffff, #e0e0e0);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: transform 0.1s ease;
}

.dice-container.rolling .dice {
  animation: shake 0.1s infinite;
}

/* Bet Selector */
.bet-btn {
  background: rgba(255,215,0,0.1);
  border: 2px solid #ffd700;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  color: #ffd700;
  font-family: 'Orbitron', sans-serif;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.bet-btn:hover:not(:disabled) {
  background: rgba(255,215,0,0.3);
  transform: scale(1.05);
}

.bet-btn.active {
  background: #ffd700;
  color: #1a1a2e;
  box-shadow: 0 0 15px rgba(255,215,0,0.5);
}

.bet-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.bet-btn.all-in {
  border-color: #ff4444;
  color: #ff4444;
}

.bet-btn.all-in.active {
  background: #ff4444;
  color: white;
}

/* Spin Button */
.spin-btn {
  background: linear-gradient(135deg, #ff1493, #c41e3a);
  border: none;
  border-radius: 30px;
  padding: 1rem 2.5rem;
  color: white;
  font-family: 'Staatliches', cursive;
  font-size: 1.5rem;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 30px rgba(255,20,147,0.5);
}

.spin-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 0 50px rgba(255,20,147,0.7);
}

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

/* History Panel */
.history-panel {
  position: fixed;
  right: -320px;
  top: 0;
  width: 300px;
  height: 100vh;
  background: rgba(10,0,21,0.98);
  border-left: 2px solid #ff1493;
  padding: 1rem;
  transition: right 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.history-panel.open {
  right: 0;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.history-header h3 {
  margin: 0;
  color: #00ffff;
}

.close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

.history-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
}

.history-list {
  flex: 1;
  overflow-y: auto;
}

.history-entry {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

.history-entry.win {
  background: rgba(0,255,136,0.1);
  border-left: 3px solid #00ff88;
}

.history-entry.loss {
  background: rgba(255,68,68,0.1);
  border-left: 3px solid #ff4444;
}

/* Celebration Overlay */
.celebration-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: pointer;
}

.confetti {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  animation: confettiFall 3s ease-out infinite;
}

.celebration-text {
  text-align: center;
  animation: bounceIn 0.5s ease;
}

.celebration-text h1 {
  font-family: 'Staatliches', cursive;
  font-size: clamp(2rem, 8vw, 5rem);
  background: linear-gradient(90deg, #ffd700, #ff1493, #00ffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: neonPulse 0.5s infinite;
}

.celebration-text p {
  font-size: 1.5rem;
  color: #ffd700;
}

/* Game Over Screen */
.game-over-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, #0a0015 0%, #2a0a3e 50%, #0d0520 100%);
}

.game-over-content {
  text-align: center;
  max-width: 500px;
}

.bust-text {
  font-family: 'Staatliches', cursive;
  background: linear-gradient(90deg, #ff4444, #ffd700);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: neonPulse 1s infinite;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.stat-item {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: bold;
  color: #00ffff;
}

.try-again-btn {
  background: linear-gradient(135deg, #00ff88, #00cc6a);
  border: none;
  border-radius: 30px;
  padding: 1rem 3rem;
  color: #1a1a2e;
  font-family: 'Staatliches', cursive;
  font-size: 1.5rem;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 30px rgba(0,255,136,0.5);
}

.try-again-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 50px rgba(0,255,136,0.7);
}

/* Footer */
.app-footer {
  padding: 1rem;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.remix-link {
  color: #ff1493;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.remix-link:hover {
  color: #00ffff;
  text-shadow: 0 0 10px #00ffff;
}

/* Responsive */
@media (max-width: 640px) {
  .header-actions {
    position: static;
    transform: none;
    margin-top: 0.5rem;
    justify-content: center;
  }
  
  .game-tabs {
    gap: 0.25rem;
    padding: 0.5rem;
  }
  
  .game-tab {
    padding: 0.5rem 0.75rem;
    min-width: 60px;
  }
  
  .tab-icon {
    font-size: 1.2rem;
  }
  
  .game-panel {
    padding: 1rem;
  }
  
  .slot-reel {
    width: 60px;
    height: 75px;
    font-size: 2.5rem;
  }
  
  .dice {
    width: 60px;
    height: 60px;
    font-size: 3rem;
  }
  
  .number-grid {
    grid-template-columns: repeat(7, 1fr);
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .history-panel {
    width: 100%;
    right: -100%;
  }
}