* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: url("images/background-battle.png") no-repeat center center / cover;
  color: white;
  height: 100vh;
  overflow: hidden;
}

.container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
}

.container h1 {
  font-size: 48px;
  letter-spacing: 3px;
  margin-bottom: 30px;
  text-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
}

.best-score {
  margin-bottom: 12px;
  font-size: 18px;
  color: #bdefff;
  background: rgba(0,0,0,0.35);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0,188,212,0.12);
  box-shadow: 0 0 10px rgba(0,188,212,0.06);
}

.current-score {
  margin-bottom: 18px;
  font-size: 16px;
  color: #fff4c2;
  background: rgba(0,0,0,0.25);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 235, 59, 0.08);
}

#game {
  width: 100%;
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-top: 40px;
}

.character {
  text-align: center;
  position: relative;
  display: inline-block;
}

.sprite {
  width: 220px;
  height: 220px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.4));
  position: relative;
}

.effect-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  pointer-events: none;
}

.effect-overlay.show {
  animation: effectPulse 0.8s ease-out;
}

@keyframes effectPulse {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}

.player {
  background-image: url("images/mc.png");
}

.enemy {
  background-image: url("images/enemy.png");
  transform: scaleX(-1);
}

.character p {
  margin-top: 15px;
  font-size: 18px;
  letter-spacing: 1px;
}

.ui {
  position: fixed;
  bottom: 30px;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 20px;
}

.battle-log {
  position: fixed;
  bottom: 120px;
  width: 90%;
  max-width: 800px;
  left: 50%;
  transform: translateX(-50%);
  height: 120px;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid rgba(0, 188, 212, 0.6);
  border-radius: 8px;
  padding: 12px;
  overflow-y: auto;
  box-shadow: 0 0 15px rgba(0, 188, 212, 0.3);
  display: none;
}

.log-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-entry {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.5px;
  animation: logSlideIn 0.3s ease-out;
}

@keyframes logSlideIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

button {
  padding: 12px 28px;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 1px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: white;
  background: linear-gradient(135deg, #00bcd4, #007c91);
  box-shadow: 0 0 15px rgba(0, 188, 212, 0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: scale(1.08);
  box-shadow: 0 0 25px rgba(0, 188, 212, 0.9);
}

button:active {
  transform: scale(0.95);
}

.action-btn {
  display: flex;
  align-items: center;
}

.action-icon {
  width: 40px;
  height: 40px;
  margin-right: 5px;
}

.enemy.hit {
  animation: hitEffect 0.5s ease-in-out;
}

.player.hit {
  animation: playerHitEffect 0.5s ease-in-out;
}

@keyframes hitEffect {
  0% { transform: scaleX(-1) translateX(0); filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.8)); }
  25% { transform: scaleX(-1) translateX(-10px); filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.8)); }
  50% { transform: scaleX(-1) translateX(10px); filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.8)); }
  75% { transform: scaleX(-1) translateX(-5px); filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.8)); }
  100% { transform: scaleX(-1) translateX(0); filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.4)); }
}

.player.attack {
  animation: attackEffect 0.3s ease-in-out;
}

@keyframes attackEffect {
  0% { transform: translateX(0); }
  50% { transform: translateX(20px); }
  100% { transform: translateX(0); }
}

@keyframes playerHitEffect {
  0% { transform: translateX(0); filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.8)); }
  25% { transform: translateX(-10px); filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.8)); }
  50% { transform: translateX(10px); filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.8)); }
  75% { transform: translateX(-5px); filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.8)); }
  100% { transform: translateX(0); filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.4)); }
}

.enemy.attack {
  animation: enemyAttackEffect 0.3s ease-in-out;
}

@keyframes enemyAttackEffect {
  0% { transform: scaleX(-1) translateX(0); }
  50% { transform: scaleX(-1) translateX(-20px); }
  100% { transform: scaleX(-1) translateX(0); }
}

.player.defend {
  animation: defendEffect 0.8s ease-in-out;
}

.enemy.defend {
  animation: enemyDefendEffect 0.8s ease-in-out;
}

@keyframes defendEffect {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.4)); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 25px rgba(100, 200, 255, 0.8)); }
}

@keyframes enemyDefendEffect {
  0%, 100% { transform: scaleX(-1) scale(1); filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.4)); }
  50% { transform: scaleX(-1) scale(1.1); filter: drop-shadow(0 0 25px rgba(100, 200, 255, 0.8)); }
}

.player.heal {
  animation: healEffect 0.8s ease-in-out;
}

.enemy.heal {
  animation: enemyHealEffect 0.8s ease-in-out;
}

@keyframes healEffect {
  0%, 100% { transform: translateY(0); filter: drop-shadow(0 0 15px rgba(0, 255, 0, 0.4)); }
  50% { transform: translateY(-20px); filter: drop-shadow(0 0 25px rgba(100, 255, 100, 0.8)); }
}

@keyframes enemyHealEffect {
  0%, 100% { transform: scaleX(-1) translateY(0); filter: drop-shadow(0 0 15px rgba(0, 255, 0, 0.4)); }
  50% { transform: scaleX(-1) translateY(-20px); filter: drop-shadow(0 0 25px rgba(100, 255, 100, 0.8)); }
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms ease;
  z-index: 30;
}

.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.overlay-content {
  background: rgba(10, 10, 10, 0.85);
  padding: 24px 32px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
}

.overlay-content h2 {
  margin: 0 0 10px 0;
  font-size: 28px;
}

.overlay-content p {
  margin: 0 0 16px 0;
}

.overlay-content button {
  background: linear-gradient(135deg, #28a745, #1e7e34);
}
