/* === Craft Modal Основное === */
#craftModal .modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  background: transparent !important;
  color: #fff;
  border-radius: 10px;
  padding: 0;
  position: relative;
}

#craftModal .modal-header {
  font-size: 18px;
  text-align: center;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
  margin: 0 0 0 0;
  padding: 0;
  line-height: 1.1;
  /* Крутое выравнивание: опускаем вниз до линии крестика */
  position: relative;
  top: 5%;
  z-index: 2;
}

.craft-main-inner {
  width: 100%;
  margin-top: 34px; /* Подбери нужный отступ — сдвигает ВСЕ вкладки и ниже */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.craft-tabs {
  display: flex;
  justify-content: center;
  gap: 14px; /* меньше промежуток */
  margin: 20px 0 0 0;
  z-index: 2;
  flex-shrink: 0;
}

.craft-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;
}

.craft-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;
}


.craft-section {
  width: 100%;
  flex: 1 1 auto;
  display: block;
  overflow: hidden;
}
.craft-section.hidden { display: none; }

/* --- Прокручиваемая только рецепты! --- */
.craft-recipes-list-wrap {
  width: 75%;
  max-width: 99vw;
  margin: 0 auto;
  flex: 1 1 0;
  overflow-y: auto;
  padding-top: 12px;
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 48vh; /* <= тут высота для скролла */
  min-height: 100px;
}

/* Стили для блока рецепта */
.craft-recipe-block {
  width: 100%;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(212, 212, 212, 0.4);
  border-radius: 14px;
  box-shadow: 0 1px 9px #0002;
  padding: 13px 5px 10px 5px;
}

.craft-recipe-title {
  font-size: 1.09em;
  font-weight: bold;
  color: #fff;
  letter-spacing: 0.01em;
  margin-bottom: 6px;
  text-align: center;
  line-height: 1.2;
}

/* уменьшить gap и размер иконок */
.craft-recipe-icons-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.craft-icon-wrap {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #181b20;
  box-shadow: 0 1px 8px #0003;
  position: relative;
}
.craft-icon-wrap img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 5px;
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 3px #aaa);
}
.craft-icon-qty {
  position: absolute;
  bottom: 1px; right: 2px;
  background: rgba(25,30,44,0.95);
  color: #ffcb6b;
  font-size: 0.7em;
  padding: 0px 5px;
  border-radius: 5px;
  font-weight: 600;
  box-shadow: 0 0 4px #0005;
  pointer-events: none;
}
.craft-recipe-arrow {
  font-size: 1.3em;
  color: #353535;
  margin: 0 3px;
}

.craft-recipe-row .craft-icon-wrap:last-child { margin-right: 0; }

/* Остальной крафт (оставь как было) */
.craft-ingredients-block {
  display: flex;
  flex-direction: row;
  align-items: center; /* Центрируем по вертикали */
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  margin-bottom: 10px;
  margin-left: 10px;
}
.craft-ingredient-slots {
  display: grid;
  grid-template-columns: repeat(3, 50px);
  grid-template-rows: repeat(2, 50px);
  gap: 7px;
}
.craft-ingredient-slot {
  width: 50px;
  height: 50px;
  background: #444;
  border: 2px dashed #777;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: border-color .14s;
}
.craft-ingredient-slot.has-item {
  border-style: solid;
  border-color: #990D0A;
  background: #222;
}
.craft-ingredient-slot img {
  max-width: 85%;
  max-height: 85%;
}
.craft-ingredient-slot .item-quantity {
  position: absolute;
  bottom: 0px;
  right: 0px;
  background: #990D0A;
  color: #fff;
  font-size: 0.7em;
  padding: 1px 7px 1px 6px;
  border-radius: 8px;
  font-weight: bold;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
  pointer-events: none;
  z-index: 2;
  letter-spacing: 0.5px;
}



/* Кнопка Крафт */
.craft-action-btn-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  min-width: 120px;
  max-width: 120px;
}
.craft-action-btn {
  width: 120px;
  height: 54px;
  background: transparent;
  border-radius: 16px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
  transition: filter .16s;
}
.craft-action-btn img {
  width: 120px;
  height: auto;
  display: block;
}
.craft-action-btn:active {
  filter: brightness(0.94);
}

/* Разделитель и секция инвентаря */
.section-divider {
  width: 100%;
  height: 1.5px;
  background: linear-gradient(90deg, #b6b6b6 0%, #444 100%);
  margin: 20px 0 14px 0;
  border: none;
  opacity: 0.28;
}
.section-header {
  text-align: center;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
}

/* Инвентарь материалов */
.craft-inventory-list {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
  min-height: 58px;
  margin-top: 0;
  padding-top: 8px;
}
.craft-material-item {
  width: 50px;
  height: 50px;
  background: #444;
  border: 1px solid #777;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}
.craft-material-item img {
  max-width: 85%;
  max-height: 85%;
}
.craft-material-item .item-quantity {
  position: absolute;
  bottom: 0px;
  right: 0px;
  background: #0D3B66;
  color: #fff;
  font-size: 0.7em;
  padding: 1px 7px 1px 6px;
  border-radius: 8px;
  font-weight: bold;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
  pointer-events: none;
  z-index: 2;
  letter-spacing: 0.5px;
}
