@font-face {
    font-family: Font;
    src: url('/resources/font.woff2');
}

:root {
    --bc1: rgb(14, 15, 16);
    --bc2: rgb(24, 25, 26);
    --bc3: rgb(34, 35, 36);
    --c1: rgb(244, 245, 246);
    --c2: rgb(204, 205, 206);
    --c3: rgb(144, 145, 146);
    --bct1: rgba(14, 15, 16, 0.75);
    --ct1: rgba(244, 245, 246, 0.25);
    --red: rgb(255, 55, 55);
    --green: rgb(55, 200, 55);
    --yellow: rgb(255, 155, 0);
    --border: solid 0.1rem var(--ct1);
    --outline: solid 0.1rem var(--c2);
    --taskbar-height: 3.2rem;
    --taskbar-height-with-gap: calc(var(--taskbar-height) + 0.8rem);
    --blur: 1rem;
    --transition: all 0.2s;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    background: none;
    color: inherit;
    fill: inherit;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex-shrink: 0;
    user-select: inherit;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
}

::-webkit-scrollbar {
    width: 0.2rem;
    height: 0.2rem;
}

::-webkit-scrollbar-track {
    background-color: var(--bct1);
    border-radius: 9rem;
}

::-webkit-scrollbar-thumb {
    background-color: var(--ct1);
    border-radius: 9rem;
}

img {
    display: block;
    pointer-events: none;
}

[data-icon] {
    width: auto;
    height: inherit;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    & > svg {
        width: auto;
        height: inherit;
    }
    & > img {
        width: auto;
        height: inherit;
    }
}

button {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    &:hover {
        cursor: pointer;
    }
}

input {
    font-size: 0.8rem;
    padding: 0 0.8rem;
    border-radius: 0.4rem;
    &::placeholder {
        color: var(--c2);
    }
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bc1);
    color: var(--c1);
    fill: var(--c1);
    font-family: Font, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    user-select: none;
}

#background {
    width: 100%;
    height: 100%;
    position: fixed;
    inset: 0;
    & > .image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
}

#desktop {
    width: 100%;
    height: auto;
    position: fixed;
    inset: 0;
    bottom: var(--taskbar-height);
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(auto-fill, minmax(4rem, 1fr));
    grid-auto-columns: 4rem;
    gap: 0.8rem;
    padding: 0.8rem;
    overflow-x: auto;
    & > [data-app-path] {
        width: auto;
        height: auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.4rem;
        border-radius: 0.4rem;
        &:hover {
            background-color: var(--ct1);
        }
        & > .icon {
            width: auto;
            height: 2.6rem;
            aspect-ratio: 1/1;
            border-radius: 0.2rem;
        }
        & > .title {
            width: 100%;
            height: auto;
            font-size: 0.6rem;
            text-align: center;
            text-shadow: 0 0 0.2rem black;
        }
    }
}

#watermark {
    position: fixed;
    right: 0.8rem;
    top: 0.8rem;
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: flex-end;
    gap: 0rem;
    pointer-events: none;
    & > .title {
        color: var(--c3);
        font-size: 1rem;
    }
    & > .desc {
        color: var(--c3);
        font-size: 0.6rem;
    }
}

