:root {
    /* VINTAGE WHITE: Ein kühles "Digital-Papier" (kein Gelbstich, eher Grau/Blau-Nuance) */
    --bg-color: #F1F2F6;

    /* HYPER BLUE: Das satte, digitale Blau aus dem Referenzbild */
    --crt-blue: #0022FF;

    /* TEXT COLOR: Der Text ist jetzt BLAU (statt Weiß), damit man ihn auf dem hellen Grund sieht */
    --text-white: #0022FF;

    /* BORDER: Auch Blau für die Rahmen */
    --window-border: #0022FF;

    /* INACTIVE: Ein blasses Blau-Grau für inaktive Fenster */
    --window-inactive: #B0B0CC;

    /* PATTERN: Das Raster im Hintergrund (ganz feines Blau) */
    --desktop-pattern: #DDE0F0;
}

* { box-sizing: border-box; cursor: none; user-select: none; }
html { background-color: var(--bg-color); }

body {
    margin: 0; padding: 0;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background-color: var(--bg-color);
    color: var(--text-white);
    font-family: 'VT323', monospace;
    height: 100dvh; width: 100%;
    overflow: hidden;
    cursor: none; user-select: none;
}

.header-block,
.post-item.active,
.desktop-icon.selected .icon-label,
#boot-header,
.social-header,
.action-btn.selected-btn,
.mobile-tab.active {
    color: #ffffff !important;
}

/* --- SVG ICON FIX --- */
.profile-svg-icon {
    width: 100%;
    height: 100%;
    background-color: var(--crt-blue);
    -webkit-mask: url('./icons/user.svg') no-repeat center;
    mask: url('./icons/user.svg') no-repeat center;
    -webkit-mask-size: 70%;
    mask-size: 70%;
}
/* --- FILE SYSTEM ICONS (SVG MASKS) --- */

/* Basis-Klasse für alle Datei-Icons */
.file-icon-svg {
    width: 32px;  /* Entspricht ca. 2rem */
    height: 32px;
    background-color: var(--crt-blue); /* Standardfarbe Blau */

    /* Maskierungseinstellungen */
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;

    display: inline-block;
}

/* Spezifische Icons (Pfade anpassen!) */
.icon-folder { -webkit-mask-image: url('./icons/folder-solid.svg'); mask-image: url('./icons/folder-solid.svg'); }
.icon-txt    { -webkit-mask-image: url('./icons/textfile.svg');    mask-image: url('./icons/textfile.svg'); }
.icon-img    { -webkit-mask-image: url('./icons/image-solid.svg');  mask-image: url('./icons/image-solid.svg'); }
.icon-code   { -webkit-mask-image: url('./icons/programming.svg');   mask-image: url('./icons/programming.svg'); }
.icon-file   { -webkit-mask-image: url('./icons/textfile.svg');    mask-image: url('./icons/textfile.svg'); } /* Fallback */
.icon-back { -webkit-mask-image: url('./icons/angle-left-solid.svg'); mask-image: url('./icons/angle-left-solid.svg'); }
.icon-floppy { -webkit-mask-image: url('./icons/save-solid.svg'); mask-image: url('./icons/save-solid.svg'); }

/* WICHTIG: Wenn eine Datei ausgewählt ist, muss das Icon weiß werden */
.file-item.active-file .file-icon-svg,
.attachment-file.active-file .file-icon-svg {
    background-color: #ffffff !important;
}

/* --- GLOBAL OVERLAY (Pixel-Mesh & Vignette) --- */
#global-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9000;

    /* Leichte Körnung + minimale blaue Scanlines */
    background-image:
            linear-gradient(rgba(0, 30, 255, 0.05) 50%, rgba(255, 255, 255, 0) 50%),
            radial-gradient(circle, rgba(0,0,255,0.02) 1px, transparent 1px);

    background-size: 100% 4px, 3px 3px;

    /* Vignette jetzt in Weiß/Grau statt Schwarz für den "Light Screen" Effekt */
    box-shadow: inset 0 0 100px rgba(0, 34, 255, 0.1);

    /* Mix-Mode hilft, es mit dem Weiß zu verschmelzen */
    mix-blend-mode: multiply;
    opacity: 0.75;
}

/* --- LOADING SCREEN (Updated Desktop) --- */
#loading-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;

    /* Hintergrund Schwarz (Retro Boot) */
    background-color: #000;

    /* FIX: Statt der hellen Variable nutzen wir hier 15% Transparenz */
    background-image:
            radial-gradient(rgba(221, 224, 240, 0.15) 15%, transparent 16%),
            radial-gradient(rgba(221, 224, 240, 0.15) 15%, transparent 16%);

    background-size: 4px 4px;

    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

/* Neuer Scanline Layer speziell für den Boot Screen */
#boot-scanlines {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    /* Der gleiche CRT Effekt wie im Blog */
    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% 3px, 3px 100%;
    pointer-events: none;
    z-index: 10001; /* WICHTIG: Muss ÜBER dem loading-window liegen */
}

