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

html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    font-family: 'Lato', sans-serif;
    background-color: #FFFD8F;
}

.horiz-center {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.vert-center {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

#game-title {
    transform: rotate(-90deg);
    position: absolute;
    left: -2.5em;
    top: 30%;
    text-align: center;
    font-size: 72pt;
    letter-spacing: 5rem;
}

#keyboard {
    /* none and hidden for computers with keyboards */
    display: none;
    visibility: hidden;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    user-select: none;
    height: max-content;
    margin-top: auto;
    margin-bottom: 10px;
}

#keyboard > div {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
}

.keyboard-key {
    padding: 1rem;
    margin: 0.5rem;
    border: 1px solid black;
    line-height: 1rem;
    min-width: 0.75rem;
    text-align: center;
    font-family: sans-serif;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#key-Space {
    width: 200px;
}

#indel-app,
#app-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    overflow-x: hidden;
    overflow-wrap: break-word;
}

#previous-guesses, #indel-app {
    height: 100%;
    width: 100%;
    text-align: center;
    min-height: 2.5rem;
    overflow-y: scroll;
    overflow-x: visible;
    scrollbar-width: none;
    font-style: normal;
}

#previous-guesses > h1:first-of-type {
    font-style: italic;
}

#previous-guesses::-webkit-scrollbar {
    display: none;
}

h1 {
    font-size: 36pt;
    margin-top: 0;
    word-spacing: 1rem;
}

h1.empty {
    font-size: 24pt;
    opacity: 0.5;
    font-style: italic;
}

#target-word {
    margin-bottom: 0;
}

@keyframes shake {
    0% { transform: translate(1px, 1px) rotate(0deg); }
    10% { transform: translate(-1px, -2px) rotate(-1deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    30% { transform: translate(3px, 2px) rotate(0deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    50% { transform: translate(-1px, 2px) rotate(-1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    70% { transform: translate(3px, 1px) rotate(-1deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
    90% { transform: translate(1px, 2px) rotate(0deg); }
    100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.bad-guess {
    animation: shake 0.5s;
}

.hidden {
    display: none;
    visibility: hidden;
}

.modal {
    position: fixed;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#error-modal-content {
    margin: 0 auto;
    background-color: #121212;
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    width: 20%;
    opacity: 0;
}

#help-modal {
    background-color: rgba(0,0,0,0.6);
}

#help-modal-close {
    position: absolute;
    top: 0;
    right: 20px;
    font-size: 28pt;
    font-weight: bold;
    cursor: pointer;
}

#help-modal-content {
    position: relative;
    margin: 5% auto;
    max-width: 800px;
    max-height: 85%;
    width: 80%;
    background-color: #121212;
    color: #CFCE97;
    padding: 20px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}

#help-modal-content::-webkit-scrollbar {
    display: none;
}

#help-modal-content p {
    width: 70%;
}

.example {
    text-align: center;
    font-style: italic;
}

.big-space {
    word-spacing: 75%;
}

#help-modal-content p.definition {
    font-style: italic;
    font-weight: lighter;
    font-size: 10pt;
    text-align: center;
}

.mutation {
    color: #94B59C;
}

.insertion {
    color: #707AB5;
}

.deletion {
    color: #B5797F;
}

@keyframes fadein {
    0% {opacity: 0;}
    10% {opacity: 1;}
    90% {opacity: 1;}
    100% {opacity: 0;}
}

#error-modal-content.visible {
    animation: fadein 1000ms;
}

.winner {
    margin: auto;
    font-size: 72pt;
}

#help-launcher {
    position: absolute;
    top: 0;
    right: 20px;
    color: #999;
    font-size: 28pt;
}

#help-launcher:hover {
    color: #666;
    cursor: pointer;
}

#emoji-chain {
    width: 80%;
    margin-bottom: 50px;
}

@media (pointer: coarse) {
    #keyboard {
        display: flex;
        visibility: visible;
    }
}

@media (max-width: 900px) {
    .keyboard-key {
        font-size: 10pt;
        min-width: 4vw;
        padding: 2vw;
        margin: 0.5vw;
    }

    #game-title {
        display: none;
        visibility: hidden;
    }

    .winner {
        font-size: 24pt;
        max-width: 900px;
    }

    #help-modal-content p {
        width: 100%;
        margin-bottom: 0;
    }
}

@media screen and (prefers-color-scheme: dark) {
    body,
    html {
        background-color: #121212;
        color: #CFCE97;
    }
    
    .keyboard-key {
        border-color: #CFCe97;
    }
}