/* 3x3 Puzzle Specific Styles - Match the image exactly */

/* 3x3 Board Specific Styling - Match the image layout */
.board--3x3 {
    width: 30vw;
    height: 30vw;
    min-width: 300px;
    min-height: 300px;
    margin: 10px auto;
    border: 2px solid steelblue;
    background: rgb(235, 239, 245);
    box-sizing: border-box;
    border-radius: 5px;
    font-size: 40px;
    color: steelblue;
}

/* Cells for 3x3 - Match the main game styling */
.board--3x3 .cell {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 1px solid steelblue;
    box-shadow: 1px 1px 0 0 rgba(0, 0, 0, 0.2);
    margin: 2px;
    border-radius: 5px;
    transition: all 0.1s ease-in;
    position: absolute;
    background: white;
    font-size: 40px;
    color: steelblue;
}

.board--3x3 .cell--can-move {
    cursor: pointer;
}

.board--3x3 .cell:hover {
    transform: scale(1.02);
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Game Stats for 3x3 */
.game-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 20px auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    max-width: 500px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.game-stats > div {
    text-align: center;
    font-weight: bold;
    color: #4682b4;
}

.game-stats__moves {
    font-size: 1.2em;
}

.game-stats__local {
    font-size: 1.1em;
}

.game-stats__global {
    font-size: 1.1em;
    color: #28a745;
}

/* Controls for 3x3 */
.controls {
    /* match site-wide controls width so buttons don't stretch full-width */
    margin: 0 auto 20px;
}

.controls__main {
    display: flex;
    justify-content: space-between; /* match global layout */
    gap: 10px;
    margin: 10px 0;
    flex-wrap: wrap;
    width: 30vw;
    min-width: 300px;
}

.controls button {
    /* use global button rules; only tweak if necessary */
    padding: 8px 12px;
    font-size: 0.95em;
}

/* Instructions specific to 3x3 */
.instructions .example-board {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 4px;
    width: 180px;
    height: 180px;
    margin: 15px auto;
    border: 2px solid #4682b4;
    border-radius: 8px;
    padding: 4px;
    background: #f0f8ff;
}

.example-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #4682b4;
    border-radius: 3px;
    font-weight: bold;
    color: #4682b4;
    font-size: 14px;
}

.example-tile.empty {
    background: #e9ecef;
    color: #6c757d;
    font-style: italic;
    font-size: 10px;
}

.tip {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    padding: 10px;
    margin: 15px 0;
    color: #856404;
}

/* Win screen for 3x3 */
.win--3x3 {
    text-align: center;
    padding: 20px;
}

.win--3x3 h2 {
    color: #28a745;
    font-size: 2em;
    margin: 10px 0;
}

.win--3x3 .celebration {
    font-size: 3em;
    margin: 10px 0;
}

.win--3x3 .stats {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    border: 2px solid #28a745;
}

.win--3x3 .stats div {
    margin: 5px 0;
    font-size: 1.1em;
}

/* Mobile optimizations for 3x3 */
@media (max-width: 480px) {
    .board--3x3 {
        width: 270px;
        height: 270px;
        min-width: 270px;
        min-height: 270px;
    }
    
    .board--3x3 .cell {
        font-size: 24px;
    }
    
    .game-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .controls__main {
        flex-direction: column;
        align-items: center;
    }
    
    .controls button {
        width: 200px;
    }
}

/* Animation for 3x3 completion */
@keyframes celebrate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.board--3x3.completed {
    animation: celebrate 0.6s ease-in-out;
}

/* 3x3 cells use standard steelblue styling - no custom colors */
