/* =================================
   HEXGEMS ULTIMATE VISUAL OVERHAUL
   Duelyst-Inspired Atmospheric Design
   ================================= */

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
  background: 
    radial-gradient(circle at 20% 80%, rgba(26, 52, 89, 0.4) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(89, 26, 52, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(52, 89, 26, 0.2) 0%, transparent 50%),
    linear-gradient(135deg, #0f1419 0%, #1a1f2e 25%, #2a1f1a 50%, #1f2a1a 75%, #19140f 100%);
  color: #f0e6d2;
  height: 100vh;
  overflow: hidden;
  box-sizing: border-box;
  animation: backgroundShift 120s ease-in-out infinite;
}

@keyframes backgroundShift {
  0% { 
    background: 
      radial-gradient(circle at 20% 80%, rgba(26, 52, 89, 0.3) 0%, transparent 50%),
      radial-gradient(circle at 80% 20%, rgba(89, 26, 52, 0.2) 0%, transparent 50%),
      radial-gradient(circle at 40% 40%, rgba(52, 89, 26, 0.15) 0%, transparent 50%),
      linear-gradient(135deg, #0f1419 0%, #1a1f2e 25%, #1f1f1f 50%, #1a1f2e 75%, #0f1419 100%);
  }
  33% {
    background: 
      radial-gradient(circle at 70% 30%, rgba(89, 52, 26, 0.3) 0%, transparent 50%),
      radial-gradient(circle at 30% 70%, rgba(26, 89, 52, 0.2) 0%, transparent 50%),
      radial-gradient(circle at 50% 50%, rgba(52, 26, 89, 0.15) 0%, transparent 50%),
      linear-gradient(135deg, #19140f 0%, #1f1a1e 25%, #1f1f1f 50%, #1e1a1f 75%, #0f1419 100%);
  }
  66% {
    background: 
      radial-gradient(circle at 40% 60%, rgba(52, 26, 89, 0.3) 0%, transparent 50%),
      radial-gradient(circle at 60% 40%, rgba(89, 89, 26, 0.2) 0%, transparent 50%),
      radial-gradient(circle at 30% 70%, rgba(26, 52, 89, 0.15) 0%, transparent 50%),
      linear-gradient(135deg, #1a1f1a 0%, #1f1e1a 25%, #1f1f1f 50%, #1a1e1f 75%, #19140f 100%);
  }
  100% {
    background: 
      radial-gradient(circle at 20% 80%, rgba(26, 52, 89, 0.3) 0%, transparent 50%),
      radial-gradient(circle at 80% 20%, rgba(89, 26, 52, 0.2) 0%, transparent 50%),
      radial-gradient(circle at 40% 40%, rgba(52, 89, 26, 0.15) 0%, transparent 50%),
      linear-gradient(135deg, #0f1419 0%, #1a1f2e 25%, #1f1f1f 50%, #1a1f2e 75%, #0f1419 100%);
  }
}

#gameUI {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
  backdrop-filter: blur(0.5px);
}

/* ========== ATMOSPHERIC PARTICLES ========== */
#gameUI::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.1), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.05), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.08), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.03), transparent),
    radial-gradient(2px 2px at 160px 30px, rgba(255, 255, 255, 0.06), transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: particleDrift 60s linear infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes particleDrift {
  0% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
  100% { background-position: 200px 100px, -200px 200px, 100px -100px, -100px 150px, 150px -200px; }
}

/* ========== PREMIUM TOP BAR ========== */
#topBar {
  width: 100%;
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 0;
  background: 
    linear-gradient(135deg, rgba(26, 21, 16, 0.95) 0%, rgba(15, 12, 8, 0.98) 100%),
    radial-gradient(circle at 50% 0%, rgba(191, 167, 106, 0.1) 0%, transparent 70%);
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, 
    transparent 0%, 
    rgba(191, 167, 106, 0.3) 20%, 
    rgba(255, 230, 179, 0.8) 50%, 
    rgba(191, 167, 106, 0.3) 80%, 
    transparent 100%
  ) 1;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 50px rgba(191, 167, 106, 0.2);
  animation: topBarGlow 8s ease-in-out infinite alternate;
}

@keyframes topBarGlow {
  0% { 
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.05),
      0 0 50px rgba(191, 167, 106, 0.2);
  }
  100% { 
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 0 60px rgba(255, 230, 179, 0.3);
  }
}

.player-corner {
  position: absolute;
  width: 380px;
  display: flex;
  align-items: center;
}

#player1Corner {
  left: 10px;
  justify-content: flex-start;
}

#player2Corner {
  right: 10px;
  justify-content: flex-end;
}

.general-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px;
}

.general-icon {
  width: 64px;
  height: 64px;
  position: relative;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: portraitBreathing 6s ease-in-out infinite alternate;
}

.general-icon::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: linear-gradient(135deg, #bfa76a, #ffe6b3, #d4af37, #bfa76a);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  z-index: -1;
  animation: portraitAura 4s ease-in-out infinite alternate;
}

.general-icon::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  z-index: 0;
}

.general-icon img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

@keyframes portraitBreathing {
  0% { 
    transform: scale(1);
  }
  100% { 
    transform: scale(1.02);
  }
}

@keyframes portraitAura {
  0% { opacity: 0.3; }
  100% { opacity: 0.6; }
}

.general-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.general-hp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: bold;
  color: #ffe6b3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.general-hp {
  font-size: 18px;
  font-weight: bold;
  color: #ffe6b3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.horizontal-mana {
  display: flex;
  gap: 4px;
  align-items: center;
}

.horizontal-mana .mana-gem {
  width: 20px;
  height: 20px;
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  border: 2px solid transparent;
  background: 
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.3), transparent 50%),
    linear-gradient(135deg, #1a3a5f, #0f1f3f);
  position: relative;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  flex-shrink: 0;
  overflow: hidden;
}

.horizontal-mana .mana-gem::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  background: linear-gradient(135deg, #4a90e2, #6bb6ff, #4a90e2);
  z-index: -1;
  opacity: 0.6;
}

.horizontal-mana .mana-gem.available {
  background: 
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.6), transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(74, 144, 226, 0.8), transparent 60%),
    linear-gradient(135deg, #4a90e2, #6bb6ff);
  box-shadow: 
    0 0 15px rgba(74, 144, 226, 0.8),
    inset 0 2px 4px rgba(255, 255, 255, 0.2);
  animation: manaGemPulse 3s ease-in-out infinite alternate;
}

.horizontal-mana .mana-gem.available::before {
  opacity: 1;
  animation: manaGemAura 2s ease-in-out infinite alternate;
}

.horizontal-mana .mana-gem.expended {
  background: 
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.1), transparent 50%),
    linear-gradient(135deg, #2a4a6f, #1a2a3f);
  opacity: 0.4;
}

