* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: "Segoe UI", sans-serif;
    background: #1e1e1e;
    color: #fff;
    overflow: hidden;
}

.startup {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.startup-icon {
    width: 160px;
}

.loader {
    width: 45px;
    height: 45px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    margin-top: 25px;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login {
    display: none;
    position: fixed;
    inset: 0;
    background: #000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-container {
    background: #2d2d2d;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-radius: 6px;
    width: 100%;
    max-width: 350px;
}

.login-icon {
    width: 100px;
    margin: 0 auto 10px;
}

.login-input {
    padding: 10px;
    border: none;
    outline: 1px solid #0078d7;
    background: transparent;
    color: #fff;
    border-radius: 4px;
    font-size: 16px;
}

.login-button,
.shutdown-button,
.reboot-button {
    padding: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.login-button { background: #0078d7; }
.shutdown-button { background: #b30000; }
.reboot-button { background: #0066cc; }

.login-button:hover { background: #0a8bf0; }
.shutdown-button:hover { background: #e60000; }
.reboot-button:hover { background: #0080ff; }

.topbar {
    display: none;
    height: 60px;
    background: #2d2d2d;
    padding: 0 12px;
    align-items: center;
    justify-content: space-between;
}

.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-icon {
    width: 32px;
}

.topbar-title {
    background: transparent;
    border: none;
    outline: 1px solid #0078d7;
    padding: 4px 6px;
    color: #fff;
    font-size: 16px;
    max-width: 160px;
    width: 100%;
    flex-shrink: 1;
}


.desktop {
    display: none;
    height: calc(100vh - 60px);
    background: linear-gradient(135deg, #016c89, #026363);
    padding: 10px;
    overflow: hidden;
}

.desktop-icons {
    display: grid;
    grid-template-columns: repeat(auto-fill, 90px);
    gap: 25px;
    padding: 10px;
    position: relative;
}

.icon {
    width: 90px;
    text-align: center;
    padding: 6px;
    border-radius: 4px;
    cursor: grab;
    user-select: none;
    transition: background .15s ease;
    touch-action: none;
}

.icon img {
    width: 58px;
    height: 58px;
    margin-bottom: 4px;
}

.icon span {
    font-size: 13px;
    text-shadow: 1px 1px 2px #000;
}

.icon:hover {
    background: rgba(255,255,255,0.12);
}

.icon.selected {
    background: rgba(0,120,215,0.35);
    outline: 1px solid rgba(0,120,215,0.8);
}

@media (max-width: 700px) {
    .desktop-icons {
        grid-template-columns: repeat(auto-fill, 70px);
        gap: 18px;
    }

    .icon {
        width: 70px;
        padding: 4px;
        cursor: pointer;
    }

    .icon img {
        width: 48px;
        height: 48px;
    }

    .icon span {
        font-size: 12px;
    }

    .topbar {
        height: 55px;
    }

    .desktop {
        height: calc(100vh - 55px);
    }
}

.fade-in {
    opacity: 1;
    transition: opacity .8s ease;
}

.fade-out {
    opacity: 0;
    transition: opacity .8s ease;
    pointer-events: none;
}

@media (max-width: 700px) {
    .topbar-title {
        max-width: 110px;
        font-size: 14px;
        padding: 3px 5px;
    }

    .topbar-right span {
        font-size: 14px;
    }
}

/* WINDOW */
.window {
    position: absolute;
    width: 420px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    overflow: hidden;
    color: white;
}

.window-titlebar {
    background: #0f172a;
    padding: 6px;
    display: flex;
    justify-content: space-between;
    cursor: move;
    color: white;
}

.window-content {
    padding: 10px;
}

@media (max-width: 700px) {
    .topbar-left {
        font-size: 14px;
    }

    .topbar-title {
        font-size: 14px;
    }
}

/* TASKBAR */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    background: #1e293b;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
}

.taskbar-btn {
    background: #334155;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    cursor: pointer;
}

.taskbar-btn.active {
    background: #3b82f6;
}
