* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    font-family: "Times New Roman", Times, serif;
}

body {
    background-color: rgb(97, 175, 186);
}

h1 {
    font-size: 2.3em;
    padding: 0.7em;
}

/* START VY BÖRJAR  */
.overlay {
    background: rgb(97, 175, 186);
    position: fixed; 
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.start-container {
    width: 90%;
    max-width: 500px;
    background: #fefdfd;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 8px 9px rgb(54, 119, 125);
    text-align: center;
    overflow: hidden;
}

.start-view p {
    font-size: 1.2em;
    margin-bottom: 20px;
}

.easy {
    background-color: rgb(53, 168, 53);
}

.normal {
    background-color: rgb(226, 226, 32);
}

.hard {
    background-color: rgb(208, 58, 58);
}

.easy:hover {
    background-color: rgb(16, 78, 16);;
}

.normal:hover {
    background-color: rgb(107, 109, 5);
}

.hard:hover {
    background-color: rgb(90, 11, 11);
}

.easy:hover,
.normal:hover,
.hard:hover,
.game-starter:hover,
#restart-btn:hover,
.btn-container > *:hover {
    color: #ebe5e5;
}

.levels button.selected {
    background-color: #2e2f30;
    color: white;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.name-input,
.game-starter,
#restart-btn,
#score-view,
.levels > * {
    border-radius: 0.5em;
    font-weight: 600;
    width: 5em;
    padding: 0.4em;
    font-size: 0.8em;
    color: #222;
    box-shadow: 1px 1px 2px black;
    border: 1px solid black;
    
}

.name-input {
    width: 9.5em;
    background-color: #f3eded;
    color: #222;
}

.game-starter {
    width: 7em;
    margin-left: 1em;
    background-color: rgb(146, 131, 197);
    cursor: pointer;
}

.game-starter:hover {
    background-color: rgb(64, 51, 107);
}

.levels {
    padding: 0 1em 1em 1em;
    display: flex;
    justify-content: center;
}

.levels > * {
    margin: 0.5em 0.8em;
    cursor: pointer;
}
/* START VY SLUTAR  */


/* SPEL VY STARTAR  */
.window {
    margin: 2.7em 10em;
    background-color: #fffefe;
    border-radius: 0.5em;
    box-shadow: 0px 0px 20px #2a2a2a;
    height: 90vh;
    display: none;
}

.flex-container {
    padding: 2em 2em 0.5em 2em;
    text-align: center;
}

#restart-btn {
    width: 5.5em;
    background-color: rgb(97, 175, 186);
}

#restart-btn:hover {
    background-color: rgb(3, 78, 88);
}

#score-view {
    width: 5.5em;
}

#score-view:hover {
    background-color: rgb(217, 221, 223);
}

.keyboard {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: fit-content;
}

.keyboard-row {
    height: 3em;
    margin: 0.2em;
}

.keyboard-row > * {
    position: relative;
    background: rgb(97, 175, 186);
    text-align: center;
    color: black;
    float: left;
    border-radius: 0.3em;
    margin: 0.2em;
    padding: 0.2em;
    width: 3.3em;
    height: 100%;
    box-sizing: border-box;
    cursor: pointer;
    user-select: none;
    border: 1px solid #444;
    box-shadow: 0 0.2em 0 0.05em #222;
    border-bottom-color: #555;
}

.keyboard-row > div[data-pressed],
.key-pressed,
.keyboard-row > div:active {
    background: #2a2a2a;
    color: #aaa;
    position: relative;
    top: 0.2em;
    box-shadow: 0 0 0 0.05em black;
}

.key-letter {
    line-height: 2.8em;
}

.game-section {
    display: flex;
    justify-content: space-evenly;
    height: 60vh;
}

.space-evenly {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
}

.letters {
    text-align: center;
    font-size: 1.5em;
}

#name {
    align-items: center;
    font-size: 2em;
}

.on {
    visibility: hidden;
}

.wrong-letter {
    background: #9a1c1c;
    color: #aaa;
    position: relative;
    top: 0.2em;
    box-shadow: 0 0 0 0.05em black;
}
/* SPEL VY SLUTAR  */


/* GAME OVER VY BÖRJAR  */
#game-over {
    display: none;
}

.gameover-container {
    margin: 5em auto;
    background-color: #fffefe;
    border-radius: 0.5em;
    box-shadow: 0px 0px 20px #2a2a2a;
    height: fit-content;
    width: 40em;
    padding: 2em;
}

.gameover-container > h1,
.gameover-container > h2 {
    text-align: center;
}
.gameover-container > h1 {
    font-size: 3em;
}

.gameover-container > h2 {
    font-size: 2em;
    margin: 0.8em;
}

.btn-container {
    display: flex;
    justify-content: center;
    margin: 1em;
}

.btn-container > * {
    margin: 0.5em;
    background-color: rgb(97, 175, 186);
    padding: 0.5em;
    font-size: 1.5em;
    border-radius: 0.5em;
    cursor: pointer;
    color: #222;
}

.btn-container > *:hover {
    background-color: rgb(3, 78, 88);
}

.emojis {
    display: flex;
    justify-content: center;
    font-size: 10em;
    text-shadow: 0 0 15px black;
}
/* GAME OVER VY SLUTAR  */


/* POÄNG VY BÖRJAR  */
#score {
    display: none;
}

