body {
    font-family: 'PressStart2P', system-ui;
}
.desktop {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(auto-fill, minmax(48px, 1fr));
    align-content: flex-start;
    gap: 8px;
    padding: 16px;
    width: 100vw;
    height: 100vh;
    pointer-events: auto;
}
.icon {
    width: 32px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    margin: 0;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: none;
    box-sizing: border-box;
}
.icon img {
    image-rendering: pixelated;
    width: 24px;
    height: 24px;
    margin: 0 auto;
    display: block;
}
textarea {
    image-rendering: pixelated;
}

.icon span {
    font-size: 12px;
    color: white;
    margin-top: 2px;
    display: block;
    line-height: 1.1;
}
.window {
    display: none;
    position: absolute;
    width: min(95vw, 400px);
    height: min(70vh, 350px);
    background: #222;
    border: 2px solid #555;
    color: white;
    font-family:'PressStart2P', system-ui;
    z-index: 10;
    resize: none;
    box-sizing: border-box;
    max-width: 100vw;
    max-height: 100vh;
}
.window-header {
    display: flex;
    justify-content: space-between;
    background: 333;
    padding: 4px 8px;
    cursor: default;
    user-select: none;
    position: relative;
}
.window-header::after {
    content: "";
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: #444;
    border-bottom: 1px solid #222;
    z-index: 1;
}
.window-controls button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
}
.window-content {
    padding: 10px;
    height: calc(100% - 32px);
    overflow: hidden;
    box-sizing: border-box;
}
.window-content textarea {
    width: 100%;
    height: 100%;
    background: #111;
    color: white;
    border: none;
    font-family: 'PressStart2P', system-ui;
    font-size: 12px;
    resize: none;
    image-rendering: pixelated;
}
.resizable {
    resize: both;
    overflow: auto;
}
.fullscreen {
    position: fixed;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    resize: none !important;
}
.taskbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 38px;
    background: #181818;
    border-top: 2px solid #333;
    display: flex;
    align-items: center;
    z-index: 100;
    padding: 0 10px;
    box-sizing: border-box;
    gap: 10px;
    font-family: 'PressStart2P', system-ui;
}
.taskbar-btn {
    width: 32px;
    height: 32px;
    background: #222;
    border: 1px solid #444;
    color: white;
    font-size: 18px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.taskbar-btn:hover {
    background: #333;
}
.taskbar-apps {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}
.taskbar-search {
    width: 180px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid #444;
    background: #222;
    color: white;
    font-family: inherit;
    font-size: 12px;
    padding: 0 8px;
    margin-right: 10px;
    outline: none;
    transition: border 0.2s;
}
.taskbar-search:focus {
    border: 1.5px solid #888;
    background: #222;
}
.taskbar-time {
    color: #ccc;
    font-size: 12px;
    min-width: 120px;
    text-align: right;
    font-family: inherit;
}
@media (max-width: 600px) {
    .window {
        width: 98vw;
        height: 70vh;
        min-width: 0;
        min-height: 0;
        max-width: 100vw;
        max-height: 100vh;
    }
    .icon {
        width: 64px;
        min-width: 64px;
        min-height: 64px;
        height: 64px;
        padding: 8px 0;
    }
    .icon img {
        width: 48px;
        height: 48px;
    }
    .icon span {
        font-size: 12px;
    }
    .window-content textarea,
    textarea {
        font-size: 14px !important;
    }
    .taskbar {
        display: none !important;
    }
}
#context-menu {
    user-select: none;
}
.context-item {
    padding: 6px 16px;
    cursor: pointer;
    white-space: nowrap;
}
.context-item:hover {
    background: #444;
}
#appcontextmenu {
    user-select: none;
    min-width: 90px;
    font-size: 9px;
    padding: 2px 0;
}
.appctx-btn {
    background: #333;
    border: 1px solid #555;
    color: white;
    font-family: inherit;
    font-size: 9px;
    padding: 2px 5px;
    border-radius: 2px;
    cursor: pointer;
    margin: 0;
    transition: background 0.2s;
}
.appctx-btn:hover {
    background: #444;
}
.appctx-item {
    padding: 4px 10px;
    cursor: pointer;
    white-space: nowrap;
    border-top: 1px solid #333;
    font-size: 9px;
}
.appctx-item:hover {
    background: #444;
}