/* ===== Warm Custard 98 — custom desktop styling layered over 98.css ===== */

:root {
  --teal: #008080;
  --silver: #c0c0c0;
  --navy: #000080;
  --taskbar-h: 30px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: "Pixelated MS Sans Serif", Arial, sans-serif;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

/* ===== Desktop ===== */
.desktop {
  position: absolute;
  inset: 0 0 var(--taskbar-h) 0;
  background: var(--teal);
  overflow: hidden;
}

/* ===== Desktop icons ===== */
.desktop-icons {
  list-style: none;
  margin: 0;
  padding: 8px 0 0 8px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 6px;
  width: 90px;
  height: 100%;
  align-content: flex-start;
}
.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 74px;
  padding: 4px 2px;
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  cursor: pointer;
  color: #fff;
}
.desktop-icon:focus { outline: none; }
.desktop-icon img {
  image-rendering: pixelated;
  pointer-events: none;
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, .35));
}
.desktop-icon span {
  font-size: 11px;
  line-height: 1.15;
  text-align: center;
  color: #fff;
  text-shadow: 1px 1px 0 #000, 0 0 2px #000;
  padding: 0 1px;
}
.desktop-icon.selected span {
  background: var(--navy);
  outline: 1px dotted #fff;
  outline-offset: -1px;
  text-shadow: none;
}
.desktop-icon.selected img { filter: drop-shadow(0 0 0 transparent) brightness(.8) sepia(1) hue-rotate(180deg); }

/* ===== Windows ===== */
.window {
  position: absolute;
  max-width: 96vw;
}
#window-ie       { width: min(580px, 94vw); top: 26px; left: 150px; }

.window[hidden] { display: none; }
.window.dragging { user-select: none; }

.window.maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100%;
  max-width: 100%;
}
.window.maximized .ie-page { max-height: none; height: calc(100vh - 150px); }

.title-bar-icon { image-rendering: pixelated; vertical-align: middle; margin-right: 2px; }
.title-bar-text { display: flex; align-items: center; }

/* ===== Internet Explorer chrome ===== */
.ie-menubar {
  display: flex;
  gap: 14px;
  padding: 2px 6px;
  font-size: 11px;
  background: var(--silver);
}
.ie-menubar span { cursor: default; padding: 1px 2px; }
.ie-menubar span:hover { background: var(--navy); color: #fff; }
.ie-menubar u { text-decoration: underline; }

.ie-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  background: var(--silver);
  border-top: 1px solid #fff;
  border-bottom: 1px solid #808080;
}
.ie-tool { min-width: auto; font-size: 11px; padding: 2px 6px; }
.ie-sep { width: 1px; height: 18px; margin: 0 3px; background: #808080; box-shadow: 1px 0 0 #fff; }

.ie-addressbar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 6px 5px;
  background: var(--silver);
  border-bottom: 1px solid #808080;
  font-size: 11px;
}
.ie-addressbar > label { color: #404040; }
.ie-url-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1px 2px;
  background: #fff;
  border: 1px solid #808080;
  box-shadow: inset 1px 1px 0 #404040;
}
.ie-url-field img { image-rendering: pixelated; }
.ie-url-field input {
  flex: 1;
  border: 0;
  outline: none;
  font: inherit;
  background: transparent;
  color: #000;
}
.ie-go { font-size: 11px; padding: 2px 8px; }

