/* === Battle Modal (аналог Craft) === */
#battleModal .modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 100%;
  background: transparent !important;
  color: #fff;
  border-radius: 0;
  padding: 0;
  position: relative;
  box-sizing: border-box;
}


@keyframes popin { from { transform: scale(0.92); opacity:0; } to { transform: scale(1); opacity:1; } }

#battleModal .modal-header {
  font-size: 18px;
  text-align: center;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
  margin: 0;
  padding: 0;
  line-height: 1.1;
  position: relative;
  top: 5%;
  z-index: 2;
}

.battle-main-inner {
  width: 80%;
  margin-top: 34px; /* смещаем под заголовок */
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

#enemy-selection-container,
#battleContainer,
#battleTabCombos {
  width: 80%;
  max-width: 440px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* === Вкладки === */
.battle-tabs {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 20px 0 20px 0;
  z-index: 2;
  flex-shrink: 0;
}

.battle-tab {
  font-family: 'Montserrat', sans-serif;
  padding: 8px 34px;
  border-radius: 13px 13px 0 0;
  border: 1.5px solid #4e4e4e;
  border-bottom: none;
  background: rgba(30,30,30,0.42);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  letter-spacing: 0.02em;
  transition: background 0.2s, color 0.16s;
  outline: none;
  box-shadow: 0 3px 16px 0 rgba(0,0,0,0.09);
  opacity: 0.85;
  z-index: 1;
}
.battle-tab.active {
  background: rgba(153, 13, 10, 0.26);
  color: #fff;
  font-weight: 700;
  opacity: 1;
  border-bottom: 2.5px solid #990D0A;
  z-index: 2;
}

.battle-section {
  width: 100%;
  flex: 0 1 auto;
  display: block;
  overflow: visible;
}
.battle-section.hidden { display: none; }

/* --- Контейнер выбора врага --- */
#enemy-selection-container {
  position: relative;
  min-height: 240px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.enemy-selection {
  width: 100%;
  position: relative;
}

/* Совпадает с portal-options — абсолют, top: 20%, 75%, 300px */
.enemy-options {
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 75%; 
  height: 300px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.enemy-scroll {
  display: flex;
  gap: 4px;
  height: 100%;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  padding-left:  calc((100% - 150px) / 2);  /* <-- так же как в портале */
  padding-right: calc((100% - 150px) / 2);
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.enemy-scroll::-webkit-scrollbar,
.world-scroll::-webkit-scrollbar {
  display: none;
}
.enemy-item {
  flex: 0 0 auto;
  width: 150px;
  text-align: center;
  scroll-snap-align: center;
  transform: scale(0.8);
  transition: transform 0.3s ease;
  cursor: pointer;
  background: none;
  border-radius: 8px;
  margin: 0;
  padding: 0;
}
.enemy-item.active { transform: scale(1); z-index: 2; }
.enemy-item.disabled { opacity: 0.4; cursor: default; }

.enemy-thumb {
  width: 150px;
  height: 225px;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}


.enemy-label {
  margin-top: 6px;
  font-size: 14px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}

#enemyBackBtn {
  position: absolute;
  bottom: -8%;
  left: 50%;
  transform: translateX(-50%);
  width: 144px;
  height: 144px;
  background: url('/static/images/icons/backbutton.webp') no-repeat center center;
  background-size: contain;
  border: none;
  cursor: pointer;
  z-index: 10;
}

/* === Контейнер битвы === */
#battleContainer {
  width: 100%;
  display: block;
  overflow: hidden;
}
#battleContainer.hidden { display: none; }
.enemy-info {
  margin: 0 0 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.enemy-image-container {
  width: 130px;     /* Было 110px */
  height: 195px;    /* Было 160px */
  margin: 0 auto 12px auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.enemy-image-container img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 9px;
  box-shadow: 0 2px 16px #0004;
}
.damage-effect {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 2em;
  font-weight: 900;
  pointer-events: none;
  opacity: 0;
  color: #FF4646;
  text-shadow: 0 0 8px #000, 0 0 22px #e83232;
  z-index: 10;
}
.enemy-health {
  width: 38%;
  min-width: 80px;  /* Было 120px */
  max-width: 170px; /* Было 260px */
  height: 14px;
  background: #191b20;
  border-radius: 7px;
  margin: 0 0 7px 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 8px #0005;
}
.enemy-health[data-hp]:after {
  content: attr(data-hp);
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -48%);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  pointer-events: none;
  text-shadow: 0 1px 2px #000b;
}
#enemyHealthBar {
  background: linear-gradient(90deg, #ff3131, #ffa800 80%);
  height: 100%;
  border-radius: 7px;
  transition: width 0.3s cubic-bezier(.8,.1,.3,.92);
  box-shadow: 0 1px 10px #e8323240;
}
.attack-options {
  margin-top: 10px;
  margin-bottom: 10px;
  display: flex;
  gap: 26px;
  justify-content: center;
}
.attack-button {
  width: 64px;
  height: 64px;
  background: rgba(26, 28, 39, 0.86);
  border: 2px solid #444;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.17s, border-color 0.17s;
  outline: none;
  box-shadow: 0 1px 7px #0004;
  padding: 0;
}
.attack-button img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 3px #aaa);
}
.attack-button:active {
  filter: brightness(0.93);
  background: #222;
  border-color: #990D0A;
}

