@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* --- CSS RESET & BASICS --- */
body {
    margin: 0;
    overflow: hidden;
    background-color: #000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
    overscroll-behavior: none;
}

/* --- 1. BIOS LOADING SCREEN --- */
#bios-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: #000;
    z-index: 20000;
    padding: 20px;
    font-family: 'Courier New', Courier, monospace;
    color: #ccc;
    font-size: 14px;
    line-height: 1.5;
    display: block;
    box-sizing: border-box;
    overflow: hidden;
}

.bios-header { display: flex; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; }
.energy-star {
    border: 2px solid #fff; padding: 5px; color: #fff; font-weight: bold; text-align: center;
    width: 100px; font-size: 10px; margin-top: 10px;
}
.energy-logo-art {
    color: yellow; font-size: 20px; display: block; margin-bottom: 5px;
}
.bios-text span { color: #fff; font-weight: bold; }
.blink { animation: blinker 1s linear infinite; }
@keyframes blinker { 50% { opacity: 0; } }

/* --- 2. WINDOWS 98 SPLASH SCREEN --- */
#splash-screen {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 15000;
    background: radial-gradient(circle at center, #fff 0%, #d4d4d4 10%, #a0a0a0 40%, #000 100%); 
    background-size: cover;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.splash-content {
    width: 90%; max-width: 400px; height: 300px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; position: relative;
}

.win-logo {
    font-family: 'Arial Black', sans-serif; font-weight: 900; font-size: 30px; color: #000;
    display: flex; align-items: center; gap: 10px; margin-bottom: 40px;
}

.windows-flag {
    display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
    gap: 2px; width: 40px; height: 40px; transform: skew(-10deg);
}
.flag-sq { width: 100%; height: 100%; }
.sq-red { background: #e73e27; }
.sq-green { background: #4ba62d; }
.sq-blue { background: #3379c2; }
.sq-yellow { background: #f0c30f; }

.splash-bar-container {
    width: 80%; height: 15px; border: 1px solid #666; background: #fff;
    border-radius: 2px; padding: 2px; box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
}

.splash-bar-fill {
    height: 100%; width: 0%; background: linear-gradient(90deg, #000080, #1084d0);
    transition: width 0.1s linear;
}

/* --- 3. DESKTOP LAYER --- */
#desktop-layer {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #008080; z-index: 10; cursor: default;
}

/* --- DESKTOP ICONS --- */
.icon-grid {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    height: 90vh;
    width: 100px;
    padding-top: 10px;
    align-content: flex-start;
}

.desktop-icon {
    width: 80px; text-align: center; color: white;
    cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 5px;
    margin-bottom: 20px; margin-left: 10px;
}

.desktop-icon:active, .desktop-icon:hover { opacity: 0.8; }
.desktop-icon img { width: 48px; height: 48px; image-rendering: pixelated; pointer-events: none; }
.icon-text { 
    background: transparent; padding: 2px; font-size: 12px; 
    text-shadow: 1px 1px 0 #000; pointer-events: none; 
}

/* --- WINDOW STYLES --- */
.win98-window {
    position: absolute; background: #c0c0c0;
    border-top: 2px solid #fff; border-left: 2px solid #fff;
    border-right: 2px solid #000; border-bottom: 2px solid #000;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
    display: flex; flex-direction: column;
    min-width: 200px; min-height: 100px;
}

.title-bar {
    background: linear-gradient(90deg, #000080, #1084d0);
    padding: 4px 5px; display: flex; justify-content: space-between; align-items: center;
    color: white; font-weight: bold; font-size: 14px; cursor: grab;
    touch-action: none;
}

.title-bar-controls button {
    width: 18px; height: 16px; font-size: 10px; font-weight: bold; line-height: 10px;
    border-top: 1px solid #fff; border-left: 1px solid #fff;
    border-right: 1px solid #000; border-bottom: 1px solid #000;
    background: #c0c0c0; margin-left: 4px; cursor: pointer; padding: 0;
}
.title-bar-controls button:active {
    border-top: 1px solid #000; border-left: 1px solid #000;
    border-right: 1px solid #fff; border-bottom: 1px solid #fff;
}

.window-body { padding: 10px; flex: 1; overflow: auto; position: relative; }

/* Window Defaults */
#profile-window { top: 50px; left: 150px; width: 450px; }
#doge-window { top: 80px; left: 620px; width: 400px; height: 350px; }
#video-window { top: 450px; left: 150px; width: 420px; height: 340px; }
#paint-window { top: 150px; left: 250px; width: 500px; height: 400px; }

/* Profile Window Content */
.profile-content { display: flex; gap: 15px; align-items: flex-start; }
.profile-pic { width: 80px; height: 80px; border: 2px solid #808080; background: #000; object-fit: cover; flex-shrink: 0; }
.field-set {
    border: 1px solid #808080; padding: 10px; margin-top: 10px; background: #fff;
    border-top: 1px solid #000; border-left: 1px solid #000;
    border-bottom: 1px solid #fff; border-right: 1px solid #fff;
}
.retro-btn {
    margin-top: 10px; padding: 8px 15px; background: #c0c0c0;
    border-top: 2px solid #fff; border-left: 2px solid #fff;
    border-right: 2px solid #000; border-bottom: 2px solid #000;
    cursor: pointer; font-weight: bold; touch-action: manipulation;
}
.retro-btn:active {
    border-top: 2px solid #000; border-left: 2px solid #000;
    border-right: 2px solid #fff; border-bottom: 2px solid #fff;
}

/* 3D Canvas */
#doge-canvas-container {
    width: 100%; height: 100%; min-height: 250px; background: #000;
    border: 2px solid #808080; border-top: 2px solid #000;
    border-left: 2px solid #000; border-bottom: 2px solid #fff;
    border-right: 2px solid #fff;
}

/* Video Player */
#video-window .window-body { padding: 0; background: #000; display: flex; justify-content: center; align-items: center; }
.video-container { width: 100%; height: 100%; }

/* Paint Styles */
.paint-toolbar { background: #c0c0c0; padding: 5px; border-bottom: 1px solid #808080; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.paint-colors { display: flex; gap: 2px; border: 1px inset #fff; padding: 2px; }
.color-swatch { width: 20px; height: 20px; border: 1px solid #000; cursor: pointer; }
.color-swatch.active { border: 2px solid #000; }
.paint-tools button { width: 30px; height: 30px; font-size: 14px; cursor: pointer; }
.paint-canvas-container { flex: 1; background: #808080; padding: 10px; overflow: hidden; display: flex; justify-content: center; align-items: center; }
#paint-canvas { background: #fff; border: 2px inset #fff; cursor: crosshair; touch-action: none; }

/* --- TASKBAR & START MENU --- */
#taskbar {
    display: none; /* Controlled by JS */
    position: fixed; bottom: 0; left: 0; width: 100%; height: 35px;
    background: #c0c0c0; border-top: 2px solid #fff;
    align-items: center; padding: 2px; box-sizing: border-box; z-index: 12000;
}

#start-btn {
    display: flex; align-items: center; gap: 5px; padding: 2px 8px;
    font-weight: bold; font-style: italic; height: 26px;
    border-top: 2px solid #fff; border-left: 2px solid #fff;
    border-right: 2px solid #000; border-bottom: 2px solid #000;
    cursor: pointer; margin-right: 5px;
}
#start-btn img { height: 18px; }
#start-btn:active, #start-btn.active {
    border-top: 2px solid #000; border-left: 2px solid #000;
    border-right: 2px solid #fff; border-bottom: 2px solid #fff; background: #d0d0d0;
}

/* Tabs removed - just a spacer */
.taskbar-spacer { flex-grow: 1; }

#clock-tray {
    margin-left: auto; border-top: 2px solid #808080; border-left: 2px solid #808080;
    border-right: 2px solid #fff; border-bottom: 2px solid #fff;
    padding: 0 10px; height: 26px; display: flex; align-items: center; font-size: 12px;
    white-space: nowrap;
}

#start-menu {
    display: none; position: fixed; bottom: 35px; left: 2px; width: 200px;
    background: #c0c0c0; 
    border-top: 2px solid #fff; border-left: 2px solid #fff;
    border-right: 2px solid #000; border-bottom: 2px solid #000;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5); z-index: 12001;
}
.start-sidebar {
    width: 25px; background: #000080; color: #fff; writing-mode: vertical-rl;
    transform: rotate(180deg); padding: 5px 0; font-weight: bold; font-size: 14px;
    float: left; height: 150px; display: flex; align-items: center; justify-content: flex-end;
}
.start-item {
    padding: 12px 10px; cursor: pointer; display: flex; align-items: center; gap: 10px; margin-left: 25px;
}
.start-item:hover { background: #000080; color: #fff; }

/* --- MOBILE RESPONSIVE OVERRIDES --- */
@media (max-width: 768px) {
    .win98-window {
        width: 90% !important; left: 5% !important; top: 50px !important;
        height: auto; max-height: 80vh;
    }
    #profile-window { top: 20px !important; }
    .profile-content { flex-direction: column; align-items: center; text-align: center; }
    .profile-pic { margin-bottom: 10px; }
    #doge-window { top: 60px !important; height: 350px !important; }
    #video-window { top: 40px !important; height: 300px !important; }
    #paint-window { top: 30px !important; height: 400px !important; }
    .bios-header { font-size: 10px; }
    .energy-star { display: none; }
}