.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  /* Allows clicks to pass through to the buttons/windows underneath */
  pointer-events: none; 
  z-index: 9999; /* Keeps it on top of everything */
  
  /* Scanline effect only */
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%, 
    rgba(0, 0, 0, 0.15) 50%
  );
  background-size: 100% 4px;
}

/* Container anchored to the bottom of the viewport */
.win98-taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 28px;
  background-color: #c0c0c0;
  border-top: 2px solid #fff;
  box-shadow: 0 -1px 0 0 #808080 inset;
  display: flex;
  align-items: center;
  padding: 2px;
  box-sizing: border-box;
  z-index: 9998; /* Just under the CRT filter */
  font-family: "MS Sans Serif";
  font-size: 11px;
}

/* Start Button custom styling */
.start-btn {
  font-weight: bold;
  height: 22px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  /* Reuses 98.css button styling rules but smaller */
  box-shadow: 1px 1px 0 0 #000, inset 1px 1px 0 0 #fff;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  background: #c0c0c0;
  cursor: pointer;
}

.start-btn:active {
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  box-shadow: -1px -1px 0 0 #000 inset;
  padding: 1px 5px 0px 7px;
}

.start-icon {
  width: 14px;
  height: 14px;
}

/* Visual vertical divider */
.taskbar-divider {
  width: 2px;
  height: 20px;
  background-color: #808080;
  border-right: 1px solid #fff;
  margin: 0 6px;
}

/* Middle area for open tasks */
.taskbar-tasks {
  flex-grow: 1;
  display: flex;
  gap: 4px;
}

.task-btn {
  height: 22px;
  max-width: 150px;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  background: #c0c0c0;
  padding: 0 8px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The Sunken System Tray (for the clock) */
.system-tray {
  border-top: 1.5px solid #808080;
  border-left: 1.5px solid #808080;
  border-right: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  height: 20px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #c0c0c0;
}

.tray-icon {
  width: 14px;
  height: 14px;
}

/* Base styling for all desktop icons */
.desktop-icon {
  position: absolute;
  width: 75px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  user-select: none;
  z-index: 10;
}

.desktop-icon img {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
}

.icon-label {
  font-family: "MS Sans Serif";
  font-size: 12px;
  color: #fff;
  text-shadow: 1px 1px 1px #000;
  padding: 2px;
  word-wrap: break-word;
}

.desktop-icon.selected .icon-label {
  background-color: #000080;
  color: #fff;
  text-shadow: none;
  outline: 1px dotted #fff;
}

/* --- ICON POSITIONS --- */

/* Left-side Column (Spaced out vertically by 80px) */
#my-computer-icon   { top: 20px;  left: 20px; }
#documents-icon     { top: 100px; left: 20px; }
#ie-icon            { top: 180px; left: 20px; }
#paint-icon         { top: 260px; left: 20px; }
#photo-editor-icon  { top: 340px; left: 20px; }

/* Bottom-Right Corner (Adjusted for 28px taskbar height) */
#recycle-bin-icon {
  bottom: 48px; /* 28px taskbar + 20px padding */
  right: 20px;
}
/* Styling to help contain the iframe window */
#paint-window {
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
}

/* Ensure all windows can be resized natively from the corner */
.window {
  resize: both;
  overflow: auto;
  min-width: 180px;
  min-height: 120px;
  max-width: 100vw;
  max-height: 100vh;
}

/* Bulletproof Fullscreen State */
.window.maximized {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: calc(100vh - 28px) !important; /* Leaves exactly 28px for your bottom taskbar */
  margin: 0 !important;
  resize: none !important; /* Disables corner resizing while fullscreen */
  border-radius: 0 !important;
  z-index: 9999 !important; /* Keeps it above everything except the CRT filter */
}

/* Hidden state when minimized to the taskbar */
.window.minimized {
  display: none !important;
}

body, .window, .title-bar, .title-bar-text, .window-body, .status-bar, .status-bar-field, button, input, select, textarea, ul, li, span, p {
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif !important;
}

.has-submenu:hover .sub-dropdown-menu {
  display: block;
}

/* Disable modern anti-aliasing to make fonts look pixelated and crisp */
body, .window, .title-bar, .title-bar-text, .window-body, .status-bar, .status-bar-field, button, input, select, textarea, ul, li, span, p,
.title-bar-text:before, .title-bar:before, button:before, .window:before {
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif !important;
  
  /* Clear font smoothing across all browser rendering engines */
  -webkit-font-smoothing: none !important;
  -moz-osx-font-smoothing: none !important;
  font-smooth: never !important;
  text-rendering: optimizeSpeed !important;
  
  /* Prevents subpixel text rendering blur on high-DPI displays */
  transform: translate3d(0, 0, 0); 
}