.grid {
    display: grid;
    grid-template-columns: repeat(5, 8.519vh);
    grid-auto-rows: 8.519vh;
    gap: 0.741vh;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.grid::-webkit-scrollbar {
    width: 0;
}

.grid-left {
    max-height: 36.296vh;
}

.grid-backpack {
    max-height: 17.778vh;
}

.grid-right {
    max-height: 54.815vh;
}

.slot {
    position: relative;
    width: 8.519vh;
    height: 8.519vh;
    border: 1px solid var(--line);
    border-radius: 0.648vh;
    background: var(--slot);
    overflow: hidden;
}

.slot.filled {
    cursor: grab;
}

.slot:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--slot-hover);
}

.slot.selected {
    border: 2px solid var(--brand);
    box-shadow: 0 0 1.481vh var(--brand-glow);
}

.slot.drop-target {
    border-color: var(--brand);
    background: var(--brand-drop);
}

.slot.dragging {
    opacity: 0.35;
}

.slot.locked {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--slot-locked);
    cursor: default;
}

.slot.locked:hover {
    border-color: var(--line);
    background: var(--slot-locked);
}

.slot-lock {
    font-size: 1.481vh;
    color: var(--text-faint);
}

.slot-image {
    position: absolute;
    top: 1.019vh;
    left: 0;
    right: 0;
    height: 5.463vh;
    background: center / contain no-repeat;
    pointer-events: none;
}

.slot.filled:hover .slot-image {
    transform: scale(1.06);
}

.slot-weight {
    position: absolute;
    top: 0.37vh;
    left: 0.463vh;
    font-size: 0.833vh;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-faint);
    pointer-events: none;
}

.slot-count {
    position: absolute;
    top: 0.278vh;
    right: 0.463vh;
    font-size: 0.926vh;
    font-weight: 700;
    line-height: 1.2;
    pointer-events: none;
}

.slot-label {
    position: absolute;
    left: 0.37vh;
    right: 0.37vh;
    bottom: 0.556vh;
    font-size: 0.926vh;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-label);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.slot-durability {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 0.185vh;
    background: var(--brand);
    pointer-events: none;
}

.slot-durability.low {
    background: var(--danger);
}

.slot-price {
    position: absolute;
    top: 0.278vh;
    right: 0.463vh;
    padding: 0.093vh 0.37vh;
    border-radius: 0.278vh;
    background: var(--brand);
    font-size: 0.833vh;
    font-weight: 700;
    line-height: 1.2;
}

.slot-hotkey {
    position: absolute;
    bottom: 0.556vh;
    left: 0.463vh;
    font-size: 0.833vh;
    font-weight: 700;
    color: var(--brand);
    pointer-events: none;
}

.slot.wear {
    width: 7.593vh;
    height: 7.593vh;
    cursor: pointer;
}

.slot.wear .slot-image {
    top: 0.926vh;
    height: 4.815vh;
    mix-blend-mode: lighten;
}

.slot.wear .slot-label {
    bottom: 0.463vh;
}

.wear-icon {
    position: absolute;
    top: 2.5vh;
    left: 0;
    right: 0;
    font-size: 2.13vh;
    line-height: 2.407vh;
    text-align: center;
    color: var(--text-body);
}

.slot.wear:hover .wear-icon {
    opacity: 0.8;
}

.slot.wear.worn {
    border-color: var(--brand);
    background: linear-gradient(180deg, transparent 40%, var(--brand-drop)), var(--slot);
}

.slot.wear.worn .wear-icon {
    color: var(--text);
}

.slot.wear.off {
    opacity: 0.45;
}

.card {
    position: absolute;
    top: 0;
    left: 0;
    width: 24.074vh;
    display: flex;
    flex-direction: column;
    gap: 0.556vh;
    padding: 1.111vh 0.741vh 0.741vh;
    border-radius: 0.833vh;
    background: var(--surface);
    box-shadow: 0 0.926vh 2.778vh var(--shadow-panel);
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.741vh) scale(0.97);
    transition: opacity 150ms ease, transform 200ms var(--ease), visibility 0s linear 200ms;
    z-index: 20;
}

.card.open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 150ms ease, transform 200ms var(--ease);
}

.card-title {
    padding: 0 0.556vh;
    font-family: var(--font-display);
    font-size: 1.667vh;
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0.093vh;
    text-transform: uppercase;
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 0.741vh;
    padding: 0 0.556vh 0.556vh;
}

.card-type {
    font-size: 1.019vh;
    font-weight: 500;
    line-height: 1.21;
    color: var(--text-sub);
}

.card-description {
    font-size: 1.111vh;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text-body);
}

.card-description:empty {
    display: none;
}

