/*
globals
*/
@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

* {
    font-family: 'VT323';
}

*::selection {
    background: #FFBACD;
}

html,
body {
    overflow: hidden;
    padding: 0;
    margin: 0;
    border: 0;
    outline: 0;

    width: 100%;
    height: 100%;

    /* background-image: url('../data/glitter.jpg'); */
    /* image-rendering: pixelated; */
    background: whitesmoke;
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;

    font-size: 1.2rem;
    color: black;
    text-shadow:
        -1px -1px 0 whitesmoke,
        1px -1px 0 whitesmoke,
        -1px 1px 0 whitesmoke,
        1px 1px 0 whitesmoke;
}

body.loading,
body.loading .icon:hover {
    cursor: wait !important;
}

/*
body {
    transition: background-image 1s;
}
*/

.moving {
    cursor: move !important;
}

#logo {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);

    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem;

    user-select: none;
    z-index: 0;
}

#logo img {
    /* cursor: not-allowed; */
    width: 18vw;
}

#logo div {
    margin-top: -2rem;
}

#contextMenu {
    position: absolute;
    z-index: 99999;
    display: none;
}

#contextMenu.open {
    display: flex;
    flex-direction: column;
    transform: scale(0.15) rotate3d(1, 0, 0, 10deg);
    transform-origin: 0 0;
    opacity: 0;
    transition: .25s ease-in-out;
}

#contextMenu.in {
    transform: scale(1);
    opacity: 1;
}

#contextMenu button {
    text-align: left;
    width: 15rem;
    font-size: 1.5rem;
}

#contextMenu button:hover {
    cursor: pointer;
    background: #89cff0;
}

#guide {
    position: absolute;
    border-radius: 3px;
    right: 5px;
    bottom: 5px;
    width: 20rem;
    padding: 0.5rem;
    background: whitesmoke;
    transition: .3s ease-in-out;
    z-index: 9999;
}

#guide.away {
    opacity: 0;
    right: -20rem;
}

#progress {
    position: absolute;
    top: 50%;
    left: 50%;
    user-select: none;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    z-index: 999999;
    text-align: center;
    line-height: 100vh;
    width: 100%;
    height: 100%;
    animation: 1s infinite pulse ease-in-out;
    transition: 0.25s ease-in-out;
    backdrop-filter: blur(10px);
}

#progress.loaded {
    animation: none;
    opacity: 0;
}

@keyframes pulse {
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
}



/*
main desktop icons + windows
*/
.file {
    display: flex;
}

.icon {
    position: absolute;
    transform: translate(-50%, -50%);

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

    width: 6rem;
    padding: 1rem;

    user-select: none;
    z-index: 2;
}

.icon.special img {
    animation: 2s infinite bump ease-in-out;
}

.icon.special .name {
    animation: 2s infinite glow ease-in-out;
}

.icon.special:nth-child(3n+1) .name {
    animation-delay: 0.7s;
}

.icon.special:nth-child(3n+2) .name {
    animation-delay: 1.4s;
}

@keyframes bump {
    20% {
        transform: scale(1.1);
    }

    40% {
        transform: scale(1);
    }
}

@keyframes glow {
    20% {
        text-shadow:
            -1px -1px 0 #FFBACD,
            1px -1px 0 #FFBACD,
            -1px 1px 0 #FFBACD,
            1px 1px 0 #FFBACD
    }

    40% {
        text-shadow: inherit;
    }
}

.icon:not(.in) {
    display: none;
}

.icon .name {
    cursor: default;
    color: black;
    text-decoration: none;
    pointer-events: none;
    padding: 4px;
    text-align: center;
    word-break: break-word;
}

.icon:hover .name {
    text-decoration: underline;
}

.icon.moving .name,
.icon.clicked .name {
    background: #89cff0;
}

.icon img {
    pointer-events: none;
    user-select: none;
    image-rendering: pixelated;
    filter: sepia(10%);
    max-width: 3rem;
    max-height: 3rem;
}

.icon img.override {
    /* background: url('../data/icons/loading.gif') no-repeat center center white; 
    background-size: 3rem; */
    border: 2px outset whitesmoke;
}

.icon img:not(.override) {
    max-height: none;
    width: 3rem;
}

.icon:hover img.override {
    border-color: #FFBACD;
}

.icon.moving img,
.icon.moving:hover img,
.icon.clicked img,
.icon.clicked:hover img {
    border-color: #89cff0;
}

.window {
    position: absolute;
    transform: translate(-50%, -50%) scale(0.15) rotate3d(1, 0, 0, 10deg);
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    opacity: 0;
    transition: .5s ease-in-out;

    height: auto;
    width: 25vw;
    min-width: 15vw;
    min-height: 15vw;
    resize: both;
    overflow: auto;
    overflow-y: hidden;

    cursor: grab;
    background: whitesmoke;
    border: 4px outset whitesmoke;
}

