@font-face {
  font-family: "Pixelated MS Sans Serif";
  src: local("Tahoma");
}

:root {
  --win98-teal: #008080;
  --win98-gray: #c0c0c0;
  --win98-gray-dark: #808080;
  --win98-gray-darker: #404040;
  --win98-white: #ffffff;
  --win98-blue-title: #000080;
  --win98-blue-title-grad: #1084d0;
  --win98-text: #000000;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Tahoma", "MS Sans Serif", Arial, sans-serif;
  font-size: 11px;
  -webkit-font-smoothing: none;
}

/* ---------- Desktop ---------- */

#desktop {
  position: relative;
  width: 100%;
  height: calc(100vh - 30px);
  background-color: var(--win98-teal);
  overflow: hidden;
  user-select: none;
}

#icons {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  height: 100%;
  padding: 8px;
  gap: 4px;
}

.icon {
  width: 75px;
  height: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px;
  cursor: pointer;
  outline: none;
}

.icon img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  margin-bottom: 4px;
  pointer-events: none;
}

.icon span {
  color: #fff;
  text-align: center;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
  line-height: 1.2;
  word-wrap: break-word;
  max-width: 72px;
}

.icon.selected {
  background: rgba(0, 0, 128, 0.4);
}

.icon.selected span {
  background: var(--win98-blue-title);
  text-shadow: none;
}

.icon.selected img {
  filter: brightness(0.7) sepia(1) hue-rotate(190deg) saturate(3);
}

/* ---------- Window frame (98.css-style borders) ---------- */

.window {
  position: absolute;
  background: var(--win98-gray);
  box-shadow:
    inset -1px -1px 0 0 #0a0a0a,
    inset 1px 1px 0 0 #dfdfdf,
    inset -2px -2px 0 0 #808080,
    inset 2px 2px 0 0 #fff;
  padding: 3px;
  min-width: 220px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
}

.window.active {
  z-index: 100;
}

.title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 3px 3px 4px;
  background: linear-gradient(90deg, var(--win98-blue-title), var(--win98-blue-title-grad));
  color: #fff;
  cursor: default;
  flex-shrink: 0;
}