/* === Комбо вкладка (battleTabCombos) === */
#battleTabCombos {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-top: 8px;
}
#battleTabCombos.hidden { display: none; }

#comboListBattle {
  display: flex;
  flex-direction: column;
  gap: 13px;
  /* Удалить: overflow-y: auto; max-height: 38vh; min-height: 60px; */
  scrollbar-width: none;
  padding-right: 0;
  width: 100%;
  box-sizing: border-box;
}
.combo-item {
  background: rgba(38, 42, 58, 0.2);
  border-radius: 11px;
  padding: 12px 20px 12px 20px;
  box-shadow: 0 1px 6px #0001;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 1.04rem;
}
.combo-item-title {
  font-size: 1em;
  font-weight: 700;
  margin-bottom: 0;
  margin-top: 0;
  line-height: 1.08;
}

.combo-item-desc {
  font-size: 0.93em;
  color: #e6e6e6;
  margin-bottom: 3px;
}

.combo-icons {
  display: flex;
  gap: 10px;
  align-items: center;
}
.combo-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: 0 1px 8px #0003;
  background: #181b20;
}
.combo-arrow {
  color: #aaa;
  font-size: 1.5em;
  margin: 0 4px;
  vertical-align: middle;
}

/* === Модалка уклонения (оставь как было) === */
#dodgeModal {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 20, 0.88);
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 11000;
}
.dodge-modal-content {
  background: #23243a;
  border-radius: 18px;
  box-shadow: 0 8px 48px #0008;
  padding: 26px 30px 22px 30px;
  min-width: 300px;
  max-width: 94vw;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: popin 0.16s cubic-bezier(.44,1.38,.84,.93);
}
.dodge-close {
  position: absolute;
  top: 8px; right: 12px;
  background: none;
  border: none;
  color: #bbb;
  font-size: 1.7rem;
  cursor: pointer;
}
.dodge-title {
  color: #fff;
  font-size: 1.09em;
  margin-bottom: 16px;
  text-align: center;
}
.dodge-slider {
  position: relative;
  width: 260px;
  height: 28px;
  background: #20252e;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 8px #0004;
  margin-bottom: 15px;
  margin-top: 5px;
  display: flex;
}
.dodge-zone {
  position: absolute;
  top: 0; bottom: 0;
}
.dodge-zone--green {
  left: 0;
  width: 36px;
  background: linear-gradient(90deg,#8fffad,#5fc76c 90%);
  z-index: 1;
}
.dodge-zone--yellow {
  left: 36px;
  width: 44px;
  background: linear-gradient(90deg,#ffe288 0,#ffd155 90%);
  z-index: 1;
}
.dodge-zone--red {
  left: 80px;
  width: 100px;
  background: linear-gradient(90deg,#ff7f7f 0,#e23a3a 90%);
  z-index: 1;
}
.dodge-marker {
  position: absolute;
  top: 1px;
  left: 0;
  width: 18px;
  height: 26px;
  background: linear-gradient(180deg,#fff,#d2e0fb 80%);
  border-radius: 4px;
  box-shadow: 0 1px 8px #0005;
  z-index: 3;
  transition: left 0.05s linear;
  border: 1px solid #adc;
}
.dodge-result {
  margin-top: 8px;
  min-height: 18px;
  font-size: 1.08em;
  color: #9ee9b1;
  text-align: center;
  letter-spacing: 0.02em;
}


/* Внешний контейнер — высота и ширина */
.combo-list-outer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 auto;
  height: 48vh; /* Как в craft-recipes-list-wrap */
  min-height: 120px;
  max-height: 56vh;
  margin: 0 auto;
}

.combo-list-inner {
  width: 85%;  /* или 75% под дизайн */
  max-width: 99vw;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  background: transparent;
  position: relative;
}

.section-header {
  position: sticky;
  top: 0;
  background: none;
  z-index: 2;
  padding: 10px 0 10px 0;
  margin-bottom: 8px;
  box-shadow: 0 3px 18px #0002;
}

/* Прокручивается только этот блок */
.combo-list-scroll {
  overflow-y: auto;
  width: 100%;
  flex: 1 1 auto;
  max-height: 40vh;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding-bottom: 8px;
  scrollbar-width: thin;
}
