﻿/* ================================================================
   DESKTOP.CSS — Authentic Windows 95 / 98 UI
   ================================================================ */

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

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ---------- CSS Variables ---------- */
:root {
  /* W95 palette */
  --w-face:     #c0c0c0;   /* gray face */
  --w-lt:       #ffffff;   /* light edge */
  --w-dk:       #808080;   /* dark edge */
  --w-ddk:      #000000;   /* deep dark (authentic W95 outer edge) */
  --w-dfl:      #dfdfdf;   /* second light tone for the double bevel */
  --w-btn:      #c0c0c0;
  --w-titlebar: #000080;
  --w-titlebar2:#1084d0;
  --w-text:     #000000;
  --w-white:    #ffffff;
  --w-select:   #000080;
  --w-select-t: #ffffff;
  /* font */
  --w-font: "MS Sans Serif", "Microsoft Sans Serif", "Pixelated MS Sans Serif", Tahoma, sans-serif;
  /* taskbar */
  --tb-h: 36px;
  /* lock screen background — change this to retheme the lock screen */
  --lock-bg: #000080;
}

/* ----------------------------------------------------------------
   WALLPAPER — Classic Windows 95 teal
   ---------------------------------------------------------------- */
html, body {
  margin: 0; padding: 0;
  font-family: var(--w-font);
  font-size: 11px;
  user-select: none;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  cursor: default;
}

body.desktop {
  background: #008080;
  height: 100vh; overflow: hidden;
}

body.desktop::before { content: none; }

/* ----------------------------------------------------------------
   DESKTOP CONTAINER
   ---------------------------------------------------------------- */
.desktop {
  position: relative;
  width: 100vw; height: 100vh;
  display: block;
}

/* ----------------------------------------------------------------
   DESKTOP ICONS
   ---------------------------------------------------------------- */
.icon {
  position: absolute;
  width: 76px;
  text-align: center;
  color: white;
  cursor: pointer;
  padding: 5px 4px 4px;
  border: 1px solid transparent;
  outline: none;
  z-index: 2;
  transition: none;
  border-radius: 0;
}

.icon:hover {
  background: rgba(0,0,128,0.35);
  border-color: rgba(255,255,255,0.6);
}
.icon:active { background: rgba(0,0,128,0.25); }
.icon.selected span {
  background: var(--w-select);
  color: var(--w-select-t);
  outline: 1px dotted #ffff88;
}
.icon.selected img { filter: brightness(0.8) saturate(1.4) hue-rotate(0deg); }

/* Single-column layout, left side – overridden by JS drag after first move */
.icon:nth-child(1) { top:  18px; left: 20px; }
.icon:nth-child(2) { top: 110px; left: 20px; }
.icon:nth-child(3) { top: 202px; left: 20px; }
.icon:nth-child(4) { top: 294px; left: 20px; }
.icon:nth-child(5) { top: 386px; left: 20px; }
.icon:nth-child(6) { top:  18px; left: 112px; }
.icon:nth-child(7) { top: 110px; left: 112px; }
.icon:nth-child(8) { top: 202px; left: 112px; }

.icon img {
  width: 36px; height: 36px;
  margin: 0 auto 5px;
  image-rendering: pixelated;
  display: block;
  filter: drop-shadow(1px 2px 2px rgba(0,0,0,0.6));
}

/* Pixel-art SVG icon placeholder when no image */
.icon .icon-emoji {
  font-size: 30px;
  display: block;
  margin: 0 auto 5px;
  line-height: 1;
  filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.8));
}

.icon span:last-child {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000,
               0 1px 0 #000, 0 -1px 0 #000, 1px 0 0 #000, -1px 0 0 #000;
  line-height: 1.3;
  word-break: break-word;
  hyphens: auto;
}

/* ----------------------------------------------------------------
   WINDOWS — W95 chrome
   ---------------------------------------------------------------- */
.window {
  position: absolute;
  min-width: 200px; min-height: 100px;
  background: var(--w-face);
  /* classic W95 raised outer border */
  border: 1px solid;
  border-color: var(--w-dfl) var(--w-ddk) var(--w-ddk) var(--w-dfl);
  box-shadow: inset 1px 1px 0 var(--w-lt), inset -1px -1px 0 var(--w-dk), 1px 1px 0 var(--w-ddk);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
}

