/* Overall battle page */
:root {
  --bg-color: #1e1e1e;
  --text-color: #7fb8ff;
  --sub-text-color: #e0e0e0;
  --button-color: #2d2d2d;
  --button-hover: #3a3a3a;
  --text-size: 14px;
}

#battle-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Close button */
#battle-page .close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--button-color);
  color: var(--sub-text-color);
  border: none;
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
}

.vscontainer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
}

.vs {
  font-size: 150px;
  font-weight: bold;
  color: #fff;
}

/* Card container */
.card-container {
  display: flex;
  gap: 500px;
}

/* Card styling */
.card {
  transform-origin: center;
  animation: card-move 1.5s ease-in-out forwards;
}

/* Positioning for card animations */
.card-left,
.card-right {
  width: 240px;
  height: 336px;
  border-radius: 10px;
  border: 5px solid transparent #efcf20;
  transform: translateY(-150%);
  animation-delay: 0.1s;
}

/* Card animation */
@keyframes card-move {
  0% {
    transform: translateY(-150%);
  }

  60% {
    transform: translateY(20%);
  }

  100% {
    transform: translateY(0%);
  }
}

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

/* Apply shake effect */
.card-hit {
  animation: shake 0.4s ease-in-out;
}

.round-container {
  position: fixed;
  top: 10px;
  left: 10px;
  margin: 5px;
  font-size: 20px;
  font-weight: bold;
  color: white;
  text-align: center;
}

.logs-container {
  width: 450px;
  height: auto;
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 5px;
  position: absolute;
  top: 70%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.logs-text {
  display: flex;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  white-space: normal;
  word-wrap: break-word;
  padding: 5px;
}

/* Ensure text appears smoothly */
@keyframes fadeOut {
  0%,
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.logs-text p {
  animation: fadeIn 0.3s ease-in-out;
}

/* Battle controls (centered buttons) */
.battle-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin: 14px 0;
}

/* Shared button styles */
#start-battle-btn,
#clear-logs-btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 14px;
  color: #ffffff;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Primary action: bright contrasting gradient */
#start-battle-btn {
  background: linear-gradient(135deg, #34d399 0%, #06b6d4 100%);
  border: 1px solid rgba(255,255,255,0.08);
}

/* Secondary: subtle translucent button */
#clear-logs-btn {
  background: rgba(255, 255, 255, 0.06);
  color: #e6f7ff;
  border: 1px solid rgba(255,255,255,0.06);
}

/* Hover / focus states */
#start-battle-btn:hover,
#clear-logs-btn:hover,
#start-battle-btn:focus,
#clear-logs-btn:focus {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 36px rgba(0,0,0,0.36);
  outline: none;
  opacity: 0.99;
}

/* Active (pressed) */
#start-battle-btn:active,
#clear-logs-btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(0,0,0,0.22);
}

/* Visual glow/pulse for primary button */
#start-battle-btn {
  position: relative;
  z-index: 0;
  background-size: 200% 200%;
}

#start-battle-btn::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 14px;
  background: radial-gradient(ellipse at center, rgba(6,182,212,0.18) 0%, rgba(52,211,153,0.06) 40%, transparent 70%);
  filter: blur(10px);
  opacity: 0;
  transition: opacity 220ms ease, transform 220ms ease;
  z-index: -1;
}

#start-battle-btn:hover::after,
#start-battle-btn:focus::after {
  opacity: 1;
  transform: scale(1.02);
}

@keyframes pulseGlow {
  0% { box-shadow: 0 6px 18px rgba(6,182,212,0.18); }
  50% { box-shadow: 0 10px 34px rgba(6,182,212,0.22); }
  100% { box-shadow: 0 6px 18px rgba(6,182,212,0.18); }
}

#start-battle-btn:hover {
  animation: pulseGlow 1.2s ease-in-out infinite;
}

/* Slight change for secondary button hover */
#clear-logs-btn:hover {
  background: rgba(255,255,255,0.09);
  color: #dff6ff;
}
/* Responsive: stack on very small screens */
@media (max-width: 420px) {
  .battle-controls { flex-direction: column; gap: 8px; }
  #start-battle-btn, #clear-logs-btn { width: 160px; }
}
