/* Base Game board styling (default for all devices) */
.game-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 1em;
    justify-items: center;
    margin: 0 auto;
    padding: 2em;
    border-radius: 10px;
    width: 100%;
    max-width: 27em;
}



/* Shape (each cell) styling */
.shape {
    background-color: #fff9db;
    border: 1px solid #1f1f1f;
    cursor: pointer;
    color: #1f1f1f;
    font-size: 60px; /* Font size for X and O */
    display: flex; /* Flexbox for centering content */
    align-items: center; /* Vertically center text */
    justify-content: center; /* Horizontally center text */
    height: 120px; /* Fixed height */
    width: 100%; /* Full width of the container */
    max-width: 120px; /* Max width for individual cells */
    border-radius: 10px;
    box-sizing: border-box; /* Ensures padding/borders are included in width/height */
            box-shadow: 4px 6px 5px #3d153f;
}

/* Portrait Mode (Mobile - up to 600px width) */
@media (max-width: 600px) and (orientation: portrait) {
    .game-board {
        padding: 0; /* Remove padding in portrait mode */
        grid-gap: 0.8em; /* Reduce gap between cells in portrait mode */
        max-width: 20em; /* Smaller max width for mobile screens */
    }

    .shape {
        font-size: 40px; /* Smaller font size */
        height: 80px; /* Smaller height for the cells */
        max-width: 90px; /* Reduce max width for smaller screens */
    }
}

/* Landscape Mode (Mobile - up to 600px width) */
@media (max-width: 600px) and (orientation: landscape) {
    .game-board {
        padding: 1.5em; /* Slightly more padding for landscape mode */
        grid-gap: 1.5em; /* Keep the grid gap moderate */
        max-width: 22em; /* Slightly larger max width in landscape mode */
    }

    .shape {
        font-size: 50px; /* Increase font size slightly for landscape */
        height: 100px; /* Adjust the cell height */
        max-width: 100px; /* Increase max width for cells */
    }
}

/* Portrait Mode (Very small screens - up to 400px width) */
@media (max-width: 400px) and (orientation: portrait) {
    .game-board {
        grid-gap: 0.5em; /* Further reduce gap */
        max-width: 18em; /* Smaller width for tiny screens */
    }

    .shape {
        font-size: 30px; /* Further reduce font size */
        height: 70px; /* Smaller height */
        max-width: 80px; /* Further reduce width */
    }
}

/* Landscape Mode (Very small screens - up to 400px width) */
@media (max-width: 400px) and (orientation: landscape) {
    .game-board {
        grid-gap: 0.8em; /* Further reduce gap */
        max-width: 20em; /* Smaller width for small landscape screens */
    }

    .shape {
        font-size: 35px; /* Slightly smaller font size */
        height: 80px; /* Slightly larger height */
        max-width: 90px; /* Slightly larger width */
    }
}


body {
    margin: 0;
    padding: 0;
    width: 100%;
    color: #247cff;
    font-family: "verdana";
    background-color: #934d98;
    box-sizing: border-box;
    text-align: center;
}

* {
    box-sizing: border-box;
}

h1 {
    font-size: 36px;
    margin: 20px 0;
}

main {
    max-width: 600px;
    width: 90%;
    margin: 0 auto;
    background-color: #934d98;
    border-radius: 20px;
    
}

select {
    padding: 10px;
    font-size: 18px;
    margin: 20px 0;
    cursor: pointer;
    width: 100%;
    max-width: 250px;
    border-radius: 11px;
}



.hidden {
    font-size: 0;
}

#status {
    font-size: 18px;
    color: #fff;
    margin-top: 10px;
    padding-bottom: 10px;
}

.restart {
    background-color: #247cff;
    color: white;
    font-size: 20px;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
    border: none;
    margin-top: 20px;
    width: 39%;
    max-width: 400px;
}

.restart:hover {
    background-color: white;
    color: #247cff;
    border: 2px solid #247cff;
}

.mod {
    background-color: #257cfb;
    color: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    width: 100%;
    max-width: 200px;
    margin: 10px auto;
}

.mod:hover {
    opacity: 0.7;
}

#winner {
    color: #fff;
    font-size: 20px; 
    /* position: absolute; */
    /* width: 100%; */
    /* top: 50%; */
    /* left: 0; */
    /* transform: translateY(-50%); */
    /* opacity: 0.7; */
    /* height: 100%; */
    /* background-color: white; */
    display: none;
    text-align: center;
}

/* Media Queries for smaller screens */
@media (max-width: 768px) {
    h1 {
        font-size: 28px;
    }

    .shape {
        font-size: 50px;
        height: 80px;
        width: 80px;
    }

    .game-board {
        max-width: 100%;
        padding: 1px;
    }

    .mod {
        max-width: 150px;
        padding: 10px;
    }

    .restart {
        max-width: 350px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 24px;
    }

    .shape {
        font-size: 40px;
        height: 2em;
        width: 2.5em;
    }

    .game-board {
        max-width: 70%;
        grid-template-columns: repeat(3, 1fr);
    }

    .mod {
        max-width: 120px;
        padding: 8px;
    }

    .restart {
        max-width: 100%;
    }
}
