body {
    background-color: #313131;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 22px 16px 28px;
    box-sizing: border-box;
}

.section-title {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
    color: #111;
    text-align: center;
}

.inventory-search {
    width: min(1180px, 100%);
    padding: 14px 16px 16px;
    box-sizing: border-box;
    background: #c6c6c6;
    border: 3px solid #1d1d1d;
    box-shadow: inset -3px -3px 0px #555555, inset 3px 3px 0px #ffffff;
}

.search-label {
    display: block;
    margin-bottom: 10px;
    font-size: 12px;
    color: #111;
}

.search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 2px solid #373737;
    background: #f4f4f4;
    color: #111;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.search-input:focus {
    border-color: #ffffff;
    box-shadow: 0 0 0 2px #111 inset;
}

.search-count {
    min-height: 18px;
    margin: 10px 0 0;
    font-size: 10px;
    line-height: 1.5;
    color: #111;
}

.inventory-wrapper {
    background-color: #c6c6c6;
    padding: 7px;
    border: 3px solid #1d1d1d;
    box-shadow: inset -3px -3px 0px #555555, inset 3px 3px 0px #ffffff;
    width: fit-content;
    overflow: visible;
}

.inventory-wrapper.drag-over {
    background-color: #b5b5b5;
}

.craft-layout {
    width: fit-content;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 22px;
    flex-wrap: nowrap;
    max-width: none;
    overflow-x: auto;
}

.crafting-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
}

.crafting-grid {
    display: grid;
    grid-template-columns: repeat(3, 48px);
    grid-auto-rows: 48px;
    gap: 0;
    width: fit-content;
    padding: 7px;
    background-color: #c6c6c6;
    border: 3px solid #1d1d1d;
    box-shadow: inset -3px -3px 0px #555555, inset 3px 3px 0px #ffffff;
}

.craft-slot {
    cursor: default;
    width: 48px;
    height: 48px;
    box-sizing: border-box;
    background: #8e8e8e;
    border: 2px solid #2a2a2a;
    box-shadow: inset 2px 2px 0 #d6d6d6, inset -2px -2px 0 #6f6f6f;
}

.craft-slot.drag-over {
    background-color: #b5b5b5;
    z-index: 10;
}

#inventory-grid {
    display: grid;
    grid-template-columns: repeat(30, 48px);
    grid-auto-rows: 48px;
    gap: 0;
    width: fit-content;
}

.slot {
    position: relative;
    overflow: visible;
    width: 48px;
    height: 48px;
    box-sizing: border-box;
    background: #8e8e8e;
    border: 2px solid #2a2a2a;
    box-shadow: inset 2px 2px 0 #d6d6d6, inset -2px -2px 0 #6f6f6f;
}

.slot:hover {
    background-color: #b5b5b5;
    z-index: 10;
}

.slot:hover::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid rgba(255, 255, 255, 1);
    pointer-events: none;
}

.block {
    width: 48px;
    height: 48px;
    margin: 0;
    flex: 0 0 auto;
    position: relative;
    float: left;
    cursor: pointer;
    font-style: normal;
    line-height: 0;
    image-rendering: pixelated;
    background-repeat: no-repeat;
    background-color: transparent;
    border: 0;
    box-shadow: none;
}

.block::before {
    width: 48px;
    height: 48px;
    position: absolute;
    top: 0;
    left: 0;
    content: "";
    background: url('images/sprite.webp') no-repeat;
    image-rendering: crisp-edges;
    background-position: var(--bg-x) var(--bg-y);
    opacity: 1;
}

.block:hover::after {
    content: attr(data-title);
    position: absolute;
    bottom: 44px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(16, 1, 32, 0.95);
    color: #ffffff;
    border: 2px solid #2d0a6d;
    padding: 5px 10px;
    font-size: 14px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.4);
}

.block[draggable="true"] {
    cursor: grab;
}

.block.dragging {
    opacity: 0.6;
    cursor: grabbing;
}

.cursor-preview {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%);
}

.cursor-preview.visible {
    opacity: 0.9;
}

.inventory-wrapper,
.crafting-grid {
    background: #c6c6c6;
    border: 3px solid #1d1d1d;
    box-shadow: inset -3px -3px 0px #555555, inset 3px 3px 0px #ffffff;
}
