@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Open Sans", sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    background: #BA55D3;
    padding-top: 120px;
}

.top-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: #ffffff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.score_container,
.difficulty-container,
.timer-container,
.skip-word {
    position: static !important;
    transform: none !important;
    margin: 0 !important;
}
.skip-word{
    border: 2px solid plum;
}

.timer-container {
    font-size: 1rem;
    font-weight: bold;
    color: black;
    background-color: #fff;
    padding: 0.6rem 2rem;
    border: 0.12rem solid plum;
    border-radius: 0.8rem;
}

.skip-word {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    background-color: #fff;
    padding: 0.6rem 2rem;
    border-radius: 0.8rem;
    z-index: 10;
}

.difficulty-container select {
    font-size: 1rem;
    font-weight: bold;
    padding: 0.6rem;
    border: 2px solid plum;
    border-radius: 0.8rem;
    background-color: white;
    color: black;
}

.score_container {
    font-weight: bold;
    color: black;
    background-color:white;
    padding: 10px 20px;
    border: 2px  solid plum;
    border-radius: 0.8rem;
}

.container {
    width: 850px;
    max-width: 60rem;
    background: #fff;
    display: flex;
    gap: 70px;
    align-items: flex-end;
    padding: 60px 40px;
    margin-top: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.hangman-box img {
    max-width: 270px;
}

.hangman-box h1 {
    font-size: 1.45rem;
    margin-top: 10px;
    text-align: center;
    text-transform: uppercase;
}

.word-display {
    display: flex;
    gap: 10px;
    list-style: none;
    align-items: center;
    justify-content: center;
}

.word-display .letter {
    width: 28px;
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 40px;
    border-bottom: 3px solid #000;
}

.word-display .letter.guessed {
    border-color: transparent;
    margin: -40px 0 35px;
}

.keyboard button.wrong {
    background: red !important;
}

.keyboard button.correct {
    background: green !important;
}

.game-box h4 {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.game-box h4 b {
    font-weight: 600;
}

.game-box .guesses-text b {
    color: #ff0000;
}

.game-box .keyboard {
    display: flex;
    gap: 5px;
    margin-top: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

:where(.game-model, .keyboard) button {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    border: none;
    background: #BA55D3;
    border-radius: 4px;
    text-transform: uppercase;
}

.keyboard button {
    padding: 7px;
    width: calc(100%/9 - 5px);
}

.keyboard button[disabled] {
    opacity: 0.6;
    pointer-events: none;
}

.keyboard button:hover,
.play-again:hover {
    transform: scale(1.05);
    transition: 0.2s ease;
}

:where(.game-model, .keyboard) button:hover {
    background: #9370DB;
}

button {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.game-model {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    padding: 0 10px;
    pointer-events: none;
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.6);
    transition: opacity 0.4s ease;
}

.game-model.show {
    opacity: 1;
    pointer-events: auto;
}

.game-model .content {
    background: #fff;
    max-width: 420px;
    width: 100%;
    text-align: center;
    border-radius: 10px;
    padding: 30px;
}

.game-model img {
    max-width: 130px;
}

.game-model h4 {
    font-size: 1.53rem;
}

.game-model p {
    font-size: 1.15rem;
    margin: 15px 0 30px;
    font-weight: 500;
}

.game-model p b {
    color: #5E63BA;
    font-weight: 600;
}

.game-model button {
    padding: 12px 23px;
}


@media (max-width: 992px) {
    .container {
        flex-direction: column;
        align-items: center;
        padding: 40px 20px;
        gap: 40px;
        width: 95%;
    }

    .hangman-box img {
        max-width: 200px;
    }

    .keyboard button {
        width: calc(100% / 8 - 5px);
        padding: 6px;
    }
}


@media (max-width: 600px) {
    .top-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 1rem;
    }

    .header-left,
    .header-right {
        justify-content: space-between;
        gap: 1rem;
    }

    .difficulty-container select,
    .skip-word,
    .timer-container {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .container {
        padding: 30px 15px;
        gap: 30px;
    }

    .hangman-box img {
        max-width: 150px;
    }

    .word-display .letter {
        width: 24px;
        font-size: 1.6rem;
    }

    .keyboard button {
        width: calc(100% / 7 - 5px);
        padding: 5px;
        font-size: 0.85rem;
    }

    .game-model .content {
        padding: 20px;
    }

    .game-model h4 {
        font-size: 1.3rem;
    }

    .game-model p {
        font-size: 1rem;
    }

    .game-model button {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
}
