* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: "Tahoma", "Verdana", Arial, sans-serif;
    font-size: 11px;
}

:root {
    --taskbar-height: 38px;

    --xp-title-active: linear-gradient(180deg, #0a5ed7 0%, #156adf 18%, #2f7ef0 53%, #1f6dde 100%);
    --xp-title-inactive: linear-gradient(180deg, #93b5df 0%, #adc7ea 34%, #96b4dc 100%);
    --xp-button-gradient: linear-gradient(180deg, #f8fcff 0%, #dbeaf8 50%, #b8d0ef 100%);
    --xp-button-hover: linear-gradient(180deg, #fff9d8 0%, #ffdb77 35%, #ffbf3e 100%);
    --xp-button-pressed: linear-gradient(180deg, #c5dcf6 0%, #88b2e5 100%);

    --xp-taskbar-gradient: linear-gradient(180deg, #2c67db 0%, #2a64cf 48%, #2558bf 100%);
    --xp-start-green: linear-gradient(180deg, #68b53b 0%, #4f9f27 45%, #3f891d 100%);
    --xp-start-green-hover: linear-gradient(180deg, #7cc850 0%, #60b839 45%, #4a9c26 100%);
    --xp-start-green-pressed: linear-gradient(180deg, #448722 0%, #3a751d 100%);

    --xp-startmenu-header: linear-gradient(to bottom, #1c3a97, #2452b5);
    --xp-startmenu-side: linear-gradient(to bottom, #2c6ad3, #1c4a97);
    --xp-startmenu-side-border: #1c3a97;
}

body[data-xp-theme="olive"] {
    --xp-title-active: linear-gradient(180deg, #7c8f2e 0%, #6d8128 44%, #5f7422 100%);
    --xp-title-inactive: linear-gradient(180deg, #c4cc9f 0%, #d8ddb7 100%);
    --xp-taskbar-gradient: linear-gradient(180deg, #6f8636 0%, #5f762f 55%, #536828 100%);
    --xp-start-green: linear-gradient(180deg, #8ea144 0%, #738c37 45%, #60772d 100%);
    --xp-start-green-hover: linear-gradient(180deg, #9bb151 0%, #819c43 45%, #6d8537 100%);
    --xp-start-green-pressed: linear-gradient(180deg, #657b31 0%, #576a2b 100%);
    --xp-startmenu-header: linear-gradient(to bottom, #576f31, #6f8748);
    --xp-startmenu-side: linear-gradient(to bottom, #7e9857, #667d44);
    --xp-startmenu-side-border: #4a5f2a;
}

body[data-xp-theme="silver"] {
    --xp-title-active: linear-gradient(180deg, #8791a4 0%, #778196 45%, #68728a 100%);
    --xp-title-inactive: linear-gradient(180deg, #c8cdd8 0%, #d7dbe4 100%);
    --xp-taskbar-gradient: linear-gradient(180deg, #72809a 0%, #657389 55%, #59657a 100%);
    --xp-start-green: linear-gradient(180deg, #8792a7 0%, #6f7a90 45%, #5a6478 100%);
    --xp-start-green-hover: linear-gradient(180deg, #96a1b4 0%, #7d89a0 45%, #677188 100%);
    --xp-start-green-pressed: linear-gradient(180deg, #5f687c 0%, #4f5768 100%);
    --xp-startmenu-header: linear-gradient(to bottom, #6b7484, #828c9d);
    --xp-startmenu-side: linear-gradient(to bottom, #8f99ab, #727d8f);
    --xp-startmenu-side-border: #565f70;
}

#boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    transition: opacity 0.5s ease-out;
}

#boot-screen img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    max-width: 100vw;
    max-height: 100vh;
}

#boot-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

#login-screen {
    position: fixed;
    inset: 0;
    z-index: 999990;
    background: linear-gradient(165deg, #0f2d62 0%, #17488e 45%, #2a62a8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

#login-screen.hidden {
    display: none;
}

#login-screen.visible {
    display: flex;
}

.login-bg-orb {
    position: absolute;
    width: 58vh;
    height: 58vh;
    max-width: 640px;
    max-height: 640px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0));
    transform: translateX(-40%) translateY(-5%);
}

.login-panel {
    position: relative;
    width: min(560px, 92vw);
    padding: 24px;
    border: 2px solid #d8ebff;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06));
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.42);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.login-title {
    font-size: 38px;
    color: #fff;
    font-weight: bold;
    text-shadow: 1px 1px 0 #09306d;
    margin-bottom: 14px;
}

.login-users {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.login-tile {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 4px;
    background: linear-gradient(180deg, rgba(21, 70, 141, 0.86), rgba(11, 46, 101, 0.86));
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    text-align: left;
    transition: background 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.login-tile:hover {
    background: linear-gradient(180deg, rgba(31, 91, 174, 0.92), rgba(14, 58, 120, 0.92));
}

.login-tile.active {
    border-color: #fff;
    box-shadow: inset 0 0 0 1px rgba(166, 212, 255, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.22);
    background: linear-gradient(180deg, rgba(46, 111, 197, 0.95), rgba(17, 69, 141, 0.95));
}

.login-tile:focus-visible {
    outline: 1px dotted #fff;
    outline-offset: 2px;
}

.login-tile img {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

.login-user-name {
    color: #fff;
    font-weight: bold;
    font-size: 20px;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.58);
}

.login-button {
    margin-top: 16px;
    min-width: 118px;
    padding: 8px 18px;
    border: 1px solid #ffffff;
    border-radius: 3px;
    background: linear-gradient(180deg, #84d45f 0%, #5db640 44%, #45952a 100%);
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    font-family: Tahoma, Arial, sans-serif;
    cursor: pointer;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.55);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.login-button:hover {
    background: linear-gradient(180deg, #95df72 0%, #68c24a 44%, #4fa533 100%);
}

.login-button:active {
    background: linear-gradient(180deg, #4f9a31 0%, #3f8627 100%);
}

#desktop {
    width: 100%;
    height: calc(100% - var(--taskbar-height));
    background: url('../assets/wallpapers/background_win_xp.jpg') no-repeat center center;
    background-size: cover;
    position: relative;
}

#desktop.blocked {
    pointer-events: none;
}

#desktop-icons {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: block;
    padding: 0;
    overflow: hidden;
}

.desktop-icon {
    position: absolute;
    left: 0;
    top: 0;
    width: 98px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: default;
    border: 1px solid transparent;
}

.desktop-icon:hover {
    background: rgba(0, 80, 200, 0.25);
}

.desktop-icon.selected {
    background: rgba(0, 80, 200, 0.5);
    border: 1px dotted #fff;
}

.desktop-icon:active {
    background: rgba(0, 80, 200, 0.3);
}

.desktop-icon.dragging {
    z-index: 2;
    opacity: 0.9;
}

.desktop-icon .icon-img {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.desktop-icon .icon-img img {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.desktop-icon .icon-label {
    color: #fff;
    text-align: center;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
    word-wrap: break-word;
    font-size: 13px;
    line-height: 1.1;
    max-width: 92px;
    font-weight: 400;
}

.desktop-selection-box {
    position: absolute;
    border: 1px dashed #fff;
    background: rgba(49, 106, 197, 0.26);
    pointer-events: none;
    z-index: 19000;
}

#windows-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.desktop-refresh {
    animation: desktopRefresh 0.18s linear;
}

@keyframes desktopRefresh {
    0% { opacity: 0.45; }
    100% { opacity: 1; }
}

.desktop-context-menu {
    position: fixed;
    min-width: 178px;
    background: #eceff4;
    border: 1px solid #a4acb8;
    box-shadow: 2px 2px 7px rgba(0, 0, 0, 0.35);
    list-style: none;
    margin: 0;
    padding: 2px;
    z-index: 20000;
    display: none;
    font-family: Tahoma, Arial, sans-serif;
}

.desktop-context-menu.visible {
    display: block;
}

.desktop-context-menu .context-item {
    min-height: 31px;
    padding: 0 8px 0 14px;
    font-size: 11px;
    color: #101826;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.desktop-context-menu .context-label {
    pointer-events: none;
}

.desktop-context-menu .context-item:hover {
    background: #316ac5;
    color: #fff;
}

.desktop-context-menu .context-item.disabled {
    color: #8994a8;
}

.desktop-context-menu .context-item.disabled:hover {
    background: transparent;
    color: #8994a8;
}

.desktop-context-menu .context-separator {
    height: 1px;
    margin: 2px 4px;
    list-style: none;
    background: #c7ced8;
}

.desktop-context-menu .submenu-arrow {
    font-size: 11px;
    margin-left: 16px;
    line-height: 1;
}

.desktop-context-menu .context-submenu {
    position: absolute;
    top: -2px;
    left: calc(100% - 1px);
    min-width: 320px;
    margin: 0;
    padding: 2px;
    list-style: none;
    border: 1px solid #a4acb8;
    background: #eceff4;
    box-shadow: 2px 2px 7px rgba(0, 0, 0, 0.32);
    display: none;
    z-index: 20001;
}

.desktop-context-menu .has-submenu:hover > .context-submenu {
    display: block;
}

.desktop-context-menu .context-subitem {
    min-height: 37px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #101826;
    font-size: 11px;
    cursor: default;
}

.desktop-context-menu .context-subitem:hover {
    background: #316ac5;
    color: #fff;
}

.desktop-context-menu .context-subitem img {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.session-hidden {
    display: none !important;
}

.hidden {
    display: none !important;
}

a {
    color: #003399;
    text-decoration: underline;
}

a:hover {
    color: #000;
}

::-webkit-scrollbar {
    width: 16px;
    height: 16px;
}

::-webkit-scrollbar-track {
    background: #eee;
    border: 1px solid #ccc;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #d0d0d0, #a0a0a0);
    border: 1px solid #fff;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #c0c0c0, #909090);
}

::-webkit-scrollbar-button {
    background: #d0d0d0;
    border: 1px solid #fff;
    display: block;
    height: 16px;
}

@media (max-width: 760px) {
    :root {
        --taskbar-height: 34px;
    }

    #desktop-icons {
        top: 8px;
        left: 8px;
        right: 8px;
        bottom: 8px;
    }

    .desktop-icon {
        width: 78px;
    }

    .desktop-icon .icon-label {
        font-size: 11px;
        max-width: 72px;
    }

    .login-title {
        font-size: 31px;
    }

    .login-users {
        grid-template-columns: 1fr;
    }

    .login-user-name {
        font-size: 18px;
    }
}