/* Das eigentliche Lade-Fenster */
#loading-window {
    width: 600px;
    height: 400px;
    background-color: var(--bg-color); /* Fenster ist jetzt hell */
    color: var(--crt-blue); /* Text blau */
    border: 2px solid var(--crt-blue);
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 10px 10px 0 #000;
    font-family: 'VT323', monospace;
    position: relative;
    z-index: 10000; /* Unter den Scanlines */
}

#boot-header {
    border-bottom: 2px solid var(--text-white);
    padding: 5px; margin-bottom: 10px;
    font-weight: bold; text-align: center; letter-spacing: 2px;
    background-color: var(--crt-blue); /* Header gefüllt */
    color: #fff !important;
}

#boot-log {
    flex-grow: 1; overflow: hidden;
    font-size: 1.2rem; line-height: 1.4;
    display: flex; flex-direction: column; justify-content: flex-end;
}

.log-line { margin: 0; }

#loading-status {
    margin-top: 20px; display: flex; align-items: center; gap: 10px;
}

#progress-bar-container {
    flex-grow: 1; height: 20px; border: 2px solid var(--crt-blue); padding: 2px;
}

#progress-bar-fill {
    height: 100%; width: 0%; background-color: var(--crt-blue); transition: width 0.1s linear;
}

/* --- ASCII BACKGROUND ART --- */
#ascii-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Zentriert den Container */
    width: 100%;
    height: 100%;

    /* NEU: Flexbox zum Zentrieren des Inhalts */
    display: flex;
    justify-content: center; /* Zentriert den PRE-Block horizontal */
    align-items: center;     /* Zentriert den PRE-Block vertikal */

    pointer-events: none;
    user-select: none;
    z-index: 0;
    opacity: 0.5; /* Oder weniger, je nach Geschmack */
    overflow: hidden;
    color: var(--crt-blue);
}

#ascii-bg pre {
    /* WICHTIG: Intern muss es linksbündig bleiben! */
    text-align: left;

    font-family: 'Courier New', Courier, monospace;
    font-size: 6px;       /* Kannst du anpassen, wenn es zu klein/groß ist */
    line-height: 6px;
    margin: 0;
    white-space: pre;
}

/* --- DESKTOP --- */
#desktop-area {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: radial-gradient(var(--desktop-pattern) 15%, transparent 16%),
    radial-gradient(var(--desktop-pattern) 15%, transparent 16%);
    background-size: 4px 4px;
    z-index: 1;
    display: flex; flex-direction: column; align-items: flex-start;
    padding: 20px; gap: 20px;
}

.desktop-icon {
    display: flex; flex-direction: column; align-items: center;
    width: 80px; text-align: center; color: var(--text-white);
    z-index: 10;
    position: relative;

    /* MODUS 1: DESKTOP FOKUS (Standard) */
    /* Wenn man auf dem Desktop ist, sind alle Icons gut sichtbar */
    opacity: 0.85;
    transition: all 0.4s ease; /* Weicher Übergang beim Wechsel */
}

/* MODUS 2: APP FOKUS (Fenster aktiv) */
/* TRICK: Wenn der Body ein .window-wrapper.active enthält... */
body:has(.window-wrapper.active) .desktop-icon {
    opacity: 0.4;
    filter: grayscale(100%); /* Optional: Farbe rausnehmen */
}

/* AUSNAHME: DAS AUSGEWÄHLTE ICON */
/* Egal welcher Modus: Das selektierte Icon ist immer voll da */
.desktop-icon.selected {
    opacity: 1 !important;
    filter: none !important;
    transform: scale(1.05); /* Kleiner Pop-Effekt */
}

.desktop-icon.selected .icon-graphic { background: var(--text-white); color: var(--bg-color); }
.desktop-icon.selected .icon-label { background: var(--crt-blue); padding: 0 4px; }

.icon-graphic {
    width: 50px; height: 50px; border: 2px solid var(--text-white);
    background: var(--bg-color); position: relative; margin-bottom: 5px;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
    transition: all 0.2s;
}

/* --- WINDOW GENERAL --- */
.window-wrapper {
    position: absolute;
    display: flex; flex-direction: column;
    box-shadow: 10px 10px 0px rgba(0,0,0,0.2);
    /* Transition für Width/Height statt Scale = True Resizing */
    transition: width 0.1s, height 0.1s, top 0.1s, left 0.1s;
    background: var(--bg-color);
    overflow: hidden; /* Wichtig damit Inhalt nicht rausläuft beim Verkleinern */
}

.window-wrapper.active { z-index: 100; border: 2px solid var(--window-border); }
.window-wrapper.inactive {
    border: 2px solid var(--window-inactive);
    box-shadow: none;

    /* FIX: Hintergrund bleibt voll deckend! */
    opacity: 1;
    background-color: var(--bg-color);
}

