.inventory-container {
    font-family: 'press_start_2pregular', monospace;
    background-color: #ffffffbb;
    color: #000000;
    font-size: 0.6em;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
    border: 4px groove #555;
    border-radius: 12px;
    min-width: 400px;
    min-height: 464px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    backdrop-filter: blur(2px);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 10px;
    padding: 10px;
    background: #b0b0b0;
    border-radius: 8px;
    border: 2px inset #444;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.7);
}

.inventory-slot {
    width: 64px;
    height: 64px;
    background: #ffffff;
    border: 2px solid #444;
    border-radius: 6px;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease, background 0.2s;
    position: relative;
}

.inventory-slot::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    bottom: 1px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.inventory-slot:hover {
    background-color: #222;
    transform: scale(1.05);
    border-color: #666;
}

.inventory-slot::after {
    content: "";
    width: 16px;
    height: 16px;
    background: url("../../media/Game/GameObjects/Loot/slot-placeholder.png") center center no-repeat;
    background-size: contain;
    opacity: 0.1;
}

.inventory-item {
    position: relative;
    width: 90%;
    height: 90%;
}

.inventory-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.item-qty {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 10px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 1px 3px;
    border-radius: 3px;
    pointer-events: none;
    text-shadow: 1px 1px 0 #000;
}

.inventory-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: -4px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.inventory-tab {
    background: linear-gradient(to bottom, #444, #222);
    color: #fff;
    border: 2px outset #666;
    box-shadow: 1px 1px 0 #000;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 0.9em;
    font-family: 'press_start_2pregular', monospace;
    cursor: url(../../media/UI/pointer.png), pointer !important;
    transition: background 0.2s;
    text-transform: uppercase;
}

.inventory-tab:hover {
    background: #aaa;
}

.inventory-tab.active {
    background: linear-gradient(to bottom, #aaa, #888);
    color: #222;
    font-weight: bold;
}

.inventory-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    position: relative;
    padding-bottom: 8px;
    margin-bottom: 4px;
    border-bottom: 2px dashed #888;
    cursor: url(../../media/UI/drag.png), pointer !important;
}

.inventory-header h3 {
    grid-column: 2;
    text-align: center;
    font-size: 1em;
    color: #000;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.item-icon {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.item-quantity {
    position: absolute;
    bottom: 2px;
    right: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 4px;
}

.inventory-close-btn {
    grid-column: 3;
    justify-self: end;
    background: #aa0000;
    color: white;
    font-family: 'press_start_2pregular', monospace;
    border: 2px solid #440000;
    border-radius: 4px;
    font-size: 1em;
    padding: 12px 24px;
    cursor: url(../../media/UI/pointer.png), pointer !important;
    transition: background 0.2s;
}

.inventory-close-btn:hover {
    background: #ff0000;
}

.inventory-footer {
    display: flex;
    justify-content: space-between; /* Spread the Apollis and the rest */
    align-items: center;
    padding-top: 8px;
    border-top: 2px dashed #888;
    font-size: 0.8em;
    font-family: 'press_start_2pregular', monospace;
    color: #000;
}

.inventory-money {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9em;
    box-shadow: inset 0 0 4px #000;
}

.money-icon {
    width: 20px;
    height: 20px;
    image-rendering: pixelated;
}

.money-value {
    margin-right: 8px;
    font-size: 0.9em;
}


.inventory-slot.selected {
    outline: 2px solid yellow;
    animation: pulse 0.5s infinite alternate;
}

@keyframes pulse {
    from { box-shadow: 0 0 2px yellow; }
    to   { box-shadow: 0 0 10px yellow; }
}

.inventory-currency {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9em;
    box-shadow: inset 0 0 4px #000;
    background: #eee;
}

.premium-currency {
    justify-content: flex-start;
    background: #ffe4b5;
    border: 2px solid rgb(0, 0, 0);
    box-shadow: inset 0 0 6px gold, 0 0 8px rgba(255, 215, 0, 0.7);
}
.premium-currency:hover {
    background: #ffffff;
    border: 2px solid rgb(0, 0, 0);
    box-shadow: inset 0 0 6px gold, 0 0 8px rgba(149, 129, 16, 0.7);
}

.standard-currency {
    justify-content: flex-end;
    background: #ddd;
}

.inventory-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 16px;
    position: fixed;
    top: 10%;
    left: 10%;
    z-index: 1000;
}

