@font-face {
    font-family: 'Tiny5';
    src: url('/fonts/Tiny5-Regular.ttf');
}

/* https://webdraft.hu/fonts/classic-console/ */
@font-face {
    font-family: 'Classic Console';
    src: url('/fonts/clacon2.ttf');
}

@font-face {
    font-family: 'Digital';
    src: url('/fonts/digital-7_mono.ttf');
}

:root {
    --grid-title-size: 24px;
    --grid-block-border-alpha: 0.5;
    --font-h: 'Classic Console';
    --font-text: 'Classic Console';
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    width: 100%;
    height: 100%;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 100%;
    height: 100%;
    color: white;
    font-family: var(--font-text);
    overflow-x: hidden;
}

h1, h2 {
    font-family: var(--font-h);
}

a {
    cursor: pointer;
    text-decoration: none;
    color: #0ff;
    text-shadow: 0 0 5px #0ff;

    &:hover {
        text-decoration: underline;
    }
}

header {
    position: absolute;
    left: 0;
    top: 0;
    width: 100vw;
    height: 200px;

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

    a {
        position: relative;
    }

    .main {
        position: relative;
        z-index: 2;
    }

    .glow {
        z-index: 1;
        filter: blur(5px);
        -webkit-filter: blur(5px);
        opacity: 0.5;
        position: absolute;
        left: 0;
        top: 0;

        animation: flicker 2s linear reverse infinite;
        -webkit-animation: flicker 10s linear reverse infinite;
    }
}

@keyframes flicker {
    0%, 19%, 22%, 62%, 64%, 70%, 100% {
        opacity: 0.99;
    }
    20%, 21%, 63%, 65%, 69.9% {
        opacity: 0.4;
    }
}

.scroll-y {
    overflow-y: scroll;
    overflow-x: visible;
}

a.invisible-link {
    text-decoration: none;
    color: white;
}

.wip::after {
    position: relative;
    content: '';
    display: inline-block;
    background-image: url('/images/wip_sign.png');
    background-size: contain;
    background-repeat: no-repeat;
    width: 32px;
    height: 32px;
    vertical-align: middle;
}

::-webkit-scrollbar {
    width: 3px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: white;
}

/* Grid */
.grid {
    display: grid;
    grid-gap: 1.2rem;
}

.grid .block {
    display: flex;
    flex-direction: column;
    transition: transform 0.5s ease;

    background: #000000e5;
    border: 2px solid #ffffff38;
    border-radius: 4px;
}

.block-content {
    padding: 10px;
}

.block.cyan {
    border-color: rgba(0, 255, 255, var(--grid-block-border-alpha));
    box-shadow: 0 0 10px rgba(0, 255, 255, var(--grid-block-border-alpha));

    .title {
        color: #0ff;
        text-shadow: 0px 0px 5px #0ff;
    }
}

.block.magenta {
    border-color: rgba(255, 0, 255, var(--grid-block-border-alpha));
    box-shadow: 0 0 10px rgba(255, 0, 255, var(--grid-block-border-alpha));

    .title {
        color: #f0f;
        text-shadow: 0px 0px 5px #f0f;
    }
}

.block.green {
    border-color: rgba(0, 255, 0, var(--grid-block-border-alpha));
    box-shadow: 0 0 10px rgba(0, 255, 0, var(--grid-block-border-alpha));

    .title {
        color: #0f0;
        text-shadow: 0px 0px 5px #0f0;
    }
}

.block.yellow {
    border-color: rgba(255, 255, 0, var(--grid-block-border-alpha));
    box-shadow: 0 0 10px rgba(255, 255, 0, var(--grid-block-border-alpha));

    .title {
        color: #ff0;
        text-shadow: 0px 0px 5px #ff0;
    }
}

@media(min-width: 1140px) {
    .grid .block:hover {
        transform: scale(1.01);
    }
}

.grid .title {
    margin: 0;
    padding: 0.2em;
    text-align: center;
    font-size: var(--grid-title-size);

    color: #fff;
    text-shadow: 0px 0px 5px #fff;
}

/* Base */
main {
    grid-area: main;
    min-height: 100%;
}

.menu { grid-area: menu; }
footer { grid-area: footer; }

.grid.base {
    height: 70%;
    width: 60%;
    /* min-width: 600px; */
    grid-template-columns: 1fr 4fr;
    grid-template-rows: minmax(200px, auto) 0fr 200px 31px;
    grid-template-areas:
        "menu   main"
        "statistics main"
        "buttons main"
        "friends friends";
}

