:root {
    --bg-color: #050505;
    --primary-color: #ff0000; /* Lain Red */
    --secondary-color: #1a0505; /* Dark Red/Black */
    --text-color: #ffcccc;
    --highlight-color: #ff3333;
    --window-bg: #0a0000;
    --window-border: #440000;
    --window-header: #220000;
    --font-main: 'Courier New', Courier, monospace;
    --font-system: 'OCR-A Extended', 'Courier New', monospace;
}

@font-face {
    font-family: 'OCR-A';
    src: local('OCR A Extended'), local('OCR-A'), url('https://db.onlinewebfonts.com/t/04f2f8f001c9e64e6774eef6c439e8c6.woff2') format('woff2');
}

* {
    box-sizing: border-box;
    user-select: none;
    cursor: default;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* CRT Effects */
#crt-overlay {
    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;
}

#scanline {
    width: 100%;
    height: 100px;
    z-index: 9998;
    background: linear-gradient(0deg, rgba(0,0,0,0) 0%, rgba(255, 0, 0, 0.1) 50%, rgba(0,0,0,0) 100%);
    opacity: 0.1;
    position: absolute;
    bottom: 100%;
    animation: scanline 10s linear infinite;
    pointer-events: none;
}

@keyframes scanline {
    0% { bottom: 100%; }
    100% { bottom: -100px; }
}

/* Login Screen */
#login-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #000;
    z-index: 1000;
    transition: opacity 1s ease-out;
}

.login-container {
    text-align: center;
    width: 400px;
}

.voice-waveform {
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-bottom: 20px;
}

.bar {
    width: 5px;
    background-color: var(--primary-color);
    height: 10px;
    transition: height 0.1s ease;
    box-shadow: 0 0 10px var(--primary-color);
}

.system-text {
    font-family: var(--font-system);
    color: var(--primary-color);
    letter-spacing: 2px;
    text-shadow: 0 0 5px var(--primary-color);
    margin: 10px 0;
}

#username-input {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--primary-color);
    color: white;
    font-family: var(--font-system);
    font-size: 1.2rem;
    text-align: center;
    width: 100%;
    padding: 10px;
    outline: none;
    text-transform: uppercase;
    caret-color: var(--primary-color);
}

.login-status {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #666;
}

/* Desktop */
#desktop {
    width: 100%;
    height: 100%;
    background-color: #050000;
    background-image: 
        linear-gradient(0deg, transparent 24%, rgba(255, 0, 0, .05) 25%, rgba(255, 0, 0, .05) 26%, transparent 27%, transparent 74%, rgba(255, 0, 0, .05) 75%, rgba(255, 0, 0, .05) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(255, 0, 0, .05) 25%, rgba(255, 0, 0, .05) 26%, transparent 27%, transparent 74%, rgba(255, 0, 0, .05) 75%, rgba(255, 0, 0, .05) 76%, transparent 77%, transparent);
    background-size: 50px 50px;
    position: relative;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* Icons */
#desktop-icons {
    position: relative;
    width: 100%;
    height: calc(100% - 40px);
    padding: 20px;
}

.desktop-icon {
    position: absolute;
    width: 80px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.1s;
}

.desktop-icon:hover {
    transform: scale(1.05);
}

.desktop-icon:active {
    transform: scale(0.95);
}

.desktop-icon.selected {
    background-color: rgba(255, 0, 0, 0.3);
    border: 1px dotted var(--primary-color);
    border-radius: 5px;
}

.icon-img {
    width: 48px;
    height: 48px;
    margin: 0 auto 5px;
    border: 2px solid var(--primary-color);
    background: rgba(255, 0, 0, 0.1);
    box-shadow: 0 0 5px var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    color: var(--primary-color);
}

.icon-img-real {
    width: 48px;
    height: 48px;
    margin: 0 auto 5px;
    display: block;
    filter: drop-shadow(0 0 5px var(--primary-color));
    transition: transform 0.2s;
}

.desktop-icon:hover .icon-img-real {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px var(--primary-color)) brightness(1.2);
}

.icon-label {
    font-size: 12px;
    color: var(--text-color);
    text-shadow: 0 0 2px #000;
    background: rgba(0,0,0,0.5);
    padding: 2px 4px;
}

