/* ============================= */
/*       Google Fonts Import      */
/* ============================= */
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap");

/* ============================= */
/*          Global Styles         */
/* ============================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Open Sans", sans-serif;
}

html,
body {
    height: 100%;
    background: #d6daf5;
    color: #24155b;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0 10px;
    min-height: 100vh;
    margin-top: 10px;
}

/* ============================= */
/*           Layout               */
/* ============================= */

#ratio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    aspect-ratio: 16 / 9;
    width: 90%;
    height: 100%;
}

.container {
    display: flex;
    width: 90%;
    gap: 70px;
    padding: 60px 40px;
    background: #fff;
    border-radius: 10px;
    align-items: flex-end;
    justify-content: space-between;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* ============================= */
/*          Hangman Box           */
/* ============================= */

.hangman-box {
    margin-top: 100px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.hangman-box img {
    user-select: none;
    max-width: 270px;
    padding-bottom: 50px;
}

.hangman-box h1 {
    font-size: 1.45rem;
    text-align: left;
    margin-top: 20px;
    text-transform: uppercase;
    color: #24155b;
}

h4.title {
    font-weight: 900;
    padding-top: 5px;
}

/* ============================= */
/*          Game Box              */
/* ============================= */

.game-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.word-display .letter,
.word-display .noguess {
    width: 28px;
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    border-bottom: 3px solid #000;
    margin-bottom: 40px;
    user-select: none;
}

.word-display .noguess {
    margin-bottom: 80px;
}

.word-display .letter.guessed {
    margin: -76px 0 0;
    border-color: transparent;
}

.game-box h4 {
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 15px;
}

.game-box h4 b {
    font-weight: 600;
}

.game-box .guess-text b {
    color: #990000;
}

.keyboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin-top: 40px;
}

.keyboard button {
    background: #d6daf5;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 18px;
    padding: 7px;
    width: calc(100% / 9 - 5px);
    text-transform: uppercase;
    color: #24155b;
    transition: background 0.3s ease;
}

.keyboard button:hover:not([disabled]) {
    background: #8286c9;
}

.keyboard button[disabled] {
    pointer-events: none;
    opacity: 0.6;
}

/* ============================= */
/*         Game Modal             */
/* ============================= */

.game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    padding: 0 10px;
    overflow-y: auto;
    transition: opacity 0.4s ease;
}

.game-modal.show {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.4s 0.4s ease;
}

.game-modal[hidden] * {
    pointer-events: none;
    visibility: hidden;
}

.game-modal .content {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    max-width: 60vw;
    width: 100%;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.game-modal .content video {
    max-width: 70vw;
    max-height: 95vh;
    width: 90%;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 10px auto 0 auto;
}

.game-modal .content .lost {
    max-width: 50vh;
}

.game-modal h4 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.game-modal p {
    color: rgb(36, 21, 91);
    font-size: 22px;
    font-weight: 500;
    margin: 15px 0 30px;
}

.game-modal .dino {
    color: #006400;
}

.game-modal .found b {
    font-weight: 900;
}

.game-modal button {
    background: #d6daf5;
    border: none;
    border-radius: 4px;
    padding: 12px 23px;
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    color: #24155b;
    text-transform: uppercase;
    transition: background 0.3s ease;
}

.game-modal button:hover {
    background: #8286c9;
}

/* ============================= */
/*            Footer             */
/* ============================= */

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #f7f8f8;
    padding: 5px 10px;
    font-size: 1em;
    border-top: 2px solid #ccc;
    text-align: right;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    z-index: 10000;
}

footer a {
    color: black;
    text-decoration: none;
    padding-right: 35px;
}

footer a:hover {
    text-decoration: underline;
}

/* ============================= */
/*          Responsive            */
/* ============================= */

@media (max-width: 850px) {
    .container {
        flex-direction: column;
        padding: 30px 15px;
        align-items: center;
        gap: 30px;
    }

    .hangman-box {
        margin-top: 50px;
        align-items: center;
    }

    .hangman-box img {
        max-width: 200px;
        padding-bottom: 30px;
    }

    .hangman-box h1 {
        display: none;
    }

    .game-box h4 {
        font-size: 1rem;
    }

    .word-display .letter {
        margin-bottom: -9px;
    }

    .word-display .letter.guessed {
        margin: 0px 0 32px;
    }

    .word-display .noguess {
        margin-bottom: 35px;
    }

    .game-modal .content video {
        max-width: 100%;
        width: 100%;
    }

    .game-modal h4 {
        font-size: 1.2rem;
    }

    .game-modal p {
        font-size: 1.1rem;
    }

    .game-modal button {
        padding: 10px 18px;
        font-size: 1.1rem;
    }
}

@media (max-width: 500px) {

    .word-display .letter.guessed {
        margin: 0px 0 32px;
    }
}

@media (max-height: 510px) {

    html,
    body {
        height: auto;
        overflow-y: auto;
    }

    #ratio {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        justify-content: flex-start;
        padding: 10px 0;
    }

    .container {
        padding-top: 20px;
        padding-bottom: 20px;
        gap: 20px;
    }

    .word-display .letter {
        margin-bottom: 0;
    }

    .word-display .letter.guessed {
        margin: 1px 0 34px;
    }


    .game-modal .content video {
        max-width: 80%;
        width: 100%;
    }

    .game-modal h4 {
        margin-top: 50px;
        font-size: 1.2rem;
    }

    .game-modal p {
        font-size: 1.1rem;
    }

    .game-modal button {
        padding: 10px 18px;
        font-size: 1.1rem;
    }

}

@media (max-height: 350px) {

    html,
    body {
        height: auto;
        overflow-y: auto;
    }

    #ratio {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        justify-content: flex-start;
        padding: 10px 0;
    }

    .container {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
        align-items: center;
        justify-content: flex-start;
    }

    .hangman-box {
        margin-top: 0;
        padding-bottom: 10px;
        align-items: center;
    }

    .hangman-box img {
        max-width: 120px;
        padding-bottom: 10px;
    }

    .hangman-box h1 {
        font-size: 1rem;
        margin-top: 5px;
    }

    .game-box {
        width: 100%;
    }

    .word-display .noguess {
        font-size: 0.85rem;
        margin-bottom: 15px;
    }

    .word-display .letter {
        font-size: 0.85rem;
        margin-bottom: -3px;
    }

    .word-display .letter.guessed {
        margin: 5px 0 20px;
        font-size: 0.85rem;
    }

    .game-box h4 {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }

    .keyboard {
        margin-top: 20px;
        gap: 3px;
    }

    .keyboard button {
        font-size: 14px;
        padding: 5px;
        width: calc(100% / 9 - 4px);
    }

    .game-modal .content video {
        max-width: 60%;
        width: 100%;
    }

        .game-modal h4 {
        margin-top: 100px;
    }
}