body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000;
}

#video-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1920px;
    height: 1080px;
    margin-left: -960px;
    margin-top: -540px;
    overflow: hidden;
    /* transform: scale(...) managed by script.js */
}

#bg-video,
#flicker-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    z-index: 1;
}

#flicker-video {
    z-index: 2;
    /* Needs to sit on top of bg-video when active */
}

/* This container will map the actual PC screen to the video */
#monitor-screen {
    z-index: 3;
    /* Increased z-index so it sits on top of everything */
    position: absolute;
    /* We'll calibrate these values: */
    top: 33.1%;
    left: 40.9%;
    width: 19%;
    height: 25.9%;
    z-index: 2;
    transform-origin: center center;
    /* initial flat transform */
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(0.99);

    background-image: url('bliss.jpeg');
    background-size: cover;
    background-position: center;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    /* Inner shadow for CRT feel */
    border-radius: 0px;
    /* Slight CRT curvature */

    /* Initially hidden for boot sequence */
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    cursor: pointer;
    /* To indicate it can be clicked to turn on */
}

#monitor-screen.powered-on {
    cursor: default;
}

/* Inside the screen */
.desktop {
    position: relative;
    width: 800px;
    height: 600px;
    transform-origin: top left;
    /* 
       For width: 19% of 1920 = 364.8px. Scale = 364.8 / 800 = 0.456
       For height: 25.9% of 1080 = 279.72px. Scale = 279.72 / 600 = 0.4662
    */
    transform: scaleX(0.456) scaleY(0.4662);
    pointer-events: none;
    /* Prevent interacting with apps while screen is off */
}

#monitor-screen.powered-on .desktop {
    pointer-events: auto;
}

.icon-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px;
    width: 100px;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-align: center;
    color: white;
    font-family: 'Tahoma', sans-serif;
    font-size: 11px;
    text-shadow: 1px 1px 2px black;
}

.desktop-icon img {
    width: 32px;
    height: 32px;
    margin-bottom: 4px;
}

.desktop-icon:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.taskbar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(to bottom, #245edb 0%, #3f8cf3 9%, #245edb 18%, #245edb 92%, #333 100%);
    display: flex;
    align-items: center;
    padding: 0 4px;
    box-sizing: border-box;
    z-index: 9999;
}