.window-wrapper.inactive #blog-screen,
.window-wrapper.inactive #social-screen,
.window-wrapper.inactive #help-screen,
.window-wrapper.inactive #files-screen,
.window-wrapper.inactive #term-screen,
.window-wrapper.inactive #about-screen,
.window-wrapper.inactive .title-bar {
    opacity: 0.3; /* Inhalt wird sehr hell/inaktiv */
    pointer-events: none; /* Man kann nicht versehentlich klicken */
    filter: grayscale(100%); /* Optional: Macht den Inhalt Grau statt Blau */
}

.title-bar {
    height: 30px; border-bottom: 2px solid #000;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 5px; font-weight: bold; flex-shrink: 0; /* Titlebar darf nicht schrumpfen */
}
.window-wrapper.active .title-bar { background: var(--window-border); color: var(--bg-color); }
.window-wrapper.inactive .title-bar { background: var(--window-inactive); color: var(--bg-color); }

.title-text { flex-grow: 1; text-align: center; letter-spacing: 2px; }
.win-btn { width: 15px; height: 15px; border: 1px solid #000; background: #fff; }

/* --- SPECIFIC WINDOWS (Startgrößen werden via JS überschrieben beim Resize) --- */
#blog-screen { flex-grow: 1; padding: 15px; overflow: hidden; position: relative; display: flex; flex-direction: column;}

#help-screen {
    flex-grow: 1; padding: 20px; overflow-y: hidden; /* Scrollen via JS */
    font-size: 1.2rem; line-height: 1.4;
    border-top: none;
}
.help-entry { margin-bottom: 15px; border-bottom: 1px dashed #444; padding-bottom: 5px; }
.key-combo { color: var(--crt-blue); font-weight: bold; display: block; margin-bottom: 2px; }

/* --- SHARED INTERNALS --- */
#scanlines {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    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% 3px, 3px 100%; pointer-events: none; z-index: 999;
}

header { display: flex; justify-content: space-between; margin-bottom: 20px; flex-shrink: 0; }
.header-block { background-color: var(--crt-blue); color: var(--text-white); padding: 5px 15px; font-weight: bold; box-shadow: 4px 4px 0px rgba(0,0,0,0.2); }
.dots-filler { flex-grow: 1; border-bottom: 2px dotted var(--text-white); margin: 0 10px 5px 10px; opacity: 0.5; }
.post-item { display: flex; justify-content: space-between; align-items: flex-end; padding: 10px; margin-bottom: 8px; border: 1px solid transparent; }
.post-item.active { background-color: var(--crt-blue); color: var(--text-white); }
.post-item.active .dots-filler { opacity: 1; }
.single-post::-webkit-scrollbar { display: none; }
.meta-row { display: flex; margin-bottom: 10px; }
.label { width: 140px; } .value { flex-grow: 1; border-bottom: 2px dotted var(--text-white); }
.post-body { margin-top: 30px; line-height: 1.4; white-space: pre-line; }

/* --- SOCIAL WINDOW STYLES (Twitter-Style Feed) --- */
#win-social { width: 400px; height: 500px; }

#social-screen {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0px; /* Kein Padding mehr am Rand, damit der Feed die volle Breite nutzt */
    display: flex;
    flex-direction: column;
    gap: 0; /* WICHTIG: Keine Lücken mehr zwischen Posts für den Flow */
    min-height: 0;
}

