:root {
  --bg-deep: #0a0a0f;
  --bg-panel: #12121f;
  --bg-card: #1a1a2e;
  --purple: #2d1b4e;
  --blue: #1a1a3e;
  --gold: #d4af37;
  --crimson: #8b0000;
  --emerald: #00c853;
  --cyan: #00bcd4;
  --text: #e0d8c8;
  --text-dim: #8a8270;
  --mana-blue: #4a9eff;
}

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

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

#root { min-height: 100vh; }

.font-cinzel { font-family: 'Cinzel', serif; }
.font-crimson { font-family: 'Crimson Pro', serif; }

@keyframes pulse-glow {
  0%, 100% { text-shadow: 0 0 20px rgba(212,175,55,0.5), 0 0 40px rgba(212,175,55,0.2); }
  50% { text-shadow: 0 0 30px rgba(212,175,55,0.8), 0 0 60px rgba(212,175,55,0.4), 0 0 80px rgba(212,175,55,0.1); }
}

@keyframes float-up {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-80px) scale(1.2); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

@keyframes card-draw {
  0% { opacity: 0; transform: translateY(60px) scale(0.8) rotateZ(-5deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotateZ(0); }
}

@keyframes card-play {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-120px) scale(1.1); }
  100% { transform: translateY(-200px) scale(0.5); opacity: 0; }
}

@keyframes node-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(212,175,55,0.3); }
  50% { box-shadow: 0 0 16px rgba(212,175,55,0.7), 0 0 24px rgba(212,175,55,0.3); }
}

@keyframes flash-red {
  0% { background: rgba(139,0,0,0.4); }
  100% { background: transparent; }
}

@keyframes flash-gold {
  0% { background: rgba(212,175,55,0.3); }
  100% { background: transparent; }
}

@keyframes enemy-die {
  0% { opacity: 1; transform: scale(1); filter: brightness(1); }
  30% { filter: brightness(3); }
  100% { opacity: 0; transform: scale(0.3); filter: brightness(0); }
}