.start-button {
    font-family: 'Trebuchet MS', 'Tahoma', sans-serif;
    font-weight: bold;
    font-style: italic;
    font-size: 14px;
    color: white;
    background: linear-gradient(to bottom, #4fbc77 0%, #3e9e3e 15%, #257e25 85%, #185a18 100%);
    background-color: #3e9e3e;
    border: 1px solid #144614;
    border-radius: 0 8px 8px 0;
    padding: 0 12px 0 6px;
    height: 26px;
    display: flex;
    align-items: center;
    box-shadow: inset 1px 1px 3px rgba(255, 255, 255, 0.4), 1px 1px 3px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.taskbar-divider {
    width: 2px;
    height: 80%;
    background-color: rgba(255, 255, 255, 0.2);
    margin: 0 6px;
}

.taskbar-tasks {
    flex-grow: 1;
    display: flex;
    gap: 4px;
}

.taskbar-task {
    background: #1d4bb8;
    color: white;
    font-family: 'Tahoma', sans-serif;
    font-size: 11px;
    border: 1px solid #133481;
    border-radius: 2px;
    padding: 2px 6px;
    height: 22px;
    display: flex;
    align-items: center;
    cursor: pointer;
    box-shadow: inset 1px 1px 1px rgba(255, 255, 255, 0.2);
}

.taskbar-task.active {
    background: #133481;
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.taskbar-systray {
    margin-right: 10px;
    background: #0f8ddd;
    /* system tray color approx */
    height: 100%;
    display: flex;
    align-items: center;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0 5px;
    box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.taskbar-systray img {
    height: 16px;
    cursor: pointer;
    margin-right: 8px;
}

.taskbar-time {
    color: white;
    font-family: 'Tahoma', sans-serif;
    font-size: 11px;
}

.volume-panel {
    position: absolute;
    bottom: 30px;
    right: 5px;
    width: 60px;
    height: 150px;
    background-color: #d4d0c8;
    /* Classic win colors or white */
    border: 1px solid white;
    border-right-color: #808080;
    border-bottom-color: #808080;
    box-shadow: 1px 1px 2px #000;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: 'Tahoma', sans-serif;
    padding: 5px 0;
}

.volume-title {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 10px;
}

.volume-slider-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    width: 100%;
}

.volume-slider-container input[type=range] {
    writing-mode: bt-lr;
    /* IE */
    -webkit-appearance: slider-vertical;
    /* WebKit */
    appearance: slider-vertical;
    /* Standard */
    width: 20px;
    height: 80px;
}

.volume-mute {
    font-size: 11px;
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.window {
    position: absolute;
    width: 400px;
    height: 350px;
    display: flex;
    flex-direction: column;
}

.window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.window-body {
    flex-grow: 1;
    background: white;
    color: black;
    overflow-y: auto;
}

/* Resize Handles */
.resize-handle {
    position: absolute;
    display: block;
    z-index: 10;
}

.resize-handle-n {
    top: -3px;
    left: 0;
    width: 100%;
    height: 6px;
    cursor: n-resize;
}

.resize-handle-e {
    top: 0;
    right: -3px;
    width: 6px;
    height: 100%;
    cursor: e-resize;
}

.resize-handle-s {
    bottom: -3px;
    left: 0;
    width: 100%;
    height: 6px;
    cursor: s-resize;
}

.resize-handle-w {
    top: 0;
    left: -3px;
    width: 6px;
    height: 100%;
    cursor: w-resize;
}

.resize-handle-ne {
    top: -3px;
    right: -3px;
    width: 6px;
    height: 6px;
    cursor: ne-resize;
}

.resize-handle-nw {
    top: -3px;
    left: -3px;
    width: 6px;
    height: 6px;
    cursor: nw-resize;
}

.resize-handle-se {
    bottom: -3px;
    right: -3px;
    width: 6px;
    height: 6px;
    cursor: se-resize;
}

.resize-handle-sw {
    bottom: -3px;
    left: -3px;
    width: 6px;
    height: 6px;
    cursor: sw-resize;
}

.title-bar {
    flex-shrink: 0;
    cursor: default;
}

/* Start Menu */
.start-menu {
    position: absolute;
    bottom: 30px;
    /* Above taskbar */
    left: 0;
    width: 380px;
    height: 480px;
    background-color: white;
    border: 1px solid #1034a6;
    border-radius: 5px 5px 0 0;
    box-shadow: 2px -2px 5px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    font-family: 'Tahoma', sans-serif;
    overflow: hidden;
}

.start-menu-header {
    background: linear-gradient(to bottom, #1d4bb8 0%, #133481 100%);
    color: white;
    padding: 10px;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #ff8c00;
}

.start-menu-header img {
    width: 48px;
    height: 48px;
    border: 2px solid white;
    border-radius: 3px;
    margin-right: 10px;
}

.start-menu-header span {
    font-size: 16px;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}

.start-menu-body {
    flex-grow: 1;
    display: flex;
    background-color: white;
}

.start-menu-left {
    width: 60%;
    background-color: white;
    padding: 5px;
    display: flex;
    flex-direction: column;
}

.start-menu-right {
    width: 40%;
    background-color: #d3e5fa;
    border-left: 1px solid #aebfde;
    padding: 5px;
    display: flex;
    flex-direction: column;
}

.start-menu-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    cursor: pointer;
    color: black;
    font-size: 11px;
    transition: background-color 0.1s;
}

.start-menu-item:hover {
    background-color: #2f71cd;
    color: white;
}

.start-menu-right .start-menu-item {
    font-weight: bold;
    color: #1034a6;
}

.start-menu-right .start-menu-item:hover {
    color: white;
}

.start-menu-item img {
    width: 32px;
    height: 32px;
    margin-right: 10px;
}

.start-menu-right .start-menu-item img {
    width: 24px;
    height: 24px;
}

.start-menu-separator {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.1) 10%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.1) 90%, transparent);
    margin: 5px 10px;
}

.start-menu-footer {
    background: linear-gradient(to bottom, #1d4bb8 0%, #133481 100%);
    padding: 5px;
    display: flex;
    justify-content: flex-end;
}

.start-menu-footer .start-menu-item {
    color: white;
}

.start-menu-footer .start-menu-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.start-menu-footer .start-menu-item img {
    width: 24px;
    height: 24px;
    margin-right: 0;
}