/* Windows */
.window {
    position: absolute;
    background-color: var(--window-bg);
    border: 2px solid var(--window-border);
    box-shadow: 5px 5px 15px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    min-width: 200px;
    min-height: 100px;
    animation: openWindow 0.2s ease-out;
}

@keyframes openWindow {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.window-header {
    background: linear-gradient(90deg, var(--window-header), var(--window-border));
    padding: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: grab;
    border-bottom: 1px solid var(--window-border);
}

.window-header:active {
    cursor: grabbing;
}

.window-title {
    font-family: var(--font-system);
    font-size: 12px;
    color: var(--primary-color);
    font-weight: bold;
    padding-left: 5px;
}

.window-controls {
    display: flex;
    gap: 5px;
}

.win-btn {
    width: 15px;
    height: 15px;
    border: 1px solid var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

.win-btn.close {
    background-color: rgba(255, 0, 0, 0.3);
}

.win-btn.close:hover {
    background-color: var(--primary-color);
    box-shadow: 0 0 5px var(--primary-color);
}

.win-btn.close:active {
    transform: scale(0.9);
}

.window-content {
    flex: 1;
    padding: 10px;
    overflow: auto;
    color: var(--text-color);
    font-family: var(--font-main);
}

/* Taskbar / Drawer */
#taskbar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35px;
    background: var(--secondary-color);
    border-top: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    padding: 0 10px;
    z-index: 9000;
    box-shadow: 0 -2px 10px rgba(255, 0, 0, 0.2);
}

.start-tab {
    background: var(--primary-color);
    color: #000;
    padding: 5px 15px;
    font-weight: bold;
    font-family: var(--font-system);
    margin-right: 10px;
    clip-path: polygon(0 0, 100% 0, 90% 100%, 10% 100%); /* Copland tab shape */
    cursor: pointer;
}

.start-tab:hover {
    background: #fff;
}

.clock {
    margin-left: auto;
    font-family: var(--font-system);
    color: var(--primary-color);
}

#open-windows-list {
    display: flex;
    gap: 5px;
    margin-left: 10px;
    flex: 1;
    overflow-x: auto;
}

.taskbar-entry {
    background: var(--window-bg);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 2px 8px;
    font-family: var(--font-system);
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}

.taskbar-entry:hover {
    background: var(--primary-color);
    color: #000;
}

/* Content Styling */
.file-list-item {
    padding: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-list-item:hover {
    background: rgba(255, 0, 0, 0.2);
    color: #fff;
}

.text-viewer {
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    line-height: 1.4;
}

.video-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
}

video {
    max-width: 100%;
    max-height: 100%;
}

/* Selection Box */
.selection-box {
    position: absolute;
    border: 1px solid var(--primary-color);
    background-color: rgba(255, 0, 0, 0.1);
    pointer-events: none; /* Let clicks pass through */
    z-index: 9999;
}

/* Custom Video Player */
.custom-video-player {
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    position: relative;
}

.custom-video-player video {
    width: 100%;
    height: calc(100% - 40px); /* Leave space for controls */
    object-fit: contain;
}

.video-controls {
    height: 40px;
    background: var(--window-header);
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 10px;
    border-top: 1px solid var(--window-border);
}

.video-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    font-family: var(--font-system);
    cursor: pointer;
    padding: 2px 8px;
    font-size: 12px;
}

.video-btn:hover {
    background: var(--primary-color);
    color: #000;
}

.download-btn {
    margin-left: 5px;
    padding: 2px 6px;
    font-size: 10px;
}

.download-btn:hover {
    background: var(--highlight-color);
}

.video-progress-container {
    flex-grow: 1;
    height: 10px;
    background: #330000;
    cursor: pointer;
    position: relative;
    border: 1px solid var(--window-border);
}

.video-progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    pointer-events: none;
}

.video-time {
    font-family: var(--font-system);
    font-size: 10px;
    color: var(--primary-color);
    min-width: 30px;
    text-align: right;
}

/* Custom Audio Player */
.custom-audio-player {
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    padding: 10px;
    gap: 10px;
}

.audio-visualizer {
    flex: 1;
    background: #050000;
    border: 1px solid var(--window-border);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 0 2px;
}

.visualizer-bar {
    width: 5%;
    background: var(--primary-color);
    opacity: 0.8;
    transition: height 0.05s ease;
    box-shadow: 0 0 5px var(--primary-color);
}

