/* ═══════════════════════════════════════════════════════════════
   EQUIPMENT — WoW-style: фигура Рокки по центру, слоты по бокам
   ═══════════════════════════════════════════════════════════════ */

.equip-overlay {
  position: fixed; inset: 0;
  background: rgba(5, 3, 10, 0.88);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: equip-fade 0.25s ease;
}
@keyframes equip-fade { from { opacity: 0; } to { opacity: 1; } }

.equip-box {
  width: min(1320px, 97vw);
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(28, 18, 38, 0.97), rgba(15, 8, 22, 0.97));
  border: 1.5px solid rgba(200, 140, 255, 0.4);
  border-radius: 6px;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.8),
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 0 40px rgba(160, 100, 230, 0.18);
  overflow: visible;   /* тултипы у краёв не должны обрезаться рамкой */
}

.equip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(200, 140, 255, 0.18);
  background: rgba(0,0,0,0.3);
  border-radius: 6px 6px 0 0;
}
.equip-title {
  font-family: 'Metamorphous', 'Cinzel', serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.3em;
  color: #f0e0ff;
  text-shadow: 0 0 10px rgba(220, 180, 255, 0.4);
  text-transform: uppercase;
}
.equip-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: rgba(220, 180, 255, 0.7);
  cursor: pointer;
  padding: 4px 10px;
  transition: color 0.2s;
}
.equip-close:hover { color: #fff; }

/* ─── основной макет ─── */
.equip-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: visible;
}

/* ═══ ЛЕВАЯ ПОЛОВИНА: фигура + слоты ═══ */
.equip-char {
  display: grid;
  grid-template-columns: 104px 1fr 104px;
  gap: 14px;
  padding: 24px 20px;
  border-right: 1px solid rgba(200, 140, 255, 0.18);
  background:
    radial-gradient(ellipse at center, rgba(80, 40, 130, 0.18) 0%, transparent 70%);
}

.slot-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

/* центральная фигура персонажа */
.char-figure {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg,
    rgba(30, 18, 50, 0.5) 0%,
    rgba(15, 8, 25, 0.7) 80%,
    rgba(10, 5, 16, 0.85) 100%);
  border: 1px solid rgba(200, 140, 255, 0.22);
  border-radius: 4px;
  min-height: 540px;
}
.char-figure svg {
  width: 75%;
  max-height: 85%;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.7));
}
.char-figure::before {
  content: "";
  position: absolute;
  inset: auto 12% 6% 12%;
  height: 14px;
  background: radial-gradient(ellipse, rgba(220, 100, 200, 0.4) 0%, transparent 70%);
  filter: blur(8px);
}
.char-figure .char-name {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Metamorphous', 'Cinzel', serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.3em;
  color: rgba(220, 180, 255, 0.55);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ─── ячейка слота ─── */
.slot {
  position: relative;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border: 1.5px solid rgba(200, 140, 255, 0.25);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.slot:hover {
  border-color: rgba(220, 180, 255, 0.55);
  background: rgba(40, 24, 60, 0.65);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5), 0 0 14px rgba(160, 100, 230, 0.3);
  z-index: 9000;   /* наведённый слот и его тултип — поверх соседей */
}

/* иконка-плейсхолдер пустого слота */
.slot.empty .slot-placeholder {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  font-size: 26px;
  color: rgba(220, 180, 255, 0.25);
  filter: grayscale(0.5);
}
.slot.empty .slot-empty-label {
  display: none;
}

/* иконка предмета (если экипирован) */
.slot .slot-item-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 72px; height: 72px;
  font-size: 32px;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.7));
}
.slot .slot-item-icon img { width: 100%; height: 100%; object-fit: contain; }