.horizontal-mana .mana-gem.expended::before {
  background: linear-gradient(135deg, #2a4a6f, #3a5a8f, #2a4a6f);
  opacity: 0.3;
}

.horizontal-mana .mana-gem.empty {
  background: 
    linear-gradient(135deg, #1a1a2f, #0f0f1f);
  opacity: 0.2;
  transform: scale(0.9);
}

.horizontal-mana .mana-gem.empty::before {
  background: linear-gradient(135deg, #333, #555, #333);
  opacity: 0.1;
}

@keyframes manaGemPulse {
  0% { 
    box-shadow: 
      0 0 15px rgba(74, 144, 226, 0.8),
      inset 0 2px 4px rgba(255, 255, 255, 0.2);
  }
  100% { 
    box-shadow: 
      0 0 25px rgba(107, 182, 255, 1),
      inset 0 2px 4px rgba(255, 255, 255, 0.3);
  }
}

@keyframes manaGemAura {
  0% { opacity: 0.8; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.1); }
}

.deck-info, .discard-info {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  color: #ccc;
}

#turnIndicator {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  color: #ffe6b3;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(255, 230, 179, 0.1);
  border: 1px solid rgba(191, 167, 106, 0.3);
  width: 200px;
}

/* CENTERED MAIN AREA */
#mainArea {
  position: fixed;
  top: 100px;
  left: 320px;
  right: 320px;
  bottom: 140px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5;
}
#boardCanvas {
  width: 918px;
  height: 510px;
  border: 4px solid transparent;
  flex-shrink: 0;
  background: 
    radial-gradient(circle at 30% 20%, rgba(74, 144, 226, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 70% 80%, rgba(255, 165, 0, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(191, 167, 106, 0.05) 0%, transparent 60%),
    linear-gradient(135deg, #1a1f2e 0%, #2a2318 25%, #1f2a23 50%, #231f2a 75%, #2e1f1a 100%);
  background-image: 
    linear-gradient(135deg, #1a1f2e 0%, #2a2318 25%, #1f2a23 50%, #231f2a 75%, #2e1f1a 100%);
  border-image: linear-gradient(135deg, 
    rgba(191, 167, 106, 0.6), 
    rgba(255, 230, 179, 0.9), 
    rgba(212, 175, 55, 0.7), 
    rgba(191, 167, 106, 0.6)
  ) 1;
  box-shadow: 
    0 0 50px rgba(0, 0, 0, 0.8),
    inset 0 0 100px rgba(191, 167, 106, 0.1),
    0 0 100px rgba(191, 167, 106, 0.2),
    0 20px 40px rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  position: relative;
  animation: battlefieldBreathing 15s ease-in-out infinite alternate;
  overflow: hidden;
}

#boardCanvas::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(255, 255, 255, 0.005) 10px,
      rgba(255, 255, 255, 0.005) 20px
    );
  pointer-events: none;
  animation: patternShift 30s linear infinite;
}

#boardCanvas::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  background: 
    radial-gradient(circle, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 15px 15px;
  animation: starfieldDrift 60s linear infinite;
  pointer-events: none;
}

@keyframes battlefieldBreathing {
  0% { 
    box-shadow: 
      0 0 50px rgba(0, 0, 0, 0.8),
      inset 0 0 100px rgba(191, 167, 106, 0.1),
      0 0 100px rgba(191, 167, 106, 0.2),
      0 20px 40px rgba(0, 0, 0, 0.3);
  }
  100% { 
    box-shadow: 
      0 0 60px rgba(0, 0, 0, 0.9),
      inset 0 0 120px rgba(255, 230, 179, 0.15),
      0 0 120px rgba(255, 230, 179, 0.3),
      0 25px 50px rgba(0, 0, 0, 0.4);
  }
}

@keyframes patternShift {
  0% { transform: translateX(0) translateY(0); }
  100% { transform: translateX(20px) translateY(20px); }
}

@keyframes starfieldDrift {
  0% { transform: translateX(0) translateY(0); }
  100% { transform: translateX(15px) translateY(15px); }
}
/* FLOATING TOOLTIP */
/* ========== MAGIC CARD STYLE TOOLTIP ========== */
#tooltip.floating-tooltip {
  position: fixed;
  bottom: 160px;
  right: 20px;
  width: 264px;
  background: 
    linear-gradient(135deg, rgba(42, 34, 20, 0.95) 0%, rgba(26, 21, 16, 0.98) 100%),
    radial-gradient(circle at 30% 30%, rgba(191, 167, 106, 0.1) 0%, transparent 70%);
  border: 3px solid rgba(191, 167, 106, 0.8);
  border-radius: 12px;
  padding: 0;
  padding-bottom: 25px; /* Extra space for hanging rarity diamond */
  color: #ffe6b3;
  font-size: 16px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.3;
  max-height: 400px;
  overflow: visible !important; /* Allow rarity diamonds to hang outside */
  box-shadow: 
    0 12px 32px rgba(0, 0, 0, 0.7),
    0 0 40px rgba(191, 167, 106, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.05),
    inset 0 0 20px rgba(191, 167, 106, 0.1);
  backdrop-filter: blur(8px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0;
  visibility: hidden;
  z-index: 20;
}

#tooltip.floating-tooltip::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 20px,
      rgba(255, 255, 255, 0.01) 20px,
      rgba(255, 255, 255, 0.01) 40px
    );
  pointer-events: none;
  opacity: 0.5;
  animation: tooltipPattern 30s linear infinite;
}

#tooltip.floating-tooltip::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 230, 179, 0.1), 
    transparent
  );
  animation: tooltipShimmer 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes tooltipPattern {
  0% { transform: translateX(0) translateY(0); }
  100% { transform: translateX(40px) translateY(40px); }
}

@keyframes tooltipShimmer {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

#tooltip.floating-tooltip.tooltip-visible {
  opacity: 1;
  visibility: visible;
}

/* Magic Card Components */
.magic-card-header {
  background: linear-gradient(90deg, rgba(191, 167, 106, 0.9) 0%, rgba(255, 230, 179, 0.95) 50%, rgba(191, 167, 106, 0.9) 100%);
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(191, 167, 106, 0.6);
  border-radius: 9px 9px 0 0;
}

.magic-card-name {
  font-weight: bold;
  font-size: 15px;
  color: #2a2a2a;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tooltip-specific overrides for larger fonts */
#tooltip .magic-card-name {
  font-size: 17px;
}

.magic-card-cost {
  background: rgba(25, 25, 25, 0.9);
  color: #ffe6b3;
  border: 1px solid rgba(191, 167, 106, 0.8);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  margin-left: 6px;
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

#tooltip .magic-card-cost {
  width: 28px;
  height: 28px;
  font-size: 16px;
}

.magic-card-type {
  padding: 4px 8px;
  font-size: 12px;
  color: #d4af37;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(191, 167, 106, 0.3);
  font-style: italic;
}

#tooltip .magic-card-type {
  font-size: 13px;
}

.tooltip-art {
  width: 100%;
  height: 130px;
  overflow: hidden;
  background: rgba(20, 20, 20, 0.8);
  border-bottom: 1px solid rgba(191, 167, 106, 0.3);
}

.tooltip-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.magic-card-textbox {
  padding: 8px;
}

.magic-card-stats {
  font-weight: bold;
  text-align: center;
  margin-bottom: 6px;
  padding: 3px 6px;
  background: rgba(191, 167, 106, 0.15);
  border-radius: 3px;
  border: 1px solid rgba(191, 167, 106, 0.3);
  font-size: 14px;
}

#tooltip .magic-card-stats {
  font-size: 16px;
}

.magic-card-keywords {
  margin-bottom: 6px;
  font-size: 12px;
  color: #ffeb3b;
  line-height: 1.3;
}

#tooltip .magic-card-keywords {
  font-size: 13px;
}

.magic-card-keywords strong {
  color: #ffe6b3;
}

.magic-card-effect, .magic-card-ability {
  margin-bottom: 4px;
  font-size: 12px;
  line-height: 1.4;
}

#tooltip .magic-card-effect, #tooltip .magic-card-ability {
  font-size: 13px;
}

.magic-card-effect strong, .magic-card-ability strong {
  color: #d4af37;
}

/* Color-themed tooltips */

/* Unit status effects in tooltips */
#tooltip .magic-card-status-effects {
  margin-bottom: 6px;
  padding: 4px 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#tooltip .status-effect {
  display: inline-block;
  margin: 2px 3px;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
}

#tooltip .status-effect.positive {
  background: rgba(76, 175, 80, 0.3);
  color: #81c784;
  border: 1px solid rgba(76, 175, 80, 0.5);
}

#tooltip .status-effect.negative {
  background: rgba(244, 67, 54, 0.3);
  color: #e57373;
  border: 1px solid rgba(244, 67, 54, 0.5);
}

#tooltip .status-effect.neutral {
  background: rgba(158, 158, 158, 0.3);
  color: #bdbdbd;
  border: 1px solid rgba(158, 158, 158, 0.5);
}

/* Stat modifications in tooltips */
#tooltip .magic-card-stats.modified {
  position: relative;
}

#tooltip .stat-modification {
  font-size: 11px;
  font-weight: normal;
  margin-left: 6px;
}

#tooltip .stat-boost {
  color: #4caf50;
}

#tooltip .stat-reduction {
  color: #f44336;
}

#tooltip .base-stats {
  color: #bdbdbd;
  font-size: 10px;
  margin-left: 4px;
}

/* Prowl status indicator */
#tooltip .prowl-status {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 9px;
  font-weight: bold;
  text-transform: uppercase;
}

#tooltip .prowl-status.active {
  background: rgba(255, 193, 7, 0.3);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.5);
}

#tooltip .prowl-status.inactive {
  background: rgba(158, 158, 158, 0.2);
  color: #9e9e9e;
  border: 1px solid rgba(158, 158, 158, 0.3);
}

/* SIDE INFO PANEL */
#sideInfo {
  position: fixed;
  bottom: 160px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 280px;
  z-index: 15;
}

