:root {
  --deep-purple: #1a0a2e;
  --dark-bg: #0d0d0d;
  --gold: #ffd700;
  --gold-dim: #b8960f;
  --crimson: #dc143c;
  --parchment: #f4e4c1;
  --parchment-dark: #d4c4a1;
  --blood-red: #8b0000;
  --royal-purple: #2d1b4e;
  --shadow-purple: #120822;
}

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

body {
  background: var(--dark-bg);
  color: var(--parchment);
  font-family: 'Crimson Pro', serif;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(26, 10, 46, 0.8) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(139, 0, 0, 0.15) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 80%, rgba(26, 10, 46, 0.6) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

#root { position: relative; z-index: 1; }

.font-pixel { font-family: 'Press Start 2P', cursive; }
.font-serif { font-family: 'Crimson Pro', serif; }

/* Title glow */
.title-glow {
  text-shadow: 
    0 0 10px rgba(255, 215, 0, 0.8),
    0 0 20px rgba(255, 215, 0, 0.4),
    0 0 40px rgba(255, 215, 0, 0.2),
    2px 2px 0px rgba(139, 0, 0, 0.8);
}

/* Gold shimmer text */
.gold-text {
  color: var(--gold);
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

/* Card styles */
.character-card {
  background: linear-gradient(135deg, #1e1230 0%, #150d22 100%);
  border: 2px solid #3d2a5c;
  border-radius: 12px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.character-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.5;
}

.character-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.15);
}

.character-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3), inset 0 0 20px rgba(255, 215, 0, 0.05);
}

.character-card.winning-streak {
  border-color: #22c55e;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.3);
}

.character-card.losing-streak {
  border-color: var(--crimson);
  box-shadow: 0 0 15px rgba(220, 20, 60, 0.3);
}

.character-card.bankrupt {
  filter: grayscale(0.7) brightness(0.6);
  border-color: #444;
  opacity: 0.7;
}