#app-window-list {
    width: 100%;
    height: auto;
    position: fixed;
    inset: 0;
    bottom: var(--taskbar-height);
    pointer-events: none;
    & > [data-app-window] {
        background-color: var(--bct1);
        backdrop-filter: blur(var(--blur));
        width: auto;
        height: 70vh;
        max-width: 90vw;
        max-height: 90vh;
        min-width: 16rem;
        min-height: 12rem;
        aspect-ratio: 3/2;
        position: fixed;
        display: grid;
        grid-template: auto 1fr / 1fr;
        border-radius: 0.4rem;
        transition: var(--transition), left 0s, top 0s, width 0s, height 0s;
        pointer-events: all;
        resize: both;
        &.maximized {
            width: auto !important;
            height: auto !important;
            max-width: unset !important;
            max-height: unset !important;
            aspect-ratio: unset !important;
            inset: 0 !important;
            bottom: var(--taskbar-height) !important;
            border-radius: unset !important;
            resize: unset !important;
        }
        &.focus {
            z-index: 1;
        }
        & > .header {
            width: 100%;
            height: 2.4rem;
            display: grid;
            grid-template: 1fr / 1fr auto 1fr;
            gap: 0.4rem;
            padding: 0 0.8rem;
            overflow-x: auto;
            touch-action: none;
            &:hover {
                & > .right {
                    & > button {
                        fill: var(--bc1);
                    }
                }
            }
            & > .left {
                min-width: min-content;
                height: 100%;
                display: flex;
                flex-direction: row;
                justify-content: start;
                align-items: center;
                gap: 0.4rem;
                & > .icon {
                    width: auto;
                    height: 1.2rem;
                    aspect-ratio: 1/1;
                    border-radius: 0.2rem;
                }
            }
            & > .center {
                min-width: min-content;
                height: 100%;
                display: flex;
                flex-direction: row;
                justify-content: center;
                align-items: center;
                gap: 0.4rem;
                & > .title {
                    font-size: 1rem;
                }
            }
            & > .right {
                min-width: min-content;
                height: 100%;
                display: flex;
                flex-direction: row;
                justify-content: flex-end;
                align-items: center;
                gap: 0.4rem;
                & > button {
                    width: auto;
                    height: 0.8rem;
                    aspect-ratio: 1/1;
                    fill: transparent;
                    border-radius: 9rem;
                    &:hover {
                        background-color: var(--bct1);
                    }
                    & > [data-icon] {
                        height: 0.6rem;
                    }
                    &.action-resize {
                        background-color: var(--green);
                    }
                    &.action-hide {
                        background-color: var(--yellow);
                    }
                    &.action-close {
                        background-color: var(--red);
                    }
                }
            }
        }
        & > iframe {
            width: 100%;
            height: 100%;
            zoom: 1;
        }
    }
}

#taskbar {
    background-color: var(--bct1);
    backdrop-filter: blur(var(--blur));
    height: var(--taskbar-height);
    position: fixed;
    inset: 0;
    top: unset;
    display: grid;
    grid-template: 1fr / 1fr auto 1fr;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    overflow-x: auto;
    & > div {
        height: 2.4rem;
    }
    & > .left {
        min-width: min-content;
        display: flex;
        flex-direction: row;
        justify-content: start;
        align-items: center;
        & > .time {
            height: 100%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: start;
            gap: 0rem;
            & > span {
                font-size: 0.8rem;
            }
        }
    }
    & > .center {
        min-width: min-content;
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 0.4rem;
        & > .profile {
            width: auto;
            height: 100%;
            aspect-ratio: 1/1;
            border: var(--border);
            border-radius: 50%;
            &:hover {
                cursor: pointer;
                border-color: var(--c1);
            }
            & > .photo {
                width: 100%;
                height: 100%;
                aspect-ratio: 1/1;
                object-fit: cover;
                object-position: center;
            }
        }
        & > .app-search-input {
            width: 8rem;
            height: 100%;
            background-color: var(--bct1);
            border: var(--border);
            &:hover {
                width: 10rem;
                border-color: var(--c1);
            }
        }
        & > [data-toggle="#app-list-window"] {
            width: auto;
            height: 100%;
            aspect-ratio: 1/1;
            padding: 0rem;
            border: var(--border);
            border-color: transparent;
            border-radius: 0.4rem;
            &:hover {
                background-color: var(--bct1);
                border-color: var(--ct1);
            }
        }
    }
    & > .right {
        min-width: min-content;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0.4rem;
        & > .running-apps {
            width: auto;
            height: 100%;
            display: flex;
            flex-direction: row;
            justify-content: flex-end;
            align-items: center;
            gap: 0.4rem;
            & > [data-app-path] {
                width: auto;
                height: 100%;
                display: flex;
                flex-direction: column;
                justify-content: center;
                align-items: center;
                gap: 0.2rem;
                padding: 0.2rem;
                & > .icon {
                    width: auto;
                    height: 1.6rem;
                    aspect-ratio: 1/1;
                    border-radius: 0.2rem;
                }
                & > .title {
                    width: auto;
                    font-size: 0.4rem;
                    text-align: center;
                    display: none;
                }
            }
        }
        & > .lock {
            width: auto;
            height: 2rem;
            aspect-ratio: 1/1;
            border: var(--border);
            border-radius: 9rem;
            &:hover {
                border-color: var(--c1);
            }
            & > [data-icon] {
                height: 1.2rem;
            }
        }
    }
}