.window.active { display: flex; }

/* Window open animation */
@keyframes winOpen {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.window.spawn { animation: winOpen 0.12s ease-out; }

/* ----------------------------------------------------------------
   TITLEBAR
   ---------------------------------------------------------------- */
.window-titlebar {
  background: linear-gradient(90deg,
    var(--w-titlebar) 0%,
    var(--w-titlebar2) 100%
  );
  height: 22px;
  display: flex;
  align-items: center;
  padding: 0 3px 0 4px;
  cursor: move;
  flex-shrink: 0;
  user-select: none;
  gap: 4px;
}

/* Title icon placeholder */
.window-titlebar .title-icon {
  font-size: 13px; line-height: 1;
  flex-shrink: 0;
}

.window-titlebar > span {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

/* ----------------------------------------------------------------
   WINDOW CONTROLS (minimize / maximize / close)
   ---------------------------------------------------------------- */
.window-controls {
  display: flex; gap: 2px; align-items: center; flex-shrink: 0;
}

.minimize-btn, .maximize-btn, .close-btn {
  width: 16px; height: 14px;
  font-size: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  cursor: pointer;
  background: var(--w-face);
  color: #000;
  /* W95 raised button */
  border: 1px solid;
  border-color: var(--w-dfl) var(--w-ddk) var(--w-ddk) var(--w-dfl);
  box-shadow: inset 1px 1px 0 var(--w-lt), inset -1px -1px 0 var(--w-dk);
  font-weight: 900;
  line-height: 1;
}

.minimize-btn:active, .maximize-btn:active, .close-btn:active {
  border-color: var(--w-ddk) var(--w-lt) var(--w-lt) var(--w-ddk);
  box-shadow: inset 1px 1px 0 var(--w-dk);
  transform: none;
}

.close-btn:hover { background: #cc0000; color: white; }

/* ----------------------------------------------------------------
   MENUBAR (for windows that have it)
   ---------------------------------------------------------------- */
.window-menubar {
  display: flex;
  background: var(--w-face);
  border-bottom: 1px solid var(--w-dk);
  padding: 1px 2px;
  flex-shrink: 0;
}

.menu-item {
  padding: 2px 8px; cursor: pointer; font-size: 11px; border: 1px solid transparent;
}
.menu-item:hover {
  background: var(--w-select); color: var(--w-select-t);
  border-color: var(--w-lt) var(--w-ddk) var(--w-ddk) var(--w-lt);
}

/* ----------------------------------------------------------------
   WINDOW CONTENT
   ---------------------------------------------------------------- */
.window-content {
  flex: 1;
  padding: 4px;
  background: var(--w-face);
  overflow: auto;
  font-size: 11px;
  color: #000;
  /* Inner sunken border */
  border-top: 1px solid var(--w-dk);
}

/* W95 scrollbars */
.window-content::-webkit-scrollbar { width: 16px; height: 16px; }
.window-content::-webkit-scrollbar-track {
  background: var(--w-face);
  border: 1px solid var(--w-dk);
}
.window-content::-webkit-scrollbar-thumb {
  background: var(--w-face);
  border: 1px solid;
  border-color: var(--w-lt) var(--w-ddk) var(--w-ddk) var(--w-lt);
  box-shadow: inset 1px 1px 0 var(--w-lt), inset -1px -1px 0 var(--w-dk);
}
.window-content::-webkit-scrollbar-button {
  background: var(--w-face);
  border: 1px solid;
  border-color: var(--w-lt) var(--w-ddk) var(--w-ddk) var(--w-lt);
  display: block; height: 16px; width: 16px;
}

/* ----------------------------------------------------------------
   STATUSBAR (bottom of windows)
   ---------------------------------------------------------------- */
.window-statusbar {
  height: 18px;
  display: flex; align-items: center;
  border-top: 1px solid var(--w-dk);
  padding: 0 4px;
  flex-shrink: 0;
  font-size: 10px; color: #000;
  background: var(--w-face);
}
.statusbar-panel {
  flex: 1; padding: 0 4px;
  border: 1px solid; border-color: var(--w-dk) var(--w-lt) var(--w-lt) var(--w-dk);
  margin-right: 2px; height: 12px; line-height: 12px;
}

/* ----------------------------------------------------------------
   SIDEBAR EXPLORER (My Computer, file explorer)
   ---------------------------------------------------------------- */
.explorer-layout {
  display: flex; height: 100%; gap: 0;
}
.explorer-sidebar {
  width: 160px;
  background: var(--w-white);
  border-right: 1px solid var(--w-dk);
  padding: 8px 4px;
  flex-shrink: 0;
  overflow-y: auto;
}
.explorer-sidebar h4 {
  font-size: 10px; font-weight: 700; color: var(--w-titlebar);
  margin-bottom: 8px; padding: 0 4px;
}
.explorer-sidebar-item {
  display: flex; align-items: center; gap: 6px;
  padding: 2px 6px; cursor: pointer; border: 1px solid transparent; font-size: 11px;
}
.explorer-sidebar-item:hover { background: var(--w-select); color: white; border-color: var(--w-select); }

/* ----------------------------------------------------------------
   FOLDER GRID (inside windows)
   ---------------------------------------------------------------- */
.folder-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  align-content: flex-start;
}

.folder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  padding: 6px;
  width: 80px;
  border: 1px solid transparent;
  word-break: break-word;
}
.folder:hover { background: rgba(0,0,128,0.1); border-color: var(--w-select); }
.folder:focus, .folder.selected {
  background: rgba(0,0,128,0.2); border: 1px dotted var(--w-ddk);
  outline: none;
}
.folder img {
  width: 32px; height: 32px; margin-bottom: 4px;
  image-rendering: pixelated;
  filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.3));
}
.folder .icon-emoji { font-size: 28px; margin-bottom: 4px; display: block; line-height: 1; }
.folder span { font-size: 10px; font-weight: 600; color: #000; line-height: 1.3; }

/* ----------------------------------------------------------------
   PROJECTS WINDOW
   ---------------------------------------------------------------- */
#projects-window { width: 680px; height: 520px; top: 60px; left: 200px; }
.project-list { display: flex; flex-direction: column; gap: 8px; padding: 4px; }
.project-item {
  background: var(--w-white);
  border: 1px solid;
  border-color: var(--w-dk) var(--w-lt) var(--w-lt) var(--w-dk);
  padding: 10px; display: flex; gap: 12px;
}
.project-item img { width: 80px; height: 80px; object-fit: cover; border: 1px solid var(--w-dk); flex-shrink: 0; }
.project-item h3 { font-size: 11px; font-weight: 700; margin-bottom: 4px; color: var(--w-titlebar); }
.project-item p { font-size: 10px; line-height: 1.5; color: #333; }

/* ----------------------------------------------------------------
   ABOUT WINDOW
   ---------------------------------------------------------------- */
#about-window { width: 480px; height: 420px; top: 80px; left: 160px; }
.about-content { display: flex; flex-direction: column; gap: 10px; padding: 4px; }
.profile-section { display: flex; align-items: center; gap: 12px; }
.profile-pic { width: 64px; height: 64px; border: 1px solid; border-color: var(--w-dk) var(--w-lt) var(--w-lt) var(--w-dk); object-fit: cover; }
.profile-section h2 { font-size: 14px; font-weight: 700; }
.bio-section p { font-size: 10px; line-height: 1.6; margin-bottom: 6px; }
.skills-section h3 { font-size: 11px; font-weight: 700; margin-bottom: 6px; }
.skills-section ul { padding-left: 16px; }
.skills-section li { font-size: 10px; margin-bottom: 3px; }

/* ----------------------------------------------------------------
   GAMES WINDOW
   ---------------------------------------------------------------- */
#games-window { width: 600px; height: 480px; top: 80px; left: 180px; }
.game-section { margin-bottom: 16px; }
.game-title { font-size: 11px; font-weight: 700; margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--w-dk); }

/* ----------------------------------------------------------------
   RECYCLE BIN
   ---------------------------------------------------------------- */
#recycle-window { width: 300px; height: 200px; top: 120px; left: 240px; }
.trash-button { margin-top: 12px; }

/* ----------------------------------------------------------------
   COMPUTER WINDOW
   ---------------------------------------------------------------- */
#computer-window { width: 520px; height: 380px; top: 60px; left: 180px; }

/* ----------------------------------------------------------------
   MY DOCUMENTS WINDOW
   ---------------------------------------------------------------- */
#mydocs-window { width: 500px; height: 420px; top: 80px; left: 200px; }
.mydocs-content { padding: 8px; }
.mydocs-content h2 { font-size: 13px; color: var(--w-titlebar); margin-bottom: 10px; border-bottom: 1px solid var(--w-dk); padding-bottom: 4px; }
.info-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.info-table td { padding: 3px 8px; border: 1px solid var(--w-dk); }
.info-table tr:nth-child(even) td { background: #f0f0f0; }
.info-table td:first-child { font-weight: 700; background: #e0e0e0; width: 120px; }
.section-header td { background: var(--w-titlebar) !important; color: white; font-weight: 700 !important; }

/* ----------------------------------------------------------------
   NOTEPAD WINDOW
   ---------------------------------------------------------------- */
#notepad-window { width: 480px; height: 360px; top: 100px; left: 220px; }
.notepad-textarea {
  width: 100%; height: 100%;
  background: white; color: black;
  border: 1px solid;
  border-color: var(--w-dk) var(--w-lt) var(--w-lt) var(--w-dk);
  font-family: "Courier New", monospace;
  font-size: 12px;
  resize: none; padding: 4px;
  outline: none;
  box-sizing: border-box;
}

/* ----------------------------------------------------------------
   INTERNET EXPLORER WINDOW
   ---------------------------------------------------------------- */
#ie-window { width: 720px; height: 500px; top: 60px; left: 120px; }
.ie-toolbar {
  display: flex; align-items: center; gap: 4px;
  background: var(--w-face);
  padding: 4px;
  border-bottom: 1px solid var(--w-dk);
  flex-shrink: 0;
}
.ie-btn {
  padding: 2px 8px; font-size: 10px; cursor: pointer;
  background: var(--w-face);
  border: 1px solid; border-color: var(--w-lt) var(--w-ddk) var(--w-ddk) var(--w-lt);
  box-shadow: inset -1px -1px 0 var(--w-dk);
}
.ie-btn:active {
  border-color: var(--w-ddk) var(--w-lt) var(--w-lt) var(--w-ddk);
  box-shadow: inset 1px 1px 0 var(--w-dk);
}
.ie-address {
  flex: 1; display: flex; align-items: center; gap: 4px; font-size: 10px;
}
.ie-address span { font-weight: 600; }
.ie-address-bar {
  flex: 1; height: 18px; font-size: 10px;
  border: 1px solid; border-color: var(--w-dk) var(--w-lt) var(--w-lt) var(--w-dk);
  background: white; padding: 0 4px; font-family: inherit;
  outline: none;
}
.ie-content {
  flex: 1; background: white; overflow: auto;
  padding: 16px; font-size: 12px; font-family: "Times New Roman", serif;
  border-top: 1px solid var(--w-dk);
}
.ie-content h1 { font-size: 24px; color: #000080; margin-bottom: 8px; }
.ie-content h2 { font-size: 18px; color: #000080; margin: 12px 0 6px; border-bottom: 2px solid navy; }
.ie-content a  { color: #0000cc; }
.ie-content a:visited { color: #551a8b; }
.ie-content hr { border: none; border-top: 1px solid #999; margin: 8px 0; }
.ie-content .ie-marquee { color: red; font-family: Comic Sans MS, cursive; font-size: 14px; font-style: italic; }
.ie-statusbar {
  height: 18px; background: var(--w-face);
  border-top: 1px solid var(--w-dk);
  display: flex; align-items: center; padding: 0 4px;
  font-size: 10px; flex-shrink: 0;
}

/* ----------------------------------------------------------------
   MINESWEEPER WINDOW
   ---------------------------------------------------------------- */
#minesweeper-window { width: 300px; height: 380px; top: 80px; left: 300px; }
.ms-wrapper {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px; gap: 6px;
}
.ms-info-bar {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  background: var(--w-face);
  border: 2px solid;
  border-color: var(--w-dk) var(--w-lt) var(--w-lt) var(--w-dk);
  padding: 4px 8px;
}
.ms-counter {
  font-family: "Courier New", monospace;
  font-size: 18px; font-weight: 700; color: red;
  background: #000; padding: 2px 6px; min-width: 40px; text-align: center;
  border: 1px solid; border-color: var(--w-dk) var(--w-lt) var(--w-lt) var(--w-dk);
  letter-spacing: 2px;
}
.ms-smiley {
  font-size: 18px; cursor: pointer; width: 28px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: var(--w-face);
  border: 2px solid; border-color: var(--w-lt) var(--w-ddk) var(--w-ddk) var(--w-lt);
  box-shadow: inset -1px -1px 0 var(--w-dk);
}
.ms-smiley:active {
  border-color: var(--w-ddk) var(--w-lt) var(--w-lt) var(--w-ddk);
  transform: translate(1px,1px);
}
.ms-grid {
  display: grid;
  border: 2px solid;
  border-color: var(--w-dk) var(--w-lt) var(--w-lt) var(--w-dk);
  background: var(--w-face);
}
.ms-cell {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; cursor: pointer;
  border: 2px solid; border-color: var(--w-lt) var(--w-dk) var(--w-dk) var(--w-lt);
  box-shadow: inset 1px 1px 0 var(--w-lt);
  font-family: "Courier New", monospace;
  user-select: none;
}
.ms-cell.revealed {
  border: 1px solid var(--w-dk);
  border-color: var(--w-dk) var(--w-lt) var(--w-lt) var(--w-dk);
  box-shadow: none;
  background: var(--w-face);
}
.ms-cell.mine       { color: #000; font-size: 16px; font-weight: 900; }
.ms-cell.mine-hit   { background: red !important; color: white !important; }
.ms-cell.flagged    { color: #cc0000; font-weight: 900; font-size: 11px; letter-spacing: 0; }
/* Number colors */
.ms-cell[data-n="1"] { color: #0000ff; }
.ms-cell[data-n="2"] { color: #008000; }
.ms-cell[data-n="3"] { color: #ff0000; }
.ms-cell[data-n="4"] { color: #000080; }
.ms-cell[data-n="5"] { color: #800000; }
.ms-cell[data-n="6"] { color: #008080; }
.ms-cell[data-n="7"] { color: #000000; }
.ms-cell[data-n="8"] { color: #808080; }
.ms-status { font-size: 10px; text-align: center; }

/* ----------------------------------------------------------------
   PIXOS WINDOW
   ---------------------------------------------------------------- */
#pixos-window { width: 800px; height: 580px; top: 40px; left: 100px; }
#pixos-window .window-content { padding: 0; }
#pixos-window iframe { width: 100%; height: 100%; border: none; background: var(--w-face); }

/* ----------------------------------------------------------------
   TETRIS WINDOW
   ---------------------------------------------------------------- */
#tetris-window { width: 520px; height: 500px; top: 60px; left: 160px; }
#tetris-window .window-content { padding: 0; }
#tetris-window iframe { width: 100%; height: 100%; border: none; background: var(--w-face); }

/* ----------------------------------------------------------------
   CLICKER / INFINITE DOWNLOAD WINDOWS
   ---------------------------------------------------------------- */
#clicker-window { width: 360px; height: 300px; top: 120px; left: 200px; }
#infinite-download-window { width: 700px; height: 360px; top: 100px; left: 150px; }
#clicker-window .window-content,
#infinite-download-window .window-content { padding: 0; }
#clicker-window iframe,
#infinite-download-window iframe { width: 100%; height: 100%; border: none; }

/* ----------------------------------------------------------------
   CONTACT / ERROR DIALOG
   ---------------------------------------------------------------- */
#contact-error-window {
  width: 340px; height: 160px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.error-dialog {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px; background: var(--w-face);
}
.error-icon-row { display: flex; align-items: flex-start; gap: 12px; }
.error-icon { font-size: 32px; line-height: 1; }
.error-message-text p { font-size: 11px; margin-bottom: 4px; }
.ok-button {
  margin-top: 8px; padding: 4px 24px;
  background: var(--w-face);
  border: 1px solid; border-color: var(--w-lt) var(--w-ddk) var(--w-ddk) var(--w-lt);
  box-shadow: inset -1px -1px 0 var(--w-dk);
  cursor: pointer; font-size: 11px; min-width: 75px;
}
.ok-button:active {
  border-color: var(--w-ddk) var(--w-lt) var(--w-lt) var(--w-ddk);
  box-shadow: inset 1px 1px 0 var(--w-dk);
  transform: translate(1px,1px);
}

/* ----------------------------------------------------------------
   W95 BUTTON (generic)
   ---------------------------------------------------------------- */
.w95-btn {
  padding: 3px 16px;
  background: var(--w-face); color: #000;
  border: 1px solid; border-color: var(--w-lt) var(--w-ddk) var(--w-ddk) var(--w-lt);
  box-shadow: inset -1px -1px 0 var(--w-dk);
  cursor: pointer; font-size: 11px; font-family: inherit;
  min-width: 75px; text-align: center;
}
.w95-btn:active {
  border-color: var(--w-ddk) var(--w-lt) var(--w-lt) var(--w-ddk);
  box-shadow: inset 1px 1px 0 var(--w-dk);
  transform: translate(1px,1px);
}
.w95-btn:hover { filter: brightness(0.97); }

/* ----------------------------------------------------------------
   TASKBAR
   ---------------------------------------------------------------- */
.taskbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--tb-h);
  background: linear-gradient(180deg, #c0bbbb 0%, #c0c0c0 3%, var(--w-face) 5%, var(--w-face) 95%, #808080 100%);
  border-top: 2px solid var(--w-lt);
  display: flex; align-items: center;
  padding: 2px 4px 2px 2px;
  z-index: 9000; gap: 4px;
}

/* ----------------------------------------------------------------
   START BUTTON
   ---------------------------------------------------------------- */
.start-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 0 10px; height: 28px;
  background: var(--w-face);
  border: 1px solid; border-color: var(--w-lt) var(--w-ddk) var(--w-ddk) var(--w-lt);
  box-shadow: inset -1px -1px 0 var(--w-dk);
  cursor: pointer; font-weight: 900; font-size: 12px;
  letter-spacing: 0.5px; font-style: italic;
  flex-shrink: 0;
}
.start-btn:active, .start-btn.active {
  border-color: var(--w-ddk) var(--w-lt) var(--w-lt) var(--w-ddk);
  box-shadow: inset 1px 1px 0 var(--w-dk);
  transform: translate(1px,1px);
}
.start-btn img { width: 18px; height: 18px; image-rendering: pixelated; }
.start-btn .pixel-logo {
  width: 18px; height: 18px; display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px; flex-shrink: 0;
}
.start-btn .pixel-logo span {
  display: block;
}
.start-btn .pixel-logo span:nth-child(1) { background: #ff0000; }
.start-btn .pixel-logo span:nth-child(2) { background: #00cc00; }
.start-btn .pixel-logo span:nth-child(3) { background: #0000ff; }
.start-btn .pixel-logo span:nth-child(4) { background: #ffcc00; }

/* ----------------------------------------------------------------
   TASKBAR ITEMS (minimized windows)
   ---------------------------------------------------------------- */
.taskbar-items {
  display: flex; gap: 2px; flex: 1; align-items: center; overflow: hidden;
}
.taskbar-item {
  display: flex; align-items: center; gap: 4px;
  height: 28px; padding: 2px 8px;
  background: var(--w-face);
  border: 1px solid; border-color: var(--w-lt) var(--w-ddk) var(--w-ddk) var(--w-lt);
  box-shadow: inset -1px -1px 0 var(--w-dk);
  cursor: pointer; font-size: 10px; font-weight: 600;
  min-width: 100px; max-width: 150px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.taskbar-item.focused {
  border-color: var(--w-ddk) var(--w-lt) var(--w-lt) var(--w-ddk);
  box-shadow: inset 1px 1px 0 var(--w-dk);
  background: #b4b4b4;
}
.taskbar-item img { width: 14px; height: 14px; image-rendering: pixelated; flex-shrink: 0; }

/* ----------------------------------------------------------------
   SYSTEM TRAY
   ---------------------------------------------------------------- */
.system-tray {
  display: flex; align-items: center; gap: 0;
  height: 28px; padding: 0 8px;
  border: 1px solid; border-color: var(--w-dk) var(--w-lt) var(--w-lt) var(--w-dk);
  box-shadow: inset 1px 1px 0 var(--w-dk);
  background: var(--w-face); flex-shrink: 0;
}

.taskbar-clock {
  font-size: 10px; font-weight: 600; color: #000;
  padding: 0 8px; letter-spacing: 0.2px;
  border-left: 1px solid var(--w-dk);
}

/* ----------------------------------------------------------------
   START MENU
   ---------------------------------------------------------------- */
.start-menu {
  display: none;
  position: fixed; bottom: var(--tb-h); left: 0;
  width: 200px;
  background: var(--w-face);
  border: 1px solid; border-color: var(--w-lt) var(--w-ddk) var(--w-ddk) var(--w-lt);
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3), inset -1px -1px 0 var(--w-dk);
  z-index: 9500;
  flex-direction: row;
}
.start-menu.visible { display: flex; }
.start-menu.hidden   { display: none; }

/* Left banner */
.start-menu-banner {
  width: 30px; background: linear-gradient(0deg, var(--w-titlebar) 0%, #6060c0 100%);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative;
}
.start-menu-banner::after {
  content: '';
  position: absolute;
  top: 6px; bottom: 6px; left: 50%; transform: translateX(-50%);
  width: 2px;
  background: rgba(255,255,255,0.12);
}

/* Menu items column */
.start-menu-items {
  flex: 1; display: flex; flex-direction: column;
}

.start-item {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 12px; cursor: pointer; font-size: 11px; font-weight: 600;
  border-top: 1px solid transparent;
}
.start-item:hover {
  background: var(--w-select); color: white;
}
.start-item img { width: 22px; height: 22px; image-rendering: pixelated; flex-shrink: 0; }
.start-item .icon-emoji { font-size: 20px; flex-shrink: 0; width: 22px; text-align: center; }

/* Separator */
.start-separator { height: 1px; background: var(--w-dk); margin: 2px 0; }

/* Programs submenu */
.start-item.has-submenu { position: relative; justify-content: space-between; }
.start-item.has-submenu::after { content: "▶"; font-size: 8px; }
.start-submenu {
  display: none; position: absolute; left: calc(100% - 2px); top: 0;
  background: var(--w-face);
  border: 1px solid; border-color: var(--w-lt) var(--w-ddk) var(--w-ddk) var(--w-lt);
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  min-width: 200px; z-index: 9600;
}
.start-item.has-submenu:hover .start-submenu { display: block; }
.start-submenu .sub-item {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px; cursor: pointer; font-size: 11px;
}
.start-submenu .sub-item:hover { background: var(--w-select); color: white; }
.start-submenu .sub-item .icon-emoji { font-size: 16px; }

/* ----------------------------------------------------------------
   LOCK SCREEN
   ---------------------------------------------------------------- */
.lock-screen {
  display: none; position: fixed; inset: 0;
  background: var(--lock-bg);
  z-index: 19999;
  align-items: center; justify-content: center;
}
.lock-screen.visible { display: flex; }
.lock-screen.hidden  { display: none; }

.lock-content {
  display: flex; flex-direction: column; align-items: stretch;
  background: var(--w-face);
  border: 2px solid;
  border-color: var(--w-lt) var(--w-ddk) var(--w-ddk) var(--w-lt);
  box-shadow: 2px 2px 0 var(--w-ddk), inset 1px 1px 0 #fff;
  min-width: 260px;
}
.lock-titlebar {
  background: linear-gradient(90deg, var(--w-titlebar) 0%, var(--w-titlebar2) 100%);
  color: #fff;
  font-size: 12px; font-weight: bold;
  padding: 3px 6px;
  font-family: var(--w-font);
  display: flex; align-items: center;
  user-select: none;
}
.lock-body {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 20px 32px 16px;
}
.lock-avatar-pixel {
  width: 64px; height: 64px;
  border: 2px solid;
  border-color: var(--w-dk) var(--w-lt) var(--w-lt) var(--w-dk);
  box-shadow: inset 1px 1px 0 var(--w-ddk);
  overflow: hidden;
  margin-bottom: 2px;
}
.lock-avatar-pixel img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.lock-username {
  font-size: 13px; font-weight: bold;
  color: #000;
  font-family: var(--w-font);
  margin: 0;
}
.password-input { display: flex; gap: 4px; }
.password-input input {
  padding: 4px 6px; font-size: 13px; width: 160px;
  background: #fff;
  border: 2px solid;
  border-color: var(--w-dk) var(--w-lt) var(--w-lt) var(--w-dk);
  box-shadow: inset 1px 1px 0 var(--w-ddk);
  color: #000;
  font-family: var(--w-font);
  outline: none;
}
.password-input input::placeholder { color: #808080; letter-spacing: 0; }
.lock-hint {
  font-size: 11px;
  color: #444;
  font-family: var(--w-font);
  font-style: normal;
  margin-top: -2px;
}
#login-btn {
  padding: 4px 10px;
  background: var(--w-face);
  border: 2px solid;
  border-color: var(--w-lt) var(--w-ddk) var(--w-ddk) var(--w-lt);
  box-shadow: inset -1px -1px 0 var(--w-dk);
  color: #000; font-size: 14px; font-weight: bold;
  cursor: pointer;
  font-family: var(--w-font);
}
#login-btn:hover { background: #d4d0c8; }
#login-btn:active {
  border-color: var(--w-ddk) var(--w-lt) var(--w-lt) var(--w-ddk);
  box-shadow: inset 1px 1px 0 var(--w-ddk);
}
.lock-screen .error-message {
  font-size: 11px; color: #c00000;
  height: 14px; font-family: var(--w-font);
}
@keyframes shake {
  0%,100%{ transform:translateX(0); }
  20%     { transform:translateX(-7px); }
  40%     { transform:translateX(7px); }
  60%     { transform:translateX(-5px); }
  80%     { transform:translateX(5px); }
}
.password-input input.shake { animation: shake 0.35s ease; }

/* ----------------------------------------------------------------
   SCREEN EFFECTS (shutdown / wake)
   ---------------------------------------------------------------- */
.screen-overlay {
  position: fixed; inset: 0; background: black;
  pointer-events: none; z-index: 29999;
  opacity: 0; transition: opacity 0.5s;
}
.screen-overlay.shutting-down { opacity: 1; }

.loading-overlay {
  position: fixed; inset: 0; background: #000;
  display: flex; align-items: center; justify-content: center;
  z-index: 29998; transition: opacity 0.5s;
}
.loading-overlay.hidden { display: none; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid #333;
  border-top-color: var(--w-titlebar2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.black-screen {
  position: fixed; inset: 0; background: black;
  z-index: 29997;
}
.shutdown-active .taskbar  { display: none; }
.shutdown-active .desktop  { pointer-events: none; }

/* ----------------------------------------------------------------
   IE PROGRESS BAR (throbber)
   ---------------------------------------------------------------- */
@keyframes ie-throb {
  0%   { background-position: 0 0; }
  100% { background-position: -200px 0; }
}


/* ── Mobile / touch support ─────────────────────────────── */
.icon, .window-titlebar { touch-action: none; }

@media (max-width: 760px) {
  .window {
    max-width: 96vw !important;
    max-height: 74vh !important;
  }
  [id$="-window"] {
    width: 96vw;
    left: 2vw;
    top: 8vh;
  }
  .window-content { overflow: auto; -webkit-overflow-scrolling: touch; }
  .window iframe { width: 100%; }
  .taskbar-items { overflow-x: auto; }
}
