.battle-field {
    min-height: 300px;
}

.pokemon-card {
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 15px;
}

.pokemon-card.player {
    border-color: #28a745;
}

.pokemon-card.opponent {
    border-color: #dc3545;
}

/* HP bar styling */
.hp-bar {
    width: 100%;
    height: 10px;
    background-color: #e0e0e0;
    border-radius: 5px;
    margin-bottom: 10px;
    overflow: hidden;
}

.hp-bar-fill {
    height: 100%;
    transition: width 0.3s ease-in-out;
}

.hp-bar-fill.player-hp {
    background-color: #28a745;
}

.hp-bar-fill.opponent-hp {
    background-color: #dc3545;
}

.move-button {
    min-width: 120px;
    margin: 5px;
}

/* Battle log styling */
.battle-log {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    font-family: 'Courier New', monospace;
}

.battle-log p {
    margin-bottom: 8px;
    padding: 4px 0;
    border-bottom: 1px dotted #dee2e6;
}

.player-move {
    background-color: rgba(40, 167, 69, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.opponent-move {
    background-color: rgba(220, 53, 69, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.battle-result {
    font-size: 1.2em;
    text-align: center;
    padding: 10px;
    margin: 10px 0;
    background-color: rgba(255, 193, 7, 0.2);
    border-radius: 5px;
}

.attack-animation {
    animation: attack 0.5s ease-in-out;
}

.critical-hit {
    animation: flash 0.5s ease-in-out;
}

@keyframes attack {
    0% { transform: translateX(0); }
    25% { transform: translateX(20px); }
    50% { transform: translateX(-10px); }
    75% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; background-color: red; }
}

/* Custom Type Colors */
.bg-purple {
    background-color: #a461e2 !important;
    color: white !important;
}

.bg-pink {
    background-color: #f9c9e3 !important;
    color: #212529 !important;
}

.bg-indigo {
    background-color: #6f42c1 !important;
    color: white !important;
}

.bg-brown {
    background-color: #b5651d !important;
    color: white !important;
}

/* Type-specific button outline colors */
.btn-outline-purple {
    color: #a461e2;
    border-color: #a461e2;
}
.btn-outline-purple:hover {
    color: white;
    background-color: #a461e2;
}

.btn-outline-pink {
    color: #e83e8c;
    border-color: #e83e8c;
}
.btn-outline-pink:hover {
    color: white;
    background-color: #e83e8c;
}

.btn-outline-indigo {
    color: #6f42c1;
    border-color: #6f42c1;
}
.btn-outline-indigo:hover {
    color: white;
    background-color: #6f42c1;
}

.btn-outline-brown {
    color: #b5651d;
    border-color: #b5651d;
}
.btn-outline-brown:hover {
    color: white;
    background-color: #b5651d;
}

/* Shaking animation for when a Pokemon is hit */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
  }
  
  .shake-animation {
    animation: shake 0.5s ease-in-out;
    animation-fill-mode: forwards;
    position: relative;
  }
  
  /* Existing attack animation can be replaced */
  .attack-animation {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    position: relative;
  }

/* Victory animation */
@keyframes victory-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
  50% { transform: scale(1.05); box-shadow: 0 0 20px 10px rgba(40, 167, 69, 0.7); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
}

.victory-animation {
  animation: victory-pulse 1s ease-in-out infinite;
  z-index: 10;
  position: relative;
}

/* Defeat animation */
@keyframes defeat {
  0% { opacity: 1; transform: translateY(0); }
  20% { opacity: 1; transform: translateY(0); }
  60% { opacity: 0.7; transform: translateY(10px); }
  100% { opacity: 0.5; transform: translateY(20px); filter: grayscale(100%); }
}

.defeat-animation {
  animation: defeat 1.5s ease-in-out forwards;
}

/* KO text animation */
@keyframes ko-text {
  0% { opacity: 0; transform: scale(0.5) rotate(-10deg); }
  50% { opacity: 1; transform: scale(1.2) rotate(5deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

.ko-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  font-weight: bold;
  color: #dc3545;
  text-shadow: 2px 2px 0 #000, -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000;
  z-index: 20;
  animation: ko-text 0.8s ease-out forwards;
}