* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #131313;
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.inventory-container {
    padding: 5px;
    width: 100%;
}

.inventory-title {
    color: #ffffff;
    font-size: 24px;
    margin-bottom: 15px;
    text-align: center;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 6px;
    max-width: 100%;
}

.cube-button {
    position: relative;
    width: 100%;
    background: #2a2a2a;
    border: 1px solid #ccc;
    cursor: pointer;
    font-size: 14px; /* Base desktop/tablet size */
    color: #fff;
    padding: 0;
}

.cube-button::before {
    content: '';
    display: block;
    padding-top: 100%; /* Square fallback for older browsers */
}

.cube-button > span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cube-button:hover {
    background: #d0d0d0;
}

.cube-button:active {
    background: #c0c0c0;
}

/* Visible focus for D-pad navigation */
.cube-button:focus {
    outline: 2px solid #007aff;
    outline-offset: 2px;
}

/* (removed) softkeys styles */

/* Responsive column counts */
@media (max-width: 640px) {
    .inventory-grid { grid-template-columns: repeat(9, 1fr); }
    .cube-button { font-size: 13px; }
}

@media (max-width: 480px) {
    .inventory-grid { grid-template-columns: repeat(6, 1fr); }
    .cube-button { font-size: 12px; }
}

@media (max-width: 360px) {
    .inventory-grid { grid-template-columns: repeat(4, 1fr); }
    .cube-button { font-size: 11px; }
}

@media (max-width: 280px) {
    .inventory-grid { grid-template-columns: repeat(3, 1fr); }
    .cube-button { font-size: 10px; }
}

