#timerDisplay {
    display: none !important;
}

:root {
    /* Migrate away from --wood-* to generic system vars */
    --cell-size: min(10vw, 40px);
    --grid-gap: 2px;
}

/* Base Grid Container */
.grid-9x9 {
    display: grid;
    grid-template-columns: repeat(9, var(--cell-size));
    grid-template-rows: repeat(9, var(--cell-size));
    gap: var(--grid-gap);
    background-color: var(--border-color, #ccc);
    /* Fallback */
    padding: var(--grid-gap);
    border-radius: 4px;
    margin: 0 auto;
    touch-action: none;
}

/* Empty Cell */
.cell {
    background-color: var(--panel-bg, #fff);
    border-radius: 2px;
    width: var(--cell-size);
    height: var(--cell-size);
    transition: background-color 0.1s;
}

/* 3x3 Subgrid emphasis (Checkerboard) */
.cell:nth-child(n+1):nth-child(-n+3),
.cell:nth-child(n+10):nth-child(-n+12),
.cell:nth-child(n+19):nth-child(-n+21),
.cell:nth-child(n+7):nth-child(-n+9),
.cell:nth-child(n+16):nth-child(-n+18),
.cell:nth-child(n+25):nth-child(-n+27),
.cell:nth-child(n+31):nth-child(-n+33),
.cell:nth-child(n+40):nth-child(-n+42),
.cell:nth-child(n+49):nth-child(-n+51),
.cell:nth-child(n+37):nth-child(-n+39),
.cell:nth-child(n+46):nth-child(-n+48),
.cell:nth-child(n+55):nth-child(-n+57),
.cell:nth-child(n+55):nth-child(-n+57),
.cell:nth-child(n+61):nth-child(-n+63),
.cell:nth-child(n+70):nth-child(-n+72),
.cell:nth-child(n+79):nth-child(-n+81),
.cell:nth-child(n+67):nth-child(-n+69),
.cell:nth-child(n+76):nth-child(-n+78) {
    /* Optional: slightly different background for 3x3 sections handled via .subgrid-alt */
}

/* Better 3x3 pattern using CSS */
.cell.subgrid-alt {
    /* Use a standard translucent fill for checkerboard */
    background-color: var(--bg-secondary, rgba(0, 0, 0, 0.05));
}

[data-theme='dark'] .cell.subgrid-alt {
    background-color: rgba(255, 255, 255, 0.05);
    /* Subtle light in dark mode */
}


/* Clearing Animation */
@keyframes clearFlash {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.1);
        filter: brightness(1.5);
        background-color: var(--game-accent-soft, #ffd700);
    }

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

.cell.clearing {
    animation: clearFlash 0.4s ease-in-out forwards;
    z-index: 10;
}

/* Filled Cell (Placed Block) */
.cell.filled,
[data-theme='dark'] .cell.filled {
    background-color: var(--game-accent, #007bff);
    /* No wood gradient! Clean flat color */
    box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
}

.block-spawn-area {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    min-height: 120px;
    margin-bottom: 20px;
}

.block-slot {
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.block {
    display: grid;
    gap: 1px;
    cursor: grab;
    touch-action: none;
    transition: transform 0.1s;
}

.block:active {
    cursor: grabbing;
    transform: scale(1.1);
}

/* Draggable Block Cells */
.block-cell {
    width: 20px;
    height: 20px;
    background-color: var(--game-accent, #007bff);
    border-radius: 2px;
}

/* Dragging state */
.block.dragging {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    transform: scale(1.1);
    /* Only scale, don't translate here */
    opacity: 0.9;
}

/* Highlighting where it will land */
.cell.highlight {
    background-color: var(--game-accent-soft, rgba(0, 123, 255, 0.3));
}

.cell.invalid {
    background-color: var(--error-color, rgba(255, 0, 0, 0.2));
}

/* Modal Improvements */
#completionModal .stats-row {
    margin-bottom: 24px;
    width: 100%;
    display: flex;
    justify-content: center;
}

#completionModal .stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

#completionModal .stat-value-lg {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}