.search-cursor { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* --- CSS UPDATE: SCROLL FIX --- */
.single-post {
    display: none;
    /* FIX: Keine feste Höhe! Sonst kollidiert es mit dem Header */
    height: auto;
    flex-grow: 1;      /* Nimm den restlichen Platz */
    min-height: 0;     /* Wichtig für Flexbox Scrolling */

    overflow-y: auto;  /* Hier wird gescrollt */

    /* Scrollbar verstecken (wie gewünscht) */
    scrollbar-width: none;
    -ms-overflow-style: none;

    /* FIX: Genug Platz unten lassen, damit man Attachments gut erreicht */
    padding-bottom: 80px;
}

/* --- SOCIAL WINDOW STYLES (Structured Feed) --- */
#win-social { width: 400px; height: 500px; }

/* --- SCROLL & SAFARI FIXES --- */

#social-screen {
    display: block;
    height: 100%;
    overflow-y: auto; /* Das erlaubt das Mausrad */

    /* Safari Smoothness */
    -webkit-overflow-scrolling: touch;

    padding: 0;
    margin: 0;

    /* MAUS SUPPORT: */
    pointer-events: auto;
    cursor: none;
    /* Scrollbar verstecken (aber Scrollen bleibt möglich) */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#social-screen::-webkit-scrollbar { display: none; }

.social-post {
    scroll-margin-top: 35px;

    /* Restliche Styles bleiben gleich */
    padding: 0;
    color: var(--crt-blue) !important;
    border-bottom: 1px dashed var(--crt-blue);
    display: flex; flex-direction: column; gap: 0;
    position: relative;
    opacity: 0.6;
    transition: opacity 0.2s;
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
}

/* Sicherstellen, dass Bilder in Safari keine Höhe klauen, wenn sie laden */
.post-real-image {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    min-height: 0; /* Wichtig für Safari Flex-Items */
    border: 2px solid var(--crt-blue);
    box-sizing: border-box;
}

/* --- SUCHE --- */
.search-bar {
    border-bottom: 2px solid var(--text-white); /* Harte Trennung zum Feed */
    padding: 10px;
    margin: 0;
    background: var(--bg-color);
    color: var(--crt-blue);
    font-weight: bold;
    display: flex;
    position: sticky; top: 0; z-index: 10;
    margin-bottom: 20px;
}
.search-cursor { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* --- FIXED SOCIAL FEED STYLES --- */

/* --- FINAL SOCIAL FEED STYLES --- */

#social-screen .search-bar {
    margin-bottom: 0 !important;
    border-bottom: 1px solid var(--crt-blue);
}

.social-post.active-post {
    opacity: 1;
    background-color: rgba(0, 34, 255, 0.05);
    border-bottom: 1px solid var(--crt-blue);
}

/* HEADER (Volle Breite) */
.social-post .social-header {
    color: var(--crt-blue) !important;
    background: rgba(0, 34, 255, 0.02);
    /* Restliche Styles */
    padding: 8px 15px;
    border-bottom: 1px dotted rgba(0, 34, 255, 0.3);
    margin: 0;
    display: flex; justify-content: space-between;
    font-weight: bold;
    font-size: 0.9rem;
}

/* NEU: Wrapper für Text & Bild (damit die Padding haben) */
.post-content-wrapper {
    padding: 15px; /* Hier ist das "Pudding" für den Inhalt */
    display: flex;
    flex-direction: column;
    gap: 15px; /* Abstand zwischen Text und Bild */
}

/* Text Inhalt */
.post-text-content {
    display: block;
    line-height: 1.5;
    margin: 0; padding: 0;
    white-space: pre-wrap;
    color: inherit;
}

/* "Show More" Button (Retro Text Style) */
.read-more-btn {
    display: inline-block;

    cursor: none;

    font-weight: bold;
    color: var(--crt-blue);

    /* Reset Box Styles */
    background: transparent;
    border: none;
}

/* WICHTIG: Nur noch '.selected-btn' färbt den Button, NICHT mehr ':hover' */
.read-more-btn.selected-btn {
    background: var(--crt-blue);
    color: #fff;
    padding: 2px 4px;
}

/* Sicherheitshalber Hover explizit neutralisieren */
.read-more-btn:hover {
    background: transparent;
    color: var(--crt-blue);
    cursor: none;
}

/* FOOTER (Volle Breite) */
.social-actions {
    /* Padding direkt hier */
    padding: 8px 15px;

    display: flex; gap: 15px;
    font-size: 0.9rem;
    font-weight: bold;
    border-top: 1px dotted rgba(0, 34, 255, 0.3);
    background: rgba(0, 34, 255, 0.02);
}

/* INTERACTION MODE */
.social-post.interaction-mode {
    background-color: rgba(0,0,0,0.5); /* Etwas dunkler für Fokus */
}

/* --- INNER STRUCTURE (Abgrenzungen) --- */

/* Wenn der Post aktiv ist, wird der Header blau gefüllt -> Text muss WEISS werden */
.social-post.active-post .social-header {
    background: var(--crt-blue);
    color: #ffffff !important; /* Hier ist Weiß korrekt */
    border-bottom-color: var(--text-white);
}

/* Feedback beim Kopieren */
.btn-copied {
    color: var(--crt-blue) !important; /* Ein Retro-Grün */
    font-weight: bold;
}

/* Auf Mobile oder bei Hover: */
.action-btn.selected-btn.btn-copied {
    color: white !important;
    text-shadow: 0px 0px 2px rgba(0,0,0,0.5);
}

/* 2. BODY (Das ASCII Bild) */
.ascii-pic {
    font-family: 'Courier New', Courier, monospace;
    font-size: 8px;
    line-height: 8px;
    white-space: pre;
    overflow: hidden;
    display: flex; justify-content: center; align-items: center;

    /* Viel Platz lassen */
    padding: 20px 0;
    color: var(--text-white);
}

/* 3. FOOTER (Actions) */
.social-actions {
    color: var(--crt-blue); /* Sicherstellen, dass Text blau ist */
    background: rgba(0, 34, 255, 0.02);
    padding: 8px 15px;
    display: flex; gap: 15px;
    font-size: 0.9rem;
    font-weight: bold;
    border-top: 1px dotted rgba(0, 34, 255, 0.3);
}

/* BUTTONS */
.action-btn {
    color: var(--crt-blue); /* Standard Blau */
    opacity: 0.7;
}

.social-post.active-post .action-btn { color: var(--text-white); }

/* Wenn Button ausgewählt/aktiv (Blau) */
.action-btn.selected-btn {
    background: var(--crt-blue);
    color: #ffffff !important;
    opacity: 1;
}

/* CAPTION (Fährt unten raus) */
.social-caption {
    background: transparent;
    padding: 0 10px;
    font-size: 1rem;
    line-height: 1.3;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease-out;
    border-top: none;
}

.social-caption.expanded {
    max-height: 200px;
    opacity: 1;
    padding-top: 10px; padding-bottom: 10px;
    border-top: 1px dashed var(--text-white); /* Trennlinie zur Action Bar */
}

/* --- SCROLLBAR WEG (Social Feed) --- */
#social-screen {
    /* Standard für Firefox/IE */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
/* Für Chrome/Safari/Webkit */
#social-screen::-webkit-scrollbar {
    display: none;
}