.audio-info {
    font-family: var(--font-system);
    color: var(--primary-color);
    font-size: 12px;
    text-align: center;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 0 2px var(--primary-color);
}

.audio-controls {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.audio-btn-row {
    display: flex;
    /*justify-content: center;*/
    gap: 10px;
}

.audio-progress-container {
    height: 4px;
    background: #330000;
    cursor: pointer;
    position: relative;
    width: 100%;
}

.audio-progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    pointer-events: none;
    box-shadow: 0 0 2px var(--primary-color);
}

/* Context Menu */
#context-menu {
    position: absolute;
    background: var(--window-bg);
    border: 1px solid var(--primary-color);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.8);
    z-index: 10000;
    min-width: 150px;
    display: none;
}

.context-item {
    padding: 5px 10px;
    font-family: var(--font-system);
    font-size: 12px;
    color: var(--primary-color);
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 0, 0, 0.2);
}

.context-item:last-child {
    border-bottom: none;
}

.context-item:hover {
    background: var(--primary-color);
    color: #000;
}

/* Wired Glitch Effect */
@keyframes glitch-skew {
    0% { transform: skew(0deg); }
    20% { transform: skew(-10deg); }
    40% { transform: skew(10deg); }
    60% { transform: skew(-5deg); }
    80% { transform: skew(5deg); }
    100% { transform: skew(0deg); }
}

.wired-active {
    animation: glitch-skew 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
    filter: invert(1) contrast(2);
}

/* CRT Shutdown Effect */
@keyframes crt-off {
    0% {
        transform: scale(1, 1);
        filter: brightness(1);
        opacity: 1;
    }
    40% {
        transform: scale(1, 0.002);
        filter: brightness(5);
        opacity: 1;
    }
    80% {
        transform: scale(0, 0.002);
        opacity: 1;
    }
    100% {
        transform: scale(0, 0);
        opacity: 0;
    }
}

.system-shutdown {
    animation: crt-off 0.8s cubic-bezier(0.755, 0.050, 0.855, 0.060) forwards;
    pointer-events: none;
}

#shutdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-family: var(--font-system);
    font-size: 2em;
    opacity: 0;
    pointer-events: none;
    letter-spacing: 5px;
}

.show-shutdown-text {
    opacity: 1 !important;
    transition: opacity 2s ease-in;
}

/* Recognized Mode */
.recognized-mode .bar {
    background-color: #fff;
    box-shadow: 0 0 10px #fff;
}

.recognized-mode .system-text {
    color: #fff;
    text-shadow: 0 0 5px #fff;
}

.recognized-name {
    font-family: var(--font-system);
    font-size: 3em;
    color: var(--primary-color);
    text-shadow: 0 0 20px var(--primary-color);
    margin: 20px 0;
    animation: pulse-name 2s infinite;
    text-transform: uppercase;
}

@keyframes pulse-name {
    0% { opacity: 0.5; transform: scale(0.95); filter: blur(1px); }
    50% { opacity: 1; transform: scale(1.05); filter: blur(0px); }
    100% { opacity: 0.5; transform: scale(0.95); filter: blur(1px); }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--window-bg);
    border-left: 1px solid var(--window-border);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border: 1px solid var(--primary-color);
    box-shadow: inset 0 0 5px rgba(255, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
    box-shadow: 0 0 5px var(--primary-color);
}

::-webkit-scrollbar-corner {
    background: var(--window-bg);
}