.mini-discard {
  background: rgba(42, 42, 42, 0.9);
  border: 1px solid #444;
  border-radius: 5px;
  padding: 8px;
  color: #eee;
  font-size: 12px;
  text-align: center;
  backdrop-filter: blur(4px);
}

.mini-history {
  background: rgba(34, 34, 34, 0.9);
  border: 1px solid #444;
  border-radius: 5px;
  padding: 8px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 11px;
  line-height: 1.3;
  color: #ccc;
  max-height: 200px;
  overflow-y: auto;
  backdrop-filter: blur(4px);
}

/* Tooltip content styles - applies to floating tooltip */
#tooltip .unit-name {
  font-weight: bold;
  font-size: 16px;
  color: #ffe6b3;
  margin-bottom: 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

#tooltip .unit-stats {
  font-weight: bold;
  color: #ffd700;
  margin-bottom: 6px;
}

#tooltip .unit-keywords {
  font-style: italic;
  color: #d4af37;
  margin-bottom: 4px;
}

#tooltip .unit-description {
  color: #e6d7c3;
  font-size: 13px;
}

#handArea {
  height: 120px;
  width: 100%;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
  background: #111;
  border-top: 2px solid #bfa76a;
  z-index: 50;
  overflow: visible;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
}
#hand {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  overflow: visible;
}
/* ========== MODERN HEXGEMS CARD DESIGN ========== */
.card {
  background: 
    linear-gradient(135deg, rgba(45, 45, 45, 0.95) 0%, rgba(35, 35, 35, 0.98) 100%),
    radial-gradient(circle at 30% 30%, rgba(191, 167, 106, 0.1) 0%, transparent 60%);
  border: 2px solid rgba(191, 167, 106, 0.6);
  border-radius: 12px;
  width: 90px;
  height: 120px;
  margin: 0 2px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  padding: 0;
  box-sizing: border-box;
  overflow: visible;
  backdrop-filter: blur(2px);
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 230, 179, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.card:hover {
  transform: translateY(-25px) scale(1.08);
  z-index: 1500;
  border-color: rgba(191, 167, 106, 1);
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(191, 167, 106, 0.8),
    0 0 80px rgba(191, 167, 106, 0.4),
    0 0 0 2px rgba(255, 230, 179, 0.6),
    inset 0 2px 4px rgba(255, 255, 255, 0.15);
  filter: brightness(1.15) saturate(1.2);
}

.card.selected {
  transform: translateY(-30px) scale(1.12);
  z-index: 1600;
  border-color: rgba(255, 215, 0, 1);
  box-shadow: 
    0 35px 70px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(255, 215, 0, 1),
    0 0 80px rgba(255, 215, 0, 0.6),
    0 0 120px rgba(255, 215, 0, 0.3),
    0 0 0 3px rgba(255, 255, 255, 0.8),
    inset 0 2px 6px rgba(255, 255, 255, 0.2);
  filter: brightness(1.3) saturate(1.5);
  animation: selectedCardGlow 2s ease-in-out infinite alternate;
}

.card.selected:hover {
  transform: translateY(-30px) scale(1.12);
}

@keyframes selectedCardGlow {
  0% { 
    box-shadow: 
      0 35px 70px rgba(0, 0, 0, 0.5),
      0 0 40px rgba(255, 215, 0, 1),
      0 0 80px rgba(255, 215, 0, 0.6),
      0 0 120px rgba(255, 215, 0, 0.3),
      0 0 0 3px rgba(255, 255, 255, 0.8),
      inset 0 2px 6px rgba(255, 255, 255, 0.2);
  }
  100% { 
    box-shadow: 
      0 35px 70px rgba(0, 0, 0, 0.5),
      0 0 50px rgba(255, 255, 255, 1),
      0 0 100px rgba(255, 215, 0, 0.8),
      0 0 150px rgba(255, 215, 0, 0.4),
      0 0 0 3px rgba(255, 255, 255, 1),
      inset 0 2px 8px rgba(255, 255, 255, 0.3);
  }
}

/* ========== CARD COST BADGE ========== */
.card-cost-badge {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  background: 
    radial-gradient(circle, rgba(25, 25, 25, 0.95) 0%, rgba(15, 15, 15, 0.98) 100%),
    linear-gradient(135deg, rgba(191, 167, 106, 0.3) 0%, transparent 70%);
  border: 2px solid rgba(191, 167, 106, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.4em;
  color: #ffe6b3;
  z-index: 100;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 230, 179, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000,
    0 0 4px rgba(0, 0, 0, 0.8);
  transition: all 0.3s ease;
  font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
}

.card:hover .card-cost-badge {
  border-color: rgba(191, 167, 106, 1);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 230, 179, 0.6),
    0 0 12px rgba(191, 167, 106, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.card.selected .card-cost-badge {
  border-color: rgba(255, 215, 0, 1);
  background: 
    radial-gradient(circle, rgba(25, 25, 25, 0.95) 0%, rgba(15, 15, 15, 0.98) 100%),
    linear-gradient(135deg, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.8),
    0 0 16px rgba(255, 215, 0, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  color: #ffffff;
  animation: selectedCostGlow 2s ease-in-out infinite alternate;
}

@keyframes selectedCostGlow {
  0% { 
    box-shadow: 
      0 4px 12px rgba(0, 0, 0, 0.7),
      0 0 0 1px rgba(255, 255, 255, 0.8),
      0 0 16px rgba(255, 215, 0, 0.8),
      inset 0 1px 0 rgba(255, 255, 255, 0.4);
  }
  100% { 
    box-shadow: 
      0 4px 12px rgba(0, 0, 0, 0.7),
      0 0 0 1px rgba(255, 255, 255, 1),
      0 0 24px rgba(255, 255, 255, 0.8),
      inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }
}

/* ========== CARD ART AREA ========== */
.card-art {
  width: 86px;
  height: 86px;
  margin: 0 auto;
  border-radius: 0px;
  overflow: hidden;
  background: 
    linear-gradient(135deg, rgba(20, 20, 20, 0.8) 0%, rgba(30, 30, 30, 0.9) 100%),
    radial-gradient(circle at center, rgba(191, 167, 106, 0.1) 0%, transparent 50%);
  position: relative;
}

.card-art::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: all 0.3s ease;
}

.card:hover .card-art img {
  transform: scale(1.05);
  filter: brightness(1.1) saturate(1.1);
}

/* ========== CARD STATS BAR ========== */
.card-stats {
  height: 24px;
  margin: 0;
  background: 
    linear-gradient(90deg, rgba(25, 25, 25, 0.95) 0%, rgba(35, 35, 35, 0.95) 50%, rgba(25, 25, 25, 0.95) 100%),
    radial-gradient(circle at center, rgba(191, 167, 106, 0.15) 0%, transparent 70%);
  border-radius: 0 0 10px 10px;
  display: flex;
  align-items: center;
  font-weight: bold;
  font-size: 0.9em;
  color: #ffe6b3;
  text-shadow: 
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.unit-stats {
  justify-content: space-between;
  padding: 0;
}

.power-stat, .toughness-stat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.85em;
  flex: 1;
}

.spell-stats {
  justify-content: center;
}



.spell-indicator {
  font-size: 1.2em;
  color: #ffeb3b;
  text-shadow: 
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000,
    0 0 8px rgba(255, 235, 59, 0.6);
  animation: spellGlow 2s ease-in-out infinite alternate;
}

@keyframes spellGlow {
  0% { 
    text-shadow: 
      -1px -1px 0 #000,
      1px -1px 0 #000,
      -1px 1px 0 #000,
      1px 1px 0 #000,
      0 0 8px rgba(255, 235, 59, 0.6);
  }
  100% { 
    text-shadow: 
      -1px -1px 0 #000,
      1px -1px 0 #000,
      -1px 1px 0 #000,
      1px 1px 0 #000,
      0 0 16px rgba(255, 235, 59, 0.9);
  }
}

.card:hover .card-stats {
  border-color: rgba(191, 167, 106, 0.6);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3),
    0 0 8px rgba(191, 167, 106, 0.3);
}

.card.selected .card-stats {
  border-color: rgba(255, 215, 0, 0.6);
  background: 
    linear-gradient(90deg, rgba(25, 25, 25, 0.95) 0%, rgba(35, 35, 35, 0.95) 50%, rgba(25, 25, 25, 0.95) 100%),
    radial-gradient(circle at center, rgba(255, 215, 0, 0.15) 0%, transparent 70%);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3),
    0 0 12px rgba(255, 215, 0, 0.4);
}

.overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(24, 24, 24, 0.92);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hide victory banner by default */
#victoryBanner {
  display: none !important;
  backdrop-filter: blur(4px);
}