.window:not(.active) .title-bar {
  background: linear-gradient(90deg, #808080, #b5b5b5);
  color: #dfdfdf;
}

.title-bar-text {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: bold;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-icon {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.title-bar-controls {
  display: flex;
  gap: 1px;
}

.title-bar-controls .close-btn {
  margin-left: 2px;
}

.title-bar-controls button {
  width: 16px;
  height: 14px;
  background: var(--win98-gray);
  box-shadow:
    inset -1px -1px 0 0 #0a0a0a,
    inset 1px 1px 0 0 #fff,
    inset -2px -2px 0 0 #808080,
    inset 2px 2px 0 0 #dfdfdf;
  border: none;
  padding: 0;
  position: relative;
  cursor: pointer;
}

.title-bar-controls button:active {
  box-shadow:
    inset -1px -1px 0 0 #fff,
    inset 1px 1px 0 0 #0a0a0a,
    inset -2px -2px 0 0 #dfdfdf,
    inset 2px 2px 0 0 #808080;
}

.min-btn::before {
  content: "";
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 7px;
  height: 2px;
  background: #000;
}

.max-btn::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 2px;
  width: 8px;
  height: 8px;
  border: 1px solid #000;
  border-top-width: 2px;
}

.close-btn::before {
  content: "\2715";
  position: absolute;
  left: 3px;
  top: -1px;
  font-size: 10px;
  font-weight: bold;
  color: #000;
}

.menu-bar {
  display: flex;
  gap: 12px;
  padding: 2px 6px;
  background: var(--win98-gray);
  font-size: 11px;
  flex-shrink: 0;
}

.menu-bar span {
  cursor: default;
}

.menu-bar span:hover {
  background: var(--win98-blue-title);
  color: #fff;
}

.window-body {
  flex: 1;
  background: var(--win98-gray);
  padding: 10px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.4;
}

.window-body p {
  margin: 0 0 8px 0;
}

.window-body a {
  color: #0000ee;
}

.status-bar {
  display: flex;
  padding: 2px 3px 0 3px;
  flex-shrink: 0;
}

.status-bar-field {
  flex: 1;
  margin: 0;
  padding: 2px 6px;
  box-shadow:
    inset -1px -1px 0 0 #fff,
    inset 1px 1px 0 0 #808080;
  font-size: 11px;
}

/* ---------- Explorer window ---------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px;
  background: var(--win98-gray);
  box-shadow: inset 0 -1px 0 0 #808080;
  flex-shrink: 0;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  background: transparent;
  border: 1px solid transparent;
  font-size: 11px;
  cursor: pointer;
  color: #000;
}

.toolbar-btn:not(:disabled):hover {
  border-color: #fff #808080 #808080 #fff;
}

.toolbar-btn:not(:disabled):active {
  border-color: #808080 #fff #fff #808080;
}

.toolbar-btn:disabled {
  color: var(--win98-gray-dark);
  text-shadow: 1px 1px 0 #fff;
  cursor: default;
}

.toolbar-btn img {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
}

.toolbar-btn:disabled img {
  opacity: 0.4;
}

.tb-arrow {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.tb-arrow.left {
  border-right: 8px solid var(--win98-gray-dark);
}

.tb-arrow.right {
  border-left: 8px solid var(--win98-gray-dark);
}

.toolbar-sep {
  width: 2px;
  height: 20px;
  box-shadow:
    inset -1px 0 0 0 #fff,
    inset 1px 0 0 0 #808080;
  margin: 0 3px;
}

.address-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  background: var(--win98-gray);
  box-shadow: inset 0 -1px 0 0 #808080;
  flex-shrink: 0;
}

.address-bar label {
  font-size: 11px;
}

.address-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  background: #fff;
  box-shadow:
    inset -1px -1px 0 0 #dfdfdf,
    inset 1px 1px 0 0 #808080,
    inset -2px -2px 0 0 #fff,
    inset 2px 2px 0 0 #0a0a0a;
  font-size: 11px;
}

.address-field img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.explorer-body {
  flex: 1;
  display: flex;
  min-height: 0;
  background: var(--win98-gray);
  padding: 2px;
  gap: 2px;
}

.explorer-list {
  width: 170px;
  flex-shrink: 0;
  background: #fff;
  overflow: auto;
  padding: 2px;
  box-shadow:
    inset -1px -1px 0 0 #dfdfdf,
    inset 1px 1px 0 0 #808080,
    inset -2px -2px 0 0 #fff,
    inset 2px 2px 0 0 #0a0a0a;
}

.explorer-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  cursor: pointer;
  font-size: 12px;
  outline: none;
}

.explorer-item img {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.explorer-item.selected {
  background: var(--win98-blue-title);
  color: #fff;
}

.explorer-detail {
  flex: 1;
  background: #fff;
  overflow: auto;
  padding: 12px;
  min-width: 0;
  box-shadow:
    inset -1px -1px 0 0 #dfdfdf,
    inset 1px 1px 0 0 #808080,
    inset -2px -2px 0 0 #fff,
    inset 2px 2px 0 0 #0a0a0a;
}

.project-detail {
  display: none;
  font-size: 12px;
  line-height: 1.5;
}

.project-detail.active {
  display: block;
}

.project-detail h2 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: var(--win98-blue-title);
  border-bottom: 1px solid var(--win98-gray);
  padding-bottom: 4px;
}

.project-image {
  margin-bottom: 8px;
}

.project-image img {
  display: block;
  max-width: 100%;
  height: auto;
  box-shadow:
    inset -1px -1px 0 0 #dfdfdf,
    inset 1px 1px 0 0 #808080,
    inset -2px -2px 0 0 #fff,
    inset 2px 2px 0 0 #0a0a0a;
  padding: 2px;
  background: var(--win98-gray);
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.tag {
  padding: 1px 6px;
  background: var(--win98-gray);
  font-size: 11px;
  box-shadow:
    inset -1px -1px 0 0 #808080,
    inset 1px 1px 0 0 #fff;
}

.project-detail p {
  margin: 0 0 8px 0;
}

.project-detail a {
  color: #0000ee;
}

.status-bar-right {
  flex: 0 0 110px;
}

.project-actions {
  margin-top: 12px;
}

.btn98 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--win98-gray);
  color: #000 !important;
  text-decoration: none;
  font-size: 12px;
  cursor: pointer;
  box-shadow:
    inset -1px -1px 0 0 #0a0a0a,
    inset 1px 1px 0 0 #fff,
    inset -2px -2px 0 0 #808080,
    inset 2px 2px 0 0 #dfdfdf;
}

.btn98:active {
  box-shadow:
    inset -1px -1px 0 0 #fff,
    inset 1px 1px 0 0 #0a0a0a,
    inset -2px -2px 0 0 #dfdfdf,
    inset 2px 2px 0 0 #808080;
  padding: 6px 11px 4px 13px;
}

.btn98 img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

.notepad-body {
  padding: 0;
}

.notepad-body textarea {
  width: 100%;
  height: 100%;
  border: none;
  resize: none;
  font-family: "Courier New", monospace;
  font-size: 12px;
  padding: 6px;
  background: #fff;
  outline: none;
}

/* ---------- Taskbar ---------- */

#taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30px;
  background: var(--win98-gray);
  box-shadow: inset 0 1px 0 0 #fff;
  display: flex;
  align-items: center;
  padding: 3px 3px 3px 3px;
  gap: 4px;
  z-index: 1000;
}

#start-button {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 2px 8px 2px 4px;
  background: var(--win98-gray);
  box-shadow:
    inset -1px -1px 0 0 #0a0a0a,
    inset 1px 1px 0 0 #fff,
    inset -2px -2px 0 0 #808080,
    inset 2px 2px 0 0 #dfdfdf;
  border: none;
  font-weight: bold;
  font-size: 11px;
  cursor: pointer;
}