.card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.463vh;
}

.card-meta:empty {
    display: none;
}

.card-meta li {
    display: flex;
    justify-content: space-between;
    gap: 1.111vh;
    font-size: 1.019vh;
    line-height: 1.21;
}

.card-meta span {
    font-weight: 500;
    color: var(--text-sub);
}

.card-meta strong {
    font-weight: 700;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-durability {
    display: flex;
    flex-direction: column;
    gap: 0.463vh;
}

.card-durability-label {
    display: flex;
    justify-content: space-between;
    font-size: 1.019vh;
    line-height: 1.21;
}

.card-durability-label span {
    font-weight: 500;
    color: var(--text-sub);
}

.card-durability-label strong {
    color: var(--brand);
}

.card-bar {
    position: relative;
    height: 0.37vh;
    border-radius: 0.185vh;
    background: var(--line-strong);
    overflow: hidden;
}

.card-bar span {
    position: absolute;
    inset: 0;
    border-radius: 0.185vh;
    background: linear-gradient(90deg, var(--brand), var(--brand-deep));
    box-shadow: 0 0 0.741vh var(--brand-strong-glow);
    transform-origin: left;
}

.card.low .card-durability-label strong {
    color: var(--danger);
}

.card.low .card-bar span {
    background: var(--danger);
    box-shadow: none;
}

.card-divider {
    height: 1px;
    background: var(--divider);
}

.card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.185vh;
}

.action {
    display: flex;
    align-items: center;
    gap: 0.926vh;
    padding: 0.556vh 0.741vh 0.556vh 0.556vh;
    border-radius: 0.556vh;
    cursor: pointer;
}

.action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.407vh;
    height: 2.407vh;
    border-radius: 0.648vh;
    background: var(--neutral);
    font-size: 1.111vh;
}

.action-icon i {
    font-size: 1.111vh;
}

.action-label {
    flex: 1;
    min-width: 0;
    font-size: 1.204vh;
    font-weight: 600;
    line-height: 1.21;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.action.active {
    background: linear-gradient(90deg, var(--brand), var(--brand-deep));
    box-shadow: 0 0 1.111vh var(--brand-glow);
}

.action.active .action-icon,
.action.active .keycap {
    background: var(--tile-active);
}

.action.active .keycap {
    background: var(--keycap-light);
}

.drag-ghost {
    position: fixed;
    top: 0;
    left: 0;
    display: none;
    width: 8.519vh;
    height: 8.519vh;
    border: 2px solid var(--brand);
    border-radius: 0.648vh;
    background: var(--slot);
    box-shadow: 0 0.926vh 2.778vh var(--shadow-panel), 0 0 1.481vh var(--brand-glow);
    pointer-events: none;
    z-index: 30;
}

.drag-ghost.active {
    display: block;
}

.drag-ghost .slot-image {
    top: 1.019vh;
}

.hotbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 3.704vh;
    display: flex;
    justify-content: center;
    gap: 0.741vh;
    opacity: 0;
    transform: translateY(1.111vh);
    pointer-events: none;
    transition: opacity 250ms ease, transform 300ms var(--ease);
}

.hotbar.open {
    opacity: 1;
    transform: none;
}

.hotbar .slot {
    cursor: default;
}

.item-notify {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 16.667vh;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 0.556vh;
    pointer-events: none;
}

.notify-item {
    display: flex;
    align-items: center;
    gap: 0.926vh;
    padding: 0.556vh 1.296vh 0.556vh 0.556vh;
    border-radius: 0.648vh;
    background: var(--surface);
    box-shadow: 0 0.37vh 1.111vh var(--shadow-item);
    animation: notify-in 250ms var(--ease) both;
}

.notify-item.leaving {
    animation: notify-out 250ms ease forwards;
}

@keyframes notify-in {
    from {
        opacity: 0;
        transform: translateY(0.741vh);
    }
}

@keyframes notify-out {
    to {
        opacity: 0;
        transform: translateY(-0.741vh);
    }
}

.notify-image {
    width: 3.333vh;
    height: 3.333vh;
    border-radius: 0.463vh;
    background: var(--slot) center / 2.778vh no-repeat;
}

.notify-text {
    display: flex;
    flex-direction: column;
    line-height: 1.21;
    white-space: nowrap;
}

.notify-text span {
    font-size: 0.926vh;
    font-weight: 700;
    letter-spacing: 0.139vh;
    color: var(--brand);
    text-transform: uppercase;
}

.notify-text strong {
    font-size: 1.204vh;
    font-weight: 700;
}

.slot-price,
.action.active,
.action.active .action-icon i,
.action.active .action-label,
.action.active .keycap {
    color: var(--brand-text);
}