html, body {
  height: 100%;
  min-height: 100%;
}

body {
  font-family: 'Press Start 2P', cursive;
  font-size: 8px;
  background-color: #111;
  color: #fff;
  text-align: center;
  padding: 10px;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

h2.choose-brand {
  color: rgb(231, 231, 231);
  font-size: large;
}

h3 {
  margin: 8px 0 5px 0;
  font-size: 10px;
}

h3.char-num {
  margin: 28px 0 12px 0;
  color: #2ecc71;
}

.choose-brand {
  color: rgb(168, 232, 255);
  margin: 16px 0 8px 0;
  display: block;
}

#get-filtered {
  margin: 16px 0 12px 0;
  padding: 10px 0 10px 0;
}

#get-random {
  color: #b0b0b0;
  padding: 7px 0 7px 0;
  margin-bottom: 16px;
}

h4.party-preview {
  color: #e1e1e1;
  margin: 12px 0 12px 0;
  font-size: small;
}

#party-preview ul {
  padding: 0;
  margin: 0 auto;
  text-align: center;
  width: 100%;
  display: block;
}

li {
  list-style: none;
  margin: 8px 0 8px 0;
  text-align: center;
  color: #2ecc71;
}

.selected {
  background: #0ff;
  color: #222;
  font-weight: bold;
}

#battle-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
  margin: 0 auto;
}

#party-column, #enemy-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 0;
}

#party-column {
  align-items: flex-start;
}

#enemy-column {
  align-items: flex-end;
}

.item-card, .enemy-card {
  background-color: #222;
  border: 2px solid #555;
  padding: 10px;
  border-radius: 8px;
  width: 160px;
  text-align: center;
  margin: 0 auto;
}

img {
  border-radius: 6px;
}

button {
  background-color: #444;
  color: #fff;
  border: none;
  padding: 5px 0 5px 0;
  margin-top: 5px;
  cursor: pointer;
  border-radius: 6px;
}

button:disabled {
  background-color: #222;
  color: #666;
  cursor: default;
}

/* In your style.css */
#all-attack:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#all-attack {
  display: block;
  margin: 15px auto;
  font-size: 12px;
}

.hp-bar {
  width: 100%;
  height: 11px;
  background: #414141;
  border-radius: 5px;
  border: 1px solid #555;
  margin-top: 4px;
  position: relative;
  overflow: hidden;
}

.hp-fill {
  height: 100%;
  background: #2ecc71;
  border-radius: 5px;
  transition: width 0.3s;
}

.hp-text {
  position: absolute;
  left: 6px;
  top: 2px;
  font-size: 7px;
  line-height: 10px;
  color: #fff;
}

#battle-log {
  background-color: #000;
  border: 2px solid #555;
  color: #fff;
  width: 90%;
  max-width: 600px;
  height: 150px;
  overflow-y: auto;
  padding: 8px;
  margin: 20px auto;
  text-align: left;
  white-space: pre-wrap;
}

.stat-text {
  font-size: 5px;
  opacity: 0.7;
  margin: 4px 0 0 0;
  border: 2px solid #555;
  padding: 2px;
  border-radius: 6px;
}

.dead-card {
  filter: grayscale(1);
  opacity: 0.5;
}

.exp-bar {
  height: 11px;
  background: linear-gradient(to right, rgb(93, 93, 93), rgb(216, 216, 216));
  width: 100%;
  border-radius: 5px;
  border: 1px solid #555;
  margin: 3px 0 0 0;
  position: relative;
  overflow: hidden;
}
.exp-bar > div {
  height: 100%;
  background: rgb(0, 186, 186);
  border-radius: 5px;
  position: absolute;
  top: 0;
  left: 0;
}
.exp-text {
  position: absolute;
  left: 6px;
  top: 2px;
  font-size: 7px;
  line-height: 10px;
  color: #fff;
  z-index: 1;
  pointer-events: none;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  #battle-container {
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
  }
  .item-card, .enemy-card {
    width: 100px;
    max-width: 100px;
    padding: 6px;
  }
  img {
    width: 50px;
  }
  .img-stats {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .stats-column {
    display: flex;
    flex-direction: column;
  }
  button {
    width: 100%;
    font-size: 10px;
    padding: 5px;
  }
  #battle-log {
    height: 80px;
    font-size: 9px;
    line-height: 1.3;
  }
}

@keyframes attack-party {
  0% { transform: translateX(0); }
  30% { transform: translateX(30px); }
  60% { transform: translateX(0); }
  100% { transform: translateX(0); }
}

@keyframes attack-enemy {
  0% { transform: translateX(0); }
  30% { transform: translateX(-30px); }
  60% { transform: translateX(0); }
  100% { transform: translateX(0); }
}

@keyframes flash-red {
  0% { background-color: #f00; }
  100% { background-color: inherit; }
}

.attacking-party {
  animation: attack-party 0.4s;
}

.attacking-enemy {
  animation: attack-enemy 0.4s;
}

.flash-hit {
  animation: flash-red 0.2s;
}

.item-card h3,
.enemy-card h3 {
  margin: 2px 0 10px 0;   /* top, right, bottom, left */
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
  display: block;
}
