:root {
    --bg: #1e1e1e;
    --bg-light: #282c34;
    --fg: #abb2bf;
    --fg-dark: #393e47;
    --red: #ff616e;
    --cyan: #4cd1e0;
    --dark-gray: #4f5666;
}

/* ---------- Layout ----------- */
body {
    margin: 0;
    width: 100vw;
    height: 100vh;
    /* overflow: hidden; */
    display: flex;
    flex-direction: row;
    background-color: var(--bg);
}

#editor {
    width: 60vw;
    height: 100vh;
}

#console-container {
    width: 40vw;
    height: 100vh;
}

@media screen and (max-width: 150vh) {
    body {
        flex-direction: column;
    }

    #editor {
        width: 100vw;
        height: 60vh;
    }

    #console-container {
        width: 100vw;
        height: 40vh;
    }
}

/* ---------- Console ---------- */
#console {
    padding: 1rem;
    font-family: 'JetBrains Mono';
    color: var(--fg);
    font-size: 14px;
    height: calc(100% - 4.2rem);
    line-height: 19px;
    overflow-y: auto;
}

#console-actionbar {
    width: 100%;
    box-sizing: border-box;
    height: 2.2rem;
    padding-inline: 1rem;
    gap: 1rem;
    background-color: var(--bg-light);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

#console-actionbar__load {
    color: var(--fg);
    font-family: sans-serif;
    height: 1.8rem;
    min-width: 25rem;
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: center;
}

#load-select {
    background-color: var(--fg-dark);
    width: 12rem;
    height: 100%;
    position: relative;
    cursor: pointer;
    user-select: none;
}

#load-select__current::after {
    content: '';
    position: absolute;
    border-style: solid;
    border-width: .4rem .4rem 0 .4rem;
    border-color: var(--fg) transparent transparent transparent;
    top: 50%;
    right: .6rem;
    transform: translateY(-50%);
}

/* #load-select-cb:checked + label #load-select__current::after {
    transform: rotate(180deg);
} */

#load-select > * {
    height: 100%;
    padding-inline-start: .5rem;
    display: flex;
    align-items: center;
}

.load-select-option {
    background-color: var(--bg-light);
}

#load-select-cb:not(:checked) + label .load-select-option {
    display: none !important;
}

.load-select-option:hover {
    background-color: var(--fg-dark);
}

#load-button {
    border: none;
    background-color: var(--fg-dark);
    color: var(--fg);
    height: 100%;
    cursor: pointer;
    font-size: 16px;
    font-family: sans-serif;
    padding-inline: .6rem;
    transition-property: background-color, color;
    transition-duration: 100ms;
}

#load-select-error {
    display: none;
}

@media screen and (max-width: 44rem) {
    #console-actionbar__load > span:first-of-type {
        display: none;
    }
}

@media screen and (max-width: 37rem) {
    #console-actionbar__load {
        min-width: 15rem;
    }

    #load-select-error {
        display: none !important;
    }
}

@media screen and (min-width: 150.0001vh) and (max-width: 110rem) {
    #load-select-error {
        display: none !important;
    }
}

#console-actionbar__buttons {
    display: flex;
    flex-direction: row-reverse;
    gap: 1rem;
}

#run-button, #kill-button {
    width: 1.2rem;
    height: 1.2rem;
    border: none;
    outline: none;
    cursor: pointer;
}

#run-button {
    background-color: transparent;
    padding: 0 .1rem;
}

#run-button > div {
    width: 100%;
    height: 100%;
    background-color: yellowgreen;
    clip-path: polygon(
        0 0,
        100% 50%,
        0 100%
    );
}

#kill-button {
    background-color: crimson;
}

button:disabled {
    opacity: 30%;
    cursor: unset;
}

button:not(:disabled):hover {
    filter: brightness(90%);
}

/* ------------- Font style ------------ */
.bold {
    font-weight: bold;
}

.red {
    color: var(--red);
}

.cyan {
    color: var(--cyan);
}

.dark-gray {
    color: var(--dark-gray);
}

.ansi_color {
    color: var(--ansi-fg-color);
}

.ansi_blink {
    animation: blink 1.2s linear 0s infinite normal;
}

@keyframes blink {
    0% {
        color: transparent;
    }
    50% {
        color: transparent;
    }
    51% {
        color: var(--ansi-fg-color);
    }
    100% {
        color: var(--ansi-fg-color);
    }
}