/* --- MOBILE OPTIMIERUNG & TASKBAR --- */
#mobile-taskbar { display: none; } /* Desktop: Aus */

/* --- FILES APP (Finder) --- */
#win-files { width: 500px; height: 400px; }

#files-screen {
    padding: 10px;
    display: flex; flex-direction: column;
    height: 100%;
}

.files-toolbar {
    border-bottom: 2px solid var(--crt-blue);
    padding-bottom: 5px; margin-bottom: 10px;
    display: flex; gap: 15px;
    font-weight: bold;
    color: var(--crt-blue);
}

#file-list {
    display: grid;
    /* FIX: Feste 4 Spalten, damit Tastatur-Navigation sauber klappt */
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 90px;
    gap: 10px;
    overflow-y: auto;
    padding: 5px;
}

.file-item {
    display: flex; flex-direction: column; align-items: center;
    text-align: center;
    padding: 10px 5px;
    border: 1px dotted transparent;
    opacity: 0.7;
}

/* Aktives File (Tastatur Auswahl) */
.file-item.active-file {
    background-color: var(--crt-blue);
    color: #fff !important;
    opacity: 1;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.1);
}

/* Damit das Icon im aktiven Zustand auch weiß wird */
.file-item.active-file .file-icon { color: #fff !important; }

.file-icon {
    font-size: 2rem; margin-bottom: 5px;
    color: var(--crt-blue);
}
.file-name {
    font-size: 0.85rem;
    word-break: break-all;
    line-height: 1.1;
    max-width: 100%;
}

/* --- BLOG ATTACHMENTS (Fix) --- */
.attachment-section {
    margin-top: 30px;
    border-top: 2px solid var(--crt-blue);
    padding-top: 10px;
}
.attachment-label { font-weight: bold; margin-bottom: 10px; display: block; color: var(--crt-blue); }

.attachment-file {
    border: 1px solid var(--crt-blue);
    background: rgba(0, 34, 255, 0.05);
    padding: 10px;
    display: flex; align-items: center; gap: 10px;
    cursor: pointer; transition: all 0.2s;
    margin-bottom: 5px;
    color: var(--crt-blue);
    text-decoration: none; /* Wichtig da wir jetzt <a> tags nutzen */
}

@media (hover: hover) {
    .attachment-file:hover {
        background: var(--crt-blue);
        color: #fff !important;
    }
}

.attachment-file.active-file {
    background: var(--crt-blue);
    color: #ffffff !important;
    border-color: var(--crt-blue);
    box-shadow: 0 0 8px rgba(0, 34, 255, 0.4);
    outline: none; /* Standard-Browser-Rahmen weg */
}

/* Auch das Icon und der Text darin müssen weiß werden */
.attachment-file.active-file span {
    color: #ffffff !important;
}

/* --- BLOG POST NAVIGATION --- */
.post-nav {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px dotted var(--crt-blue); /* Feine Trennlinie zum Inhalt */
    display: flex;
    align-items: center;
}

.nav-btn {
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--crt-blue);
    border: 1px solid var(--crt-blue); /* Rahmen für Klickbarkeit */
    padding: 5px 10px;
    transition: all 0.2s;
    background: transparent;
    text-decoration: none;
    display: inline-block;
}

/* Hover, Active & Keyboard Selection */
.nav-btn:hover,
.nav-btn:active,
.nav-btn.selected-nav { /* <-- NEU */
    background: var(--crt-blue);
    color: #ffffff !important;
    box-shadow: 0 0 5px var(--crt-blue); /* Optional: Kleiner Glow */
}

/* --- TERMINAL APP (System Style) --- */
#win-term {
    /* Standard Fenster-Look */
    width: 600px; height: 400px;
    background-color: var(--bg-color);
    color: var(--crt-blue);
    font-family: 'VT323', monospace; /* Deine System-Schrift */
    font-size: 1.1rem;
    font-weight: bold;
    display: flex; flex-direction: column;
}

#term-screen {
    padding: 10px;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    cursor: none; /* Zeigt an, dass man tippen kann */

    /* Scrollbar weg */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
#term-screen::-webkit-scrollbar { display: none; }

