/* =========================================
   0. HELPER CLASSES
   ========================================= */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@font-face {
    font-family: "Courier New", Courier, monospace;
    src: local('Courier New'), local('Arial');
}

/* =========================================
   1. RESET & BASE SYSTEM
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    margin: 0; padding: 0; height: 100%; overflow: hidden;
}

body {
    background-color: #008080; /* Windows Teal */
    color: #000;
    font-family: "Courier New", Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
    cursor: default;
}

/* =========================================
   2. DESKTOP & ICONS
   ========================================= */
.container {
    display: flex; justify-content: center; align-items: center; height: 100vh;
}

.logo {
    width: 10%; height: auto; opacity: 0.5; user-select: none; pointer-events: none;
}

.desktop {
    position: absolute; 
    top: 10px; 
    left: 10px; 
    display: flex; 
    flex-direction: column; /* Immer untereinander */
    gap: 20px; 
    z-index: 5;
}

.desktop-icon {
    width: 150px; 
    text-align: center; 
    font-size: 18px; 
    user-select: none; 
    color: #ffffff; 
    text-shadow: 1px 1px 0 #000;
}

.desktop-icon a { text-decoration: none; color: inherit; display: block; cursor: pointer; }

.desktop-icon img {
    width: 80px; 
    height: auto; 
    display: block; 
    margin: 0 auto 5px;
    image-rendering: pixelated; 
    border: 2px solid transparent;
}
.desktop-icon a:hover img { border: 2px solid #000080; opacity: 0.8; }

/* =========================================
   3. WINDOW SYSTEM
   ========================================= */
.window {
    position: fixed; 
    display: none; 
    width: 1000px; min-width: 300px; min-height: 200px;
    background: #C0C0C0;
    border: 2px solid #808080;
    box-shadow: 1px 1px 0 #000, 1px 1px 0 #404040, -1px -1px 0 #fff;
    font-family: "MS Sans Serif", sans-serif;
    z-index: 10;
}

.window.inactive .title-bar { background: #808080; color: #ccc; }
.window.active .title-bar { background: #000080; color: #fff; }

.title-bar {
    padding: 2px 3px; font-weight: bold; font-size: 14px;
    display: flex; justify-content: space-between; align-items: center;
    cursor: move;
    border-bottom: 2px solid #808080;
}

.title-bar-buttons button {
    width: 16px; height: 14px; margin-left: 2px; background: #C0C0C0;
    border: 1px solid #808080; border-top: 1px solid #fff; border-left: 1px solid #fff;
    font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 10px;
}
.title-bar-buttons button:active { border: 1px solid #808080; border-bottom: 1px solid #fff; border-right: 1px solid #fff; }

.content {
    background: #C0C0C0; padding: 10px; 
    border: 2px solid #808080; border-top: none; border-bottom: 1px solid #fff; border-right: 1px solid #fff;
    box-shadow: inset 1px 1px #000;
    font-family: "Courier New", Courier, monospace; font-size: 16px; line-height: 1.6;
    overflow-y: auto; height: calc(100% - 25px);
}

.resize-handle {
    width: 16px; height: 16px; position: absolute; right: 2px; bottom: 2px; cursor: se-resize;
    display: flex; align-items: center; justify-content: center; background: transparent;
}
.resize-handle:before { content: "⇲"; color: #808080; font-size: 14px; pointer-events: none; }

/* =========================================
   4. TYPOGRAPHY & LISTS
   ========================================= */
h2 { font-size: 24px; margin-bottom: 10px; border-bottom: 1px dashed #000; }
h3 { font-size: 18px; margin-top: 20px; margin-bottom: 10px; }
p, ul { margin-bottom: 15px; }
ul { padding-left: 20px; list-style-type: square; }
li { margin-bottom: 5px; }
a { color: #000080; text-decoration: none; }
a:hover { text-decoration: underline; background-color: #000080; color: #fff; }

.file-list {
    display: table; width: 100%; border-collapse: collapse; margin: 0; padding: 0;
    border: 1px solid #808080; background-color: #fff;
}
.file-list li { display: table-row; border-bottom: 1px dotted #ccc; }
.file-list li .name { display: table-cell; width: 60%; padding: 4px 8px; vertical-align: middle; }
.file-list li .links { display: table-cell; width: 40%; text-align: right; vertical-align: middle; padding: 4px 8px; }
.file-list li:hover { background-color: #000080; color: #fff; }
.file-list li:hover a { color: #fff; }

/* =========================================
   5. TASKBAR & START MENU
   ========================================= */
.taskbar {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 30px;
    background: #C0C0C0; border-top: 2px solid #fff; 
    display: flex; align-items: center; padding: 2px; z-index: 1000;
}
#taskbar-tabs { display: flex; flex-grow: 1; overflow: hidden; margin-left: 5px; }

.start-button {
    display: flex; align-items: center; gap: 4px; background: #C0C0C0;
    border: 2px solid #fff; border-right: 2px solid #000; border-bottom: 2px solid #000;
    padding: 2px 6px; cursor: pointer; font-weight: bold; font-family: "MS Sans Serif", sans-serif;
}
.start-button:active, .start-button.active {
    border: 2px solid #000; border-right: 2px solid #fff; border-bottom: 2px solid #fff;
    padding: 3px 5px 1px 7px;
}

.taskbar-tab {
    display: inline-flex; align-items: center; justify-content: flex-start;
    width: 160px; height: 24px; font-size: 12px; cursor: pointer; font-family: "MS Sans Serif", sans-serif;
    border: 2px solid #fff; border-right: 2px solid #000; border-bottom: 2px solid #000;
    margin-right: 2px; background: #C0C0C0; padding: 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.taskbar-tab:active, .taskbar-tab.active-tab {
    border: 2px solid #000; border-right: 2px solid #fff; border-bottom: 2px solid #fff;
    background: #eee; font-weight: bold;
}

.start-menu {
    position: fixed; bottom: 32px; left: 2px; background: #C0C0C0; 
    border: 2px solid #fff; border-right: 2px solid #000; border-bottom: 2px solid #000;
    padding: 2px; display: none; flex-direction: column; z-index: 1100;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.5);
}
.start-menu a {
    padding: 8px 20px; text-decoration: none; color: #000; display: block; 
    cursor: pointer; font-family: "MS Sans Serif", sans-serif;
}
.start-menu a:hover { background: #000080; color: #fff; }

#clock {
    margin-left: auto; padding: 0 10px; 
    border: 2px solid #808080; border-right: 2px solid #fff; border-bottom: 2px solid #fff;
    background: #c0c0c0; font-family: "MS Sans Serif", sans-serif; font-size: 12px;
}

/* =========================================
   6. APPS & SPECIALS
   ========================================= */
.music-player {
    background: #c0c0c0; color: #000; border: 2px solid #808080; 
    font-family: 'Courier New', monospace; margin: 10px 0; padding: 8px;
}
#music-player-container {
    background: #c0c0c0; display: flex; flex-direction: column; gap: 10px;
}
.music-player-tracklist li.active-track { background-color: #000080; color: #fff; }
.music-player-tracklist li.active-track a { color: #fff !important; }

#snakeCanvas { width: 100%; height: auto; image-rendering: pixelated; border: 2px inset #fff; }
.vst-container-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.vst-manual-wrapper { background-color: #c0c0c0; color: #000; height: 100%; overflow-y: auto; }
.vst-h2 { font-weight: bold; font-size: 1.5rem; border-bottom: 2px solid #000; margin-bottom: 15px; }
.vst-fieldset { border: 2px groove #dfdfdf; margin-bottom: 15px; padding: 10px; background: #d4d0c8; cursor: pointer; }
.vst-fieldset:hover { background: #e0e0e0; }
.vst-legend { font-weight: bold; padding: 0 5px; }
.sys-highlight-vst { background: #000; color: #0f0; padding: 1px 4px; font-family: monospace; }
.get-it-now-btn {
    background: #000; color: #0f0; border: 3px outset #ccc; padding: 10px; 
    font-weight: bold; width: 100%; cursor: pointer; text-transform: uppercase;
}
.get-it-now-btn:active { border-style: inset; }

#boot-screen {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: #000 !important; color: #cecece; z-index: 999999;
    display: flex; flex-direction: column; padding: 20px;
}
#boot-log div:last-child::after { content: '_'; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.fade-out { opacity: 0; transition: opacity 0.8s ease-out; pointer-events: none; }

#screensaverOverlay {
    display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #000; z-index: 9000; justify-content: center; align-items: center;
}
#screensaver { width: 100%; height: 100%; object-fit: cover; }

/* =========================================
   7. EXTRAS & SCROLLBAR
   ========================================= */
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: #dfdfdf; }
::-webkit-scrollbar-thumb {
    background: #c0c0c0; border: 2px solid #fff; border-right: 2px solid #404040; border-bottom: 2px solid #404040;
}
::selection { background: #000080; color: #fff; }

/* =========================================
   8. MOBILE FIXES (Max-Width: 768px)
   ========================================= */
@media (max-width: 768px) {
    .desktop {
        top: 60px !important; 
        left: 10px !important;
        flex-direction: column !important;
        gap: 15px !important;
    }

    /* === HIER SIND DIE GRÖSSEREN MOBILE ICONS === */
    .desktop-icon { 
        width: 140px !important; /* Fast so breit wie Desktop */
        font-size: 14px !important; /* Größere Schrift */
    }
    
    .desktop-icon img { 
        width: 64px !important; /* Deutlich größer als vorher (42px) */
    }
    /* ========================================== */

    .window { 
        width: 100% !important; 
        height: calc(100% - 32px) !important; 
        top: 0 !important; 
        left: 0 !important; 
        border: none; 
    }
    
    .content { 
        height: calc(100% - 35px) !important; 
        -webkit-overflow-scrolling: touch; 
    }
    
    .title-bar { padding: 8px 5px; font-size: 16px; }
    .title-bar-buttons button { width: 32px; height: 32px; font-size: 20px; }

    .taskbar { height: 35px; bottom: 0; }
    #taskbar-tabs { display: none; } 
    .start-button { flex-grow: 1; justify-content: center; height: 100%; }
    .start-menu { width: 90%; left: 5%; bottom: 40px; }

    /* Game & Player Stacking */
    #snakeCanvas { max-width: 260px !important; }
    #snake-mobile-controls { display: grid !important; grid-template-areas: '. up .' 'left . right' '. down .'; gap: 2px; }
    .snake-btn { width: 32px !important; height: 32px !important; font-size: 14px !important; }

    .vst-container-grid { display: flex !important; flex-direction: column !important; gap: 15px !important; }
    .vst-main-content, .vst-side-content { width: 100% !important; min-width: 0 !important; }
    .vst-fieldset, .vst-side-fieldset { width: 100% !important; }

    #music-player-tracklist { max-height: 200px !important; }
    #music-player-embed { height: 152px !important; }
    #detail-img { max-width: 100% !important; height: auto !important; }
}