/* цвета рамок по редкости (для занятых слотов) */
.slot[data-rarity="common"]    { border-color: rgba(154, 160, 170, 0.6); }
.slot[data-rarity="uncommon"]  { border-color: rgba(90, 208, 111, 0.7); box-shadow: 0 0 10px rgba(90, 208, 111, 0.25); }
.slot[data-rarity="rare"]      { border-color: rgba(90, 158, 255, 0.75); box-shadow: 0 0 10px rgba(90, 158, 255, 0.3); }
.slot[data-rarity="epic"]      { border-color: rgba(181, 106, 255, 0.8);  box-shadow: 0 0 12px rgba(181, 106, 255, 0.35); }
.slot[data-rarity="legendary"] { border-color: rgba(255, 176, 64, 0.85);  box-shadow: 0 0 14px rgba(255, 176, 64, 0.4); }

/* подпись типа слота снизу */
.slot-label {
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Cinzel', serif;
  font-size: 8px;
  letter-spacing: 0.18em;
  color: rgba(220, 180, 255, 0.4);
  white-space: nowrap;
  text-transform: uppercase;
}

/* всплывающая подсказка с описанием при наведении */
/* ═══ WoW-style карточка-тултип с КРУПНОЙ иконкой ═══ */
.slot-tooltip {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: 224px;
  padding: 14px 14px 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: linear-gradient(180deg, rgba(18,10,28,0.99), rgba(7,3,12,0.99));
  border: 1px solid rgba(220, 180, 255, 0.4);
  border-radius: 6px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  color: #f0e4d0;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  z-index: 9001;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.05);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
/* стрелочка вниз */
.slot-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: rgba(220, 180, 255, 0.4);
}
/* крупная иконка предмета */
.slot-tooltip .tt-icon {
  display: flex; align-items: center; justify-content: center;
  width: 104px; height: 104px;
  margin-bottom: 6px;
  background: radial-gradient(circle at 50% 38%, rgba(160,100,230,0.22), rgba(0,0,0,0.55));
  border: 1px solid rgba(220, 180, 255, 0.3);
  border-radius: 6px;
  font-size: 34px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.7));
}
.slot-tooltip .tt-icon img { width: 100%; height: 100%; object-fit: contain; }
.slot-tooltip .tt-rarity {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.24em;
}
.slot-tooltip .tt-name {
  display: block;
  font-family: 'Metamorphous', serif;
  font-size: 13px;
  color: #f6ecd8;
  line-height: 1.2;
}
.slot-tooltip .tt-bonus {
  display: block;
  margin-top: 1px;
  color: #5ad06f;
  font-size: 11px;
  letter-spacing: 0.05em;
}
.slot-tooltip .tt-lore {
  display: block;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(220, 180, 255, 0.16);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 12.5px;
  line-height: 1.32;
  color: rgba(214, 198, 170, 0.85);
}
/* цветная рамка по редкости */
.slot-tooltip[data-rarity="uncommon"]  { border-color: rgba(90, 208, 111, 0.7); }
.slot-tooltip[data-rarity="rare"]      { border-color: rgba(90, 158, 255, 0.75); }
.slot-tooltip[data-rarity="epic"]      { border-color: rgba(181, 106, 255, 0.8); }
.slot-tooltip[data-rarity="legendary"] { border-color: rgba(255, 176, 64, 0.85);
  box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 20px rgba(255,176,64,0.3); }
.slot-tooltip[data-rarity="uncommon"]::after  { border-top-color: rgba(90, 208, 111, 0.7); }
.slot-tooltip[data-rarity="rare"]::after      { border-top-color: rgba(90, 158, 255, 0.75); }
.slot-tooltip[data-rarity="epic"]::after      { border-top-color: rgba(181, 106, 255, 0.8); }
.slot-tooltip[data-rarity="legendary"]::after { border-top-color: rgba(255, 176, 64, 0.85); }
.slot:hover .slot-tooltip { opacity: 1; transform: translateX(-50%) translateY(0); }