#victoryBanner.show {
  display: flex !important;
  animation: victoryEnter 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes victoryEnter {
  0% { 
    opacity: 0; 
    backdrop-filter: blur(0px);
  }
  50% {
    backdrop-filter: blur(2px);
  }
  100% { 
    opacity: 1; 
    backdrop-filter: blur(4px);
  }
}

.splash-content, .victory-content {
  text-align: center;
  background: 
    linear-gradient(135deg, #1a1a2a, #2a2a3a),
    radial-gradient(circle at 30% 30%, rgba(191, 167, 106, 0.1) 0%, transparent 50%);
  padding: 60px 80px;
  border-radius: 16px;
  border: 3px solid transparent;
  background-clip: padding-box;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 0 60px rgba(191, 167, 106, 0.6),
    inset 0 2px 4px rgba(255, 255, 255, 0.1),
    0 20px 40px rgba(0, 0, 0, 0.8);
}

/* Only victory content should float and pulse */
.victory-content {
  animation: victoryContentFloat 3s ease-in-out infinite alternate;
}

/* Splash content gets subtle animated glow */
.splash-content {
  box-shadow: 
    0 0 40px rgba(191, 167, 106, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.1),
    0 15px 30px rgba(0, 0, 0, 0.6);
  animation: splashBackgroundGlow 4s ease-in-out infinite alternate;
}

@keyframes splashBackgroundGlow {
  0% { 
    box-shadow: 
      0 0 40px rgba(191, 167, 106, 0.4),
      inset 0 2px 4px rgba(255, 255, 255, 0.1),
      0 15px 30px rgba(0, 0, 0, 0.6);
  }
  100% { 
    box-shadow: 
      0 0 60px rgba(255, 230, 179, 0.6),
      inset 0 2px 4px rgba(255, 255, 255, 0.15),
      0 20px 40px rgba(0, 0, 0, 0.7);
  }
}

.victory-content::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: linear-gradient(135deg, #bfa76a, #ffe6b3, #d4af37, #bfa76a);
  border-radius: 16px;
  z-index: -1;
  animation: victoryBorderGlow 2s ease-in-out infinite alternate;
}

.victory-content::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 30%),
    conic-gradient(from 0deg, transparent, rgba(191, 167, 106, 0.2), transparent);
  transform: translate(-50%, -50%) rotate(0deg);
  z-index: -2;
  animation: victoryRadiance 8s linear infinite;
}

@keyframes victoryContentFloat {
  0% { 
    transform: translateY(0px) scale(1);
    box-shadow: 
      0 0 60px rgba(191, 167, 106, 0.6),
      inset 0 2px 4px rgba(255, 255, 255, 0.1),
      0 20px 40px rgba(0, 0, 0, 0.8);
  }
  100% { 
    transform: translateY(-10px) scale(1.02);
    box-shadow: 
      0 0 80px rgba(255, 230, 179, 0.8),
      inset 0 2px 4px rgba(255, 255, 255, 0.15),
      0 30px 60px rgba(0, 0, 0, 0.9);
  }
}

@keyframes victoryBorderGlow {
  0% { opacity: 0.6; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.02); }
}

@keyframes victoryRadiance {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Splash screen title - no pulsing */
.splash-content h1 {
  margin-top: 0;
  margin-bottom: 30px;
  color: #ffe6b3;
  font-size: 3.5em;
  font-weight: 900;
  text-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.8),
    0 0 20px rgba(255, 215, 0, 0.6),
    0 0 40px rgba(191, 167, 106, 0.4);
  position: relative;
  z-index: 10;
}

/* Victory screen title - with pulsing */
.victory-content h1 {
  margin-top: 0;
  margin-bottom: 30px;
  color: #ffe6b3;
  font-size: 3.5em;
  font-weight: 900;
  text-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.8),
    0 0 20px rgba(255, 215, 0, 0.6),
    0 0 40px rgba(191, 167, 106, 0.4);
  animation: victoryTextGlow 2s ease-in-out infinite alternate;
  position: relative;
  z-index: 10;
}

@keyframes victoryTextGlow {
  0% { 
    text-shadow: 
      0 2px 4px rgba(0, 0, 0, 0.8),
      0 0 20px rgba(255, 215, 0, 0.6),
      0 0 40px rgba(191, 167, 106, 0.4);
  }
  100% { 
    text-shadow: 
      0 2px 4px rgba(0, 0, 0, 0.8),
      0 0 30px rgba(255, 230, 179, 0.8),
      0 0 60px rgba(212, 175, 55, 0.6);
  }
}

/* Splash screen buttons - normal buttons */
.splash-content button {
  padding: 16px 32px;
  margin: 0 8px;
  background: 
    linear-gradient(135deg, #bfa76a, #d4af37),
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
  border: 2px solid transparent;
  border-radius: 12px;
  color: #1a1a1a;
  font-size: 1.3em;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 
    0 6px 12px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 0 1px rgba(191, 167, 106, 0.5);
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

/* Start Game button gets special pulsing */
#startGameBtn {
  animation: startButtonPulse 2s ease-in-out infinite alternate;
}

@keyframes startButtonPulse {
  0% { 
    box-shadow: 
      0 6px 12px rgba(0, 0, 0, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.3),
      0 0 0 1px rgba(191, 167, 106, 0.5);
  }
  100% { 
    box-shadow: 
      0 8px 16px rgba(0, 0, 0, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.4),
      0 0 0 1px rgba(255, 230, 179, 0.8),
      0 0 20px rgba(255, 215, 0, 0.4);
  }
}

/* Victory screen buttons - unchanged */
.victory-content button {
  padding: 16px 32px;
  margin: 0 8px;
  background: 
    linear-gradient(135deg, #bfa76a, #d4af37),
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
  border: 2px solid transparent;
  border-radius: 12px;
  color: #1a1a1a;
  font-size: 1.3em;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 
    0 6px 12px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 0 0 1px rgba(191, 167, 106, 0.5);
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.victory-content button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s;
  z-index: -1;
}

/* Button hover effects */
.splash-content button:hover, .victory-content button:hover {
  background: 
    linear-gradient(135deg, #ffe6b3, #f0d070),
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4) 0%, transparent 50%);
  transform: translateY(-4px) scale(1.08);
  box-shadow: 
    0 12px 24px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 0 0 1px rgba(255, 230, 179, 0.8),
    0 0 20px rgba(255, 215, 0, 0.6);
}

.victory-content button:hover::before {
  left: 100%;
}

/* Button active effects */
.splash-content button:active, .victory-content button:active {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 
    0 4px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 0 1px rgba(191, 167, 106, 0.6);
}

.splash-content > div {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.splash-content label {
  font-weight: bold;
}

.splash-content input {
  border: 1px solid #bfa76a;
  background: #232323;
  color: #f0e6d2;
  padding: 8px;
  border-radius: 4px;
}

#deckUploadError {
  color: #ff5555;
  margin-bottom: 12px;
}

.status-icon {
  font-size: 1.2em;
}

/* ========== PREMIUM TILE HIGHLIGHTING ========== */
.tile-highlight-blue {
  background: 
    radial-gradient(circle at 50% 50%, rgba(0, 120, 255, 0.4) 0%, rgba(0, 120, 255, 0.2) 70%, transparent 100%);
  box-shadow: 
    inset 0 0 20px rgba(0, 120, 255, 0.3),
    0 0 30px rgba(0, 120, 255, 0.2);
  animation: premiumTileBlue 2s ease-in-out infinite alternate;
  position: relative;
  overflow: hidden;
}

.tile-highlight-blue::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  background: 
    radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 8px 8px;
  animation: tileStarfield 4s linear infinite;
  pointer-events: none;
}

.tile-highlight-red {
  background: 
    radial-gradient(circle at 50% 50%, rgba(255, 40, 40, 0.4) 0%, rgba(255, 40, 40, 0.2) 70%, transparent 100%);
  box-shadow: 
    inset 0 0 20px rgba(255, 40, 40, 0.3),
    0 0 30px rgba(255, 40, 40, 0.2);
  animation: premiumTileRed 2s ease-in-out infinite alternate;
  position: relative;
  overflow: hidden;
}

