body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    box-sizing: border-box;
    background-image: url(bg1.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

.button-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 10px;
    gap: 10px;
}

.button-container button {
    background-color: #4186cb;
    border: 2px solid #4186cb;
    color: white;
    padding: 0.4rem 1.1rem;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    font-variant: small-caps;
    font-size: 1em;
}

.button-container button:hover {
    background-color: white;
    border: 2px solid #4186cb;
    color:black;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.title-container,
.board-container {
    width: 100%;
    max-width: 750px;
}

.title-container {
    background: #febf11;
    border: 2px solid black;
    border-radius: 8px;
    margin-bottom: 10px;
    height: 5vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.title-container h1 {
    color: black;
    font-size: 1.5em;
    font-weight: bold;
    font-variant: small-caps;
    text-align: center;
    margin: 0;
}
.board-container {
    background: #febf11;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 35px;
    border: 2px solid black;
    border-radius: 10px;
    box-sizing: border-box;
}

.board-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.board {
    background-image: url(bg.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column-reverse;
    border: 2px solid black;
}
.board-row {
    display: flex;
    flex-direction: row;
    height: 75px;
}
.square {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border: 1px solid black;
    width: 75px;
    height: 75px;
    position: relative;
    background-color: rgb(0,0,0,0.4);
    cursor: pointer;
}
.green { background-color: green; opacity: 0.8; color:white; }
.orange { background-color: orange; opacity: 0.6; color: black; }
.red { background-color: red; opacity: 0.6; color: white; }
.coordinates {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1em;
    font-weight: bold;
}
.row-coordinates {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-top: -10px;
}
.row-coordinates .coordinates {
    height: 75px;
}
.column-coordinates {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
}
.column-coordinates .coordinates {
    width: 75px;
}
.hidden {
    background-color: transparent !important;
    color: transparent !important;
    border: 1px solid black;
}

.copyright-message {
    text-align: center;
    margin-top: -30px;
    margin-bottom: 10px;
    color: #ffffff;
    font-size: 0.8em;
    width: 100%;
}

.modal {
    display: none;
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.modal-content {
    width: 100%;
    height: 100%;
    background: #f6dec2;
    border: 2px solid black;
    padding: 20px;
    box-sizing: border-box;
    overflow: auto;
    position: absolute; /* Ensures correct positioning inside modal */
}

.close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    font-weight: bold;
    color: black;
    cursor: pointer;
}

.close:hover {
    color: #fa8704; /* Highlight on hover */
}

/* Medium screens (Tablets) */
@media (max-width: 1024px) {
    .title-container,
    .board-container {
        max-width: 600px;
    }

    .board-row {
        height: 60px;
    }

    .square {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .row-coordinates .coordinates {
        height: 60px;
    }

    .column-coordinates .coordinates {
        width: 60px;
    }
}

/* Small screens (Smartphones) */
@media (max-width: 768px) {
    .title-container,
    .board-container {
        max-width: 500px;
    }

    .board-row {
        height: 50px;
    }

    .square {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .row-coordinates .coordinates {
        height: 50px;
    }

    .column-coordinates .coordinates {
        width: 50px;
    }
}

/* Extra small screens (Phones < 480px) */
@media (max-width: 480px) {
    .title-container,
    .board-container {
        max-width: 350px;
    }

    .board-row {
        height: 35px;
    }

    .square {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    .row-coordinates .coordinates {
        height: 35px;
    }

    .column-coordinates .coordinates {
        width: 35px;
    }
}