#inventory-grid {
    display: grid;
    grid-template-columns: repeat(3, 120px);
    grid-auto-rows: 120px;
    gap: 10px;
    padding: 10px;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    position: relative;
}

.inventory-item {
    width: 120px;
    height: 120px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: grab;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.inventory-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--rarity-color, rgba(27, 217, 106, 0.1)), transparent);
    z-index: -1;
    opacity: 0.1;
}

.inventory-item:hover::before {
    left: 100%;
    transition-duration: 0.4s;
}

.inventory-item:hover {
    box-shadow: 0 10px 20px var(--rarity-shadow-color, rgba(0, 0, 0, 0.1));
    background: rgba(255, 255, 255, 0.005);
        border-color: var(--rarity-color, #1bd96a);
    transform: translateY(-5px) scale(1.02);
    z-index: 2;
}

.mythical-border:hover {
    border-image: linear-gradient(to right, #54478c, #2c699a, #048ba8, #0db39e, #16db93, #83e377, #b9e769, #efea5a, #f1c453, #f29e4c, #54478c) 1;
}

.save-button {
    padding: 5px 10px;
    font-size: 12px;
    background: #1bd96a;
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    transform: scale(1);
    margin-top: 10px;
}

#inventory-grid::-webkit-scrollbar {
    display: none;
}

.save-button:active {
    transform: scale(0.95);
    background: #17B252;
}

.save-button:disabled {
    background: #404040;
    cursor: not-allowed;
}

.item-name {
    font-weight: bold;
    font-size: 0.8em;
}

.item-rarity {
    font-size: 0.6em;
}

.inventory-item:hover .item-details {
    filter: blur(2px) brightness(50%);
    transition: filter 0.2s ease-in-out;
}

.empty-inventory-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #888;
}

.empty-inventory-message .secondary-text {
    color: #666;
}

.sell-container {
    position: absolute;
    bottom: 14px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.inventory-item:hover .sell-container {
    opacity: 1;
}

.sell-button {
    background-color: rgba(40, 40, 40, 0.5);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.sell-button:hover {
    transform: scale(1.1);
    background-color: rgba(50, 50, 50, 0.7);
}

.item-price {
    margin-top: 5px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.9);
}