/* верхний слот в колонке — тултип раскрывается ВНИЗ (чтобы не обрезался сверху) */
.slot-column .slot:first-child .slot-tooltip {
  bottom: auto;
  top: calc(100% + 14px);
  transform: translateX(-50%) translateY(-6px);
}
.slot-column .slot:first-child:hover .slot-tooltip {
  transform: translateX(-50%) translateY(0);
}
.slot-column .slot:first-child .slot-tooltip::after { display: none; }

/* ═══ ПРАВАЯ ПОЛОВИНА: рюкзак ═══ */
.equip-backpack {
  padding: 24px 26px;
  overflow: visible;       /* без скролла — меню вмещает всё */
  display: flex;
  flex-direction: column;
}

.equip-section-title {
  font-family: 'Metamorphous', 'Cinzel', serif;
  font-size: 10px;
  letter-spacing: 0.4em;
  color: rgba(220, 180, 255, 0.55);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.backpack-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 1fr;
  gap: 12px;
  align-content: start;
}
@media (max-width: 760px) {
  .backpack-grid { grid-template-columns: repeat(4, 1fr); }
}

/* прячем любые полосы прокрутки внутри инвентаря (по просьбе) */
.equip-box, .equip-body, .equip-backpack { scrollbar-width: none; }
.equip-box::-webkit-scrollbar,
.equip-body::-webkit-scrollbar,
.equip-backpack::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* пустая ячейка рюкзака */
.bp-empty {
  aspect-ratio: 1 / 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(200, 140, 255, 0.15);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.backpack-item {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  background: rgba(0,0,0,0.5);
  border: 1.5px solid rgba(220, 180, 255, 0.25);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  position: relative;
  overflow: visible;
}
.backpack-item:hover {
  transform: translateY(-2px);
  background: rgba(40, 24, 60, 0.7);
  box-shadow: 0 4px 14px rgba(0,0,0,0.5), 0 0 18px rgba(160, 100, 230, 0.22);
  z-index: 9000;   /* наведённая ячейка и её тултип — всегда поверх соседей */
}

.backpack-item[data-rarity="common"]    { border-color: rgba(154, 160, 170, 0.5); }
.backpack-item[data-rarity="uncommon"]  { border-color: rgba(90, 208, 111, 0.6); }
.backpack-item[data-rarity="rare"]      { border-color: rgba(90, 158, 255, 0.65); }
.backpack-item[data-rarity="epic"]      { border-color: rgba(181, 106, 255, 0.7); }
.backpack-item[data-rarity="legendary"] { border-color: rgba(255, 176, 64, 0.75); }

.backpack-item .bi-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 86%; height: 86%;
  font-size: 24px;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.6));
  line-height: 1;
}
.backpack-item .bi-icon img { width: 100%; height: 100%; object-fit: contain; }
.backpack-item .bi-name,
.backpack-item .bi-bonus,
.backpack-item .bi-rarity {
  display: none;
}

