body, html {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f1c2d7;
}

#board {
    display: grid;
    grid-template-columns: repeat(3, 180px);
    gap: 8px; /* Small gap to ensure grids are separated */
    background-color: #9d54b3;
    box-sizing: border-box;
    overflow: visible; /* Allow overflow to prevent clipping */
    border: solid #9d54b3 8px;
}

.title-container {
    text-align: center;
    margin-bottom: 20px; /* Space between the title and the board */
}

.title-image {
    max-width: 100%;
    height: auto;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 60px);
    gap: 1px;
    background-color: #fe66c3;
    transition: transform 0.2s ease; /* Only transform, no border transition */
    cursor: pointer;
    position: relative; /* Relative position to contain zoom */
    overflow: visible; /* Ensure the zoom effect isn't clipped */
    box-sizing: border-box; /* Include padding and border in the total width and height */
}

.cell {
    width: 60px;
    height: 60px;
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    cursor: pointer;
    box-sizing: border-box; /* Include padding and borders in size */
}

.cell:hover {
    background-color: #eee;
}

.highlight {
    background-color: #00e25f;    
}

.zoom {
    transform: scale(1.5); /* Small zoom effect */
    z-index: 1; /* Normal stacking order */
    border: 2px solid #333; /* Border to ensure visibility */
}

.active-grid {
    border: 2px solid #333; /* Keep border consistent */
    cursor: pointer;
    box-sizing: border-box; /* Include border in size calculations */
    overflow: visible; /* Ensure borders are not clipped */
}

.active-grid.mini-grid {
    background-color: #38b6ff;
}

.mini-grid.zoom.active-grid {
    border-right: 2px solid black;
    width: 103.5%;
}

button#resetZoomButton {
    padding: 10px 20px; /* Padding for a better click area */
    font-size: 16px; /* Readable font size */
    background-color: #38b6ff; /* Blue background to stand out */
    color: #fff; /* White text color */
    border: none; /* Remove default border */
    border-radius: 5px; /* Slightly rounded corners */
    cursor: pointer; /* Pointer cursor on hover */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Shadow for a lifted effect */
    transition: background-color 0.3s ease; /* Smooth background color transition */
}

button#resetZoomButton:hover {
    background-color: #1e90ff; /* Darker blue on hover */
}

button#resetZoomButton:active {
    background-color: #1c86ee; /* Even darker blue on click */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Reduce shadow when active */
}

button#rejouer {
    padding: 10px 20px; /* Padding for a better click area */
    font-size: 16px; /* Readable font size */
    background-color: #38b6ff; /* Blue background to stand out */
    color: #fff; /* White text color */
    border: none; /* Remove default border */
    border-radius: 5px; /* Slightly rounded corners */
    cursor: pointer; /* Pointer cursor on hover */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Shadow for a lifted effect */
    transition: background-color 0.3s ease; /* Smooth background color transition */
    margin-left: 1rem;
}

button#rejouer:hover {
    background-color: #1e90ff; /* Darker blue on hover */
}

button#rejouer:active {
    background-color: #1c86ee; /* Even darker blue on click */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Reduce shadow when active */
}

.mini-grid.locked.highlight {
    background-color: red;
}

.container {
    display: flex;
    justify-content: center;
    flex-direction: row;
    margin-right: 1rem;
    margin-top: 1.5rem;
}

@media (max-width: 600px) {
    #board {
        grid-template-columns: repeat(3, 90px); /* Smaller grid columns for mobile */
        gap: 5px; /* Reduce gap */
        border: solid black 5px; /* Smaller border */
    }

    .mini-grid {
        grid-template-columns: repeat(3, 30px); /* Smaller mini-grid cells */
    }

    .cell {
        width: 30px;
        height: 30px;
        font-size: 16px; /* Smaller font size */
    }

    button#resetZoomButton {
        padding: 8px 15px; /* Smaller padding for the button */
        font-size: 14px; /* Smaller font size for the button */
    }

    .title-container {
        margin-bottom: 10px; /* Less space between title and board */
    }

    .mini-grid.zoom.active-grid {
        border-right: 2px solid black;
        width: 106.5%;
    }

}