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

* {
    box-sizing: border-box;
}

.material-symbols-outlined {
  font-variation-settings:
  'FILL' 0,
  'wght' 400,
  'GRAD' 0,
  'opsz' 48
}

body {
    font-family: 'Rajdhani', sans-serif;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
    overflow: hidden;
    background-color: aquamarine;
    position: relative;
}

.mode-btn {
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 15px;
    background-color: gray;
    padding: 5px;
    border: none;
    transition: background-color 0.4s;
}

.mode-btn:hover {
    background-color: rgb(4, 54, 38);
    color: aliceblue;
}

.mode-btn:active {
    transform: scale(0.98);
}

.mode-div {
    position: absolute;
    left: 0;
    top: 0;
    padding: 0 30px;
    height: 100vh;
    width: 120px;
    color: white;
    background-color: rgb(4, 54, 38);
    display: flex;
    text-align: center;
    align-items: center;
    justify-content: center;
    transform: translateX(0);
    transition: transform 0.43s linear;
}

.mode-div.slideout {
    transform: translateX(-100%);
}

input::placeholder {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2em;
    text-align: center;
}

label {
    font-size: 1.7em;
}

#modes {
    appearance: none;
    font-size: 1em;
    width: 90px;
    text-align: center;
    margin-top: 10px;
}

.game-wrapper {
    margin-left: 100px;
    background-color: rgb(0, 130, 139);
    color: white;
    padding: 2em;
    font-size: 1.2em;
    text-align: center;
    width: 500px;
    box-shadow: 6px 6px 5px rgb(0, 0, 0);
    position: relative;
    transition: margin-left 0.4s;
}

.game-wrapper.centered {
    margin-left: 0px;
}

.game-wrapper h2 {
    background-color: cadetblue;
    width: 270px;
    margin: 0 auto;
    padding: 0.4em;
    border-radius: 1px 8px 1px;
    margin-bottom: 20px;
}

.game-wrapper h2 span {
    transform: translateY(7px);
    font-size: 1.1em;
}

.word {
    margin: 0;
    padding: 0.5em;
    background-color: cadetblue;
}

#text {
    margin-top: 20px;
    margin-bottom: 80px;
    height: 40px;
    font-size: 1.1em;
    text-align: center;
}

#text:focus {
    outline: none;
}

.time-wrapper {
    position: absolute;
    left: 20px;
    bottom: 5px;
}

.score-wrapper {
    position: absolute;
    right: 30px;
    bottom: 5px;
}

.time-wrapper p span, .score-wrapper p span {
    font-weight: 900;
}

.game-start-wrapper, .game-over-wrapper {
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: darkblue;   
}

.game-start-wrapper {
    display: flex;
    background-color: rgb(1, 103, 110);
}

.game-start-wrapper button,.game-over-wrapper button {
    padding: 1em;
    border: none;
    border-radius: 2px 10px 2px;
    font-family: inherit;
    font-weight: 700;
    color: rgb(255, 255, 255);
    background-color: green;
    cursor: pointer;
    font-size: 1.3em;
}

.game-start-wrapper button {
    width: 300px;
}

.game-start-wrapper p,.game-over-wrapper p {
    font-size: 1.6em;
}

.game-start-wrapper button:hover,.game-over-wrapper button:hover {
    background-color: rgb(0, 77, 0);
    font-weight: 900;
}

.game-start-wrapper button:active,.game-over-wrapper button:active {
    transform: scale(0.98);
}
.game-start-wrapper.started {
    display: none;
}

.game-over-wrapper.ended {
    display: flex;
}

.bolt {
    animation: glow 1s linear infinite;
}

.keyboard {
    animation: keying 1s linear infinite;
}

@keyframes glow {
    0%, 20%, 50%,100% {
        color: white;
        transform: translate(-2px, 10px);
    }
    10%, 30%, 60% {
        color: yellow;
        transform: translate(10px, -10px);
    }
}

@keyframes keying {
    0%, 100% {
        color: white
    }
    50% {
        color: black;
    }
}

@keyframes warning {
    0%, 100% {
        background-color: aquamarine;
    }
    50% {
        background-color: rgb(255, 127, 127);
    }
}

.toast-added-time, .toast-added-score {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 25px;
    background-color: rgb(0, 195, 255);
    bottom: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.toast-added-score {
    right: 30px;
    
}

.toast-added-time {
    left: 55px
}

.toast-added-score.toasted, .toast-added-time.toasted {
    animation: showUp 1s linear;
}

@keyframes showUp {
    0%{
        opacity: 0;
        transform: translateY(10px);
    }
    40%, 60% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@media (max-width: 650px) {
    .mode-div {
        width: 100px;
    }

    .game-wrapper {
        margin-left: 90px;
        padding: 1.7em;
        font-size: 1em;
        width: 400px;
    }
    
    .game-wrapper h2 {
        width: 220px;
        margin: 0 auto;
        padding: 0.2em;
    }

    .game-wrapper h2 span {
        transform: translateY(4px);
        font-size: 0.9em;
    }
    
    .word {
        padding: 0.3em;
        margin-top: 30px;
    }
    
    #text {
        margin-top: 30px;
        margin-bottom: 80px;
        height: 35px;
        font-size: 1em;
    }
    .toast-added-time {
        left: 40px
    }
    
}

@media (max-width: 500px) {
    .mode-div {
        padding: 0 10px;
        width: 80px;
    }
    
    input::placeholder {
        font-size: 0.8em;
    }
    
    label {
        font-size: 1.2em;
    }
    
    #modes {
        font-size: 0.9em;
        width: 75px;
    }
    .game-wrapper {
        margin-left: 80px;
        padding: 1.2em;
        font-size: 0.8em;
        width: 300px;
        box-shadow: 4px 4px 4px rgb(0, 0, 0);
    }
    
    .game-wrapper h2 {
        background-color: cadetblue;
        width: 210px;
        padding: 0.2em;
        margin-bottom: 17px;
    }

    .game-wrapper h2 span {
        transform: translateY(2.5px);
        font-size: 0.8em;
    }

    .word {
        padding: 0.3em;
    }
    
    #text {
        margin-top: 25px;
        margin-bottom: 60px;
        height: 35px;
        font-size: 1.1em;
    }
    
    .time-wrapper {
        left: 15px;
    }
    
    .score-wrapper {
        right: 15px;
    }
    
    .game-start-wrapper button,.game-over-wrapper button {
        padding: 0.8em;
        font-size: 1.1em;
    }
    
    .game-start-wrapper button {
        width: 200px;
    }

    .toast-added-time, .toast-added-score {
        width: 35px;
        height: 35px;
        background-color: rgb(0, 195, 255);
        bottom: 55px;
    }
    
    .toast-added-score {
        right: 12px;
        
    }
    
    .toast-added-time {
        left: 15px
    }

}