
:root {
    --PADDING: 3em;
    --PADDING-TOP: 0em;
    --PADDING-BOTTOM: 5em;

    --BORDER-WIDTH: 0.2em;

    /* Main */
    --COL-1: #FF90C8;
    /* --COL-1: #2099c9; */
    /* --COL-1: hsl(320deg, 80%, 70%); */
    /* Errors */
    --COL-ERROR: #D00;
    /* Shading Dark */
    --COL-SH-1: color-mix(in srgb, var(--COL-1) 15%, black);
    /* Shading Dim */
    --COL-SH-2: color-mix(in srgb, var(--COL-1) 25%, black);
    /* Shading Bright */
    --COL-SH-3: color-mix(in srgb, var(--COL-1) 45%, black);
    /* Noticeably contrasts with the main col */
    --COL-FILL: color-mix(in srgb, var(--COL-1) 75%, black);
    /* Invisible */
    --COL-INVIS: rgba(0, 0, 0, 0);
    /* Opacity Dark */
    --COL-OP-1: color-mix(in srgb, var(--COL-1) 10%, var(--COL-INVIS));
    /* Opacity Dim */
    --COL-OP-2: color-mix(in srgb, var(--COL-1) 20%, var(--COL-INVIS));
    /* Opacity Bright */
    --COL-OP-3: color-mix(in srgb, var(--COL-1) 35%, var(--COL-INVIS));
    /* Brightness */
    --COL-A: 0.7;
}

html {
    background-color: black;
    color: var(--COL-1);
    font-family: monospace;
    font-size: min(2vmin, 1.25em);
    text-shadow: 0 0 0.15em var(--COL-1);
}

html::selection {
    color: black;
    background-color: var(--COL-1);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
}

input {
    position: relative;
    bottom: 0;
}

a {
    color: inherit;
    user-select: all;
}

hr {
    border-color: var(--COL-1);
    margin-bottom: 1em;
    border-style: solid;
    font-size: 0.5em;

    border-width: var(--BORDER-WIDTH);
}

.console-body img {
    display: block;
    min-height: 6em;
    max-height: 10em;

    padding: 0.5em;
    margin-top: 0.5em;
    margin-bottom: 0.5em;

    border-width: var(--BORDER-WIDTH);
    border-color: var(--COL-1);
    border-style: solid;

    background-color: var(--COL-SH-1);
}

table {
    text-align: center;
    border-collapse: collapse;
}

table *:not(span) {
    padding: 0.1em 0.5em;
    border-style: solid;
    border-color: var(--COL-1);
    border-width: calc(var(--BORDER-WIDTH) * 0.5);
}

table tr:nth-child(even) {
    background-color: var(--COL-SH-2);
}

table.fullscreen {
    width: 100%;
}

table td,
table th,
table caption {
    user-select: all;
}

iframe {
    width: 20em;
    height: 20em;

    border-width: var(--BORDER-WIDTH);
    border-color: var(--COL-1);
    border-style: solid;
}

::-webkit-scrollbar {
    background-color: #0000;
}

::-webkit-scrollbar-thumb {
    background-color: var(--COL-1);
}

.disabled {
    display: none !important;
}

.reset {
    all: unset;
}

.animation-paused {
    animation-play-state: paused !important;
}

/* Console Elements */

span.error {
    color: var(--COL-ERROR);
    text-shadow: 0 0 0.15em var(--COL-ERROR);
}

div.error,
div.error * {
    color: var(--COL-ERROR);
    border-color: var(--COL-ERROR);
    text-shadow: 0 0 0.15em var(--COL-ERROR);
}

.highlighted {
    background-color: color-mix(in srgb, var(--COL-1) 85%, black);
    color: var(--COL-SH-1);
    /* text-shadow: 0 0 0.15em var(--COL-SH-1); */
    padding: 0.3em;
}

.poster {
    display: flex;
    flex-direction: column;
    text-align: center;
    white-space: initial;
}

/* Console layout */

#console-background,
#console-foreground,
#console-opening-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    user-select: none;
    pointer-events: none;
}

@keyframes gradient-move {
    0% {
        background-position-y: 0;
    }

    100% {
        background-position-y: 100vh;
    }
}

#console-background {
    /* background: linear-gradient(0deg, rgba(0,0,0,1) 0%, rgba(255,255,255,0.2) 100%); */
    z-index: -1;

    background: linear-gradient(
        to bottom,
        #000,
        #000 50%,
        var(--COL-SH-1) 50%,
        var(--COL-SH-1)
    );
    background-size: 100% 0.3em;
    animation: gradient-move 3000ms linear infinite;
}

#console-foreground {
    box-shadow: 0 0 2em 2em black inset;
    z-index: 9999;
    /* opacity: 0.3; */
}

#console-foreground.crt-overlay {
    background: linear-gradient(
        to bottom,
        var(--COL-INVIS),
        var(--COL-INVIS) 50%,
        var(--COL-OP-1) 50%,
        var(--COL-OP-1)
    );
    background-size: 100% 0.3em;
    animation: gradient-move 3000ms linear infinite;
}