@keyframes slide-in-right {
  0% { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes shimmer {
  0% { transform: translateX(-100%) rotate(45deg); }
  50% { transform: translateX(100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

@keyframes pack-reveal {
  0% { transform: scale(0.5) rotateY(180deg); opacity: 0; }
  60% { transform: scale(1.1) rotateY(10deg); opacity: 1; }
  100% { transform: scale(1) rotateY(0deg); opacity: 1; }
}

.animate-pack-reveal { animation: pack-reveal 0.6s ease-out forwards; }

@keyframes mana-refill {
  0% { transform: scale(0.5); opacity: 0.3; }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }
.animate-float-up { animation: float-up 1s ease-out forwards; }
.animate-shake { animation: shake 0.4s ease-out; }
.animate-card-draw { animation: card-draw 0.4s ease-out forwards; }
.animate-card-play { animation: card-play 0.5s ease-out forwards; }
.animate-node-pulse { animation: node-pulse 1.5s ease-in-out infinite; }
.animate-flash-red { animation: flash-red 0.5s ease-out; }
.animate-flash-gold { animation: flash-gold 0.6s ease-out; }
.animate-enemy-die { animation: enemy-die 0.8s ease-out forwards; }
.animate-slide-in { animation: slide-in-right 0.3s ease-out; }
.animate-mana-refill { animation: mana-refill 0.5s ease-out; }

@keyframes diablo-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255,0,64,0.3), inset 0 0 10px rgba(255,0,64,0.1); }
  50% { box-shadow: 0 0 40px rgba(255,0,64,0.6), inset 0 0 20px rgba(255,0,64,0.2), 0 0 60px rgba(255,0,0,0.2); }
}

.animate-diablo-pulse { animation: diablo-pulse 1.5s ease-in-out infinite; }

.card-hover-effect {
  transition: transform 0.2s ease, box-shadow 0.2s ease, z-index 0s;
}
.card-hover-effect:hover {
  transform: translateY(-20px) scale(1.12);
  z-index: 50;
}

.game-bg {
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(45,27,78,0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(26,26,62,0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(139,0,0,0.1) 0%, transparent 40%),
    var(--bg-deep);
}

.title-bg {
  background:
    radial-gradient(ellipse at 50% 60%, rgba(45,27,78,0.5) 0%, transparent 60%),
    radial-gradient(ellipse at 30% 30%, rgba(26,26,62,0.5) 0%, transparent 50%),
    linear-gradient(180deg, #060610 0%, #0a0a1a 40%, #0f0a1f 70%, #0a0a0f 100%);
}

.card-border-attack { border-color: #a83232; box-shadow: inset 0 0 15px rgba(168,50,50,0.2); }
.card-border-defend { border-color: #3264a8; box-shadow: inset 0 0 15px rgba(50,100,168,0.2); }
.card-border-skill { border-color: #32a852; box-shadow: inset 0 0 15px rgba(50,168,82,0.2); }
.card-border-power { border-color: #d4af37; box-shadow: inset 0 0 15px rgba(212,175,55,0.2); }
.card-border-curse { border-color: #6b2fa0; box-shadow: inset 0 0 15px rgba(107,47,160,0.2); }

.card-selected {
  transform: translateY(-30px) scale(1.15) !important;
  box-shadow: 0 0 25px rgba(212,175,55,0.6), 0 0 50px rgba(212,175,55,0.2) !important;
  z-index: 100 !important;
}

.hp-bar-enemy { background: linear-gradient(90deg, #8b0000, #cc2222); }
.hp-bar-player { background: linear-gradient(90deg, #6b1010, #cc2222); }
.block-bar { background: linear-gradient(90deg, #2a5090, #4a80cc); }

.ornate-border {
  border: 2px solid rgba(212,175,55,0.3);
  background: linear-gradient(135deg, rgba(26,26,46,0.95), rgba(18,18,31,0.98));
}

.tooltip-keyword {
  border-bottom: 1px dotted rgba(212,175,55,0.5);
  cursor: help;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(212,175,55,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(212,175,55,0.5); }

.merchant-bg {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(212,175,55,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(180,100,20,0.1) 0%, transparent 40%),
    var(--bg-deep);
}

.rest-bg {
  background:
    radial-gradient(circle at 50% 60%, rgba(200,120,20,0.15) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 70%, rgba(255,80,20,0.08) 0%, transparent 50%),
    var(--bg-deep);
}

/* ============================================ */
/* LIGHT MODE OVERRIDES                         */
/* ============================================ */

.light-mode-wrapper .title-bg,
body.light-mode .title-bg {
  background:
    radial-gradient(ellipse at 50% 60%, rgba(212,175,55,0.1) 0%, transparent 60%),
    radial-gradient(ellipse at 30% 30%, rgba(180,160,120,0.15) 0%, transparent 50%),
    linear-gradient(180deg, #f5f0e4 0%, #ede6d6 40%, #e8e0d0 70%, #f0ebe0 100%);
}

.light-mode-wrapper .game-bg,
body.light-mode .game-bg {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(180,160,120,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(160,140,100,0.1) 0%, transparent 50%),
    #f0ebe0;
}

.light-mode-wrapper .merchant-bg,
body.light-mode .merchant-bg {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(212,175,55,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(180,140,60,0.08) 0%, transparent 40%),
    #f0ebe0;
}

.light-mode-wrapper .rest-bg,
body.light-mode .rest-bg {
  background:
    radial-gradient(circle at 50% 60%, rgba(200,120,20,0.1) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 70%, rgba(255,140,40,0.06) 0%, transparent 50%),
    #f0ebe0;
}

.light-mode-wrapper .ornate-border {
  border-color: rgba(160,140,100,0.4);
  background: linear-gradient(135deg, rgba(240,235,224,0.95), rgba(230,225,210,0.98));
}

/* Light mode range input */
.light-mode-wrapper input[type="range"] {
  accent-color: #b09030;
}