.tile-highlight-red::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  background: 
    radial-gradient(circle, rgba(255, 100, 100, 0.1) 1px, transparent 1px);
  background-size: 8px 8px;
  animation: tileStarfield 4s linear infinite reverse;
  pointer-events: none;
}

.tile-highlight-gray {
  background: 
    radial-gradient(circle at 50% 50%, rgba(120, 120, 120, 0.3) 0%, rgba(120, 120, 120, 0.15) 70%, transparent 100%);
  box-shadow: 
    inset 0 0 20px rgba(120, 120, 120, 0.2),
    0 0 20px rgba(120, 120, 120, 0.1);
  animation: premiumTileGray 2s ease-in-out infinite alternate;
  position: relative;
  overflow: hidden;
}

.tile-highlight-gray::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  right: -50%;
  bottom: -50%;
  background: 
    radial-gradient(circle, rgba(180, 180, 180, 0.05) 1px, transparent 1px);
  background-size: 8px 8px;
  animation: tileStarfield 6s linear infinite;
  pointer-events: none;
}

@keyframes premiumTileBlue {
  0% { 
    background: 
      radial-gradient(circle at 50% 50%, rgba(0, 120, 255, 0.3) 0%, rgba(0, 120, 255, 0.15) 70%, transparent 100%);
    box-shadow: 
      inset 0 0 20px rgba(0, 120, 255, 0.2),
      0 0 20px rgba(0, 120, 255, 0.1);
  }
  100% { 
    background: 
      radial-gradient(circle at 50% 50%, rgba(0, 120, 255, 0.5) 0%, rgba(0, 120, 255, 0.3) 70%, transparent 100%);
    box-shadow: 
      inset 0 0 30px rgba(0, 120, 255, 0.4),
      0 0 40px rgba(0, 120, 255, 0.3);
  }
}

@keyframes premiumTileRed {
  0% { 
    background: 
      radial-gradient(circle at 50% 50%, rgba(255, 40, 40, 0.3) 0%, rgba(255, 40, 40, 0.15) 70%, transparent 100%);
    box-shadow: 
      inset 0 0 20px rgba(255, 40, 40, 0.2),
      0 0 20px rgba(255, 40, 40, 0.1);
  }
  100% { 
    background: 
      radial-gradient(circle at 50% 50%, rgba(255, 40, 40, 0.5) 0%, rgba(255, 40, 40, 0.3) 70%, transparent 100%);
    box-shadow: 
      inset 0 0 30px rgba(255, 40, 40, 0.4),
      0 0 40px rgba(255, 40, 40, 0.3);
  }
}

@keyframes premiumTileGray {
  0% { 
    background: 
      radial-gradient(circle at 50% 50%, rgba(120, 120, 120, 0.2) 0%, rgba(120, 120, 120, 0.1) 70%, transparent 100%);
    box-shadow: 
      inset 0 0 20px rgba(120, 120, 120, 0.15),
      0 0 15px rgba(120, 120, 120, 0.08);
  }
  100% { 
    background: 
      radial-gradient(circle at 50% 50%, rgba(120, 120, 120, 0.35) 0%, rgba(120, 120, 120, 0.2) 70%, transparent 100%);
    box-shadow: 
      inset 0 0 25px rgba(120, 120, 120, 0.25),
      0 0 25px rgba(120, 120, 120, 0.15);
  }
}

@keyframes tileStarfield {
  0% { transform: translateX(0) translateY(0); }
  100% { transform: translateX(8px) translateY(8px); }
}

/* ACTION BUTTONS */
#actionButtons {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  gap: 12px;
  z-index: 1002; /* Above hand and rules button */
}

#cancelBtn {
  padding: 12px 24px;
  background: linear-gradient(135deg, #666, #777);
  border: 2px solid #888;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0.7;
}

#cancelBtn:hover {
  background: linear-gradient(135deg, #777, #888);
  border-color: #aaa;
  transform: scale(1.02);
  opacity: 1;
}

#cancelBtn:active {
  transform: scale(0.98);
}

/* ========== PREMIUM BUTTON SYSTEM ========== */
#endTurnBtn {
  padding: 14px 36px;
  background: 
    linear-gradient(135deg, rgba(191, 167, 106, 0.95) 0%, rgba(255, 230, 179, 0.98) 100%),
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
  color: #181818;
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: 12px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 
    0 8px 24px rgba(191, 167, 106, 0.5),
    0 0 40px rgba(255, 230, 179, 0.3),
    inset 0 2px 4px rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  min-width: 140px;
  position: relative;
  overflow: hidden;
  animation: endTurnPulse 4s ease-in-out infinite;
  text-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.3),
    0 0 10px rgba(255, 255, 255, 0.5);
}

#endTurnBtn::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: linear-gradient(135deg, 
    rgba(191, 167, 106, 0.8), 
    rgba(255, 230, 179, 0.9), 
    rgba(212, 175, 55, 0.8), 
    rgba(191, 167, 106, 0.8)
  );
  border-radius: 12px;
  z-index: -1;
  opacity: 0.8;
  animation: endTurnBorderGlow 3s ease-in-out infinite alternate;
}

#endTurnBtn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.4), 
    transparent
  );
  animation: buttonShimmer 3s ease-in-out infinite;
  pointer-events: none;
}

#endTurnBtn:hover {
  background: 
    linear-gradient(135deg, rgba(255, 230, 179, 0.98) 0%, rgba(255, 244, 214, 1) 100%),
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
  transform: scale(1.08) translateY(-2px);
  box-shadow: 
    0 12px 32px rgba(191, 167, 106, 0.7), 
    0 0 60px rgba(255, 230, 179, 0.6),
    inset 0 2px 6px rgba(255, 255, 255, 0.4);
  text-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.4),
    0 0 15px rgba(255, 255, 255, 0.8);
  animation: endTurnPulse 1s ease-in-out infinite;
}

#endTurnBtn:hover::before {
  opacity: 1;
  animation: endTurnBorderGlow 1s ease-in-out infinite alternate;
}

#endTurnBtn:hover::after {
  animation: buttonShimmer 1s ease-in-out infinite;
}

#endTurnBtn:active {
  transform: scale(1.02) translateY(0);
  box-shadow: 
    0 6px 18px rgba(191, 167, 106, 0.6),
    0 0 40px rgba(255, 230, 179, 0.5),
    inset 0 2px 6px rgba(255, 255, 255, 0.4);
}

@keyframes endTurnPulse {
  0% { 
    box-shadow: 
      0 8px 24px rgba(191, 167, 106, 0.5),
      0 0 40px rgba(255, 230, 179, 0.3),
      inset 0 2px 4px rgba(255, 255, 255, 0.3);
  }
  50% { 
    box-shadow: 
      0 12px 32px rgba(191, 167, 106, 0.7),
      0 0 60px rgba(255, 230, 179, 0.5),
      inset 0 2px 6px rgba(255, 255, 255, 0.4);
  }
  100% { 
    box-shadow: 
      0 8px 24px rgba(191, 167, 106, 0.5),
      0 0 40px rgba(255, 230, 179, 0.3),
      inset 0 2px 4px rgba(255, 255, 255, 0.3);
  }
}

@keyframes endTurnBorderGlow {
  0% { opacity: 0.7; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.02); }
}

@keyframes buttonShimmer {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

.unit-tilted {
  transform: rotate(-20deg);
}

.pulsing-aura {
  box-shadow: 0 0 16px 4px #ffb30088, 0 0 32px 8px #ffb30044;
  animation: pulse 1.2s infinite alternate;
}

@keyframes pulse {
  0% { box-shadow: 0 0 16px 4px #ffb30088, 0 0 32px 8px #ffb30044; }
  100% { box-shadow: 0 0 32px 8px #ffb300cc, 0 0 48px 16px #ffb30022; }
}

/* Old mana display styles removed - using new horizontal mana in top bar */

.history-message {
  padding: 2px 4px;
  border-radius: 3px;
  margin-top: 4px;
}

.history-message.type-attack {
  background-color: #4d2d2d;
  color: #ffc1c1;
}

.history-message.type-move {
  background-color: #2d4d4a;
  color: #c1fff8;
}

.history-message.type-play {
  background-color: #4a2d4d;
  color: #f8c1ff;
}

.history-message.type-system {
  background-color: #4d4d2d;
  color: #ffffc1;
  font-style: italic;
}

#rulesBtn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1001;
  background: #bfa76a;
  color: #181818;
  border: none;
  border-radius: 8px;
  width: 72px;
  height: 48px;
  font-size: 1.4em;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 8px #000a;
  transition: background 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

#rulesBtn:hover {
  background: #ffe6b3;
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(191, 167, 106, 0.6);
}

#rulesModal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: auto;
  background: rgba(24,24,24,0.92);
}

#rulesModal.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

#rulesModal .modal-content {
  background: #232323;
  color: #ffe6b3;
  margin: auto;
  padding: 32px 32px 24px 32px;
  border-radius: 12px;
  border: 2px solid #bfa76a;
  box-shadow: 0 0 24px #000;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

#closeRulesModal {
  position: absolute;
  top: 12px;
  right: 18px;
  color: #ffe6b3;
  font-size: 2em;
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 10;
}

