/* TickelPickel - Grid Styles */

.game-grid-container {
    display: flex;
    justify-content: center;
    padding: 10px;
}

.game-grid {
    display: grid;
    gap: 3px;
    background-color: #333;
    border-radius: 12px;
    padding: 3px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
}

/* Dynamic grid sizes */
.game-grid[data-size="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.game-grid[data-size="5"] {
    grid-template-columns: repeat(5, 1fr);
}

.game-grid[data-size="6"] {
    grid-template-columns: repeat(6, 1fr);
}

.game-grid[data-size="8"] {
    grid-template-columns: repeat(8, 1fr);
}

/* Cell base styles */
.cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.1s ease, filter 0.15s ease, box-shadow 0.15s ease;
    border-radius: 6px;
    user-select: none;
    position: relative;
    font-weight: 700;
}

.cell:hover {
    transform: scale(1.03);
    filter: brightness(1.1);
    z-index: 1;
}

.cell:active {
    transform: scale(0.97);
}

/* Cell content */
.cell-content {
    font-size: 2rem;
    line-height: 1;
}

/* Adjust font size based on grid size */
.game-grid[data-size="5"] .cell-content {
    font-size: 1.8rem;
}

.game-grid[data-size="6"] .cell-content {
    font-size: 1.5rem;
}

.game-grid[data-size="8"] .cell-content {
    font-size: 1.2rem;
}

/* Cell states */
.cell.empty .cell-content::after {
    content: '';
}

.cell.marked .cell-content::after {
    content: 'X';
    color: rgba(0, 0, 0, 0.4);
    font-weight: 800;
}

.cell.pickle .cell-content::after {
    content: '🥒';
}

/* Violation state */
.cell.violation {
    box-shadow: inset 0 0 0 3px #ef4444, 0 0 10px rgba(239, 68, 68, 0.5);
}

/* Hint state */
.cell.hinted {
    box-shadow: inset 0 0 0 3px #fbbf24, 0 0 15px rgba(251, 191, 36, 0.6);
}

/* Locked cells (pre-placed pickles) */
.cell.locked {
    cursor: not-allowed;
    opacity: 0.9;
}

.cell.locked::before {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
}

/* Region borders for better visibility */
.cell[data-border-top="true"] {
    border-top: 2px solid #333;
}

.cell[data-border-right="true"] {
    border-right: 2px solid #333;
}

.cell[data-border-bottom="true"] {
    border-bottom: 2px solid #333;
}

.cell[data-border-left="true"] {
    border-left: 2px solid #333;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .game-grid {
        max-width: 320px;
        gap: 2px;
        padding: 2px;
    }

    .cell {
        border-radius: 4px;
    }

    .cell-content {
        font-size: 1.5rem;
    }

    .game-grid[data-size="5"] .cell-content {
        font-size: 1.3rem;
    }

    .game-grid[data-size="6"] .cell-content {
        font-size: 1.1rem;
    }

    .game-grid[data-size="8"] .cell-content {
        font-size: 0.9rem;
    }
}
