:root {
    --topbottom: #1f363dff;
    --back: #40798cff;
    --button: #70a9a1ff;
    --input: #9ec1a3ff;
    --text: #cfe0c3ff;
}

body{
    font-family: "Ubuntu Mono", monospace;
    text-align: center;
    margin: auto;
    background-color: var(--back);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100dvh;
}

h1, .howto_header{
    margin:0;
}


h1, h2, h3, h4, h5, h6{
    color: var(--text);
}

#target-container{
    display: inline-flex;
    flex-direction: row;
    height: 50%;
    padding-bottom: 10px;
}

.target{
    display: inline;
    text-decoration: underline;
    font-size: 5vh;
    margin: auto 7px auto auto;
}

.unlocked{
    color: green;
}

#bottom{
    display: flex;
    width: 100%;
    background-color: var(--topbottom);
    min-height: 0;
    height: auto;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding-bottom: 2vh;
    flex: 0 0 auto;
}

#top{
    width: 100%;
    height: 50px;
    background-color: var(--topbottom);
    flex-direction: column;
    justify-content: center;
    display: flex;
    flex: 0 0 auto;
}

#chain-container{
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text);
    overflow-y: auto;
    width: 100%;
    min-height: 0;
}

.chain_element{
    font-size: 35px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.overlap_start{
    text-decoration: underline;
    text-decoration-color: var(--button);
    text-decoration-thickness: 5px;
}
.overlap_end{
    text-decoration: underline;
    text-decoration-color: var(--button);
    text-decoration-thickness: 5px;
}

.overlap_start.overlap_end{
    text-decoration-line: underline;
    text-decoration-color: var(--input);
}

.unlocker_left, .unlocker_right{
    color: green;
    background-color: var(--topbottom);
    text-decoration: underline;
    text-decoration-thickness: 5px;
}

.unlocker_left{
    border-radius: 10px 0 0 10px;
}

.unlocker_right{
    border-radius: 0 10px 10px 0;
    margin-left: -1px;
}

.error{
    color: red;
    opacity: 1;
    animation-name: shake, fadeOut;
    animation-duration: 0.5s, 1s;
    animation-iteration-count: 2, 1;
    animation-delay: 0s, 1.1s;
}

#loading{
    animation: shake 0.5s linear infinite;
}

@keyframes shake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(3deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-3deg); }
    100% { transform: rotate(0deg); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

#input-container{
    display: flex;
    justify-content: center;
    height: 7dvh;
    /*height: auto;*/
    width: 100%;
    flex-direction: row;
    z-index: 1;
    padding-bottom: 10px;
    flex: 0 0 auto;
}

#input-form{
    display: contents;
}

#input-box{
    font-family: "Ubuntu Mono", monospace;
    width: 40%;
    height: 100%;
    border: 0;
    border-radius: 25px;
    background-color: var(--input);
    margin-left: 5px;
    margin-right: 5px;
    font-size: 25px;
    text-align: center;
    pointer-events: none;
    direction: rtl;
}

#keyboard-container{
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: var(--topbottom);
    justify-content: flex-end;
    flex: 1 1 auto;
    /*min-height: 0;*/
}

.keyboard_row{
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 33%;
    /*height: auto;*/
    justify-content: center;
    flex: 1 1 auto;
}

.keyboard_key{
    width: 9%;
    border-radius: 25px;
    color: var(--text);
    background-color: var(--button);
    font-size: 5vh;
    font-weight: bold;
    aspect-ratio: 1 / 1;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2px;
}

.pressed_key{
    background-color: var(--input);
}

button{
    font-family: "Ubuntu Mono", monospace;
}


#undo-button{
    position: relative;
}

#undo_warning{
    position: absolute;
    color: var(--back);
    font-size: 16px;
    top: 10%;
    right: 10%;
}


.button{
    border: 0;
    padding: 0;
    border-radius: 25px;
    color: var(--text);
    /*color: red;*/
    background-color: var(--button);
    font-size: 5vh;
    font-weight: bold;
    height: 100%;
    aspect-ratio: 1/1;
}

.popup{
    display: none;
    position: absolute;
    flex-direction: column;
    background-color: var(--topbottom);
    width: 40vw;
    border-radius: 25px;
    box-shadow: -7px 6px 20px 1px;
    color: var(--text);
    padding: 40px;
    overflow-y: auto;
    z-index: 3;
    max-height: 80vh;
}

#howto{
    width: 50vw;
}

#goto_today{
    display: none;
    position: absolute;
    font-size: 18px;
    height: 40px;
    width: 110px;
    left: 0;
}

.close{
    background-color: transparent;
    color: var(--text);
    font-size: 3vh;
    width: 3vh;
    border: 0;
    right: 1vh;
    position: absolute;
    top: 1vh;
}

.summary_element{
    margin: 2px;
}

#share_button {
    width: 10vw;
    background-color: var(--button);
    border-radius: 25px;
    padding: 5px;
    margin: 20px auto auto;
}

#navigator_box{
    display: inline-flex;
    justify-content: center;
}

.game_end_navigator{
    width: 25%;
    aspect-ratio: 2/1;
    background-color: var(--button);
    border-radius: 25px;
    padding: 5px;
}

#howto_button{
    right: 0;
    background-color: var(--button);
    border-radius: 20px;
    aspect-ratio: 1/1;
    height: 40px;
    font-weight: bold;
    font-size: 30px;
    border: 0;
    color: var(--text);
    position: fixed;
}

@media screen and (max-width: 600px) {
    #input-container{
        width: 100%;
    }
    #input-box{
        width: 60%;
    }
    .button{
        width: 20%;
    }
    #share_button{
        width: 50vw;
    }
    #random_game_button, #today_game_finished{
        width: 25vw;
    }
    #goto_today{
        width: 70px;
        font-size: 13px;
        flex-wrap: wrap;
        align-content: center;
    }
}

@media screen and (max-width: 800px) {
    #success, #howto{
        width: calc(90vw - 80px);

    }
}

/*when screen is wider than 1000px*/
@media screen and (min-width: 1000px) {
    .keyboard_key{
        max-width: 50px;
    }
}

/*query for there being a mouse or touchpad*/
@media (hover: hover) and (pointer: fine) {
    #keyboard-container{
        display: none;
    }
}