/* System Alert Glitch Effects */
@keyframes violent-shake {
    0% { transform: translate(0, 0) rotate(0deg); }
    10% { transform: translate(-10px, -10px) rotate(-2deg); filter: invert(1); }
    20% { transform: translate(10px, 10px) rotate(2deg); }
    30% { transform: translate(-10px, 10px) rotate(-2deg); filter: invert(0); }
    40% { transform: translate(10px, -10px) rotate(2deg); }
    50% { transform: translate(0, 0) rotate(0deg); }
    60% { transform: translate(-5px, 5px) rotate(-1deg); filter: invert(1); }
    70% { transform: translate(5px, -5px) rotate(1deg); }   
    80% { transform: translate(-2px, 2px) rotate(0deg); }
    90% { transform: translate(2px, -2px) rotate(0deg); filter: invert(0); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes glitch-text {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

.system-alert-window {
    animation: violent-shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    border: 4px solid red !important;
    box-shadow: 0 0 50px red !important;
}

.system-alert-content {
    background: #000;
    color: red;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    text-transform: uppercase;
    overflow: hidden;
}

.system-alert-big-text {
    font-size: 4em;
    letter-spacing: 10px;
    animation: glitch-text 0.2s infinite;
    text-shadow: 2px 2px 0px #fff;
}

/* Wired App Styles */
.wired-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #000;
    color: #0f0;
    font-family: 'OCR-A', monospace;
    padding: 5px;
}

.wired-layout {
    display: flex;
    flex: 1;
    height: 100%;
    overflow: hidden;
}

.wired-main-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #0f0;
}

.wired-user-list {
    width: 150px;
    background: rgba(0, 10, 0, 0.5);
    padding: 5px;
    overflow-y: auto;
    font-size: 12px;
}

.user-list-header {
    border-bottom: 1px solid #0f0;
    margin-bottom: 5px;
    padding-bottom: 2px;
    font-weight: bold;
    text-align: center;
    color: #0f0;
}

.wired-user-item {
    padding: 2px 5px;
    color: #0f0;
    cursor: default;
    opacity: 0.8;
}

.wired-user-item:hover {
    background: rgba(0, 255, 0, 0.2);
    opacity: 1;
}

.wired-chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    /* Remove border and margin as it's now inside the layout */
    border: none;
    margin-bottom: 0;
    background: rgba(0, 20, 0, 0.3);
    box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.1);
}

.wired-input-area {
    display: flex;
    align-items: center;
    padding: 10px;
    border-top: 1px solid #0f0;
    background: #000;
}

.wired-prompt {
    color: #0f0;
    margin-right: 10px;
    font-weight: bold;
    text-shadow: 0 0 5px #0f0;
}

.wired-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #0f0;
    font-family: 'OCR-A', monospace;
    font-size: 14px;
    outline: none;
    text-shadow: 0 0 2px #0f0;
}

.wired-input::placeholder {
    color: rgba(0, 255, 0, 0.3);
    font-style: italic;
}

/* Advanced Glitch Effects for User List */
@keyframes glitch-anim-1 {
    0% { clip-path: inset(20% 0 80% 0); transform: translate(-2px, 1px); }
    20% { clip-path: inset(60% 0 10% 0); transform: translate(2px, -1px); }
    40% { clip-path: inset(40% 0 50% 0); transform: translate(-2px, 2px); }
    60% { clip-path: inset(80% 0 5% 0); transform: translate(2px, -2px); }
    80% { clip-path: inset(10% 0 70% 0); transform: translate(-1px, 1px); }
    100% { clip-path: inset(30% 0 50% 0); transform: translate(1px, -1px); }
}