.inventory-equipment {
    min-width: 400px;
    max-height: 500px;
    display: flex;
    flex-direction: column;
    font-family: 'press_start_2pregular', monospace;
    background-image: url(/media/Game/UI/Inventory/nullEquips.png);
    background-size: 564px 350px;
    background-repeat: no-repeat;
    color: #000000;
    font-size: 0.6em;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
    border: 4px groove #555;
    border-radius: 12px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    backdrop-filter: blur(2px);
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

@media (max-width: 1000px) {
    .inventory-equipment {
        background-image: none;
    }
}



.equipment-slot {
    font-size: 10px;
    text-transform: capitalize;
    cursor: url(../../media/UI/pointer.png), pointer !important;
    min-width: 64px;
    height: 64px;
    background: #ffffff;
    border: 2px solid #444;
    border-radius: 6px;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease, background 0.2s;
    position: relative;
}

.equipment-slot:hover {
    background: #333;
}

.equipment-row {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.accessory-row {
    gap: 32px;
    margin-top: 6px;
}

.chest-hand-row {
    gap: 64px;
    margin-top: 6px;
}

.inventory-tooltip {
    background-color: rgba(0, 0, 0, 0.596); /* dark background */
    color: #eee;
    padding: 8px 12px;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    max-width: 280px;
    line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.15);
    pointer-events: none;
    z-index: 10000;
    white-space: normal;
}

.inventory-tooltip strong {
    font-weight: bold;
    display: block;
    margin: 0 auto;
    text-align: center;
}

.inventory-tooltip em {
    font-style: italic;
    color: #ccc;
    display: block;
    margin-bottom: 6px;
}

.inventory-tooltip .rarity-common { color: #ffffff !important; }
.inventory-tooltip .rarity-uncommon { color: #ff8c00 !important; }
.inventory-tooltip .rarity-rare { color: #ffd700 !important; }
.inventory-tooltip .rarity-epic { color: #a020f0 !important; }
.inventory-tooltip .rarity-legendary { color: #8b0000 !important; }



.inventory-context-menu {
    position: fixed;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    padding: 5px 0;
    min-width: 120px;
    z-index: 1000;
    list-style-type: none;
    margin: 0;
}

.inventory-context-menu li {
    padding: 8px 15px;
    cursor: pointer;
    color: #ddd;
    font-size: 14px;
}

.inventory-context-menu li:hover {
    background-color: #444;
    color: #fff;
}

.item-inspect-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.item-inspect-content {
    background-color: #2a2a2a;
    border: 2px solid #444;
    border-radius: 8px;
    padding: 20px;
    max-width: 500px;
    width: 90%;
    position: relative;
}

.item-inspect-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
}

.item-inspect-close:hover {
    color: #fff;
}

.item-display {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.inspect-item-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background-color: #333;
    border: 1px solid #555;
    border-radius: 4px;
}

.item-details {
    flex: 1;
}

.item-details h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 20px;
}

.item-description {
    color: #aaa;
    font-style: italic;
    margin-bottom: 15px;
}

.item-stats {
    border-top: 1px solid #444;
    padding-top: 10px;
}

.item-stats p {
    margin: 5px 0;
}

.inventory-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1000;
    font-size: 14px;
    display: none;
}

/* Rarity colors */
.rarity-common { color: #aaa; }
.rarity-uncommon { color: #2ecc71; }
.rarity-rare { color: #3498db; }
.rarity-epic { color: #9b59b6; }
.rarity-legendary { color: #f1c40f; }