/* general styling rules */

body {
    text-align: center;
    font-family: 'Roboto Mono', monospace;
    background: #121743;
    color: #222224;
    font-size: 1rem;
    user-select: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    margin: 0;
}

h1,
h2 {
    color: #d3d5e2;
    font-weight: 300;
    margin: 0;
}

h1 {
    font-size: 2rem;
    line-height: 2rem;
}

h2 {
    font-size: 1.5rem;
    line-height: 1.5rem;
    /* margin: 1rem 0; */
}

.tile {
    height: 20px;
    width: 20px;
    margin: 3px;
    border-radius: 3px;
    font-family: 'Roboto Mono', monospace;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
    border: none;
    line-height: 20px;
    padding: 0;
}

.hidden {
    display: none;
}

::-webkit-scrollbar {
    display: none;
}

/* Colours */
/* Box shadow soft UI tiles were created with help from https://neumorphism.io/#dedfe8 */
.box-shadow {
    border-radius: 10px;
    box-shadow: 3px 3px 8px #010208,
        -5px -5px 5px #454579;
}

.container-dark-background {
    background: linear-gradient(25deg, #0f133b, #0A0D28);
}

.active {
    background: #d3d5e2;
    box-shadow: 5px 5px 2px #040510,
        -2px -2px 2px #5f67af;
}

.inactive {
    background: #727379;
    box-shadow: 5px 5px 2px #040510,
        -2px -2px 2px #101540;
}

.game-controls .button {
    padding: 10px;
}

.button,
a {
    margin: 5px;
    border-radius: 3px;
    font-family: 'Roboto Mono', monospace;
    font-size: 1rem;
    transition: all 0.2s ease-in-out;
    border: none;
    text-decoration: none;
    padding: 0;
    color: inherit;
    display: block;
}

/* Hover effects */

.active:hover {
    background: #fff;
    box-shadow: 5px 5px 9px #151a50,
        -5px -5px 9px #363c74;
    cursor: pointer;
}

/* Header and Nav */

header {
    width: 100%;
}

header h1 {
    transform: translateY(30%);
}

nav {
    position: absolute;
    top: 2px;
    right: 2px;
    display: flex;
    flex-direction: column;
}

/* Modal */

.modal {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.modal-content {
    background-color: #d3d5e2;
    padding: 10px;
    font-size: 1rem;
    max-height: 100vh;
    max-width: 100vw;
    overflow: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

.modal h2 {
    color: #222224;
    font-size: 2rem;
    line-height: 2rem;
    margin: 0 30px 0 10px;
    word-break: break-all;
}

.modal img {
    max-height: 15vh;
    max-width: 50vw;
}

form {
    padding: 5px;
}

form label {
    color: #d3d5e2;
}

.modal header {
    position: relative;
}

.close {
    position: absolute;
    top: -5px;
    right: -5px;
}

.modal p {
    margin-top: 1.5rem;
}

/* ---------------Game space-------------- */
.container {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    width: 100%;
    height: calc(100vh - 100px);
    padding-top: 30px;
    align-items: center;
}

/* Game-controls */
.game-controls {
    width: fit-content;
    height: fit-content;
    min-height: 20%;
    min-width: 80vw;
    padding: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    margin: 10px;
}

.letters-row {
    margin-top: 5px;
    display: flex;
    justify-content: space-around;
}

/* Rocket */
.rocket {
    height: 50vh;
    width: 40vh;
    background-image: url("../images/stars-background.gif");
    background-size: cover;
    display: flex;
    align-items: center;
    flex-direction: column;
}

.rocket img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
}

/* Target word */
.target-word {
    display: flex;
    flex-flow: row wrap;
    flex-direction: row;
    justify-content: center;
    max-width: 80vw;
}

.target-word .tile {
    cursor: default !important;
}

.target-word .active:hover {
    background: #d3d5e2;
    box-shadow: 5px 5px 2px #040510,
        -2px -2px 2px #5f67af;
}

.target-word-container {
    margin: 20px auto;
    width: fit-content;
    height: fit-content;
    padding: 5px;
}

/* countdown */
.countdown {
    color: #d3d5e2;
    position: absolute;
    font-size: 2rem;
    transform: translateX(10%);
}

/* ----------media queries--------- */
/* Resizing for mobile devices */
@media only screen and (min-width: 375px) {
    .tile {
        height: 25px;
        width: 25px;
        margin: 4px;
        border-radius: 3px;
        font-size: 1rem;
        line-height: 25px;
    }

    .modal h2 {
        word-break: normal;
        margin: 0 30px;
    }

    nav {
        top: 8px;
        right: 8px;
    }
}

@media only screen and (min-width: 520px) {
    .tile {
        height: 30px;
        width: 30px;
        margin: 5px;
        border-radius: 4px;
        font-size: 1.5rem;
        line-height: 30px;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    nav {
        top: 15px;
        right: 15px;
    }
}

/* Resizing for tablet devices */
@media only screen and (min-width: 650px) {
    .tile {
        height: 35px;
        width: 35px;
        margin: 6px;
        border-radius: 5px;
        font-size: 1.5rem;
        line-height: 30px;
    }

    .game-controls .button {
        font-size: 2rem;
        line-height: 2rem;
        margin: 0.5rem;
        padding: 15px;
    }

    header h1 {
        transform: translateY(50%);
    }
}

@media only screen and (min-width: 768px) {
    .tile {
        height: 40px;
        width: 40px;
        margin: 6px;
        border-radius: 6px;
        font-size: 2rem;
        line-height: 40px;
    }

    h1,
    h2 {
        font-size: 3rem;
    }
}

@media only screen and (min-width: 800px) {
    .tile {
        height: 50px;
        width: 50px;
        margin: 8px;
        font-size: 2rem;
        line-height: 50px;
    }

    .game-controls {
        min-width: 65vw;
    }

    .target-word-container {
        max-width: 90%;
    }

    .modal {
        padding-top: 50px;
    }

    .modal-content {
        margin: auto;
        max-height: 80vh;
        width: 60vw;
        overflow: auto;
        border-radius: 6px;
    }
}

/* Resizing for desktop (HD) devices */
@media only screen and (min-width: 1025px) {
    .container {
        display: grid;
        width: 100%;
        place-items: center;
    }

    .target-word-container {
        align-self: end;
    }

    .game-controls {
        min-width: 520px;
        min-height: 180px;
        margin: 20px 0;
        padding: 5px;
    }

    .rocket {
        grid-row: 1/3;
    }

    h1 {
        font-size: 5rem;
        padding-top: 1rem;
    }

    h2 {
        font-size: 2.5rem;
    }

    /* .rocket {
        height: 70vh;
        width: 56vh;
    } */

    .countdown {
        font-size: 4rem;
    }

    .close {
        top: -10px;
        right: -10px;
    }
}

/* Resizing for desktop (QHD) devices */
@media only screen and (min-width: 1440px) {
    .game-controls {
        padding: 10px;
    }

    .modal .tile {
        height: 50px;
        width: 50px;
        font-size: 2rem;
        line-height: 50px;
    }
}

/* Resizing for desktop (UHD) devices */
@media only screen and (min-width: 2560px) {
    .tile {
        height: 65px;
        width: 65px;
        margin: 10px;
        font-size: 2.5rem;
        line-height: 65px;
    }

    header h1 {
        font-size: 7rem;
        transform: translateY(100%);
    }

    .game-controls {
        min-width: 800px;
        min-height: 255px;
    }

    .game-controls .button {
        font-size: 2.5rem;
        line-height: 2.5rem;
        padding: 20px;
    }

    h2 {
        font-size: 4rem;
        margin-bottom: 1rem;
    }
}

@media only screen and (min-width: 3000px) {
    .tile {
        height: 80px;
        width: 80px;
        margin: 12px;
        font-size: 3rem;
        line-height: 80px;
        border-radius: 10px;
    }

    header h1 {
        font-size: 9rem;
        transform: translateY(150%);
    }

    .game-controls {
        min-width: 1040px;
        min-height: 327px;
    }

    .game-controls .button {
        font-size: 3.5rem;
        line-height: 3.5rem;
        padding: 25px;
        border-radius: 10px;
    }

    h2 {
        font-size: 4rem;
        margin-bottom: 1rem;
    }
}

/* Landscape orientation */

@media screen and (orientation: Landscape) {
    .container {
        display: grid;
        grid-template-columns: 50% 50%;
        width: 100%;
        place-items: center;
    }

    .target-word-container {
        align-self: end;
    }

    .game-controls {
        align-self: start;
    }

    .rocket {
        grid-row: 1/3;
    }

    .start-game-container {
        grid-template-rows: 1fr;
    }

    .start {
        align-self: center !important;
    }

    @media only screen and (min-width: 1025px) {
        .rocket {
            height: 70vh;
            width: 56vh;
        }
    }

    @media screen and (orientation: Landscape) and (max-device-width: 825px) {
        .tile {
            height: 22px;
            width: 22px;
            margin: 2px;
            border-radius: 3px;
            font-size: 1rem;
            line-height: 22px;
        }

        .rocket {
            grid-row: 1/3;
            height: 70vh;
            width: 56vh;
        }

        .game-controls {
            width: fit-content;
            min-width: 260px;
            padding: 2px;
        }

        header h1 {
            font-size: 2rem;
        }
    }

    @media screen and (max-height:1440px) and (max-width:2075px) {
        .tile {
            height: 40px;
            width: 40px;
            margin: 6px;
            border-radius: 6px;
            font-size: 2rem;
            line-height: 40px;
        }
    }

    @media screen and (max-height:1200px) and (max-width:1480px) {
        .tile {
            height: 35px;
            width: 35px;
            margin: 6px;
            border-radius: 5px;
            font-size: 1.5rem;
            line-height: 30px;
        }

        .rocket {
            height: 60vh;
            width: 48vh;
        }
    }

    @media screen and (max-height:1080px) and (max-width:1440px) {
        .game-controls {
            min-width: 470px;
            min-height: 156px;
        }
    }

    @media screen and (max-height:900px) and (max-width:1050px) {
        .tile {
            height: 25px;
            width: 25px;
            margin: 4px;
            border-radius: 3px;
            line-height: 25px;
            font-size: 1rem;
        }

        .rocket {
            height: 50vh;
            width: 40vh;
        }

        .game-controls {
            min-width: 330px;
            min-height: 114px;
        }

        .game-controls .button {
            padding: 8px;
        }

        h2 {
            font-size: 2.5rem;
        }
    }

    @media screen and (max-height:800px) and (max-width:880px) {
        .rocket {
            height: 55vh;
            width: 44vh;
        }
    }

    @media screen and (max-height:800px) and (max-width:880px) {
        .tile {
            height: 20px;
            width: 20px;
            margin: 3px;
            border-radius: 3px;
            font-size: 1rem;
            line-height: 20px;
        }

        .game-controls {
            min-width: 260px;
            min-height: 93px;
        }

        .game-controls .button {
            padding: 3px;
            font-size: 1.3rem;
        }

        h2 {
            font-size: 1.5rem;
        }

        .rocket {
            height: 50vh;
            width: 40vh;
        }
    }
}