#start-button img {
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
}

#start-button.active,
#start-button:active {
  box-shadow:
    inset -1px -1px 0 0 #fff,
    inset 1px 1px 0 0 #0a0a0a,
    inset -2px -2px 0 0 #dfdfdf,
    inset 2px 2px 0 0 #808080;
}

#taskbar-separator {
  width: 2px;
  height: 24px;
  box-shadow:
    inset -1px 0 0 0 #fff,
    inset 1px 0 0 0 #808080;
  margin: 0 2px;
  flex-shrink: 0;
}

#taskbar-tasks {
  flex: 1;
  display: flex;
  gap: 3px;
  height: 24px;
  overflow: hidden;
}

.task-button {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  min-width: 120px;
  max-width: 160px;
  padding: 2px 6px;
  background: var(--win98-gray);
  box-shadow:
    inset -1px -1px 0 0 #0a0a0a,
    inset 1px 1px 0 0 #fff,
    inset -2px -2px 0 0 #808080,
    inset 2px 2px 0 0 #dfdfdf;
  border: none;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-button img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.task-button.active {
  box-shadow:
    inset -1px -1px 0 0 #fff,
    inset 1px 1px 0 0 #0a0a0a,
    inset -2px -2px 0 0 #dfdfdf,
    inset 2px 2px 0 0 #808080;
  font-weight: bold;
}

#tray {
  display: flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  box-shadow:
    inset 1px 1px 0 0 #808080,
    inset -1px -1px 0 0 #fff;
}

#tray-clock {
  font-size: 11px;
}

/* ---------- Start Menu ---------- */

#start-menu {
  position: fixed;
  bottom: 30px;
  left: 0;
  width: 220px;
  background: var(--win98-gray);
  box-shadow:
    inset -1px -1px 0 0 #0a0a0a,
    inset 1px 1px 0 0 #dfdfdf,
    inset -2px -2px 0 0 #808080,
    inset 2px 2px 0 0 #fff;
  display: none;
  z-index: 1001;
  flex-direction: row;
}

#start-menu.open {
  display: flex;
}

.start-menu-banner {
  width: 24px;
  background: linear-gradient(180deg, var(--win98-blue-title), #1084d0);
  display: flex;
  align-items: flex-end;
  padding-bottom: 8px;
  justify-content: center;
}

.start-menu-banner span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: #fff;
  font-weight: bold;
  font-size: 15px;
  letter-spacing: 1px;
  font-style: italic;
}

.start-menu-items {
  list-style: none;
  margin: 0;
  padding: 3px;
  flex: 1;
}

.start-menu-items li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.start-menu-items li img {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.start-menu-items li:hover {
  background: var(--win98-blue-title);
  color: #fff;
}

.start-menu-items li.divider {
  height: 1px;
  padding: 0;
  margin: 3px 2px;
  box-shadow:
    inset 0 1px 0 0 #808080,
    inset 0 -1px 0 0 #fff;
  cursor: default;
}

.start-menu-items li.divider:hover {
  background: none;
}
