@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

:root {
    --bg-color: #050505;
    --term-green: #33ff33;
    --term-white: #e0e0e0;
    --win-bg: #0a0a0a;
    --win-border: #ffffff;
}

* { box-sizing: border-box; }

body, html {
    margin: 0; padding: 0;
    width: 100%; height: 100%;
    font-family: 'VT323', monospace;
    background: var(--bg-color);
    color: var(--term-white);
    overflow: hidden;
    cursor: url('data:image/svg+xml;utf8,<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path fill="white" stroke="black" d="M0,0 L0,12 L3,9 L6,15 L8,14 L5,8 L10,8 Z"/></svg>'), auto;
    user-select: none;
}

#hang-girl {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%) rotate(0deg);
    width: 250px;
    animation: swing 3s ease-in-out infinite alternate;
    transform-origin: top center;
    pointer-events: none;
    z-index: 50;
}

@keyframes swing {
    0% {
        transform: translateX(-50%) rotate(-6deg);
    }
    100% {
        transform: translateX(-50%) rotate(6deg);
    }
}

@media (max-width: 768px) {
    #hang-girl {
        display: none !important;
    }
}

#snowCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
}

#crt-layer {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 9999;
}
#vignette {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(0,0,0,0) 60%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
    z-index: 9998;
}

#loadingScreen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}
.title-bar {
    background: #fff; color: #000;
    padding: 5px 20px;
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 1.5rem;
}
#progressBarContainer {
    width: 300px; height: 20px;
    border: 2px solid #fff;
    padding: 2px;
}
#progressBar {
    width: 0%; height: 100%;
    background: #fff;
    transition: width 0.2s;
}
#loadingText { margin-bottom: 10px; font-size: 1.2rem; }

#login-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    z-index: 2000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.login-box {
    border: 2px solid var(--term-white);
    padding: 2px;
    width: 300px;
    box-shadow: 8px 8px 0 rgba(255,255,255,0.2);
    background: #000;
}
.login-header {
    background: var(--term-white);
    color: #000;
    padding: 5px;
    font-weight: bold;
    text-align: center;
}
.login-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.user-btn {
    background: transparent;
    border: 1px solid #444;
    color: var(--term-white);
    padding: 8px;
    font-family: 'VT323';
    font-size: 1.2rem;
    cursor: pointer;
    text-align: left;
    transition: 0.2s;
}
.user-btn:hover { background: var(--term-white); color: #000; }

#desktop {
    width: 100vw; height: 100vh;
    position: relative;
    display: none;
    background-image: radial-gradient(#222 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 10;
}

.sys-widget {
    position: absolute; top: 20px; right: 20px;
    width: 200px;
    border: 1px solid #444;
    background: rgba(0,0,0,0.8);
    padding: 10px;
    font-size: 0.9rem;
}
.bar-container { background: #333; height: 6px; margin-top: 4px; width: 100%; }
.bar-fill { height: 100%; background: var(--term-white); width: 0%; transition: width 0.5s; }

.icon-grid {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    height: 80vh;
    width: 100px;
    padding: 20px;
    gap: 20px;
}
.desktop-icon {
    width: 80px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
}
.desktop-icon:hover img { transform: scale(1.1); filter: drop-shadow(0 0 5px #fff); }
.desktop-icon img {
    width: 48px; height: 48px;
    margin-bottom: 5px;
    border-radius: 4px;
    transition: 0.2s;
    background: #333;
    object-fit: cover;
}
.desktop-icon span { background: #000; padding: 2px 4px; }

.window {
    position: absolute;
    width: 350px;
    background: var(--win-bg);
    border: 2px solid var(--win-border);
    box-shadow: 8px 8px 0 rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    min-height: 200px;
    animation: openWindow 0.2s ease-out;
}
@keyframes openWindow {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.win-header {
    background: var(--win-border);
    color: #000;
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    font-weight: bold;
}
.win-header:active { cursor: grabbing; }
.win-body {
    padding: 15px;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.win-controls span {
    cursor: pointer; padding: 0 5px; background: #ccc;
}
.win-controls span:hover { background: #fff; }

.pfp-large {
    width: 100px; height: 100px;
    border-radius: 50%;
    border: 2px solid var(--term-white);
    object-fit: cover;
    margin-bottom: 10px;
}
.social-links { margin-top: 15px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.social-btn {
    text-decoration: none; color: #000; background: #fff;
    padding: 5px 10px; font-size: 0.9rem; border: 1px solid #aaa;
}
.social-btn:hover { background: var(--term-green); }

#taskbar {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 35px;
    background: #111;
    border-top: 2px solid #fff;
    display: flex;
    align-items: center;
    padding: 0 10px;
    z-index: 5000;
    gap: 10px;
}
.start-btn { background: #fff; color: #000; padding: 2px 8px; font-weight: bold; cursor: pointer; }
.task-item { border: 1px solid #555; padding: 2px 10px; color: #aaa; cursor: pointer; }
.task-item.active { background: #333; color: #fff; border: 1px solid #fff; }

@media (max-width: 600px) {
    .window { width: 90%; left: 5% !important; top: 10% !important; }
    .icon-grid { flex-direction: row; height: auto; width: 100%; }
    .sys-widget { display: none; }
}