:root {
    --grid-bg: #2d3748;
    --cell-bg: rgba(255, 255, 255, 0.08);
    --cell-alt-bg: rgba(255, 255, 255, 0.14);
    --highlight-bg: rgba(255, 255, 255, 0.35);
    --piece-filled: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    --occupied-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --base-cell-size: 42px;
    --grid-gap: 2px;
}

@media (max-width: 480px) {
    :root {
        --base-cell-size: 32px;
        --grid-gap: 1px;
    }
}


.blockdoku-grid {
    display: grid;
    grid-template-columns: repeat(9, var(--base-cell-size));
    grid-template-rows: repeat(9, var(--base-cell-size));
    gap: var(--grid-gap);
    background: var(--grid-bg);
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    width: fit-content;
    margin: 0 auto;
    position: relative;
}

.grid-cell {
    width: var(--base-cell-size);
    height: var(--base-cell-size);
    background: var(--cell-bg);
    border-radius: 2px;
    box-sizing: border-box;
    transition: background-color 0.2s;
}

.grid-cell.alt {
    background: var(--cell-alt-bg);
}

.grid-cell.occupied {
    background: var(--occupied-bg);
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

.grid-cell.highlight {
    background: var(--highlight-bg) !important;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.blockdoku-tray {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    width: 100%;
    min-height: 140px;
    margin-top: 2rem;
    gap: 1rem;
    box-sizing: border-box;
}

.blockdoku-piece {
    cursor: grab;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.1s ease;
    touch-action: none;
}

.blockdoku-piece-grid {
    display: grid;
    gap: var(--grid-gap);
    pointer-events: none;
}

.piece-cell {
    width: var(--base-cell-size);
    height: var(--base-cell-size);
    border-radius: 3px;
    box-sizing: border-box;
}

.piece-cell.filled {
    background: var(--piece-filled);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.piece-cell.empty {
    background: transparent;
}

.blockdoku-piece.is-dragging {
    z-index: 10000;
    opacity: 0.9;
    pointer-events: none !important;
    transform: scale(1) !important;
    transition: none !important;
}

@keyframes clearCell {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        background: #fff;
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

.grid-cell.clearing {
    animation: clearCell 0.4s forwards;
}

.game-instructions {
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1), 1px 1px 5px rgba(0, 0, 0, 0.1), 0 0px 10px rgba(0, 0, 0, 0.1);
    color: #fff;
}