/* inventory.css - ФИНАЛЬНАЯ ВЕРСИЯ */

.rpg-container {
    display: flex;
    gap: 20px;
    background: #111;
    padding: 25px;
    border: 1px solid #333;
    box-shadow: 0 0 30px rgba(0,0,0,1);
}

/* Сетка рюкзака */
.backpack-panel {
    width: 280px;
    background: rgba(0,0,0,0.5);
    padding: 15px;
    border: 1px solid #222;
    z-index: 2; /* Защита от перекрытия */
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.item-slot {
    width: 55px;
    height: 55px;
    background: #1a1a1a;
    border: 1px solid #333;
}

/* ЭКРАН ПЕРСОНАЖА */
.character-screen {
    width: 500px;
    background: #050505;
    border: 1px solid #222;
    position: relative;
    overflow: hidden; /* <--- ИМЕННО ЭТО ОБРЕЗАЕТ ВЫЛЕЗШИЕ КРАЯ КАРТИНКИ */
}

.char-model-container {
    position: relative;
    width: 100%;
    height: 600px;
}

/* САМА КАРТИНКА */
.char-image {
    height: 550px;
    position: absolute; /* Отвязываем картинку от сетки */
    top: 10px;
    left: 50%; /* Ставим ровно по центру */
    transform: translateX(-50%); /* Идеальное выравнивание */
    opacity: 0.9;
    z-index: 1; /* Картинка всегда позади слотов */
}

/* СЛОТЫ */
.body-slot {
    position: absolute;
    width: 55px;
    height: 55px;
    background: rgba(25, 25, 25, 0.8);
    border: 1px solid #444;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #777;
    z-index: 10;
    transition: 0.2s;
}

.body-slot:hover {
    border-color: #d4af37;
    color: #d4af37;
    background: rgba(25, 25, 25, 0.95);
}

/* ЦЕНТРАЛЬНЫЕ СЛОТЫ (Теперь они всегда строго по центру тела) */
.slot-head   { top: 25px;  left: calc(50% - 27px); }
.slot-chest  { top: 135px; left: calc(50% - 27px); }
.slot-pants  { top: 290px; left: calc(50% - 27px); }
.slot-boots  { top: 450px; left: calc(50% - 27px); }

/* БОКОВЫЕ СЛОТЫ (Руки и плечи) */
.slot-cloak  { top: 90px;  left: 90px;  }
.slot-gloves { top: 230px; left: 70px;  }
.slot-weapon { top: 230px; right: 70px; border-color: #800; }

/* НИЖНИЙ РЯД (Кольца и браслеты) */
.slot-ring-1 { bottom: 15px; left: 15px;  }
.slot-ring-2 { bottom: 15px; left: 80px;  }
.slot-ring-3 { bottom: 15px; left: 145px; }
.slot-ring-4 { bottom: 15px; left: 210px; }
.slot-ring-5 { bottom: 15px; left: 275px; }
.slot-brac-1 { bottom: 15px; left: 340px; }
.slot-brac-2 { bottom: 15px; left: 405px; }

/* ХАРАКТЕРИСТИКИ */
.stats-panel {
    width: 220px;
    background: rgba(0,0,0,0.5);
    padding: 15px;
    border: 1px solid #222;
    z-index: 2; /* Защита от перекрытия */
}

.panel-title { 
    color: #d4af37; 
    text-align: center; 
    font-size: 14px; 
    margin-bottom: 20px;
    text-transform: uppercase;
}

.stat-box p { margin: 25px 0; font-size: 15px; font-weight: bold; }
.stat-box span { color: #d4af37; float: right; }


/* Цвета редкости предметов */
.rarity-common { border-color: #b2b2b2 !important; box-shadow: inset 0 0 10px rgba(178, 178, 178, 0.2); }
.rarity-expensive { border-color: #5e98d9 !important; box-shadow: inset 0 0 10px rgba(94, 152, 217, 0.3); }
.rarity-rare { border-color: #4b69ff !important; box-shadow: inset 0 0 15px rgba(75, 105, 255, 0.4); }
.rarity-legendary { border-color: #d32ce6 !important; box-shadow: inset 0 0 15px rgba(211, 44, 230, 0.4); }

/* Мифический — самый сочный, с красным свечением */
.rarity-mythical { 
    border-color: #eb4b4b !important; 
    box-shadow: 0 0 15px rgba(235, 75, 75, 0.6), inset 0 0 20px rgba(235, 75, 75, 0.4);
    animation: mythical-pulse 2s infinite alternate;
}

@keyframes mythical-pulse {
    from { box-shadow: 0 0 10px rgba(235, 75, 75, 0.4); }
    to { box-shadow: 0 0 20px rgba(235, 75, 75, 0.8); }
}

/* Стиль для текста ресурсов (чтобы цифры были ярче) */
.stat-box.materials span {
    color: #fff;
    text-shadow: 0 0 5px rgba(255,255,255,0.3);
}

.item-clickable { position: relative; cursor: pointer; }

/* Стили окна подсказки */
.item-tooltip {
    display: none;
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid #444;
    padding: 10px;
    border-radius: 5px;
    z-index: 100;
    color: #eee;
    font-size: 13px;
    pointer-events: none;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.item-clickable:hover .item-tooltip { display: block; }

.tt-name { font-weight: bold; font-size: 15px; margin-bottom: 2px; }
.tt-rarity { font-size: 11px; opacity: 0.7; margin-bottom: 5px; }
.tt-action { margin-top: 8px; color: #ffeb3b; font-style: italic; font-size: 11px; }

/* Цвета текста редкости */
.rarity-text-mythical { color: #eb4b4b; text-shadow: 0 0 5px rgba(235, 75, 75, 0.5); }
.rarity-text-legendary { color: #d32ce6; }