.window.open {
    display: flex;
}

.window.in {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.window.moving {
    transition: none !important;
}

.window.active .header {
    background: #89cff0;
}

.window.large {
    /* max-height: 80vh; */
    width: 80vw;
}

.window * {
    user-select: none;
}

.window .header {
    display: flex;
    flex-direction: row;
    gap: .5rem;
    padding: .1rem;
    align-items: center;

    background: #FFBACD;
    font-weight: bold;
}

.window .header img {
    height: 1.2rem;
}

.window .header .name {
    width: 100%;
}

.window .header .nav {
    display: inline-flex;
    gap: 0.1rem;
}

.window .header .nav>* {
    cursor: pointer;
    user-select: all;
}

.window .header .nav>*:hover {
    filter: invert(100%);
}

.window .body {
    overflow: hidden;
    width: -webkit-fill-available;
    height: auto;
    display: flex;
    flex-direction: column;
}

.window .body .pre {
    overflow-y: auto;
    display: block;
    unicode-bidi: embed;
    white-space: pre-wrap;
    padding: 4px 0;
    margin: 0;
    min-height: 2rem;
    height: auto;
}

.window .body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.window .body img {
    user-select: none;
    pointer-events: none;
}

.window .body .video {
    overflow: hidden;
    width: -webkit-fill-available;
    height: auto;
}

.window .body .video video {
    box-sizing: border-box;
    cursor: pointer;
    width: -webkit-fill-available;
    background: black;
}

.window .body .video.paused video {
    filter: grayscale(100%);
    cursor: pointer;
}

.window .body .video .overlay {
    position: absolute;
    display: none;
    cursor: pointer;
    z-index: 10;
    pointer-events: none;
}

.window .body .video .overlay::before {
    content: "PLAY";
    /* ⯈ */
    color: #FFBACD;
    line-height: 5rem;
    font-size: 4rem;
    padding-left: 1rem;
}

.window .body .video:hover .overlay::before {
    color: #89cff0;
}

.window .body .video.paused .overlay {
    display: block;
}

.window .body .controls {
    padding: 6px;
    width: 100%;
    margin-top: -1px;
    box-sizing: border-box;
    background: #A1A1A1;
    text-align: center;
    overflow: hidden;
    min-height: 2rem;
}

.window .body .controls button,
#guide button {
    font-size: 1.2rem;
    background: #FFBACD;
    border-radius: 6px;
}

.window .body .controls button:hover,
.window .body .controls button.a,
#guide button:hover {
    background: #89cff0;
    cursor: pointer;
}

.window .body .controls button:not(.a) span:nth-child(1),
.window .body .controls button.a span:nth-child(2) {
    display: none;
}

.folder>.window>.body {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.folder>.window>.body>.file>.icon {
    position: relative;
    transform: none;
    top: auto !important;
    left: auto !important;
}



/*
addons
*/
.star {
    user-select: none;
    pointer-events: none;
    position: absolute;
    z-index: 99999;
    transition: all .5s ease-out;
    transform: translate(-50%, -50%);

    color: #FFBACD;
}



/*
admin
*/
.admin {
    background: #89cff0;
    overflow-x: hidden;
    overflow-y: auto;

    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    gap: 1rem;

    padding: 2rem;
    box-sizing: border-box;
}

.admin * {
    font-size: 1.5rem;
}

.admin>* {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin form {
    width: 35vw;
}

.admin .files {
    width: calc(100vw / 3);
}

.admin .files table tr td {
    padding: .5rem;
}

.admin h1 {
    margin: 0;
    padding: 0;
}

form input,
form textarea {
    padding: .5rem;
}



/**
 * mobil
 */

@media (max-aspect-ratio: 1/1) {

    * {}

    html,
    body {
        position: absolute;
        overflow-y: auto;
    }

    #progress {
        backdrop-filter: none;
        background: #FFBACD;
    }

    #logo {
        width: 100%;
        font-size: 0.8rem;
        position: absolute;
    }

    #logo img {
        width: 70vw;
    }

    #guide {
        display: none;
    }

    .icon img {
        background: none !important;
        max-width: 3rem;
        max-height: 3rem;
    }

    .window,
    .window.window.large {
        position: fixed;
        top: 50% !important;
        left: 50% !important;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .window .header .name {
        overflow-x: clip;
    }

    .window .body {
        height: auto;
        flex-direction: column-reverse;
    }

    .window .body .pre {
        padding: 1rem;
        box-sizing: border-box;
    }

    .window .body .video {
        height: fit-content;
    }

    .window .body .video .overlay {
        display: none !important;
    }

    .window .body .video video {
        height: 100%;
        width: 100%;
    }

    .window .body .controls {
        display: none;
    }

}