@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@300&display=swap');

* {
    margin: 0;
    padding: 0;

    font-size: 16px;
    user-select: none;

    font-family: 'Roboto Mono', monospace;

    overflow: hidden;

    white-space: nowrap;

    --col1: #111;
    --col1-1: #222;
    --col2: #fff;
    --col3: #a9bbf7;
    /* --col1: #89F5D8;
    --col1-1: #215C4C;
    --col2: #A8563D; */
}

@keyframes dropLeft {
    from {
        transform: translateX(-100vw);
    }
    to {
        transform: translateX(0);
    }
}
@keyframes dropTop {
    from {
        transform: translateY(-100vh);
    }
    to {
        transform: translateY(0);
    }
}
@keyframes dropTopAbsolute {
    from {
        top: -100vh;
    }
    to {
        top: 0;
    }
}
@keyframes appearOpacity {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@keyframes appearScale {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}
@keyframes appearBoom {
    from {
        opacity: 0;
        scale: 2;
    }
    to {
        opacity: 1;
        cale: 1;
    }
}

body {
    margin: 0;
    padding: 0;
    
    height: 100vh;
    
    display: flex;
    flex-direction: column;
}

header {
    flex: 1;

    display: flex;

    color: var(--col2);

    background-color: var(--col1);
    box-shadow: 0 0 2vh var(--col1);

    z-index: 5;
}
#stage-symbol {
    flex: 2;
    
    display: flex;
    flex-direction: column;
    justify-content: center;

    opacity: 0.3;
    text-shadow: 0 0 0.3vh #fff;
    font-size: 7em;
    font-weight: 1000;
    text-align: center;
}
#stage-info {
    flex: 5;

    display: flex;
    flex-direction: column;
}
#stage-info > div {
    position: relative;

    flex: 1;

    padding-left: 2%;

    display: flex;
    flex-direction: column;
    justify-content: center;

    text-align: left;
}
#stage-info > div::before {
    top: 0;
    left: 5%;
    position: absolute;

    font-size: 0.3em;

    opacity: 0.4;
}
#stage-title::before {
    content: "Title";
}
#stage-description::before {
    content: "Goal";
}
#stage-title {
    border-radius: 0 0 0 2vh;

    font-weight: bolder;
    background-color: var(--col1-1);
}
#stage-description {
    background-color: #0000;
}


main {
    position: relative;

    flex: 10;

    display: flex;
    flex-direction: column;
    justify-content: center;

    background-color: var(--col1-1);
}

#merge-field {
    position: relative;
    margin: 0 auto;

    width: 80vw;
    height: 95%;
}
.merge-item {
    display: inline-block;
    padding: 0.15vh 0.3vw;

    position: absolute;

    font-size: 2.4em;
    color: #fff;

    background-color: #1111;

    cursor: pointer;
    transition: color 0.6s cubic-bezier(0,.67,0,.99),
        transform 0.6s cubic-bezier(0,.67,0,.99),
        background-color 0.6s cubic-bezier(0,.67,0,.99);
}
.merge-item:not(.locked):hover {
    transform: scale(1.4);
}
.merge-item:not(.locked):active {
    color: var(--col1);

    transform: scale(1.1);
    background-color: var(--col2);

    transition: color 3s cubic-bezier(0,.67,0,.99),
        transform 3s cubic-bezier(0,.67,0,.99),
        background-color 3s cubic-bezier(0,.67,0,.99);
}
.merge-item.locked {
    background-color: var(--col1-1);

    cursor: auto;
}
#merge-field-bg {
    position: absolute;
    margin-left: 10vw;

    width: 80vw;
    height: 95%;

    background-color: #8888;
    box-shadow: 0 0 1.5vh var(--col1-1) inset;
    border-radius: 1vh;
}

.context-menu {
    position: absolute;
    padding: 0.7vh;
    
    color: var(--col2);
    
    box-shadow: 0 0 1vh var(--col1-1);
    
    border-radius: 0.2vh;
    background-color: var(--col1-1);

    z-index: 9999;
    animation: appearOpacity 0.15s cubic-bezier(0,.2,.07,.91);
}
.context-menu > .title {
    padding: 0.2vh 0.9vw;
    margin-bottom: 0.6vh;

    min-width: 10vw;

    color: var(--col2);
    font-size: 1.2em;

    border-radius: 0.3vh;
    background-color: var(--col1);
    box-shadow: 0 0 0.4vh var(--col1);
}
.context-menu > .item-container > div {
    padding-left: 0.3vw;

    border-radius: 0.4vh;

    cursor: pointer;
}
.context-menu > .item-container > div:hover {
    background-color: #fff4;
}