#rulesModalContent {
  font-size: 1.08em;
  line-height: 1.6;
  margin-top: 12px;
}

@media (max-width: 700px) {
  #rulesModal .modal-content {
    max-width: 98vw;
    padding: 16px 4vw 12px 4vw;
  }
  #rulesBtn {
    top: 16px;
    right: 16px;
    width: 48px;
    height: 48px;
    font-size: 1.4em;
  }
}

/* Logo Styles */
.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.game-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 0 20px #bfa76a);
  transition: all 0.3s ease;
  animation: logoGlow 3s ease-in-out infinite alternate;
}

.game-logo:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 0 30px #ffe6b3);
  animation-duration: 1s;
}

@keyframes logoGlow {
  0% { 
    filter: drop-shadow(0 0 20px #bfa76a);
    transform: scale(1);
  }
  100% { 
    filter: drop-shadow(0 0 25px #ffe6b3);
    transform: scale(1.02);
  }
}

/* Damaged toughness styling */
.damaged-toughness {
  color: #ff6b6b !important; /* Red color for damaged units */
}

.unit-stats-damaged {
  color: #ff6b6b !important; /* Red stats when damaged */
}

/* Stat modification styling */
.stat-boosted {
  color: #00ff00 !important; /* Bright green for boosted stats */
  text-shadow: 0 0 4px rgba(0, 255, 0, 0.5);
}

.stat-debuffed {
  color: #ff8800 !important; /* Bright orange for debuffed stats */
  text-shadow: 0 0 4px rgba(255, 136, 0, 0.5);
}

/* Legacy prowl styling - keeping for compatibility */
.prowl-boosted {
  color: #00ff00 !important; /* Bright green for boosted stats */
  text-shadow: 0 0 4px rgba(0, 255, 0, 0.5);
}

.prowl-active {
  color: #4CAF50 !important; /* Green for active Prowl */
  font-weight: bold;
}

.prowl-inactive {
  color: #999 !important; /* Gray for inactive Prowl */
}

/* Keyword effect animation for stat changes */
.stat-change-effect {
  animation: statChangeGlow 1s ease-in-out;
}

@keyframes statChangeGlow {
  0% { 
    opacity: 1;
    transform: scale(1);
  }
  50% { 
    opacity: 0.7;
    transform: scale(1.05);
  }
  100% { 
    opacity: 1;
    transform: scale(1);
  }
}

/* Color-themed tooltips */

/* Future General Ability Tracking Panes */
.general-abilities-pane {
  position: fixed;
  top: 120px;
  width: 280px;
  height: 60px;
  background: rgba(35, 35, 35, 0.9);
  border: 2px solid rgba(191, 167, 106, 0.5);
  border-radius: 8px;
  padding: 8px;
  backdrop-filter: blur(4px);
  z-index: 10;
  display: none; /* Hidden until implemented */
}

.general-abilities-pane.player1 {
  left: 20px;
}

.general-abilities-pane.player2 {
  right: 20px;
}

.general-abilities-pane h4 {
  margin: 0 0 4px 0;
  color: #ffe6b3;
  font-size: 12px;
  font-weight: bold;
}

.general-abilities-pane .ability-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 4px;
  margin: 2px 0;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  font-size: 10px;
  color: #ccc;
}

.general-abilities-pane .ability-item {
  background: rgba(191, 167, 106, 0.1);
  border: 1px solid rgba(191, 167, 106, 0.3);
  border-radius: 4px;
  padding: 6px;
  margin-bottom: 4px;
  font-size: 11px;
  line-height: 1.3;
}

/* ========== GENERAL TRACKER SYSTEM ========== */
.general-tracker {
  width: 100%;
  padding: 15px;
  color: #ffe6b3;
  background: 
    linear-gradient(135deg, rgba(26, 21, 16, 0.95) 0%, rgba(15, 12, 8, 0.98) 100%),
    radial-gradient(circle at 50% 50%, rgba(191, 167, 106, 0.08) 0%, transparent 70%);
  border: 2px solid transparent;
  border-image: linear-gradient(180deg, 
    rgba(191, 167, 106, 0.3) 0%, 
    rgba(255, 230, 179, 0.6) 50%, 
    rgba(191, 167, 106, 0.3) 100%
  ) 1;
  border-radius: 8px;
  backdrop-filter: blur(8px);
  box-shadow: 
    inset 0 0 30px rgba(191, 167, 106, 0.1),
    0 0 20px rgba(0, 0, 0, 0.5);
  margin-bottom: 20px;
}

.left-tracker {
  position: fixed;
  left: 20px;
  top: 120px;
  width: 250px;
  z-index: 100;
}

.right-tracker {
  position: fixed;
  right: 20px;
  top: 120px;
  width: 250px;
  z-index: 100;
}

.general-tracker-sidebar {
  /* Remove old sidebar styles - no longer needed */
  display: none;
}

#leftSidebar {
  display: none;
}

#rightSidebar {
  display: none;
}

.tracker-header {
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  color: #ffe6b3;
  margin-bottom: 15px;
  text-shadow: 0 0 10px rgba(255, 230, 179, 0.6);
  letter-spacing: 1px;
}

/* Progress Bar System */
.progress-container {
  margin-bottom: 20px;
}

.progress-bar {
  position: relative;
  height: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(191, 167, 106, 0.3);
  border-radius: 6px;
  overflow: visible; /* Allow markers to break out */
  margin: 15px 20px; /* Extra margin for markers + left/right padding */
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, 
    rgba(191, 167, 106, 0.8) 0%, 
    rgba(255, 230, 179, 0.9) 50%, 
    rgba(212, 175, 55, 0.8) 100%
  );
  width: 0%;
  transition: width 0.5s ease-out;
  border-radius: 5px;
  box-shadow: 
    0 0 10px rgba(255, 230, 179, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: progressGlow 2s ease-in-out infinite alternate;
}