#term-output {
    display: flex;
    flex-direction: column;
    /* Kompakter Text */
    line-height: 1.1;
    gap: 2px; /* Minimaler Abstand zwischen Zeilen */
}

/* Die Log-Zeilen */
.term-line {
    margin: 0;
    word-wrap: break-word;
    white-space: pre;
    font-family: 'VT323', monospace;
}

/* Die Eingabezeile */
.input-line {
    display: flex;
    align-items: center;
    margin-top: 2px;
}

#term-prompt {
    margin-right: 5px;
    white-space: nowrap;
}

/* --- TERMINAL CURSOR HACK --- */

/* Der echte Input wird zum "Ghost" */
#term-input {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;             /* Unsichtbar */
    background: transparent;
    border: none;
    color: transparent;     /* Text auch unsichtbar */
    caret-color: transparent; /* Den dünnen Strich verstecken! */
    cursor: default;
    z-index: 10;            /* Liegt über allem, damit man tippen kann */
}

/* Der sichtbare Text (spiegelt den Input) */
#term-visual-wrapper {
    color: var(--crt-blue);
    white-space: pre; /* Damit Leerzeichen dargestellt werden */
    min-width: 0;
}

.term-selected-text {
    background-color: var(--crt-blue);
    color: var(--bg-color);
    display: inline;
    white-space: pre;
}

.term-cursor-char {
    display: inline;
    white-space: pre;
    /* Wir starten im "invertierten" Modus (Blauer Block, weißer Text) */
    background-color: var(--crt-blue);
    color: var(--bg-color);
    animation: blinkColors 1s step-end infinite;
}

/* Wenn Terminal inaktiv, Cursor ausblenden oder stoppen */
.window-wrapper.inactive .term-cursor-char {
    animation: none;
    background-color: transparent;
    color: var(--crt-blue);
    outline: 1px solid rgba(0, 34, 255, 0.5);
}

@keyframes blinkColors {
    0%, 49% {
        background-color: var(--crt-blue);
        color: var(--bg-color);
    }
    50%, 100% {
        /* "Off"-Phase: Normaler Text (Blau auf Transparent) */
        background-color: transparent;
        color: var(--crt-blue);
        /* Optional: Outline, damit man sieht wo der Cursor ist */
        outline: 1px solid var(--crt-blue);
    }
}

@keyframes blinkBlock {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* --- FILE VIEWER WINDOWS --- */
.viewer-content {
    flex-grow: 1;
    overflow: auto;
    padding: 0;
    display: flex;
    justify-content: center; /* Zentriert Bilder */
    align-items: center;
    background-color: #fff; /* Weißer Hintergrund für bessere Lesbarkeit */
    color: #000; /* Schwarzer Text im Viewer (Kontrast) */
    position: relative;
    min-height: 0;
}

/* Bilder: Sollen sich anpassen */
.viewer-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* Text-Dateien (Code, CSS, JS) */
.viewer-text {
    width: 100%;
    height: auto;
    min-height: 100%;
    margin: 0;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    white-space: pre;
    text-align: left;
    align-self: flex-start;
    color: #333;

    /* FIX: Cursor unsichtbar machen für Tastatur-only Feeling */
    user-select: none; /* Optional: Textmarkierung auch aus, wenn man keine Maus nutzt */
    cursor: none;
}

/* --- VIEWER ERROR / BINARY STATE --- */
.viewer-binary {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    text-align: center;
    color: var(--crt-blue);
    font-weight: bold;
    padding: 20px;
    border: 2px dashed var(--crt-blue);
    background: rgba(0, 34, 255, 0.05);
}

.binary-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.binary-msg {
    margin-bottom: 20px;
    line-height: 1.4;
}

.shortcut-hint {
    background: var(--crt-blue);
    color: #fff;
    padding: 5px 10px;
    font-size: 0.9rem;
}

/* --- ABOUT / PROFILE STYLE --- */
#about-screen {
    flex-grow: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    /* Damit der Hintergrund nicht leer wirkt */
    background-color: var(--bg-color);
}

/* Das Cover Bild (Muster statt echtes Bild) */
.profile-cover {
    height: 120px;
    width: 100%;
    /* Ein schraffiertes Muster als "Cover Image" */
    background: repeating-linear-gradient(
            45deg,
            var(--crt-blue),
            var(--crt-blue) 2px,
            var(--bg-color) 2px,
            var(--bg-color) 4px
    );
    position: relative;
    border-bottom: 2px solid var(--crt-blue);

    /* Name rechts unten im Cover positionieren */
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 10px;
    margin-bottom: 0;
}

/* Der Name im Cover */
.profile-name-header {
    font-size: 2rem;
    font-weight: bold;
    color: var(--crt-blue);
    background: var(--bg-color); /* Hinterlegt, damit lesbar */
    padding: 2px 10px;
    border: 2px solid var(--crt-blue);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
}