@keyframes console-opening-effect-anim {
    0%, 10% {
        box-shadow: 0 0 0 50vmax black inset;
        text-shadow: 0 0 0.05em var(--COL-1),
                    0 0 1em var(--COL-1);
        color: #0000;
        pointer-events: all;
    }

    25% {
        box-shadow: 0 0 0 50vmax black inset;
        text-shadow: 0 0 0.1em var(--COL-1);
    }

    60% {
        box-shadow: 0 0 16em 0 black inset;
        text-shadow: 0 0 1em #0000;
    }

    100% {
        box-shadow: 0 0 0 0 black inset;
        text-shadow: 0 0 0 #0000;
    }
}

#console-opening-effect {
    box-shadow: 0 0 0 0 black inset;
    animation: console-opening-effect-anim 4s;
    animation-timing-function: ease;
    animation-iteration-count: 1;

    display: flex;
    color: #0000;
    font-size: 4em;
    text-shadow: 0 0 0 #0000;

    z-index: 9998;
}

#console-opening-effect span {
    margin: auto;
}

#console-root {
    padding: calc(var(--PADDING) + var(--PADDING-TOP)) var(--PADDING) calc(var(--PADDING) + var(--PADDING-BOTTOM)) var(--PADDING);
    opacity: var(--COL-A);
    line-height: 1.8;
    display: flex;
    flex-direction: column;
}

#console-output *:not(.desktop-reset *) {
    word-wrap: normal;
    overflow: overlay;
    white-space: pre;
}

#console-output {
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column-reverse;
}

#console-current-line {
    /* box-shadow: 0 0 1em 1em black; */
    background-color: var(--COL-SH-1);
    padding: 1em;
    margin-bottom: 1em;
}

#console-input {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
}

.console-entry {
    margin-bottom: 0.5em;
}

.console-output {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    padding: 0.5em;
    border-width: var(--BORDER-WIDTH);
    border-left-width: calc(var(--BORDER-WIDTH) * 2.5);
    border-color: var(--COL-1);
    border-style: solid;
}

.console-output:empty,
.console-entry:empty {
    display: none;
}


.console-entry-tl {
    padding-right: 0.5em;
}

.console-entry-sep {
    display: inline-block;
    min-width: 1em;
}

.console-entry-tr {
    margin-left: auto;
    min-width: 10em;
}

/* Windows */

.desktop-reset {
    white-space: normal !important;
    transition: 200ms opacity;
}

.desktop-reset:hover {
    opacity: 1 !important;
}

.window {
    position: absolute;
    border: solid var(--BORDER-WIDTH) var(--COL-1);
    min-width: 5em;
    min-height: 5em;
}

.window * {
    z-index: inherit;
}

.window .window-titlebar {
    display: flex;
    border-bottom: solid var(--BORDER-WIDTH) var(--COL-1);
    /* padding-left: 1em; */
    padding-right: 1em;
    background-color: var(--COL-SH-2);
    user-select: none;
    height: 2em;
}

.window .window-titlebar button {
    background: none;
    background-color: var(--COL-1);
    border: none;
    height: auto;
    aspect-ratio: 1;
}
.window .window-titlebar button:hover {
    cursor: pointer;
}

.window .window-titlebar span {
    margin: auto    
}

.window .window-body {
    padding: 1em;
    display: grid;
    background-color: var(--COL-SH-1);
}

.window .window-body.grid {
    grid-template-columns: repeat(2, 1fr);
}

.file-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: dotted var(--BORDER-WIDTH) var(--COL-INVIS);
    padding: 0.5em 0.5em 0 0.5em;
    user-select: none;
    cursor: pointer;
}

.file-entry:hover {
    border-color: var(--COL-1);
    font-style: italic;
}

.file-entry img {
    width: 4em;
    height: 4em;
}

.progress-bar {
    height: 2em;
    background-color: var(--COL-SH-2);
    border: solid var(--COL-1) var(--BORDER-WIDTH);
}

.progress-bar-fill {
    background-color: var(--COL-FILL);
    height: 100%;
    width: 0;
    transition: 50ms width;
}

@keyframes media-player-animation {
    0% {
        box-shadow: 0 0 0 0 var(--COL-FILL);
        background-color: var(--COL-FILL);
    }

    100% {
        box-shadow: 0 0 0 0.5em var(--COL-1);
        background-color: var(--COL-1);
    }
}

.window.media-player img {
    border-radius: 0em;
    border: solid var(--COL-FILL) var(--BORDER-WIDTH);
    width: 12em;
    height: 12em;

    transform: translateY(-1em);
    transition: transform 200ms;
}
.window.media-player img:hover {
    transform: translateY(-1.5em);
}
.window.media-player img:active {
    transform: translateY(-0.5em);
}

.window.media-player .image-button {
    cursor: pointer;
    user-select: none;

    margin-bottom: 2em;
    width: 12em;
    height: 12em;

    transform: translateY(1em);
    
    box-shadow: 0 0 1em 0 var(--COL-FILL);
    background-color: var(--COL-FILL);
    animation: media-player-animation infinite;
    animation-duration: 352ms;
}