.score-container {
    margin: 3em auto;
    background-color: #fffefe;
    /* background-image: url("https://img.freepik.com/free-vector/blank-white-notepaper-design_53876-118304.jpg?w=740&t=st=1701353728~exp=1701354328~hmac=f43b3b75e91667e3dde83a7fb3fd6cfe09b2c824798f23876ee2debfe8c54476"); */
    background-size: cover;
    background-size: contain;
    opacity: 0.95;
    border-radius: 0.5em;
    box-shadow: 0px 0px 20px #2a2a2a;
    height: fit-content;
    max-width: 40em;
    padding: 2em;
}

.display-score,
.score-container > h1,
.score-container > h2 {
    color: #424275;
    text-align: center;
    font-family: "Pixelify Sans", sans-serif;
}

.score-item {
    /* border-bottom: 2px dotted black; */
    box-shadow: 1px 1px 5px rgb(82, 82, 82);
    padding: 1em;
    border-radius: 0.4em;    
}

.score-item > * {
    font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}

.score-item > p {
    font-size: 1.2em;
}

.score-item > p:first-child {
    font-size: 1.4em;
    font-weight: bold;
    color: rgb(97, 175, 186);
}

.score-item > p:nth-child(5) {
    font-weight: bold;
}

.score-item > p:nth-child(2) {
    font-weight: bold;
}

.score-container > h1 {
    padding-bottom: 0;
    color: #a45252;
}

.score-container > h2 {
    color: #a45252;
    font-size: 1.9em;
    margin-bottom: 0.5em;
}

.display-score > * {
    margin: 1em 0;
    font-size: 16px;
}

.button-container1 {
    display: flex;
    justify-content: center;
    margin: 1em;
}

.button-container1 > * {
    margin: 0.5em;
}

#score img {
    height: 80px;
    width: 80px;
    border-radius: 20px;
    box-shadow: 0px 0px 8px gray;
    margin: 20px auto;
    display: block;
}

#score .button1,
.sort-btns > * {
    border-radius: 0.5em;
    border: none;
    padding: 0.5em;
    box-shadow: 0px 0px 8px gray;
    font-family: "Pixelify Sans", sans-serif;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: rgb(123, 200, 180);
    color: #222;
}

#score .button1:hover {
    background-color: #45a049;
}

.sort-btns {
    display: flex;
    justify-content: center;
}

.sort-btns > * {
    margin: 0.5em;
    padding: 0.2em;
    cursor: pointer;
    background-color: #a4525294;
}
/* POÄNG VY SLUTAR  */


/* MEDIA QUERYS BÖRJAR */
@media (max-width: 1400px) {
    .keyboard {
        font-size: 0.8em;
    }
}

@media (max-width: 1310px) {
    .game-section {
        flex-direction: column;
        align-items: center;
        height: fit-content;
    }

    .space-evenly {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    #change-gubbe {
        height: 30vh;
        width: 30vw;
    }

    .window {
        margin: 2.7em 6em;
        height: fit-content;
    }

    #name {
        font-size: 1.5em;
    }
    .letters {
        margin: 0.5em 0 1em 0;
        font-size: 1.5em;
    }
}

@media (max-width: 790px) {
    .window {
        margin: 2.7em 2em;
    }

    #change-gubbe {
        width: 50vw;
        height: 20vh;
    }
    .h1 {
        font-size: 1.7em;
    }

    .name-input,
    .game-starter,
    .levels > * {
        font-size: 0.7em;
    }

    .letters {
        margin-top: 1em;
    }

    #name {
        font-size: 1.2em;
    }
    .gameover-container {
        width: 20em;
        margin: 3em auto;
    }

    .gameover-container > h1 {
        font-size: 2.5em;
    }

    .gameover-container > h2 {
        font-size: 1.5em;
    }

    .btn-container > * {
        font-size: 1em;
    }

    .start-container {
        width: 90%;
    }

    .score-container {
        padding: 1em;
    }
}

@media (max-width: 592px) {
    .keyboard {
        font-size: 0.7em;
    }

    .window {
        margin: 2.7em 1em;
    }
    .letters {
        font-size: 1.6em;
        margin-top: 2em;
    }

    #name {
        font-size: 1em;
    }
    
}

@media (max-width: 500px) {
    .keyboard-row > * {
        width: 2.1em;
    }

    .h1 {
        font-size: 0.6em;
    }

    .letters {
        font-size: 1.3em;
        margin-top: 3em;
    }

    .sort-date,
    .sort-guesses {
        font-size: 0.6em;
    }
}

/* Media för score vy */
@media screen and (max-width: 679px) {
    .score-container {
        /* margin: 1em; */
        padding: 1em;
        max-width: 100%;
        margin: 3em 2em;
    }

    .sort-date,
    .sort-guesses {
        font-size: 0.8em;
    }

    .score-item > p {
        font-size: 1.1em;
    }
}

@media screen and (min-width: 680px) and (max-width: 1000px) {
    .score-container {
        padding: 1.5em;
        margin: 3em auto;
        /* max-width: 90%; */
        background-size: contain;
    }
    .score-item > p {
        font-size: 1.2em;
    }
}

@media (max-width: 380px) {
    .sort-date,
    .sort-guesses {
        font-size: 0.5em;
        width: 10em;
    }

    .score-item > p {
        font-size: 0.9em;
    }
}