/* Das Profilbild (überlappt Cover und Body) */
.profile-pic-container {
    width: 100px; height: 100px;
    background: var(--bg-color);
    border: 2px solid var(--crt-blue);
    position: absolute;
    /* Hängt halb im Cover, halb draußen */
    bottom: -30px;
    left: 20px;

    display: flex; justify-content: center; align-items: center;
    font-size: 3rem;
    color: var(--crt-blue);
    font-weight: bold;
    box-shadow: 5px 5px 0 rgba(0,0,0,0.1);
    z-index: 2;
}

/* Layout Container */
.profile-body {
    margin-top: 40px; /* Platz lassen für das überlappende Bild */
    padding: 20px;
    display: flex;
    gap: 20px;
}

/* Linke Spalte (Sidebar) */
.profile-sidebar {
    width: 140px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Rechte Spalte (Main) */
.profile-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Die kleinen Info-Kästen links */
.info-box {
    border: 1px dotted var(--crt-blue);
    padding: 10px;
    font-size: 0.9rem;
    background: rgba(0, 34, 255, 0.03);
}

.info-title {
    font-weight: bold;
    border-bottom: 1px solid var(--crt-blue);
    margin-bottom: 5px;
    color: var(--crt-blue);
}

.info-row {
    margin-bottom: 4px;
    display: flex;
    flex-direction: column; /* Labels oben */
}

.info-label {
    font-weight: bold;
    opacity: 0.6;
    font-size: 0.8rem;
}

/* Die "Posts" in der Mitte */
.section-card {
    border: 2px solid var(--crt-blue);
    padding: 20px 15px 15px 15px;
    position: relative;
    background: var(--bg-color);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.05);
}

.section-header {
    position: absolute;
    top: -12px;
    left: 10px;
    background: var(--bg-color);
    padding: 0 5px;
    font-weight: bold;
    color: var(--crt-blue);
    border: 1px solid var(--crt-blue);
}

/* --- SNAKE GAME --- */
#game-screen {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    color: var(--crt-blue); /* Text bleibt blau */
    padding: 20px;
    font-family: 'Courier New', monospace;
}

.game-ui-header {
    width: 100%;
    display: flex; justify-content: space-between;
    font-weight: bold;
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--crt-blue);
    padding-bottom: 5px;
}

#snake-grid {
    background: rgba(0, 34, 255, 0.05); /* Ganz leichtes Blau im Hintergrund */
    border: 2px solid var(--crt-blue);    /* Das ist jetzt der einzige Rahmen */
    margin: 0;

    line-height: 1;      /* Zeilenabstand verringern */
    letter-spacing: 0px; /* Zeichenabstand normalisieren */

    font-weight: bold;
    cursor: none;
    display: inline-block; /* Damit der Rahmen sich eng um den Text legt */
    padding: 2px;          /* Minimaler Abstand zum Rahmen */
}

#snake-msg {
    margin-top: 15px;
    font-weight: bold;
    height: 20px; /* Platzhalter */
}

.blink-text { animation: blink 1s step-end infinite; }

