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

:root {
    --main-col: orangered;
}


/* #region BASIC */
.hide {
    display: none;
}
* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}
html {
    font-family: "Onest", serif;
    font-size: 1.2rem;
}
body {
    padding: 1rem;
}
.container {
    max-width: 960px;
    margin: 0 auto;
    /* overflow-x: hidden; */
}
h1,h2,h3 {
    margin-bottom: 1rem;
}
.logo {
    font-size: 1.5rem;
    font-weight: 700;
}
/* #endregion */

/* #region NAVIGATION */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center !important;
    margin-bottom: 1rem;
}
nav .links {
    display: flex;
    gap: .5rem;
}
nav .links a, .actions a {
    display: inline-block;
    background-color: hsl(from var(--main-col) h s 95%);
    color: var(--main-col);
    padding: .25rem .5rem;
    border-radius: .25rem;
    text-decoration: none;
    font-size: .8rem;
    text-align: center;
}
.actions {
    margin-bottom: 1rem;
}
#shade {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9;
    background-color: rgba(0, 0, 0, .5);
    display: none;
    width: 100%;
    height: 100dvh;
}
#close-menu-btn, #open-menu-btn {
    display: none;
    border-radius: 1rem;
    width: fit-content;
    padding: .5rem 1rem .6rem;
    cursor: pointer;
    align-self: flex-end;
    border: 1px solid;
    color: var(--main-col);
    background-color: hsl(from var(--main-col) h s 95%);
}
/* #endregion */

/* #region WORDS & BUTTONS */
.btn {
    display: inline-block;
    padding: .8rem 1.2rem .7rem;
    background-color: #f0f0f0;
    border-radius: .4rem;
    text-decoration: none;
    color: #303030  ;
    font-weight: 700;
    cursor: pointer;
}
.btn.b {
    background-color: black;
    color: white;
}
#word {
    display: flex;
    background-color: #f5f5f5;
    align-items: center;
    padding: 1rem 2rem;
    border-radius: .4rem;
    border: solid .2rem #e0e0e0;
    transition: transform .25s, background .25s;   
}
/* ======  success animation  ====== */
@keyframes popIn {
    0%   { transform: scale(1);   border: solid .2rem #e0e0e0;}
    50%  { transform: scale(1.05); border: solid .2rem rgb(10, 189, 136); }
    100% { transform: scale(1);   border: solid .2rem #e0e0e0; }
}
#word.correct {
    /* border: solid .2rem rgb(10, 189, 136) !important;
    color: rgb(10, 189, 136); */
    animation: popIn .5s ease-in-out forwards;
}
/* ======  fail  ====== */
@keyframes shake {
    0%,100% { transform: translateX(0);   border: solid .2rem #e0e0e0; }
    25%     { transform: translateX(-8px); border: solid .2rem orangered; }
    75%     { transform: translateX(8px);  border: solid .2rem orangered; }
}
#word.wrong {
    border: solid .2rem orangered !important;
    animation: shake .4s ease-in-out;
}
.variants {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.variants .btn {
    display: flex;
    justify-content: center;
    align-items: center;
}
a {
    color: var(--main-col);
}
.hotkey {
    display: inline-block;
    background-color: rgba(255,255,255,.2);
    border: solid 2px hsl(from var(--main-col) h s 70%);
    padding: .2rem .4rem;
    border-radius: .2rem;
    margin-left: .5rem;
    font-size: .7rem;
}
button,
input[type="button"] {
    border: none;
    outline: none;
    box-shadow: none;
}
/* #endregion */

.langs {
    display: flex;
    gap: .5rem;
}
.lang {
    display: inline-block;
    color: var(--main-col);
    background-color: hsl(from var(--main-col) h s 95%);
    padding: 2rem 3rem;
    border-radius: .5rem;
    text-decoration: none;
}
.lang:hover {
    background-color: hsl(from var(--main-col) h s 96%);
}



@media screen and (max-width:640px) {
    h2 {
        font-size: 1.1rem;
    }
    .hotkey {
        display: none;
    }
    #word {
        height: 5rem;
    }
    .variants {
        grid-template-columns: 1fr;
        margin-bottom: 1rem;
    }
    nav .links, .langs {
        flex-direction: column;
    }
    .links {
        position: fixed;
        top: 0;
        right: -100%;
        background-color: white;
        z-index: 10;
        width: 80%;
        height: 100dvh;
        padding: 1rem;
        transition: right .2s ease-in-out;
    }
    .links.show {
        right: 0;
    }
    .links.show ~ #shade {
        display: block;
    }
    nav .links a {
        padding: 1rem 2rem;
        border-radius: 1rem;
    }
    #close-menu-btn, #open-menu-btn {
        display: inline-block;
    }
}