/* tooltip при наведении — WoW-style карточка с КРУПНОЙ иконкой */
.backpack-item .bi-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: 224px;
  padding: 14px 14px 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: linear-gradient(180deg, rgba(18,10,28,0.99), rgba(7,3,12,0.99));
  border: 1px solid rgba(220, 180, 255, 0.4);
  border-radius: 6px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 13px;
  color: #f0e4d0;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  z-index: 9001;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.05);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.backpack-item .bi-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: rgba(220, 180, 255, 0.4);
}
.backpack-item .bi-tooltip .bt-icon {
  display: flex; align-items: center; justify-content: center;
  width: 104px; height: 104px;
  margin-bottom: 6px;
  background: radial-gradient(circle at 50% 38%, rgba(160,100,230,0.22), rgba(0,0,0,0.55));
  border: 1px solid rgba(220, 180, 255, 0.3);
  border-radius: 6px;
  font-size: 34px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.7));
}
.backpack-item .bi-tooltip .bt-icon img { width: 100%; height: 100%; object-fit: contain; }
.backpack-item .bi-tooltip .bt-rarity {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.24em;
}
.backpack-item .bi-tooltip .bt-name {
  display: block;
  font-family: 'Metamorphous', serif;
  font-size: 13px;
  color: #f6ecd8;
  line-height: 1.2;
}
.backpack-item .bi-tooltip .bt-bonus {
  display: block;
  margin-top: 1px;
  color: #5ad06f;
  font-size: 11px;
  letter-spacing: 0.05em;
}
.backpack-item .bi-tooltip .bt-lore {
  display: block;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(220, 180, 255, 0.16);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 12.5px;
  line-height: 1.32;
  color: rgba(214, 198, 170, 0.85);
}
.backpack-item .bi-tooltip[data-rarity="uncommon"]  { border-color: rgba(90, 208, 111, 0.7); }
.backpack-item .bi-tooltip[data-rarity="rare"]      { border-color: rgba(90, 158, 255, 0.75); }
.backpack-item .bi-tooltip[data-rarity="epic"]      { border-color: rgba(181, 106, 255, 0.8); }
.backpack-item .bi-tooltip[data-rarity="legendary"] { border-color: rgba(255, 176, 64, 0.85);
  box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 20px rgba(255,176,64,0.3); }
.backpack-item .bi-tooltip[data-rarity="uncommon"]::after  { border-top-color: rgba(90, 208, 111, 0.7); }
.backpack-item .bi-tooltip[data-rarity="rare"]::after      { border-top-color: rgba(90, 158, 255, 0.75); }
.backpack-item .bi-tooltip[data-rarity="epic"]::after      { border-top-color: rgba(181, 106, 255, 0.8); }
.backpack-item .bi-tooltip[data-rarity="legendary"]::after { border-top-color: rgba(255, 176, 64, 0.85); }
.backpack-item:hover .bi-tooltip { opacity: 1; transform: translateX(-50%) translateY(0); }

/* верхний ряд рюкзака — тултип раскрывается ВНИЗ (чтобы не обрезался сверху) */
.backpack-item:nth-child(-n+6) .bi-tooltip {
  bottom: auto;
  top: calc(100% + 10px);
  transform: translateX(-50%) translateY(-6px);
}
.backpack-item:nth-child(-n+6):hover .bi-tooltip {
  transform: translateX(-50%) translateY(0);
}
.backpack-item:nth-child(-n+6) .bi-tooltip::after { display: none; }

/* ═══ ПАНЕЛЬ СТАТОВ ГЕРОЯ (низ модалки) ═══ */
.equip-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(200, 140, 255, 0.12);
  border-top: 1px solid rgba(200, 140, 255, 0.22);
  border-radius: 0 0 6px 6px;
  overflow: hidden;
}
.es-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(28,18,40,0.96), rgba(16,9,24,0.96));
}
.es-icon {
  font-size: 22px;
  color: var(--gold-bright, #e8c873);
  text-shadow: 0 0 10px rgba(212,175,90,0.5);
  width: 26px; text-align: center;
  flex-shrink: 0;
}
.es-info { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.es-label {
  font-family: 'Cinzel', serif;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: rgba(220, 180, 255, 0.6);
  text-transform: uppercase;
}
.es-val {
  font-family: 'Metamorphous', serif;
  font-size: 19px;
  color: #f4ead4;
  display: flex; align-items: baseline; gap: 6px;
}
.es-val .es-bonus {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  font-weight: 700;
  color: #5ad06f;
  text-shadow: 0 0 8px rgba(90,208,111,0.5);
}
.es-derived .es-icon { color: #7fb0ff; text-shadow: 0 0 10px rgba(127,176,255,0.5); }
.es-derived .es-val { color: #cfe0ff; font-size: 17px; }

@media (max-width: 760px) {
  .equip-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .equip-body { grid-template-columns: 1fr; }
  .equip-char { border-right: none; border-bottom: 1px solid rgba(200, 140, 255, 0.18); }
}