/* --- MOBILE OPTIMIERUNG --- */
@media (max-width: 800px) {

    #boot-log, #loading-status, #progress-percent {
        color: #ffffff !important;
    }

    /* --- GLOBAL FIXES --- */
    /* GUI Anpassungen: Desktop Elemente ausblenden */
    #desktop-area, .title-bar, .window-controls { display: none !important; }

    /* Cursor auf Auto setzen für Touch */
    body { cursor: auto; }

    /* --- MOBILE BOOT SCREEN FIXES --- */

    #loading-screen {
        /* Hintergrund sicherstellen (Hyper Blue) */
        background-color: var(--crt-blue) !important;

        /* FIX: Das Raster viel subtiler machen (nur 10% Deckkraft) */
        background-image:
                radial-gradient(rgba(0,0,0,0.1) 15%, transparent 16%),
                radial-gradient(rgba(0,0,0,0.1) 15%, transparent 16%) !important;
        background-size: 4px 4px !important;
    }

    /* FIX: Ladebalken muss WEISS sein auf dem blauen Grund */
    #progress-bar-container {
        border-color: #ffffff !important;
    }

    #progress-bar-fill {
        background-color: #ffffff !important;
        box-shadow: 0 0 10px rgba(255,255,255,0.5); /* Leichter Glow für Coolness */
    }

    /* Status Text (Prozentanzeige) auch Weiß erzwingen */
    #loading-status {
        color: #ffffff !important;
    }

    #loading-window {
        border: none; box-shadow: none; background: transparent;
    }

    /* --- WINDOW MANAGEMENT --- */
    /* Fenster immer Fullscreen */
    #win-blog, #win-help, #win-files, #win-social {
        position: fixed !important; top: 0 !important; left: 0 !important;
        transform: none !important; width: 100% !important; height: calc(100dvh - 60px) !important; /* Platz für Taskbar */
        box-shadow: none !important; border: none !important; z-index: 100 !important;
        background: var(--bg-color) !important; /* Hintergrund Hellgrau */
    }

    .window-wrapper {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        width: 100% !important;

        /* WICHTIG: Volle Höhe minus Taskbar (60px) */
        height: calc(100dvh - 60px) !important;

        box-shadow: none !important;
        border: none !important;
        z-index: 100 !important;
        background: var(--bg-color) !important;

        /* Flexbox sicherstellen */
        display: flex !important;
        flex-direction: column !important;
    }

    /* Inaktive Fenster weg */
    .window-wrapper.inactive { display: none !important; }

    /* Scrolling ermöglichen */
    #blog-screen, #social-screen, #help-screen {
        padding-bottom: 20px;
        overflow-y: auto; min-height: 0; flex-grow: 1;
    }
    #list-view, #post-view { overflow-y: auto; flex-grow: 1; min-height: 0; }

    /* --- TASKBAR (Unten) --- */
    #mobile-taskbar {
        /* FIX: Erstmal verstecken! */
        display: none;

        position: fixed; bottom: 0; left: 0; width: 100%; height: 60px;
        background: var(--crt-blue);
        border-top: none;
        z-index: 9999;
        justify-content: space-around; align-items: center;
        font-size: 1.2rem;
        padding-bottom: env(safe-area-inset-bottom);
    }

    body.system-ready #mobile-taskbar {
        display: flex;
    }

    .mobile-tab {
        /* Inaktive Tabs: Weiß aber transparent (damit sie auf Blau gut aussehen) */
        color: rgba(255,255,255,0.6);
        cursor: pointer; padding: 10px;
        font-weight: normal;
    }

    /* Aktiver Tab wird im globalen Contrast-Fix (oben) auf Weiß gesetzt,
       aber hier sicherheitshalber nochmal definiert */
    .mobile-tab.active {
        color: #ffffff !important;
        font-weight: bold;
        opacity: 1;
        text-shadow: none;
    }

    /* --- SOCIAL FEED MOBILE FIXES --- */

    /* 1. Layout & Abstand */
    .social-post {
        margin-bottom: 25px !important;
        padding-bottom: 15px !important;
        border-bottom: 1px dashed var(--crt-blue) !important; /* Klare Trennlinie */

        /* Reset der Desktop-Selection Styles */
        opacity: 1 !important;
        background: transparent !important;
        border-left: none !important;
    }

    /* 2. HEADER: Hier ist der Fix! */
    .social-header,
    .social-post.active-post .social-header {
        /* Hintergrund BLAU (mit etwas Transparenz) */
        background-color: rgba(0, 34, 255, 0.15) !important;

        /* Text Farbe BLAU (weil Hintergrund hellblau ist) */
        color: var(--crt-blue) !important;

        padding: 8px 10px !important;
        margin-bottom: 10px !important;

        /* Dicker blauer Balken links */
        border-left: 4px solid var(--crt-blue) !important;
        border-bottom: none !important; /* Keine Linie unten im Header */

        /* Schriftart */
        font-weight: bold !important;
        text-shadow: none !important;
    }

    /* 3. Footer schlicht halten */
    .social-actions,
    .social-post.active-post .social-actions {
        background: transparent !important;
        border-top: none !important;
        padding-top: 10px;
    }

    .action-btn {
        opacity: 1 !important;
        color: var(--crt-blue) !important;
    }

    /* --- FILES APP MOBILE --- */
    /* Weniger Spalten auf dem Handy, damit Icons Platz haben */
    #file-list {
        grid-template-columns: repeat(2, 1fr) !important;
        padding-bottom: 80px; /* Platz für Taskbar unten */
    }

    /* Toolbar etwas kompakter */
    .files-toolbar {
        font-size: 0.9rem;
    }
    #files-screen {
        flex-grow: 1;
        overflow-y: auto;
        padding: 15px;
        min-height: 0;
    }

    #icon-term, #win-term { display: none !important; }

}

/* --- INVISIBLE SCROLLING (Cleaner Look) --- */

/* Alle Elemente, die scrollen können */
#blog-scroll-area,
#social-screen,
#files-screen,
.single-post,
#help-screen {
    /* Firefox */
    scrollbar-width: none;

    /* IE 10+ */
    -ms-overflow-style: none;
}

#social-screen, #blog-screen, #files-screen, #term-screen, .viewer-content {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Chrome, Safari, Edge */
#blog-scroll-area::-webkit-scrollbar,
#social-screen::-webkit-scrollbar,
#files-screen::-webkit-scrollbar,
.single-post::-webkit-scrollbar,
#help-screen::-webkit-scrollbar,
::-webkit-scrollbar { /* Globaler Catch-All */
    display: none;
    width: 0;
    height: 0;
}

.keyboard-scrolling .attachment-file,
.keyboard-scrolling .nav-btn {
    pointer-events: none;
}

.window-wrapper.inactive #term-screen {
    pointer-events: auto !important;
    cursor: text;
}