/* Avatar frame */
.avatar-frame {
  border: 3px solid var(--gold-dim);
  border-radius: 8px;
  padding: 3px;
  background: linear-gradient(135deg, #2d1b4e, #1a0a2e);
  image-rendering: pixelated;
  position: relative;
}

.avatar-frame img {
  image-rendering: pixelated;
  border-radius: 4px;
}

/* Stat bar */
.stat-bar-bg {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  height: 10px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* Button styles */
.btn-gold {
  background: linear-gradient(180deg, #ffd700 0%, #b8960f 100%);
  color: #1a0a2e;
  font-family: 'Press Start 2P', cursive;
  border: 2px solid #ffd700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-shadow: none;
}

.btn-gold:hover {
  background: linear-gradient(180deg, #ffe44d 0%, #d4af37 100%);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
  transform: translateY(-1px);
}

.btn-crimson {
  background: linear-gradient(180deg, #dc143c 0%, #8b0000 100%);
  color: var(--parchment);
  font-family: 'Press Start 2P', cursive;
  border: 2px solid #dc143c;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-crimson:hover {
  background: linear-gradient(180deg, #ff1a4d 0%, #a30000 100%);
  box-shadow: 0 0 15px rgba(220, 20, 60, 0.5);
}

/* Fight button pulse */
@keyframes fightPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(220, 20, 60, 0.5); }
  50% { box-shadow: 0 0 40px rgba(220, 20, 60, 0.8), 0 0 60px rgba(220, 20, 60, 0.3); }
}

.fight-btn {
  animation: fightPulse 2s infinite;
}

/* Dice animation */
@keyframes diceRoll {
  0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  25% { transform: rotateX(90deg) rotateY(180deg) rotateZ(90deg); }
  50% { transform: rotateX(180deg) rotateY(360deg) rotateZ(180deg); }
  75% { transform: rotateX(270deg) rotateY(540deg) rotateZ(270deg); }
  100% { transform: rotateX(360deg) rotateY(720deg) rotateZ(360deg); }
}

.dice-rolling {
  animation: diceRoll 0.4s linear infinite;
}

@keyframes diceSettle {
  0% { transform: rotateX(20deg) rotateY(10deg) scale(1.2); }
  50% { transform: rotateX(-5deg) rotateY(-3deg) scale(0.95); }
  100% { transform: rotateX(0deg) rotateY(0deg) scale(1); }
}

.dice-settled {
  animation: diceSettle 0.5s ease-out forwards;
}

/* Slide in animations */
@keyframes slideInLeft {
  from { transform: translateX(-120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.slide-in-left { animation: slideInLeft 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.slide-in-right { animation: slideInRight 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

/* Victory glow */
@keyframes victoryGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
  50% { box-shadow: 0 0 50px rgba(255, 215, 0, 0.8), 0 0 80px rgba(255, 215, 0, 0.3); }
}

.victory-glow {
  animation: victoryGlow 1s infinite;
}

/* Screen shake */
@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-5px, -3px); }
  20% { transform: translate(5px, 3px); }
  30% { transform: translate(-3px, 5px); }
  40% { transform: translate(3px, -5px); }
  50% { transform: translate(-5px, 3px); }
  60% { transform: translate(5px, -3px); }
  70% { transform: translate(-3px, -5px); }
  80% { transform: translate(3px, 5px); }
  90% { transform: translate(-5px, -3px); }
}

.screen-shake { animation: screenShake 0.5s ease; }

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

.confetti-piece {
  position: fixed;
  width: 8px;
  height: 8px;
  top: -10px;
  z-index: 100;
  animation: confettiFall linear forwards;
}

/* Coin fly */
@keyframes coinFly {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
  100% { opacity: 0; transform: scale(0.5); }
}

/* Floating text */
@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-40px) scale(1.2); }
}

.float-up {
  animation: floatUp 1.5s ease-out forwards;
}

/* Flame aura for streaks */
@keyframes flameAura {
  0%, 100% { box-shadow: 0 0 10px rgba(255, 100, 0, 0.5), 0 -5px 15px rgba(255, 50, 0, 0.3); }
  50% { box-shadow: 0 0 20px rgba(255, 100, 0, 0.7), 0 -10px 25px rgba(255, 50, 0, 0.5); }
}

.flame-aura {
  animation: flameAura 1.5s infinite;
}

/* Modal overlay */
.modal-overlay {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--dark-bg); }
::-webkit-scrollbar-thumb { background: var(--royal-purple); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-dim); }

/* Nav tab */
.nav-tab {
  transition: all 0.2s ease;
  border-bottom: 3px solid transparent;
}

.nav-tab.active {
  border-bottom-color: var(--gold);
  color: var(--gold);
}

.nav-tab:hover {
  color: var(--gold);
}

/* VS emblem */
@keyframes vsGlow {
  0%, 100% { text-shadow: 0 0 20px rgba(220, 20, 60, 0.5); }
  50% { text-shadow: 0 0 40px rgba(220, 20, 60, 0.8), 0 0 60px rgba(255, 215, 0, 0.3); }
}

.vs-emblem {
  animation: vsGlow 2s infinite;
}

/* Spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  border: 3px solid rgba(255, 215, 0, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

/* Commentary fade */
@keyframes commentaryFade {
  0% { opacity: 0; transform: translateY(10px); }
  20% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

.commentary-text {
  animation: commentaryFade 2.5s ease forwards;
}

/* Input styles */
input[type="text"], input[type="number"], select {
  background: rgba(26, 10, 46, 0.8);
  border: 2px solid #3d2a5c;
  color: var(--parchment);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: 'Crimson Pro', serif;
  font-size: 16px;
  transition: border-color 0.2s;
}

input[type="text"]:focus, input[type="number"]:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
}

input[type="range"]::-webkit-slider-track {
  background: #3d2a5c;
  height: 8px;
  border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #1a0a2e;
  margin-top: -8px;
}

/* Responsive */
@media (max-width: 768px) {
  .font-pixel { font-size: 0.7em; }
}