@import url('https://fonts.googleapis.com/css2?family=Anek+Devanagari:wght@100..800&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&family=Nunito:ital,wght@0,200..1000;1,200..1000&family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&display=swap');

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', sans-serif;
    background-color: #f3f3f3;
    height: 100vh;
    overflow: hidden;
}

#game {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 90vw;
    max-width: 500px;
}

.board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    width: 100%;
    aspect-ratio: 5 / 6; /* Maintain grid aspect ratio */
}

.tile {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border: 1px solid #ccc;
    font-size: 2.5vh;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#keyboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 100%;
    max-width: 90vw;
}

.row {
    display: flex;
    justify-content: center;
    gap: 4px;
    width: 100%;
}

.key {
    background-color: white;
    border: 1px solid #bbb;
    padding: 1.5vh;
    cursor: pointer;
    font-size: 2vh;
    flex: 1;
    max-width: 40px;
    height: 7vw;
    max-height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-transform: uppercase;
    font-weight: bold;
}

.key.wide {
    flex: 1.5;
    max-width: 60px;
}

.key:active {
    background-color: #ddd;
}

.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
    font-size: 2vh;
    z-index: 1000;
    width: 80%; /* Ensures the popup doesn't take up too much space */
    max-width: 400px; /* Prevents it from becoming too wide */
}

.h {
    height: 100vh;
    width: 100vw;
    position: absolute;
    left: 0px;
    top: 0px;
}

.background {
    background-color: rgba(0, 0, 0, 0.6);
    width: 100vw;
    height: 100vh;
    position: absolute;
    left: 0px;
    top: 0px;
}

.h.hidden {
    display: none !important;
}

.popup h1 {
    font-size: 2rem; /* Ensures title is readable */
    margin-bottom: 10px;
}

.popup p {
    margin-bottom: 20px;
    font-size: 1.5rem; /* Adjusts text for readability */
}

.popup button {
    margin-top: 10px;
    padding: 12px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.5rem;
    font-family: 'Open Sans', sans-serif;
}

.popup button:hover {
    background-color: #0056b3;
}

.popup button:active {
    background-color: #004085;
}

@media (max-width: 600px) {
    .popup {
        width: 90%; /* Makes the popup more mobile-friendly */
        padding: 15px;
    }

    .popup h1 {
        font-size: 1.8rem;
    }

    .popup p {
        font-size: 1.2rem;
    }

    .popup button {
        padding: 10px 18px;
        font-size: 1.2rem;
    }
}


@media (orientation: landscape) {
    .tile {
        font-size: 2vh;
    }

    .key {
        padding: 1vh;
        font-size: 1.5vh;
    }
}


#board {
    display: grid;
    grid-template-columns: repeat(5, 50px);
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.tile {
    width: 50px;
    height: 50px;
    border: 2px solid #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    text-transform: uppercase;
    background-color: white;
}
