/* ── inventory panel ─────────────────────────────────────────────────────────── */

#player-inventory {
    margin-top: 2rem;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.inv-waiting {
    color: #666;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

/* ── tabs (pill style) ───────────────────────────────────────────────────────── */
.inv-tabs {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 1.25rem;
    background: #111;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #222;
}

.inv-tab {
    background: transparent;
    border: none;
    color: #666;
    font-family: 'Geist', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.4rem 0.9rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.inv-tab:hover {
    color: #aaa;
    background: #1a1a1a;
}

.inv-tab.active {
    color: #fff;
    background: #222;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

/* ── panels ────────────────────────────────────────────────────────────────── */
.inv-panel.hidden { display: none; }

.inv-main-area {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

/* ── slots & grids ──────────────────────────────────────────────────────────── */
.inv-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr); 
    gap: 3px;
    width: max-content; 
    max-width: 100%;  /*.. PLEASE dont overflow IM BEGGING YOUUUU */
}

.inv-armor-col {
    display: grid;
    grid-template-columns: 36px;
    gap: 3px;
}

.inv-hotbar-wrap {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #1a1a1a;
}

.inv-slot {
    width: 36px;
    height: 36px;
    background: #0f0f0f;
    border: 1px solid #222;
    border-radius: 4px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    image-rendering: pixelated;
    transition: transform 0.1s ease, border-color 0.2s ease, background 0.2s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
}

.inv-slot.filled {
    border-color: #333;
    background: #161616;
}

.inv-slot.filled:hover {
    border-color: #444;
    background: #1c1c1c;
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.inv-slot img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* stack count badge */
.inv-count {
    position: absolute;
    bottom: 2px;
    right: 3px;
    font-size: 10px;
    font-family: 'Geist', sans-serif;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
    pointer-events: none;
    z-index: 5;
}

/* ── shulker popup ───────────────────────────────────────────────────────────── */
.shulker-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    margin: 0 0 8px 2px;
    font-family: 'Geist', sans-serif;
}

.shulker-grid {
    display: grid;
    grid-template-columns: repeat(9, 30px);
    gap: 2px; 
    width: max-content;  /* i'll be SUPER mad if you overflow again.*/
}

.shulker-grid .inv-slot {
    width: 30px;
    height: 30px;
    border-radius: 3px;
}

.shulker-grid .inv-slot img {
    width: 22px;
    height: 22px;
}

/* Subtle indicator for interactive items */
.inv-slot.filled[title*="Shulker"] {
    cursor: pointer;
}

.inv-slot.filled[title*="Shulker"]::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 4px;
    height: 4px;
    background: #555;
    border-radius: 50%;
}

/* ── tooltip styling ────────────────────────────────────────────────────────── */
.item-tooltip, .shulker-popup {
    position: fixed; /* Ensures JS positioning works correctly */
    z-index: 10000;
    background: rgba(16, 1, 16, 0.98);
    border: 2px solid #280659;
    padding: 12px;
    pointer-events: none;
    /* Allow it to expand to fit the 9-slot grid, but not more than the screen */
    width: max-content;
    max-width: 90vw; 
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.9);
}

    .item-tooltip.sticky {
    pointer-events: auto;
}

.tt-name { 
    display: block; 
    font-weight: 700; 
    margin-bottom: 4px; 
    font-size: 0.9rem;
}

/* Rarity/Type Colors */
.tt-name.rarity-uncommon { color: #ffff55; }
.tt-name.rarity-rare { color: #55ffff; }
.tt-name.rarity-epic { color: #ff55ff; }

.tt-enchants {
    color: #7f7f7f;
    font-size: 0.8rem;
    margin: 4px 0;
}

.tt-enchant-line { display: block; color: #aaaaaa; }

.tt-lore {
    color: #aa00aa;
    font-size: 0.8rem;
    font-style: italic;
    margin-top: 4px;
    border-top: 1px solid #333;
    padding-top: 4px;
}

/* Shulker Grid inside Tooltip */
.tt-shulker-grid {
    margin-top: 8px;
    border-top: 1px solid #333;
    padding-top: 8px;
    display: grid;
    grid-template-columns: repeat(9, 30px);
    gap: 2px;
}

@media (max-width: 400px) {  /* turns out some ppl have smaller phones? */
    .inv-slot {
        width: 32px;
        height: 32px;
    }
    .inv-grid {
        grid-template-columns: repeat(9, 32px);
        gap: 1px;
    }
    .inv-slot img {
        width: 22px;
        height: 22px;
    }
}