#stage-select-bg {
    position: absolute;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    width: 100vw;
    height: 100vh;

    background-color: #111c;

    cursor: pointer;
    z-index: 6;
    animation: appearOpacity 0.15s linear;
}
#stage-select {
    position: relative;

    padding: 0.5%;
    box-sizing: border-box;

    width: 60%;
    height: 60%;

    display: flex;
    flex-direction: column;

    color: #fff;

    box-shadow: 0 0 1vh #222;
    border: 2px solid #222;
    background: rgb(68,68,68);
    background: linear-gradient(180deg, rgba(68,68,68,1) 0%, rgba(119,119,119,1) 10%, rgba(119,119,119,1) 17%, rgba(68,68,68,1) 100%);

    cursor: auto;
    animation: appearScale 0.15s cubic-bezier(0,.2,.07,.91);
}
#stage-select-title {
    flex: 1;
    margin: 1vh;
    padding-left: 3vh;

    display: flex;
    flex-direction: column;
    justify-content: center;

    font-size: 2em;

    background-color: #222;
    box-shadow: 0 0 1vh #222;
    border-radius: 1vh;
}
#stage-select-back {
    position: absolute;
    right: 1vh;

    display: inline-block;

    width: 5vh;
    height: 5vh;

    font-size: 2em;
    
    border-radius: 0.8vh;
    background-color: #e33424;
    box-shadow: 0 0 0.75vh #e33424;

    cursor: pointer;
    transition: color 0.05s linear, background-color 0.05s linear;
}
#stage-select-back::before {
    position: absolute;
    left: 50%;
    top: 50%;

    transform: translate(-50%, -50%);

    content: "×";
}
#stage-select-back:hover {
    color: #e33424;

    background-color: #fff;
}
#stage-select-list {
    padding: 1%;

    flex: 8;

    background-color: #fff2;
    border-radius: 0.5vh;

    overflow-y: auto;
}
#stage-select-list::-webkit-scrollbar {
    width: 10px;
}
#stage-select-list::-webkit-scrollbar-thumb {
    background-color: #2228;
    border-radius: 10px;
    background-clip: padding-box;
    border: 2px solid transparent;
}
#stage-select-list::-webkit-scrollbar-track {
    border-radius: 10px;
}
.stage-item {
    padding: 1%;

    background-color: #2228;
    border-radius: 0.5vh;

    cursor: pointer;

    transition: background-color 0.05s linear;
}
.stage-item:hover {
    background-color: #1118;
}
.stage-item.completed {
    background-color: #d4f0c588;
}
#stage-select-list > .stage-item:not(:last-child) {
    margin-bottom: 1%;
}
.stage-title {
    font-size: 1.5em;
    font-weight: bold;
}
.stage-description {
    font-size: 0.8em;
    margin-bottom: 0.3%;
}
.stage-difficulty {
    padding-left: 2vh;

    font-weight: bold;

    border-radius: 0.3vh;
}
.stage-difficulty::before {
    content: "Difficulty: ";
    font-weight: initial;
}

#stage-rule-display {
    padding: 1vh 3vw;

    position: absolute;
    top: 0;
    left: 50vw;
    transform: translateX(-50%);

    text-align: center;
    color: #fff;

    background-color: #fff3;
    box-shadow: 0 0 0.8vh #ff8888;
    border-radius: 0 0 0.5vh 0.5vh;
    --border: 2px solid #ff8888;
    border-bottom: var(--border);
    border-left: var(--border);
    border-right: var(--border);

    backdrop-filter: blur(0.6vh);

    pointer-events: none;

    z-index: 1;
    animation: dropTopAbsolute 0.15s cubic-bezier(0,.2,.07,.91);
}
#stage-rule-title {
    font-size: 1.3em;
    font-weight: bold;

    color: #ff8888;
}
#stage-rule-list > div {
    display:list-item;
    list-style: circle;
}

#increment-stage {
    padding: 2vh 3vw;

    position: absolute;
    left: 50%;
    bottom: 6vh;
    transform: translateX(-50%);

    font-size: 1.2em;
    font-weight: bold;
    color: var(--col2);

    background-color: var(--col1-1);
    box-shadow:
        0 0 1vh var(--col1) inset,
        0 0 0.5vh var(--col2);

    transition:
        background-color 0.3s ease-out,
        box-shadow 0.3s ease-out,
        color 0.3s ease-out;
    cursor: pointer;
    z-index: 2;
    animation: appearBoom 1s cubic-bezier(0,.2,.07,.91);
}
#increment-stage:hover {
    color: var(--col1);
    text-shadow: 0 0 0.3vh var(--col1);

    background-color: var(--col2);
    box-shadow:
        0 0 1vh var(--col2) inset,
        0 0 0.5vh var(--col2);
}
