@import url('https://fonts.googleapis.com/css2?family=Macondo&display=swap');

.macondo-regular {
    font-family: "Macondo", cursive;
    font-weight: 400;
    font-style: normal;
}

* {
    box-sizing: border-box;
    font-family: var(--font-macondo-regular);
}

:root {
    --font-macondo-regular: "Macondo", cursive;
    --base-color: #bb4c3a;
    --accent-color: #ff7043;
    --white-color: #ffffff;
    font-size: 62.5%;
}

body {
    height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--base-color);
    margin-top: 70px;
}

.container {
    text-align: center;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 75%;
    gap: 50px;
    padding: 0px 20px;
    background-color: var(--white-color);
    border-radius: 30px;
    box-shadow: 20px 0px 40px rgba(0, 0, 0, 0.5);
}


.game-box>div {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
}

.game-box>div span {
    margin: 20px 0;
    font-size: 2rem;
    text-transform: uppercase;
    color: var(--base-color);
}

.game-box .keyborad button.correct {
    background-color: #4caf50;
    cursor: not-allowed;

}

.game-box .keyborad button.correct:hover {
    background-color: #4caf4fb4;
}

.game-box .keyborad button.wrong {
    background-color: #f44336;
    cursor: not-allowed;

}

.game-box .keyborad button.wrong:hover {
    background-color: #f44336b4;
}

.display-box {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    list-style: none;
    margin-bottom: 30px;
}

.display-box .letter {
    border-bottom: 4px solid var(--base-color);
    width: 30px;
    height: 30px;
    text-transform: uppercase;
    font-size: 2.5rem;
    color: #000;
}

.display-box .letter.guessed {
    border-bottom: transparent;
    width: 30px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 2.5rem;
    transition: all 0.3s ease-in-out;
    animation: revealLetter 0.3s ease-in-out;
}

@keyframes revealLetter {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hangman-part {
    position: absolute;
    top: 350px;
    left: 270px;
}

.game-box .guesses-text {
    font-size: 1.8rem;
}

.game-box .keyborad {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.hangman-box img {
    margin-top: 5%;
}

.game-box .keyborad button {
    width: calc(100% / 9 - 10px);
    height: 50px;
    font-size: 1.8rem;
    text-transform: uppercase;
    border: none;
    border-radius: 50% 20% / 10% 40%;
    background-color: var(--base-color);
    color: var(--white-color);
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease-in-out;

}

.game-box .keyborad button:hover {
    background-color: var(--accent-color);
}

/*  Category Modal Styles */
.category-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}
.modal-content h2{  
    font-size: 2.6rem;
    color: var(--white-color);
}

.category-modal.hide {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease-in-out;
    z-index: -999;
    opacity: 0;
}
.modal-content {
    background: var(--base-color);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 600px;
}

.category-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.cat-card {
    background: var(--white-color);
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    width: 120px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s, border-color 0.2s;
}

.cat-card:hover {
    transform: translateY(-5px);
    border-color: var(--white-color);
    background: rgba(0, 0, 0, 0.35);
}

.cat-card img {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
    object-fit: contain;
}

.cat-card span {
    font-weight: bold;
    font-size: 1rem;
    color: var(--accent-color);
}

.cat-card:hover span {
    color: var(--white-color);
}

/*  Game model Styles */
.game-model {
    position: fixed;
    background: #000a;
    backdrop-filter: blur(5px);
    width: 100%;
    height: 100%;
    display: flex;
    z-index: -9999;
    opacity: 0;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    color: var(--white-color);
    text-align: center;
    transition: all 0.3s ease-in-out;
}

.game-model.show {
    z-index: 9999;
    opacity: 1;
}
.game-model .content-text {
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    align-items: center;

}

.game-model .content {
    border-radius: 20px;
    display: flex;
    flex-direction: column;
}

.game-model .content span {
    font-size: 2.5rem;
    font-weight: bold;
}
.game-model .content p {
    font-size: 4.5rem;
    font-weight: bold;
}


.game-model .content button {
    height: 50px;
    font-size: 2rem;
    text-transform: uppercase;
    border: none;
    border-radius: 10px;
    background-color: var(--accent-color);
    color: var(--white-color);
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.game-model .content button:hover {
    background-color: var(--base-color);
}


/* Mobile */
@media (max-width: 600px) {
    :root {
        --font-macondo-regular: "Macondo", cursive;
        font-size: 50%;
    }



    .container {
        width: 95%;
        height: auto;
        flex-direction: column;
        gap: 18px;
        padding: 16px;
        box-shadow: 10px 0 20px rgba(0, 0, 0, 0.3);
        border-radius: 18px;
    }

    h1 {
        display: none;
    }

    .category-options button {
        padding: 10px 20px;
        margin: 10px;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
        width: fit-content;
        flex-direction: column;
        border: none;
        background: var(--base-color);
        color: white;
        border-radius: 5px;
        font-size: 2rem;
    }

    .game-box {
        width: 100%;
        flex: none;
        padding: 6px 0;
    }

    .hangman-box img {
        width: 50%;
    }

    .game-box>div {
        font-size: 1.4rem;
    }

    .game-box>div span {
        font-size: 1.8rem;
    }

    .display-box {
        gap: 8px;
        margin-bottom: 18px;

    }

    .display-box .letter,
    .display-box .letter.guessed {
        width: 24px;
        font-size: 2rem;
        border-bottom-width: 3px;
    }

    .game-box .guesses-text {
        font-size: 1.6rem;
    }

    .game-box .keyborad {
        gap: 8px;
    }

    .game-box .keyborad button {
        width: 42px;
        height: 42px;
        font-size: 1.4rem;
        border-radius: 10px;
    }

    .game-lose,
    .game-model {
        height: 100%;
        font-size: 2.2rem;
    }

    .game-lose .content,
    .game-model .content {
        padding: 18px;
    }

    .game-lose .content span,
    .game-model .content span {
        font-size: 1.8rem;
    }

    .game-lose .content button,
    .game-model .content button {
        height: 44px;
        font-size: 1.6rem;
    }
}


/* Tablet */
@media (max-width: 768px) and (min-width: 601px) {
    :root {
        font-size: 56%;
    }

    .container {
        width: 80%;
        height: auto;
        flex-direction: column;
        border-radius: 22px;
        margin-top: 120px;
        box-shadow: 14px 0 30px rgba(0, 0, 0, 0.35);
    }

    .container h1 {
        font-size: 3.8rem;
        position: relative;
        transform: none;
        top: -15px;
        left: 0px;
    }

    .display-box {
        gap: 12px;
        margin-top: 40px;
        flex-wrap: wrap;
    }


    .display-box .letter,
    .display-box .letter.guessed {
        width: 26px;
        font-size: 2.2rem;
    }

    .hangman-box img {
        width: 40%;
    }

    .game-box .keyborad button {
        width: 48px;
        height: 48px;
        font-size: 1.6rem;
    }
}