@keyframes glitch-anim-2 {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02) skew(10deg); }
    51% { opacity: 0.5; transform: scale(0.98) skew(-10deg); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes text-scramble {
    0% { content: "Unknown"; }
    25% { content: "N0d3_Err"; }
    50% { content: "Gh0st"; }
    75% { content: "L0st"; }
    100% { content: "Unknown"; }
}

.glitch-user-severe {
    position: relative;
    color: #ff0000 !important;
    animation: glitch-anim-1 0.3s infinite linear alternate-reverse;
}

.glitch-user-severe::before {
    content: attr(data-text);
    position: absolute;
    left: -2px;
    text-shadow: 1px 0 blue;
    top: 0;
    color: white;
    background: black;
    overflow: hidden;
    clip-path: inset(0 0 0 0);
    animation: glitch-anim-2 2s infinite linear alternate-reverse;
}

.glitch-user-severe::after {
    content: attr(data-text);
    position: absolute;
    left: 2px;
    text-shadow: -1px 0 red;
    top: 0;
    color: white;
    background: black;
    overflow: hidden;
    clip-path: inset(0 0 0 0);
    animation: glitch-anim-1 2s infinite linear alternate-reverse;
}

.glitch-user-mild {
    animation: glitch-anim-2 4s infinite;
    text-shadow: 0 0 5px var(--primary-color);
}

.glitch-user-ghost {
    opacity: 0.5;
    filter: blur(1px);
    transition: opacity 0.5s;
}

.glitch-user-ghost:hover {
    opacity: 1;
    filter: blur(0);
}

/* Accela.exe Effects */
@keyframes accela-pulse {
    0% { filter: contrast(1) saturate(1) hue-rotate(0deg); transform: scale(1); }
    50% { filter: contrast(1.5) saturate(2) hue-rotate(10deg); transform: scale(1.02); }
    100% { filter: contrast(1) saturate(1) hue-rotate(0deg); transform: scale(1); }
}

@keyframes accela-shake {
    0% { transform: translate(0, 0); }
    25% { transform: translate(2px, 2px); }
    50% { transform: translate(-2px, 1px); }
    75% { transform: translate(1px, -2px); }
    100% { transform: translate(0, 0); }
}

.accela-active body {
    animation: accela-pulse 2s infinite ease-in-out;
}

.accela-active .window {
    animation: accela-shake 0.2s infinite;
    border-color: #ff0000 !important;
    box-shadow: 0 0 15px #ff0000 !important;
}

/* Phantoma Ghost Mode */
.ghost-mode {
    filter: invert(1);
}
.ghost-mode .desktop-icon {
    animation: float 3s infinite ease-in-out;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Volume Slider */
.volume-container {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.volume-slider {
    -webkit-appearance: none;
    width: 60px;
    height: 4px;
    background: #330000;
    outline: none;
    border: 1px solid var(--window-border);
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    cursor: pointer;
    border: 1px solid #000;
}

.volume-slider::-moz-range-thumb {
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    cursor: pointer;
    border: 1px solid #000;
}

/* Homunculus Pet */
#homunculus-pet {
    /* animation: pet-pulse 2s infinite; */
}

/* Protocol 7 Browser */
.protocol7-browser a {
    color: blue;
    text-decoration: underline;
    cursor: pointer;
}

.protocol7-browser a:hover {
    color: red;
}

/* Wired Mirror */
.wired-mirror-overlay {
    background: linear-gradient(rgba(0,255,0,0.1) 1px, transparent 1px);
    background-size: 100% 4px;
}

/* Mail Protocol */
.mail-unread {
    font-weight: bold;
    background: #fff0f0;
}

/* Psyche Installer */
.psyche-installed {
    filter: hue-rotate(90deg) contrast(1.2);
    font-family: Impact, sans-serif;
}

/* 5. Hidden Bear */
#hidden-bear {
    position: absolute;
    bottom: 5px;
    right: 5px;
    font-size: 20px;
    opacity: 0.1;
    cursor: pointer;
    z-index: 10001; /* Above taskbar */
    transition: opacity 0.3s;
}
#hidden-bear:hover {
    opacity: 1;
}

/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
    /* Login Screen */
    .login-container {
        width: 90%;
    }

    #username-input {
        font-size: 1rem;
    }

    /* Desktop Icons */
    #desktop-icons {
        display: flex;
        flex-wrap: wrap;
        align-content: flex-start;
        gap: 15px;
        padding: 15px;
    }

    .desktop-icon {
        position: relative !important; /* Override absolute positioning */
        margin: 0 !important;
        left: auto !important;
        top: auto !important;
    }

    /* Windows */
    .window {
        width: 95% !important;
        left: 2.5% !important;
        top: 50px !important;
        max-height: 80vh;
        display: flex;
        flex-direction: column;
    }

    .window-content {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .window-header {
        padding: 10px;
    }

    .win-btn {
        width: 24px;
        height: 24px;
    }

    /* Taskbar */
    #taskbar {
        height: 50px;
    }

    .start-tab {
        padding: 10px 20px;
        font-size: 16px;
    }

    #open-windows-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .taskbar-entry {
        padding: 5px 10px;
        font-size: 14px;
        height: 30px;
    }

    /* Mail App Mobile */
    .window-content > div[style*="display: flex"] {
        flex-direction: column !important;
    }
    
    /* Sidebar */
    .window-content > div > div:first-child {
        width: 100% !important;
        height: auto !important;
        border-right: none !important;
        border-bottom: 1px solid #999;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
    }

    /* Protocol 7 Browser Mobile */
    .protocol7-browser .toolbar {
        flex-wrap: wrap;
    }
    
    .protocol7-browser input {
        width: 100%;
        margin-bottom: 5px;
    }
}