@keyframes progressGlow {
  0% { 
    box-shadow: 
      0 0 10px rgba(255, 230, 179, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
  100% { 
    box-shadow: 
      0 0 15px rgba(255, 230, 179, 0.8),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
}

.progress-markers {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

/* Subtle breakpoint lines */
.progress-bar::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20%; /* 1 unit mark */
  width: 1px;
  background: rgba(191, 167, 106, 0.3);
  z-index: 1;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 60%; /* 3 unit mark */
  width: 1px;
  background: rgba(191, 167, 106, 0.3);
  z-index: 1;
}

/* Additional breakpoint lines using pseudo-elements on progress-markers */
.progress-markers::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 80%; /* 4 unit mark */
  width: 1px;
  background: rgba(191, 167, 106, 0.3);
  z-index: 1;
}

.progress-marker {
  position: absolute;
  top: -8px; /* Break out above the bar */
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  background: rgba(100, 100, 100, 0.8);
  border: 3px solid rgba(150, 150, 150, 0.6);
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.progress-marker[data-units="2"] {
  left: 40%; /* 2 out of 5 units */
}

.progress-marker[data-units="5"] {
  left: 100%; /* 5 out of 5 units */
}

.progress-marker.achieved {
  background: rgba(255, 230, 179, 0.9);
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 
    0 0 15px rgba(255, 230, 179, 0.8),
    0 2px 8px rgba(0, 0, 0, 0.4);
  animation: markerPulse 1.5s ease-in-out infinite alternate;
  transform: translateX(-50%) scale(1.1);
}

@keyframes markerPulse {
  0% { 
    box-shadow: 
      0 0 15px rgba(255, 230, 179, 0.8),
      0 2px 8px rgba(0, 0, 0, 0.4);
  }
  100% { 
    box-shadow: 
      0 0 20px rgba(255, 230, 179, 1),
      0 2px 12px rgba(0, 0, 0, 0.6);
  }
}

.unit-counter {
  text-align: center;
  font-size: 12px;
  color: #cccccc;
  margin-bottom: 5px;
}

/* Roman Numeral Steps */
.ability-steps {
  margin-bottom: 15px;
}

.ability-step {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(191, 167, 106, 0.2);
  transition: all 0.3s ease;
}

.ability-step.active {
  background: linear-gradient(135deg, 
    rgba(191, 167, 106, 0.2) 0%, 
    rgba(255, 230, 179, 0.15) 100%
  );
  border: 1px solid rgba(255, 230, 179, 0.6);
  box-shadow: 
    0 0 12px rgba(255, 230, 179, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ability-step.newly-activated {
  animation: stepActivation 1.2s ease-out;
}

.ability-step.newly-deactivated {
  animation: stepDeactivation 0.8s ease-out;
}

@keyframes stepActivation {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 230, 179, 0);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 20px rgba(255, 230, 179, 0.8);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 12px rgba(255, 230, 179, 0.4);
  }
}

@keyframes stepDeactivation {
  0% {
    transform: scale(1);
    box-shadow: 0 0 12px rgba(255, 230, 179, 0.4);
  }
  50% {
    transform: scale(0.97);
    box-shadow: 0 0 4px rgba(255, 230, 179, 0.2);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 230, 179, 0);
  }
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(100, 100, 100, 0.5);
  border: 2px solid rgba(150, 150, 150, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  font-family: 'Times New Roman', serif;
  color: #cccccc;
  transition: all 0.3s ease;
}

.ability-step.active .step-number {
  background: radial-gradient(circle, 
    rgba(255, 230, 179, 0.9) 0%, 
    rgba(191, 167, 106, 0.8) 100%
  );
  border: 2px solid rgba(255, 230, 179, 0.9);
  color: #1a1a1a;
  box-shadow: 
    0 0 10px rgba(255, 230, 179, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.step-description {
  flex: 1;
  font-size: 13px;
  color: #cccccc;
  line-height: 1.2;
}

.ability-step.active .step-description {
  color: #fff;
  text-shadow: 0 0 6px rgba(255, 230, 179, 0.6);
}

.step-description em {
  font-style: italic;
  font-weight: normal;
}

.total-bonus {
  text-align: center;
  padding-top: 10px;
  border-top: 1px solid rgba(191, 167, 106, 0.3);
  font-size: 14px;
  font-weight: bold;
  color: #ffe6b3;
}

.total-bonus.has-bonus {
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 230, 179, 0.8);
  animation: totalPulse 2s ease-in-out infinite alternate;
}

@keyframes totalPulse {
  0% { 
    text-shadow: 0 0 10px rgba(255, 230, 179, 0.8);
  }
  100% { 
    text-shadow: 0 0 15px rgba(255, 230, 179, 1);
  }
}

/* Responsive adjustments for smaller screens */
@media (max-width: 1400px) {
  .left-tracker, .right-tracker {
    width: 220px;
  }
  
  .tracker-header {
    font-size: 14px;
  }
  
  .step-description {
    font-size: 11px;
  }
  
  .step-number {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
}

@media (max-width: 1200px) {
  .left-tracker, .right-tracker {
    width: 200px;
  }
  
  .general-tracker {
    padding: 12px;
  }
}

/* === DECK BUILDER STYLES === */
/* Modal and Container */
.deck-builder-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(3px);
  z-index: 1000;
}

.deck-builder-modal.open {
  display: flex; /* Show when open class is added */
}

.deck-builder-container {
  width: 95%;
  max-width: 1400px;
  height: 90%;
  background: linear-gradient(135deg, #2a1810 0%, #1a1008 50%, #2a1810 100%);
  border: 3px solid #8b5a3c;
  border-radius: 15px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.deck-builder-header {
  background: linear-gradient(135deg, #8b5a3c, #6b4226);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #5a3419;
}

.deck-builder-header h2 {
  color: #f4e4bc;
  margin: 0;
  font-size: 1.5em;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
}

.close-btn {
  background: #d32f2f;
  color: white;
  border: none;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.close-btn:hover {
  background: #f44336;
  transform: scale(1.1);
}

/* Tab System */
.catalog-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 2px solid #5a3419;
  background: rgba(0, 0, 0, 0.3);
}

.tab-btn {
  background: rgba(0, 0, 0, 0.3);
  color: #bbb;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 3px solid transparent;
  flex: 1;
  font-size: 14px;
  font-weight: bold;
}

.tab-btn:hover {
  color: #f4e4bc;
  background: rgba(139, 90, 60, 0.2);
}

.tab-btn.active {
  color: #f4e4bc;
  background: rgba(139, 90, 60, 0.3);
  border-bottom-color: #8b5a3c;
}

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

.tab-content {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}

.tab-content.active {
  display: flex;
}

/* Main Content Layout */
.deck-builder-content {
  flex: 1;
  display: flex;
  overflow: hidden;
  padding: 20px;
  gap: 20px;
}

/* Left Side - Card Catalog */
.card-catalog-section {
  flex: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-right: 2px solid #5a3419;
  padding-right: 20px;
}

/* General Selection */
.general-selection {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.general-selection h3 {
  color: #f4e4bc;
  margin: 0 0 15px 0;
  font-size: 1.1em;
  text-align: center;
  flex-shrink: 0;
}

.general-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
  padding: 0 20px;
  justify-content: center;
}

.general-option {
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid #8b5a3c;
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}

.general-option:hover {
  border-color: #f4e4bc;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(244, 228, 188, 0.3);
}

.general-option.selected {
  border-color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
  box-shadow: 0 0 15px rgba(74, 222, 128, 0.4);
}

/* Enhanced General Art Styling */
.general-art {
  height: 200px;
  overflow: hidden;
  width: 100%;
  flex-shrink: 0;
  border-radius: 0px;
}

.general-art img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  border-radius: 0 !important;
  margin: 0 !important;
}

.general-option .general-info {
  padding: 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.6);
}

.general-name {
  color: #f4e4bc;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 8px;
  text-align: center;
}

.general-stats {
  color: #bbb;
  font-size: 14px;
  text-align: center;
  margin-bottom: 12px;
}

.general-abilities {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(139, 90, 60, 0.3);
  border-radius: 6px;
  padding: 10px;
  margin-top: auto;
}

.general-abilities h4 {
  background: rgba(0, 0, 0, 0.4);
  color: #f4e4bc;
  font-size: 14px;
  font-weight: bold;
  margin: 0 0 12px 0;
  padding: 8px 12px;
  text-align: center;
  border-radius: 6px;
  border: 1px solid rgba(139, 90, 60, 0.6);
}

.general-abilities .ability-description {
  color: #ccc;
  font-size: 11px;
  line-height: 1.3;
  text-align: left;
}

/* Ability Tiers Styling */
.ability-tiers {
  margin-bottom: 10px;
}

.ability-tier {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  border-left: 3px solid rgba(191, 167, 106, 0.6);
}

.tier-badge {
  background: rgba(191, 167, 106, 0.8);
  color: #2a2a2a;
  font-weight: bold;
  font-size: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  flex-shrink: 0;
}

.tier-description {
  color: #e0e0e0;
  font-size: 12px;
  line-height: 1.3;
  flex: 1;
}

.ability-note {
  font-style: italic;
  color: #999;
  font-size: 11px;
  text-align: center;
  margin-top: 8px;
  border-top: 1px solid rgba(139, 90, 60, 0.3);
  padding-top: 8px;
}

/* Filters */
.catalog-filters {
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  border: 1px solid #8b5a3c;
  flex-shrink: 0;
}

.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-row input,
.filter-row select {
  background: #2a1810;
  border: 1px solid #8b5a3c;
  color: #f4e4bc;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  min-width: 150px;
}

.filter-row input:focus,
.filter-row select:focus {
  outline: none;
  border-color: #f4e4bc;
  box-shadow: 0 0 5px rgba(244, 228, 188, 0.3);
}

/* Right Side - Deck Sidebar */
.deck-sidebar {
  flex: 1;
  min-width: 350px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Deck Header */
.deck-header {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #8b5a3c;
}

.deck-header h3 {
  color: #f4e4bc;
  margin: 0 0 5px 0;
  font-size: 1.2em;
}

.deck-count {
  color: #ff6b6b;
  font-size: 1.1em;
  font-weight: bold;
}

/* Selected General Display */
.selected-general-display {
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #8b5a3c;
  margin-bottom: 15px;
}

.no-general {
  color: #999;
  font-style: italic;
  padding: 15px;
  text-align: center;
}

.selected-general-card {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
}

.selected-general-card img {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

.deck-builder .general-info {
  flex: 1;
}

.deck-builder .general-info .general-name {
  color: #f4e4bc;
  font-weight: bold;
  font-size: 14px;
  margin-bottom: 3px;
}

.deck-builder .general-info .general-stats {
  color: #bbb;
  font-size: 12px;
}

/* Mana Curve */
.mana-curve {
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #8b5a3c;
  margin-bottom: 15px;
}

.mana-curve h4 {
  color: #f4e4bc;
  margin: 0 0 10px 0;
  font-size: 1em;
}

.curve-bars {
  display: flex;
  gap: 8px;
  align-items: end;
  height: 60px;
}

.curve-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: end;
  align-items: center;
  height: 100%;
}

.curve-count {
  color: #f4e4bc;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
}

.curve-fill {
  width: 100%;
  background: linear-gradient(0deg, #8b5a3c, #a67c52);
  border-radius: 2px 2px 0 0;
  transition: height 0.3s;
  min-height: 2px;
}

.curve-label {
  color: #bbb;
  font-size: 11px;
  margin-top: 5px;
}

/* Deck Statistics */
.deck-stats {
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #8b5a3c;
  margin-bottom: 15px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  color: #f4e4bc;
  margin-bottom: 5px;
  font-size: 14px;
}

.stat-row:last-child {
  margin-bottom: 0;
}

/* Current Deck List */
.current-deck-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.current-deck-list h4 {
  color: #f4e4bc;
  margin: 0 0 10px 0;
  font-size: 1em;
}

.deck-list-container {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid #8b5a3c;
  border-radius: 6px;
  padding: 10px;
  overflow-y: auto;
}

.empty-deck {
  color: #999;
  font-style: italic;
  text-align: center;
  padding: 20px;
}

.deck-list-item {
  display: flex;
  align-items: center;
  padding: 8px;
  margin-bottom: 5px;
  background: rgba(139, 90, 60, 0.1);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.deck-list-item:hover {
  background: rgba(139, 90, 60, 0.2);
  transform: translateX(5px);
}

.deck-item-cost {
  background: #8b5a3c;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  margin-right: 10px;
}

.deck-item-name {
  flex: 1;
  color: #f4e4bc;
  font-size: 14px;
}

.deck-item-copies {
  color: #4ade80;
  font-weight: bold;
  font-size: 12px;
}

/* Footer */
.deck-builder-footer {
  background: rgba(0, 0, 0, 0.3);
  padding: 15px 20px;
  display: flex;
  gap: 15px;
  align-items: center;
  border-top: 2px solid #5a3419;
}

.deck-builder-footer input {
  flex: 1;
  background: #2a1810;
  border: 1px solid #8b5a3c;
  border-radius: 6px;
  padding: 10px;
  color: #f4e4bc;
  font-size: 14px;
}

.deck-builder-footer input:focus {
  outline: none;
  border-color: #f4e4bc;
  box-shadow: 0 0 5px rgba(244, 228, 188, 0.3);
}

.save-btn {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.save-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  transform: translateY(-1px);
}

.save-btn:disabled {
  background: #6b7280;
  cursor: not-allowed;
}

.cancel-btn {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.cancel-btn:hover {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transform: translateY(-1px);
}

/* Card Catalog Grid */
.catalog-card {
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 10px;
  overflow: visible !important; /* Allow diamonds to show outside */
  position: relative;
  height: 360px; /* Further reduced height for better fit */
  margin-bottom: 35px; /* Good spacing between cards */
}

.catalog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(244, 228, 188, 0.2);
}

.card-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 25px 18px;
  overflow-y: scroll;
  overflow-x: hidden;
  padding: 20px;
  padding-bottom: 40px;
  height: 100%;
  border: 1px solid #5a3419;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

/* Custom scrollbar styling for card catalog */
.card-catalog-grid::-webkit-scrollbar {
  width: 12px;
}

.card-catalog-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  border: 1px solid rgba(139, 90, 60, 0.3);
}

.card-catalog-grid::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(139, 90, 60, 0.8), rgba(191, 167, 106, 0.6));
  border-radius: 6px;
  border: 1px solid rgba(139, 90, 60, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.card-catalog-grid::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, rgba(191, 167, 106, 0.9), rgba(244, 228, 188, 0.7));
  border-color: rgba(191, 167, 106, 0.8);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 8px rgba(191, 167, 106, 0.3);
}

.card-catalog-grid::-webkit-scrollbar-thumb:active {
  background: linear-gradient(135deg, rgba(244, 228, 188, 0.9), rgba(191, 167, 106, 0.8));
}

.catalog-card-tooltip {
  background: linear-gradient(135deg, rgba(69, 53, 35, 0.98) 0%, rgba(45, 35, 25, 0.95) 50%, rgba(35, 27, 20, 0.98) 100%);
  border: 2px solid rgba(139, 90, 60, 0.9);
  transition: all 0.3s ease;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
  height: 360px; /* Match card container height */
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Fix art section to be full width */
.catalog-card-tooltip .card-art {
  width: 100%;
  height: 130px;
  background: rgba(15, 12, 10, 0.9);
  border-bottom: 1px solid rgba(139, 90, 60, 0.3);
  overflow: hidden;
  flex-shrink: 0;
}

.catalog-card-tooltip .card-art img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center;
  border-radius: 0 !important;
  margin: 0 !important;
}

/* Add shimmer effect on hover */
.catalog-card-tooltip::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s;
  pointer-events: none;
  z-index: 1;
}

.catalog-card:hover .catalog-card-tooltip::before {
  left: 100%;
}

/* Rarity Diamond - Hangs Out Bottom of Cards */
.rarity-diamond {
  position: absolute;
  bottom: -20px; /* Hang outside card bounds */
  left: 50%;
  transform: translateX(-50%);
  z-index: 20; /* Above everything else */
  font-size: 28px; /* Large and dramatic */
  filter: drop-shadow(0 0 8px currentColor);
  pointer-events: none; /* Prevent interfering with card interactions */
}

.diamond-shape {
  transform: scaleY(2.0); /* Made even taller for more dramatic effect */
  animation: rarityGlow 2s ease-in-out infinite alternate;
}

@keyframes rarityGlow {
  0% { 
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.9), 0 3px 6px rgba(0, 0, 0, 0.7), 0 0 15px currentColor;
    filter: drop-shadow(0 0 8px currentColor);
  }
  100% { 
    text-shadow: 0 0 15px rgba(0, 0, 0, 0.9), 0 4px 8px rgba(0, 0, 0, 0.7), 0 0 25px currentColor;
    filter: drop-shadow(0 0 12px currentColor);
  }
}

/* Add bottom padding to all card types */
.magic-card-display,
.general-card-tooltip,
.catalog-card-tooltip {
  margin-bottom: 10px; /* Additional margin for grid spacing */
  overflow: visible !important; /* Allow rarity diamonds to show outside card bounds */
}

/* Specific padding for card catalog cards */
.card-catalog-grid .magic-card-display {
  padding-bottom: 25px !important; /* Extra padding for catalog cards */
}

/* Ensure card containers allow diamonds to extend outside */
.general-grid,
.catalog-card {
  overflow: visible !important;
  padding-bottom: 20px; /* Extra space at bottom of grid for hanging diamonds */
}

/* General selection cards need padding too */
.general-selection .general-card {
  padding-bottom: 20px !important;
}

/* Rarity Colors */
.rarity-diamond[style*="#9ca3af"] { /* Common - Gray */
  color: #9ca3af !important;
}

.rarity-diamond[style*="#3b82f6"] { /* Rare - Blue */
  color: #3b82f6 !important;
}

.rarity-diamond[style*="#8b5cf6"] { /* Epic - Purple */
  color: #8b5cf6 !important;
}

.rarity-diamond[style*="#f59e0b"] { /* Legendary - Orange */
  color: #f59e0b !important;
}