.menu {
    font-size: 1em;
}

.main-block {
    height: 100%;
}

#friends {
    display: flex;
    flex-direction: row;
    grid-area: friends;
}

#buttons {
    display: flex;
    flex-direction: column;
    height: 100%;

    justify-content: center;
    align-items: center;

    textarea {
        resize: none;
    }
}

footer {
    display: flex;
    flex-direction: column;
    padding: 5px;
    margin-bottom: 36px;
    align-items: center;
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100vw;
}

/* Listed Posts */
.listed-post {
    padding: 10px;
    margin-bottom: 10px;

    p {
        color: gray;
    }
}

.listed-post-meta {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: top;
}

/* Trees */
.tree {
    --disabled: #666;

    position: relative;
    padding: 10px 30px 10px 30px;
    line-height: 1.5;
    list-style: none;
    margin: 0;
    overflow-y: scroll;

    li::before {
        position: relative;
        left: -8px;
        content: '';
        display: inline-block;
        background-image: url('/images/folder_closed.png');
        background-size: contain;
        background-repeat: no-repeat;
        width: 32px;
        height: 32px;
        vertical-align: middle;
    }

    li:hover::before {
        background-image: url('/images/folder_open.png');
    }

    li.wip::before {
        color: var(--disabled);
    }

    li {
        padding: 5px 0 5px 0;
    }
    li.wip {
        filter: brightness(50%);
    }

    ul {
        padding-left: 5px;
        list-style: none;

        li {
            position: relative;
            padding-top: 5px;
            padding-bottom: 5px;
            padding-left: 15px;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;

            &:before {
                position: absolute;
                top: 18px;
                left: 0;
                width: 10px;
                height: 2px;
                margin: auto;
                content: '';
                background-color: white;
            }

            &:after {
                position: absolute;
                top: 3px;
                bottom: 0;
                left: 0;
                width: 2px;
                height: 100%;
                content: '';
                background-color: white;
            }

            &:first-child {
                margin-top: 5px;
            }

            &:last-child:after {
                height: 15px;
            }
        }
    }
}

/* Scrollable */
.scrollable {
    position: relative;
    width: 100%;
    height: 100%;

    .gradient {
        position: absolute;
        width: 100%;
        height: 100%;

        pointer-events: none;
        opacity: 1;
        transition: opacity 0.3s ease;
    }

    .gradient.top {
        background-image: linear-gradient(to top, transparent 90%, black);
    }

    .gradient.bottom {
        background-image: linear-gradient(to bottom, transparent 90%, black);
    }

    .gradient.fade-in {
        animation: gradient_fadeIn 0.3s forwards;
    }

    .gradient.fade-out {
        animation: gradient_fadeOut 0.3s forwards;
    }
}

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

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

/* Compatibility */
.mobile-menu.block {
    display: none;
    position: fixed;

    left: 0;
    top: 0;
    width: 100vw;

    .tree {
        display: none;
    }

    .title {
        font-size: 56px;
    }

    a {
        text-decoration: none;
    }
}


@media(max-width: 1640px) or (max-height: 960px) {
    header {
        display: none
    }

    .grid.base {
        width: 80%;
        height: 80%;
    }
}

@media(max-width: 1400px) or (max-height: 900px) {
    header {
        display: none
    }

    .grid.base {
        width: 90%;
        height: 90%;
    }
}

@media(max-width: 1140px) or (max-height: 800px) {
    .mobile-menu.block {
        display: block;
        z-index: 99;
    }

    .asteroid , .menu.block, header, #buttons-block, #other-block, .scanlines, #friends {
        display: none;
    }

    .grid {
        display: flex;
        flex-direction: column;
        font-size: 32px;
    }

    .grid.base {
        width: 100%;
        height: 100%;
        margin-top: 200px;
    }

    .grid .block:not(.mobile-menu) {
         margin: 20px;
    }

    body {
        min-height: 100%;
    }

    main {
        min-height: auto;
    }

    .main-block {
        height: auto;
    }

    footer {
        font-size: 24px;
        position: relative;
    }

    #friends {
        img {
            width: 50%;
            -ms-interpolation-mode: nearest-neighbor;
            image-rendering: crisp-edges;
            image-rendering: pixelated;
        }
    }
}

@media(max-width: 640px) {
    #other-block {
        display: none;
    }
}