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

:root {
  --bg-dark: #0a0a0f;
  --bg-mid: #14141f;
  --bg-card: #1a1a2e;
  --gold: #c9a84c;
  --gold-bright: #f0d060;
  --crimson: #8b1a1a;
  --crimson-bright: #dc2626;
  --blue-accent: #3b82f6;
  --blue-dark: #1e3a5f;
  --green-accent: #22c55e;
  --text-primary: #e8e0d0;
  --text-secondary: #9a917e;
  --parchment: #d4c5a0;
  --parchment-dark: #b3a47e;
}

body {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'Alegreya', serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

#root {
  height: 100vh;
  width: 100vw;
}

.font-title {
  font-family: 'Cinzel', serif;
}

.font-body {
  font-family: 'Alegreya', serif;
}

.font-mono {
  font-family: 'JetBrains Mono', monospace;
}

/* Card Styles */
.card-container {
  perspective: 800px;
  cursor: pointer;
  transition: transform 0.2s ease, z-index 0s;
}

.card-container:hover {
  transform: translateY(-20px) scale(1.08);
  z-index: 100;
}

.game-card {
  width: 130px;
  height: 185px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.6);
  transition: box-shadow 0.2s ease;
}

.game-card.attack { border: 2px solid #dc2626; background: linear-gradient(145deg, #2a1015, #1a0a0e); }
.game-card.skill { border: 2px solid #3b82f6; background: linear-gradient(145deg, #0f1a2e, #0a1020); }
.game-card.power { border: 2px solid #c9a84c; background: linear-gradient(145deg, #2a2210, #1a150a); }
.game-card.status { border: 2px solid #6b7280; background: linear-gradient(145deg, #1a1a1a, #111); }

.game-card .card-cost {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle, #4a3a20, #2a1a10);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 14px;
  color: var(--gold-bright);
  z-index: 10;
}

.game-card .card-name {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  padding: 2px 4px;
  color: var(--text-primary);
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  position: absolute;
  bottom: 56px;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
}

.game-card .card-art {
  width: 90%;
  height: 65px;
  margin: 32px auto 0;
  border-radius: 4px;
  overflow: hidden;
  image-rendering: pixelated;
  background: rgba(0,0,0,0.3);
}

.game-card .card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.game-card .card-desc {
  position: absolute;
  bottom: 4px;
  left: 6px;
  right: 6px;
  font-size: 9px;
  line-height: 1.2;
  text-align: center;
  color: var(--parchment);
  height: 48px;
  overflow: hidden;
}

.game-card .card-type {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 8px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.game-card.unplayable {
  opacity: 0.5;
  filter: grayscale(0.5);
}

.game-card.upgraded .card-name {
  color: #4ade80;
}

/* Enemy intent icons */
.intent-icon {
  animation: intentBob 1.5s ease-in-out infinite;
}

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

/* Damage flash */
@keyframes damageFlash {
  0% { filter: brightness(1); }
  25% { filter: brightness(3) saturate(2); }
  50% { filter: brightness(1.5); }
  100% { filter: brightness(1); }
}

.damage-flash {
  animation: damageFlash 0.3s ease-out;
}

/* Shake animation */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.4s ease-out;
}

/* Floating damage number */
@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-60px) scale(1.3); }
}

.float-damage {
  animation: floatUp 1s ease-out forwards;
  pointer-events: none;
}

/* Map node pulse */
@keyframes nodePulse {
  0%, 100% { box-shadow: 0 0 8px rgba(201, 168, 76, 0.4); }
  50% { box-shadow: 0 0 20px rgba(201, 168, 76, 0.9); }
}

.node-available {
  animation: nodePulse 1.5s ease-in-out infinite;
}

/* HP bar animation */
.hp-bar-fill {
  transition: width 0.5s ease-out;
}

/* Screen transitions */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.screen-enter {
  animation: fadeIn 0.4s ease-out;
}

/* Title screen glow */
@keyframes titleGlow {
  0%, 100% { text-shadow: 0 0 20px rgba(201, 168, 76, 0.3), 0 0 60px rgba(201, 168, 76, 0.1); }
  50% { text-shadow: 0 0 30px rgba(201, 168, 76, 0.6), 0 0 80px rgba(201, 168, 76, 0.2); }
}

.title-glow {
  animation: titleGlow 3s ease-in-out infinite;
}

/* Button styles */
.btn-gold {
  background: linear-gradient(145deg, #8b7530, #5a4a1e);
  border: 2px solid var(--gold);
  color: var(--gold-bright);
  font-family: 'Cinzel', serif;
  font-weight: 700;
  padding: 10px 28px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.btn-gold:hover {
  background: linear-gradient(145deg, #a08838, #6b5a28);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.4);
}

.btn-crimson {
  background: linear-gradient(145deg, #8b1a1a, #5a0e0e);
  border: 2px solid #dc2626;
  color: #fca5a5;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  padding: 10px 28px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-crimson:hover {
  background: linear-gradient(145deg, #a02020, #6b1212);
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.5);
}

/* Energy orb */
.energy-orb {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f87171, #991b1b, #450a0a);
  border: 3px solid #fca5a5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 20px;
  color: white;
  text-shadow: 0 0 10px rgba(255,255,255,0.5);
  box-shadow: 0 0 15px rgba(248, 113, 113, 0.4);
}

/* Map styles */
.map-container {
  background: linear-gradient(180deg, #0a0a14 0%, #141420 50%, #1a1a2e 100%);
}

.map-node {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 18px;
  border: 2px solid rgba(201, 168, 76, 0.3);
  background: rgba(20, 20, 30, 0.9);
}

.map-node:hover {
  transform: scale(1.2);
}

.map-node.visited {
  opacity: 0.4;
  border-color: rgba(100, 100, 100, 0.3);
}

.map-node.current {
  border-color: var(--gold-bright);
  box-shadow: 0 0 20px rgba(201, 168, 76, 0.8);
  transform: scale(1.15);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 3px;
}

/* Campfire glow */
@keyframes campfireGlow {
  0%, 100% { box-shadow: 0 0 30px rgba(255, 120, 20, 0.3); }
  50% { box-shadow: 0 0 60px rgba(255, 120, 20, 0.6); }
}

.campfire-glow {
  animation: campfireGlow 2s ease-in-out infinite;
}

/* Tooltip */
.tooltip-container {
  position: relative;
}

.tooltip-content {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 15, 0.95);
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 8px 12px;
  white-space: nowrap;
  z-index: 1000;
  font-size: 12px;
}

.tooltip-container:hover .tooltip-content {
  display: block;
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  animation: fadeIn 0.2s ease-out;
}

/* Status effect icons */
.status-icon {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  position: relative;
  margin: 0 2px;
}

.status-count {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 8px;
  background: rgba(0,0,0,0.8);
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.3);
}

/* Card reward glow */
@keyframes rewardGlow {
  0%, 100% { box-shadow: 0 0 15px rgba(201, 168, 76, 0.3); }
  50% { box-shadow: 0 0 30px rgba(201, 168, 76, 0.7); }
}

.reward-card {
  animation: rewardGlow 2s ease-in-out infinite;
}

/* Block shield */
.block-shield {
  width: 36px;
  height: 40px;
  background: linear-gradient(145deg, #4a6fa5, #2d4a7a);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 14px;
  color: white;
}

footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 11px;
}
footer a:hover {
  color: var(--gold);
}