#app-list-window {
    background-color: var(--bct1);
    backdrop-filter: blur(var(--blur));
    width: auto;
    max-width: 90vw;
    height: 60vh;
    aspect-ratio: 3/2;
    position: absolute;
    bottom: var(--taskbar-height-with-gap);
    left: 50%;
    transform: translateX(-50%);
    padding: 1.6rem;
    padding-right: 1.2rem;
    border-radius: 0.8rem;
    & > .app-list {
        width: 100%;
        height: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
        grid-auto-rows: minmax(min-content, max-content);
        gap: 0.4rem;
        padding-right: 0.4rem;
        overflow-y: auto;
        &::-webkit-scrollbar {
            width: 0.4rem;
            height: 0.4rem;
        }
        & > [data-app-path] {
            width: 100%;
            height: 2.6rem;
            display: flex;
            flex-direction: row;
            justify-content: start;
            align-items: center;
            gap: 0.6rem;
            padding: 0.4rem;
            border-radius: 0.4rem;
            &:hover {
                background-color: var(--bct1);
                cursor: pointer;
            }
            &.hide {
                display: none;
            }
            & > .icon {
                width: auto;
                height: 100%;
                aspect-ratio: 1/1;
                border-radius: 0.2rem;
            }
            & > .title {
                width: 100%;
                flex-shrink: 1;
            }
        }
    }
}

#settings-window {
    background-color: var(--bct1);
    backdrop-filter: blur(var(--blur));
    width: auto;
    max-width: 90vw;
    height: auto;
    position: fixed;
    left: 50%;
    bottom: var(--taskbar-height-with-gap);
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: start;
    gap: 0.8rem;
    padding: 1.2rem;
    border-radius: 0.8rem;
    & > span {
        font-size: 1rem;
        margin-bottom: -0.4rem;
    }
    & > input {
        width: 14rem;
        background-color: var(--bct1);
        padding: 0.6rem 0.8rem;
        border: var(--border);
        border-radius: 0.4rem;
        &:hover {
            border-color: var(--c1);
        }
    }
}

#user-list {
    background-color: var(--bct1);
    backdrop-filter: blur(var(--blur));
    width: auto;
    min-width: 12rem;
    height: auto;
    position: fixed;
    left: 50%;
    bottom: var(--taskbar-height-with-gap);
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    padding: 0.8rem;
    border-radius: 0.8rem;
    & > [data-user] {
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: row;
        justify-content: start;
        align-items: center;
        gap: 0.4rem;
        padding: 0.4rem;
        border-radius: 0.6rem;
        &:hover {
            background-color: var(--bct1);
            cursor: pointer;
        }
        &.active {
            & > .photo {
                border-color: var(--c1);
            }
            & > .name {
                color: var(--c1);
                font-weight: 500;
            }
        }
        & > .photo {
            width: auto;
            height: 2.4rem;
            aspect-ratio: 1/1;
            object-fit: cover;
            object-position: center;
            border: var(--border);
            border-radius: 100%;
        }
        & > .name {
            font-size: 1rem;
            font-weight: 400;
        }
    }
}

#lockscreen {
    width: 100%;
    height: 100%;
    position: fixed;
    inset: 0;
    & > .background {
        width: 100%;
        height: 100%;
        position: fixed;
        inset: 0;
        & > .image {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center;
        }
        & > .blur {
            width: 100%;
            height: 100%;
            position: fixed;
            inset: 0;
            backdrop-filter: blur(calc(var(--blur) / 2));
        }
    }
    & > .profile {
        width: auto;
        height: auto;
        position: fixed;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.4rem;
        & > .photo {
            width: auto;
            height: 5.6rem;
            aspect-ratio: 1/1;
            border: var(--border);
            border-color: var(--c1);
            border-radius: 9rem;
            object-fit: cover;
            object-position: center;
        }
        & > .name {
            font-size: 1.2rem;
            font-weight: 600;
        }
        & > .unlock {
            background-color: var(--bct1);
            backdrop-filter: blur(var(--blur));
            padding: 0.6rem 1.2rem;
            border: var(--border);
            border-radius: 0.6rem;
            margin-top: 0.8rem;
            &:hover {
                border-color: var(--c1);
            }
            & > [data-icon] {
                height: 1.2rem;
            }
        }
        & > .fingerprint {
            height: 2.4rem;
        }
    }
    & > .social-list {
        width: auto;
        height: auto;
        position: fixed;
        right: 1rem;
        bottom: 1rem;
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 0.4rem;
        & > div {
            height: 1.6rem;
        }
    }
}

.hide {
    opacity: 0 !important;
    translate: 0 10% !important;
    pointer-events: none !important;
}