/* ===== IE page (content) ===== */
.ie-page {
  margin: 0;
  padding: 14px 18px;
  background: #fff;
  max-height: 58vh;
  overflow-y: auto;
}
.custard-hero { display: flex; align-items: center; gap: 12px; }
.custard-hero img { image-rendering: pixelated; }
.ie-page h1 {
  margin: 0;
  font-size: 26px;
  color: var(--navy);
}
.ie-intro { color: #333; font-size: 13px; }
.ie-page hr { border: 0; border-top: 1px inset #c0c0c0; margin: 12px 0; }
.ie-section h2 { font-size: 15px; margin: 0 0 6px; color: #000080; }
.link-list { margin: 4px 0; padding-left: 22px; line-height: 1.9; font-size: 13px; }
.link-list a {
  color: #0000ee;
  text-decoration: underline;
  font-weight: bold;
}
.link-list a:visited { color: #551a8b; }
.link-list a:hover { color: #ee0000; }
.ie-note { color: #666; font-size: 12px; }
.ie-footer { color: #595959; font-size: 11px; text-align: center; }

/* ===== Taskbar ===== */
.taskbar {
  position: fixed;
  inset: auto 0 0 0;
  height: var(--taskbar-h);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  background: var(--silver);
  border-top: 1px solid #fff;
  box-shadow: inset 0 1px 0 #dfdfdf;
  z-index: 10000;
}
.start-button {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 2px 8px 2px 4px;
  font-weight: bold;
  font-size: 12px;
}
.start-button img { image-rendering: pixelated; }
.start-button[aria-expanded="true"] {
  box-shadow: inset -1px -1px 0 #fff, inset 1px 1px 0 #0a0a0a,
              inset -2px -2px 0 #dfdfdf, inset 2px 2px 0 #808080;
}
.taskbar-windows {
  flex: 1;
  display: flex;
  gap: 3px;
  overflow: hidden;
  height: 24px;
}
.taskbar-window {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 160px;
  height: 24px;
  padding: 2px 8px;
  font-size: 11px;
  text-align: left;
}
.taskbar-window img { image-rendering: pixelated; flex-shrink: 0; }
.taskbar-window span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.taskbar-window.active {
  font-weight: bold;
  box-shadow: inset -1px -1px 0 #fff, inset 1px 1px 0 #0a0a0a,
              inset -2px -2px 0 #dfdfdf, inset 2px 2px 0 #808080;
  background: repeating-conic-gradient(#dfdfdf 0% 25%, #d4d0c8 0% 50%) 0 / 4px 4px;
}
.taskbar-tray {
  display: flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #fff;
}
.clock { font-size: 11px; }

/* ===== Start menu ===== */
.start-menu {
  position: fixed;
  bottom: var(--taskbar-h);
  left: 2px;
  width: 210px;
  display: flex;
  background: var(--silver);
  box-shadow: inset -1px -1px 0 #0a0a0a, inset 1px 1px 0 #fff,
              inset -2px -2px 0 #808080, inset 2px 2px 0 #dfdfdf;
  z-index: 10001;
}
.start-menu[hidden] { display: none; }
.start-menu-banner {
  width: 26px;
  background: linear-gradient(#000080, #1084d0);
  flex-shrink: 0;
}
.start-menu-banner span {
  display: block;
  transform: rotate(180deg);
  writing-mode: vertical-rl;
  color: #fff;
  font-weight: bold;
  font-size: 16px;
  padding: 8px 4px;
  white-space: nowrap;
}
.start-menu-list {
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 2px;
}
.start-menu-list li[role="menuitem"] {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  font-size: 13px;
  cursor: pointer;
}
.start-menu-list li[role="menuitem"] img { image-rendering: pixelated; }
.start-menu-list li[role="menuitem"]:hover {
  background: var(--navy);
  color: #fff;
}
.start-menu-list u { text-decoration: underline; }
.start-menu-divider {
  height: 1px;
  margin: 3px 2px;
  border-top: 1px solid #808080;
  border-bottom: 1px solid #fff;
}

/* ===== Mobile fallback ===== */
@media (max-width: 640px) {
  html, body { overflow: auto; }
  .desktop { position: relative; min-height: calc(100vh - var(--taskbar-h)); overflow: visible; }
  .desktop-icons {
    flex-direction: row;
    width: 100%;
    height: auto;
    gap: 10px;
  }
  .window {
    position: static !important;
    width: auto !important;
    margin: 10px;
    transform: none !important;
  }
  .ie-page { max-height: none; }
  .title-bar-controls { pointer-events: none; }
}
