/* ============== Windows 98 styling ============== */

:root {
  --w98-bg: #008080;            /* classic teal */
  --w98-face: #c0c0c0;
  --w98-face-light: #dfdfdf;
  --w98-hilite: #ffffff;
  --w98-shadow: #808080;
  --w98-dark: #000000;
  --w98-title: #000080;
  --w98-title-text: #ffffff;
  --w98-title-inactive: #808080;
  --w98-text: #000000;
  --w98-link: #0000ee;
  --w98-select: #000080;
  --w98-select-text: #ffffff;
  --w98-desktop-icon-text: #ffffff;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: none;
  font-smoothing: none;
  image-rendering: pixelated;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Pixelated MS Sans Serif", "MS Sans Serif", "Microsoft Sans Serif", Tahoma, Geneva, sans-serif;
  font-size: 11px;
  color: var(--w98-text);
  user-select: none;
  -webkit-user-select: none;
}

#root {
  height: 100vh;
  width: 100vw;
  position: relative;
  overflow: hidden;
}

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

.desktop.wallpaper-clouds {
  background:
    radial-gradient(ellipse 400px 200px at 20% 30%, rgba(255,255,255,0.25), transparent 70%),
    radial-gradient(ellipse 500px 250px at 75% 65%, rgba(255,255,255,0.18), transparent 70%),
    radial-gradient(ellipse 300px 150px at 50% 85%, rgba(255,255,255,0.15), transparent 70%),
    linear-gradient(180deg, #5b9fdc 0%, #8ec5e8 100%);
}

.desktop.wallpaper-setup {
  background: #008080;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 60px, rgba(0,0,0,0.04) 60px, rgba(0,0,0,0.04) 61px),
    repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(0,0,0,0.04) 60px, rgba(0,0,0,0.04) 61px);
}

.desktop.wallpaper-plus {
  background: #3a6ea5;
}

/* ===== Image-based wallpapers (Plus! 98 + Win98 originals) ===== */
.desktop[class*="wallpaper-img-"] {
  background-color: #000;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  image-rendering: auto;
}
.desktop.wallpaper-img-underwater   { background-image: url('/windows98/wallpapers/Underwater-wallpaper.jpg'); }
.desktop.wallpaper-img-space        { background-image: url('/windows98/wallpapers/Space-wallpaper.jpg'); }
.desktop.wallpaper-img-jungle       { background-image: url('/windows98/wallpapers/Jungle-wallpaper.jpg'); }
.desktop.wallpaper-img-inside       { background-image: url('/windows98/wallpapers/Inside-your-Computer-wallpaper.jpg'); }
.desktop.wallpaper-img-davinci      { background-image: url('/windows98/wallpapers/Leonardo-da-Vinci-wallpaper.jpg'); }
.desktop.wallpaper-img-mystery      { background-image: url('/windows98/wallpapers/Mystery-wallpaper.jpg'); }
.desktop.wallpaper-img-nature       { background-image: url('/windows98/wallpapers/Nature-wallpaper.jpg'); }
.desktop.wallpaper-img-travel       { background-image: url('/windows98/wallpapers/Travel-wallpaper.jpg'); }
.desktop.wallpaper-img-sports       { background-image: url('/windows98/wallpapers/Sports-wallpaper.jpg'); }
.desktop.wallpaper-img-science      { background-image: url('/windows98/wallpapers/Science-wallpaper.jpg'); }
.desktop.wallpaper-img-baseball     { background-image: url('/windows98/wallpapers/Baseball-wallpaper.jpg'); }
.desktop.wallpaper-img-dangerous    { background-image: url('/windows98/wallpapers/Dangerous-Creatures-wallpaper.jpg'); }
.desktop.wallpaper-img-sixties      { background-image: url('/windows98/wallpapers/The-60s-USA-wallpaper.jpg'); }
.desktop.wallpaper-img-goldenera    { background-image: url('/windows98/wallpapers/The-Golden-Era-wallpaper.jpg'); }
.desktop.wallpaper-img-morewindows  { background-image: url('/windows98/wallpapers/More-Windows-wallpaper.jpg'); }
.desktop.wallpaper-img-cloudslogo   { background-image: url('/windows98/wallpapers/Clouds-Win98-logo.jpg'); }
.desktop.wallpaper-img-win98theme   { background-image: url('/windows98/wallpapers/Windows-98-wallpaper.jpg'); }
.desktop.wallpaper-img-morewinblur  { background-image: url('/windows98/wallpapers/Win98-Theme-MoreWindows.jpg'); }
.desktop.wallpaper-img-setupblue    { background-image: url('/windows98/wallpapers/Win98-wordmark.png'); background-size: contain; background-color: #00007f; }

/* ===== Desktop icons ===== */
.desktop-icons {
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  grid-template-columns: repeat(1, 75px);
  gap: 6px;
  z-index: 1;
}

.desktop-icon {
  width: 75px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 2px;
  cursor: pointer;
  text-align: center;
}

.desktop-icon .icon-img {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.desktop-icon .icon-label {
  color: var(--w98-desktop-icon-text);
  font-size: 11px;
  text-shadow: 1px 1px 0 #000;
  padding: 1px 2px;
  line-height: 1.2;
  max-width: 75px;
  word-wrap: break-word;
}

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

.desktop-icon.selected .icon-label {
  background: var(--w98-select);
  outline: 1px dotted #fff;
  outline-offset: -1px;
}

/* ===== Bevels ===== */
.bevel-out {
  border-top: 1px solid var(--w98-hilite);
  border-left: 1px solid var(--w98-hilite);
  border-right: 1px solid var(--w98-dark);
  border-bottom: 1px solid var(--w98-dark);
  box-shadow: inset -1px -1px 0 var(--w98-shadow), inset 1px 1px 0 var(--w98-face-light);
}

.bevel-in {
  border-top: 1px solid var(--w98-shadow);
  border-left: 1px solid var(--w98-shadow);
  border-right: 1px solid var(--w98-hilite);
  border-bottom: 1px solid var(--w98-hilite);
  box-shadow: inset 1px 1px 0 var(--w98-dark), inset -1px -1px 0 var(--w98-face-light);
}

.bevel-thin-in {
  border-top: 1px solid var(--w98-shadow);
  border-left: 1px solid var(--w98-shadow);
  border-right: 1px solid var(--w98-hilite);
  border-bottom: 1px solid var(--w98-hilite);
}

.bevel-thin-out {
  border-top: 1px solid var(--w98-hilite);
  border-left: 1px solid var(--w98-hilite);
  border-right: 1px solid var(--w98-shadow);
  border-bottom: 1px solid var(--w98-shadow);
}

/* ===== Windows ===== */
.window {
  position: absolute;
  background: var(--w98-face);
  padding: 3px;
  display: flex;
  flex-direction: column;
  min-width: 120px;
  min-height: 60px;
  border-top: 1px solid var(--w98-hilite);
  border-left: 1px solid var(--w98-hilite);
  border-right: 1px solid var(--w98-dark);
  border-bottom: 1px solid var(--w98-dark);
  box-shadow: inset -1px -1px 0 var(--w98-shadow), inset 1px 1px 0 var(--w98-face-light), 1px 1px 0 var(--w98-dark);
}

.window.minimized {
  display: none;
}

.window-title {
  background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
  color: var(--w98-title-text);
  display: flex;
  align-items: center;
  padding: 2px 2px 2px 4px;
  height: 20px;
  font-weight: bold;
  font-size: 11px;
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}

.window:not(.active) .window-title {
  background: linear-gradient(90deg, #808080 0%, #b5b5b5 100%);
}

.window-title-icon {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.window-title-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.window-controls {
  display: flex;
  gap: 2px;
}

.title-btn {
  width: 16px;
  height: 14px;
  background: var(--w98-face);
  border-top: 1px solid var(--w98-hilite);
  border-left: 1px solid var(--w98-hilite);
  border-right: 1px solid var(--w98-dark);
  border-bottom: 1px solid var(--w98-dark);
  box-shadow: inset -1px -1px 0 var(--w98-shadow), inset 1px 1px 0 var(--w98-face-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  color: #000;
  font-size: 10px;
  line-height: 1;
}

.title-btn:active {
  border-top: 1px solid var(--w98-dark);
  border-left: 1px solid var(--w98-dark);
  border-right: 1px solid var(--w98-hilite);
  border-bottom: 1px solid var(--w98-hilite);
  box-shadow: inset 1px 1px 0 var(--w98-shadow);
}

.title-btn svg {
  display: block;
}

.window-menu {
  display: flex;
  padding: 1px 2px;
  font-size: 11px;
  gap: 0;
  flex-shrink: 0;
}

.window-menu-item {
  padding: 2px 7px;
  cursor: pointer;
}

.window-menu-item:hover {
  background: var(--w98-select);
  color: var(--w98-select-text);
}

.window-menu-item .underline {
  text-decoration: underline;
}

.window-toolbar {
  display: flex;
  align-items: center;
  padding: 2px;
  gap: 1px;
  background: var(--w98-face);
  flex-shrink: 0;
}

.toolbar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 6px;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  min-width: 44px;
  font-size: 11px;
  color: #000;
  font-family: inherit;
}

.toolbar-btn:hover {
  border-top: 1px solid var(--w98-hilite);
  border-left: 1px solid var(--w98-hilite);
  border-right: 1px solid var(--w98-dark);
  border-bottom: 1px solid var(--w98-dark);
}

.toolbar-btn:active {
  border-top: 1px solid var(--w98-dark);
  border-left: 1px solid var(--w98-dark);
  border-right: 1px solid var(--w98-hilite);
  border-bottom: 1px solid var(--w98-hilite);
}

.toolbar-btn .ico {
  font-size: 18px;
  margin-bottom: 2px;
}

.toolbar-sep {
  width: 1px;
  background: var(--w98-shadow);
  border-right: 1px solid var(--w98-hilite);
  align-self: stretch;
  margin: 2px 3px;
}

.address-bar {
  display: flex;
  align-items: center;
  padding: 2px 4px;
  gap: 4px;
  flex-shrink: 0;
}

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

.address-input {
  flex: 1;
  background: #fff;
  border-top: 1px solid var(--w98-shadow);
  border-left: 1px solid var(--w98-shadow);
  border-right: 1px solid var(--w98-hilite);
  border-bottom: 1px solid var(--w98-hilite);
  box-shadow: inset 1px 1px 0 var(--w98-dark);
  padding: 2px 4px;
  font-family: inherit;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.window-body {
  flex: 1;
  background: var(--w98-face);
  overflow: auto;
  position: relative;
}

.window-body.sunken {
  border-top: 1px solid var(--w98-shadow);
  border-left: 1px solid var(--w98-shadow);
  border-right: 1px solid var(--w98-hilite);
  border-bottom: 1px solid var(--w98-hilite);
  box-shadow: inset 1px 1px 0 var(--w98-dark);
  background: #fff;
}

.window-statusbar {
  display: flex;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

.status-cell {
  border-top: 1px solid var(--w98-shadow);
  border-left: 1px solid var(--w98-shadow);
  border-right: 1px solid var(--w98-hilite);
  border-bottom: 1px solid var(--w98-hilite);
  padding: 2px 6px;
  font-size: 11px;
  background: var(--w98-face);
}

.status-cell:first-child { flex: 1; }

/* ===== Taskbar ===== */
.taskbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: var(--w98-face);
  border-top: 1px solid var(--w98-hilite);
  box-shadow: inset 0 1px 0 var(--w98-face-light);
  display: flex;
  align-items: center;
  padding: 2px;
  gap: 3px;
  z-index: 9999;
}

.start-button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px 2px 2px;
  height: 22px;
  background: var(--w98-face);
  border-top: 1px solid var(--w98-hilite);
  border-left: 1px solid var(--w98-hilite);
  border-right: 1px solid var(--w98-dark);
  border-bottom: 1px solid var(--w98-dark);
  box-shadow: inset -1px -1px 0 var(--w98-shadow), inset 1px 1px 0 var(--w98-face-light);
  font-family: inherit;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  color: #000;
}

.start-button.active {
  border-top: 1px solid var(--w98-dark);
  border-left: 1px solid var(--w98-dark);
  border-right: 1px solid var(--w98-hilite);
  border-bottom: 1px solid var(--w98-hilite);
  box-shadow: inset 1px 1px 0 var(--w98-shadow);
  padding: 3px 3px 1px 3px;
}

.taskbar-divider {
  width: 1px;
  height: 22px;
  border-left: 1px solid var(--w98-shadow);
  border-right: 1px solid var(--w98-hilite);
  margin: 0 2px;
}

.task-items {
  flex: 1;
  display: flex;
  gap: 3px;
  overflow: hidden;
}

.task-item {
  height: 22px;
  min-width: 130px;
  max-width: 160px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 4px;
  background: var(--w98-face);
  border-top: 1px solid var(--w98-hilite);
  border-left: 1px solid var(--w98-hilite);
  border-right: 1px solid var(--w98-dark);
  border-bottom: 1px solid var(--w98-dark);
  box-shadow: inset -1px -1px 0 var(--w98-shadow), inset 1px 1px 0 var(--w98-face-light);
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}

.task-item.active {
  border-top: 1px solid var(--w98-dark);
  border-left: 1px solid var(--w98-dark);
  border-right: 1px solid var(--w98-hilite);
  border-bottom: 1px solid var(--w98-hilite);
  box-shadow: inset 1px 1px 0 var(--w98-shadow);
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.5) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.5) 75%),
    linear-gradient(45deg, rgba(255,255,255,0.5) 25%, transparent 25%, transparent 75%, rgba(255,255,255,0.5) 75%);
  background-size: 2px 2px;
  background-position: 0 0, 1px 1px;
  background-color: #c0c0c0;
}

.task-item .task-icon {
  font-size: 14px;
}
.task-item .task-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.systray {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px 0 4px;
  height: 22px;
  border-top: 1px solid var(--w98-shadow);
  border-left: 1px solid var(--w98-shadow);
  border-right: 1px solid var(--w98-hilite);
  border-bottom: 1px solid var(--w98-hilite);
}

.systray-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
}

.systray-clock {
  font-size: 11px;
  font-family: inherit;
  color: #000;
  min-width: 50px;
  text-align: right;
}

/* ===== Start Menu ===== */
.start-menu {
  position: absolute;
  bottom: 28px;
  left: 2px;
  width: 220px;
  background: var(--w98-face);
  border-top: 1px solid var(--w98-hilite);
  border-left: 1px solid var(--w98-hilite);
  border-right: 1px solid var(--w98-dark);
  border-bottom: 1px solid var(--w98-dark);
  box-shadow: inset -1px -1px 0 var(--w98-shadow), inset 1px 1px 0 var(--w98-face-light), 1px 1px 0 var(--w98-dark);
  padding: 3px;
  display: flex;
  z-index: 9998;
}

.start-menu-band {
  width: 28px;
  background: linear-gradient(180deg, #808080 0%, #000080 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  flex-shrink: 0;
  margin-right: 3px;
}

.start-menu-band-text {
  color: #c0c0c0;
  font-size: 18px;
  font-weight: bold;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 1px;
}

.start-menu-band-text b {
  color: #fff;
}

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

.start-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  cursor: pointer;
  font-size: 12px;
  color: #000;
}

.start-menu-item:hover {
  background: var(--w98-select);
  color: var(--w98-select-text);
}

.start-menu-item .smi-ico {
  font-size: 22px;
  width: 28px;
  display: inline-flex;
  justify-content: center;
}

.start-menu-item.has-submenu::after {
  content: "▶";
  margin-left: auto;
  font-size: 9px;
}

.start-menu-sep {
  height: 0;
  border-top: 1px solid var(--w98-shadow);
  border-bottom: 1px solid var(--w98-hilite);
  margin: 3px 2px;
}

/* ===== Buttons ===== */
.btn {
  background: var(--w98-face);
  border-top: 1px solid var(--w98-hilite);
  border-left: 1px solid var(--w98-hilite);
  border-right: 1px solid var(--w98-dark);
  border-bottom: 1px solid var(--w98-dark);
  box-shadow: inset -1px -1px 0 var(--w98-shadow), inset 1px 1px 0 var(--w98-face-light);
  padding: 4px 12px;
  font-family: inherit;
  font-size: 11px;
  color: #000;
  cursor: pointer;
  min-width: 75px;
}

.btn:active, .btn.pressed {
  border-top: 1px solid var(--w98-dark);
  border-left: 1px solid var(--w98-dark);
  border-right: 1px solid var(--w98-hilite);
  border-bottom: 1px solid var(--w98-hilite);
  box-shadow: inset 1px 1px 0 var(--w98-shadow);
}

.btn:focus {
  outline: 1px dotted #000;
  outline-offset: -4px;
}

/* ===== Notepad ===== */
.notepad-text {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  resize: none;
  padding: 4px 6px;
  font-family: "Pixelated MS Sans Serif", "Lucida Console", "Courier New", monospace;
  font-size: 13px;
  background: #fff;
  color: #000;
  line-height: 1.3;
}

/* ===== File list (My Computer / Explorer) ===== */
.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, 75px);
  gap: 8px;
  padding: 8px;
}

.file-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 3px;
  cursor: pointer;
  text-align: center;
}

.file-item .fi-icon {
  font-size: 28px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-item .fi-label {
  font-size: 11px;
  padding: 1px 3px;
  max-width: 72px;
  word-wrap: break-word;
  line-height: 1.2;
}

.file-item.selected .fi-icon {
  filter: brightness(0.7) sepia(1) hue-rotate(190deg) saturate(3);
}
.file-item.selected .fi-label {
  background: var(--w98-select);
  color: #fff;
}

/* ===== Minesweeper ===== */
.mine-app {
  padding: 6px;
  background: var(--w98-face);
}

.mine-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  margin-bottom: 6px;
  border-top: 1px solid var(--w98-shadow);
  border-left: 1px solid var(--w98-shadow);
  border-right: 1px solid var(--w98-hilite);
  border-bottom: 1px solid var(--w98-hilite);
}

.lcd {
  background: #000;
  color: #ff0000;
  font-family: "DSEG7-Classic", "Courier New", monospace;
  font-weight: bold;
  font-size: 22px;
  padding: 1px 4px;
  border-top: 1px solid var(--w98-shadow);
  border-left: 1px solid var(--w98-shadow);
  border-right: 1px solid var(--w98-hilite);
  border-bottom: 1px solid var(--w98-hilite);
  letter-spacing: 2px;
  min-width: 44px;
  text-align: right;
}

.mine-smiley {
  width: 28px;
  height: 28px;
  font-size: 18px;
  background: var(--w98-face);
  border-top: 1px solid var(--w98-hilite);
  border-left: 1px solid var(--w98-hilite);
  border-right: 1px solid var(--w98-dark);
  border-bottom: 1px solid var(--w98-dark);
  box-shadow: inset -1px -1px 0 var(--w98-shadow), inset 1px 1px 0 var(--w98-face-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.mine-smiley:active {
  border-top: 1px solid var(--w98-dark);
  border-left: 1px solid var(--w98-dark);
  border-right: 1px solid var(--w98-hilite);
  border-bottom: 1px solid var(--w98-hilite);
  box-shadow: inset 1px 1px 0 var(--w98-shadow);
}

.mine-grid {
  display: grid;
  border-top: 1px solid var(--w98-shadow);
  border-left: 1px solid var(--w98-shadow);
  border-right: 1px solid var(--w98-hilite);
  border-bottom: 1px solid var(--w98-hilite);
  background: var(--w98-face);
}

.mine-cell {
  width: 18px;
  height: 18px;
  font-size: 13px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--w98-face);
  border-top: 2px solid var(--w98-hilite);
  border-left: 2px solid var(--w98-hilite);
  border-right: 2px solid var(--w98-shadow);
  border-bottom: 2px solid var(--w98-shadow);
  cursor: pointer;
  user-select: none;
  font-family: inherit;
}

.mine-cell.revealed {
  border: 1px solid var(--w98-shadow);
  border-right: none;
  border-bottom: none;
  background: var(--w98-face);
}

.mine-cell.revealed.mine {
  background: #ff0000;
}

.mine-cell.flagged::before { content: "⚑"; color: #d00; }

.mc-1 { color: #0000ff; }
.mc-2 { color: #008000; }
.mc-3 { color: #ff0000; }
.mc-4 { color: #000080; }
.mc-5 { color: #800000; }
.mc-6 { color: #008080; }
.mc-7 { color: #000000; }
.mc-8 { color: #808080; }

/* ===== Paint ===== */
.paint-shell {
  display: flex;
  height: 100%;
  background: var(--w98-face);
}

.paint-tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  border-right: 1px solid var(--w98-shadow);
  align-content: flex-start;
}

.paint-tool {
  width: 22px;
  height: 22px;
  font-size: 14px;
  background: var(--w98-face);
  border-top: 1px solid var(--w98-hilite);
  border-left: 1px solid var(--w98-hilite);
  border-right: 1px solid var(--w98-dark);
  border-bottom: 1px solid var(--w98-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.paint-tool.active {
  border-top: 1px solid var(--w98-dark);
  border-left: 1px solid var(--w98-dark);
  border-right: 1px solid var(--w98-hilite);
  border-bottom: 1px solid var(--w98-hilite);
  box-shadow: inset 1px 1px 0 var(--w98-shadow);
}

.paint-canvas-wrap {
  flex: 1;
  padding: 4px;
  overflow: auto;
  background: var(--w98-face);
}

.paint-canvas {
  background: #fff;
  cursor: crosshair;
  display: block;
  border-top: 1px solid var(--w98-shadow);
  border-left: 1px solid var(--w98-shadow);
  border-right: 1px solid var(--w98-hilite);
  border-bottom: 1px solid var(--w98-hilite);
  box-shadow: inset 1px 1px 0 var(--w98-dark);
}

.paint-palette {
  display: grid;
  grid-template-columns: repeat(14, 16px);
  grid-template-rows: 16px 16px;
  gap: 1px;
  padding: 4px;
  border-top: 1px solid var(--w98-shadow);
}

.paint-swatch {
  width: 16px;
  height: 16px;
  border: 1px solid #000;
  cursor: pointer;
}

.paint-swatch.active {
  outline: 2px solid #000;
  outline-offset: 1px;
}

/* ===== IE / Browser ===== */
.ie-content {
  padding: 16px 20px;
  font-family: "Times New Roman", Times, serif;
  font-size: 13px;
  color: #000;
  background: #fff;
  line-height: 1.45;
}

.ie-content h1 {
  font-size: 28px;
  color: var(--w98-title);
  margin: 0 0 8px;
}

.ie-content h2 {
  font-size: 18px;
  color: #800000;
  margin: 16px 0 6px;
  border-bottom: 1px solid #999;
}

.ie-content a {
  color: var(--w98-link);
  text-decoration: underline;
  cursor: pointer;
}

.ie-content a:visited { color: #551a8b; }

.ie-marquee {
  background: #ffff00;
  color: #000;
  padding: 2px 0;
  font-weight: bold;
  overflow: hidden;
  white-space: nowrap;
  border: 2px dashed #000;
  margin: 12px 0;
}

.ie-marquee-inner {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 18s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}

.ie-img-placeholder {
  display: inline-block;
  width: 220px;
  height: 140px;
  background: linear-gradient(135deg, #f0a, #f80, #fc0, #0c0, #08f, #80f);
  background-size: 200% 200%;
  animation: hue 8s linear infinite;
  border: 3px ridge #888;
  margin: 6px;
  vertical-align: middle;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: "Comic Sans MS", "Comic Sans", cursive;
  font-size: 18px;
  font-weight: bold;
  text-shadow: 2px 2px 0 #000;
}

@keyframes hue { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(360deg); } }

.ie-hr {
  border: none;
  border-top: 2px ridge #888;
  margin: 14px 0;
}

.ie-counter {
  display: inline-flex;
  font-family: "Courier New", monospace;
  font-weight: bold;
  background: #000;
  color: #0f0;
  padding: 2px 4px;
  font-size: 14px;
  letter-spacing: 1px;
  border: 1px solid #888;
}

/* ===== Dialog ===== */
.dialog-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px 6px;
}

.dialog-icon {
  font-size: 36px;
  width: 40px;
  flex-shrink: 0;
}

.dialog-text {
  flex: 1;
  font-size: 12px;
  padding-top: 6px;
  line-height: 1.4;
}

.dialog-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px 14px;
}

/* ===== Scrollbar styling (subtle Win98 look) ===== */
.window-body::-webkit-scrollbar { width: 16px; height: 16px; }
.window-body::-webkit-scrollbar-track {
  background:
    linear-gradient(45deg, transparent 25%, #fff 25%, #fff 50%, transparent 50%, transparent 75%, #fff 75%) 0 0 / 4px 4px,
    #c0c0c0;
}
.window-body::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-top: 1px solid var(--w98-hilite);
  border-left: 1px solid var(--w98-hilite);
  border-right: 1px solid var(--w98-dark);
  border-bottom: 1px solid var(--w98-dark);
  box-shadow: inset -1px -1px 0 var(--w98-shadow), inset 1px 1px 0 var(--w98-face-light);
}
.window-body::-webkit-scrollbar-button {
  width: 16px;
  height: 16px;
  background: #c0c0c0;
  border-top: 1px solid var(--w98-hilite);
  border-left: 1px solid var(--w98-hilite);
  border-right: 1px solid var(--w98-dark);
  border-bottom: 1px solid var(--w98-dark);
  display: block;
}

/* ===== MSN Messenger ===== */
.msn-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #ece9d8;
  font-size: 11px;
}

.msn-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: linear-gradient(180deg, #ffffff 0%, #d4e6f7 60%, #a9c5e8 100%);
  border-bottom: 1px solid #6b8caf;
}

.msn-banner-bird {
  background: #fff;
  border: 1px solid #2a6db8;
  border-radius: 2px;
  padding: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.msn-banner-title {
  font-weight: bold;
  font-size: 12px;
  color: #1a3a5c;
}

.msn-banner-tag {
  font-size: 10px;
  color: #5b7a99;
  font-style: italic;
}

.msn-me {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: linear-gradient(180deg, #fafafa, #e6ecf2);
  border-bottom: 1px solid #b8c4d4;
}

.msn-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  background: #fff;
  border: 2px solid #fff;
  outline: 1px solid #2a6db8;
  flex-shrink: 0;
}

.msn-avatar-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.msn-status-dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3);
}

.msn-me-name {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
}

.msn-me-status {
  color: #555;
  cursor: pointer;
  font-size: 10px;
}

.msn-status-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid #777;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  z-index: 100;
  min-width: 170px;
  padding: 2px 0;
}

.msn-status-menu-item {
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.msn-status-menu-item:hover {
  background: #2f6cd0;
  color: #fff;
}

.msn-psm {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  font-style: italic;
  color: #5a3a6e;
  font-size: 11px;
  font-family: inherit;
  padding: 1px 2px;
  margin-top: 1px;
}

.msn-psm:hover, .msn-psm:focus {
  background: #fff;
  border: 1px solid #888;
  outline: none;
  font-style: normal;
}

.msn-toolbar {
  display: flex;
  gap: 1px;
  padding: 3px 4px;
  background: linear-gradient(180deg, #f5f4ec, #d6d2bc);
  border-bottom: 1px solid #a89e7e;
}

.msn-tool {
  background: transparent;
  border: 1px solid transparent;
  padding: 2px 6px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  color: #1a3a5c;
}

.msn-tool:hover {
  background: #fff7c4;
  border: 1px solid #c0a060;
}

.msn-tool.small {
  font-size: 10px;
  padding: 1px 4px;
}

.msn-list {
  flex: 1;
  overflow-y: auto;
  background: #ffffff;
  padding: 4px 0;
}

.msn-group {
  margin-bottom: 4px;
}

.msn-group-header {
  font-weight: bold;
  font-size: 11px;
  color: #406a99;
  padding: 2px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(180deg, #fdfdfd, #e2ebf5);
  border-bottom: 1px solid #c0d2e6;
}

.msn-group-arrow {
  font-size: 8px;
  color: #5a8ac0;
}

.msn-contact {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 22px;
  cursor: default;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
}

.msn-contact:hover {
  background: #fff7c4;
}

.msn-contact.offline {
  color: #999;
  font-style: italic;
}

.msn-contact-icon {
  position: relative;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.msn-contact-emoji {
  font-size: 13px;
  filter: grayscale(0%);
}

.msn-contact.offline .msn-contact-emoji {
  filter: grayscale(100%) opacity(0.6);
}

.msn-contact-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid #fff;
}

.msn-contact-name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.msn-contact-display {
  color: inherit;
}

.msn-contact-psm {
  color: #888;
  font-size: 10px;
  font-style: italic;
}

.msn-footer {
  background: linear-gradient(180deg, #e7eef7, #c5d4e8);
  border-top: 1px solid #8aa6c4;
  padding: 3px 8px;
  font-size: 10px;
  color: #2a4a7c;
  text-decoration: underline;
  cursor: pointer;
}

/* ===== MSN Chat ===== */
.msn-chat-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #ece9d8;
  font-size: 11px;
}

.msn-chat-shell.nudge {
  animation: nudge 0.6s ease-out;
}

@keyframes nudge {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-8px, -4px); }
  20% { transform: translate(8px, 4px); }
  30% { transform: translate(-6px, 4px); }
  40% { transform: translate(6px, -4px); }
  50% { transform: translate(-4px, 0); }
  60% { transform: translate(4px, 0); }
  70% { transform: translate(-2px, 2px); }
  80% { transform: translate(2px, -2px); }
}

.msn-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: linear-gradient(180deg, #ffffff, #d4e6f7);
  border-bottom: 1px solid #6b8caf;
}

.msn-chat-them {
  display: flex;
  align-items: center;
  gap: 8px;
}

.msn-chat-toolbar {
  display: flex;
  gap: 1px;
  padding: 2px 4px;
  background: linear-gradient(180deg, #f5f4ec, #d6d2bc);
  border-bottom: 1px solid #a89e7e;
  flex-wrap: wrap;
}

.msn-messages {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px;
  background: #fff;
  font-family: Tahoma, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msn-msg {
  font-size: 11px;
  line-height: 1.4;
}

.msn-msg-author {
  font-weight: bold;
  font-size: 11px;
  margin-right: 4px;
  display: inline;
}

.msn-msg-body {
  display: inline;
  font-size: 11px;
  word-wrap: break-word;
}

.msn-msg-sys {
  font-size: 10px;
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 2px 0;
}

.msn-typing {
  font-size: 10px;
  color: #888;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}

.msn-typing-dots {
  display: inline-flex;
  gap: 2px;
}

.msn-typing-dots span {
  width: 4px;
  height: 4px;
  background: #888;
  border-radius: 50%;
  animation: typing 1s infinite;
}

.msn-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.msn-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.msn-font-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 4px;
  background: #ece9d8;
  border-top: 1px solid #fff;
  border-bottom: 1px solid #a89e7e;
}

.msn-fbtn {
  width: 20px;
  height: 18px;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  background: #ece9d8;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.msn-fbtn:hover {
  background: #fff7c4;
  border: 1px solid #c0a060;
}

.msn-fbtn.on {
  background: #fff;
  border: 1px solid #888;
}

.msn-font-select {
  font-family: inherit;
  font-size: 10px;
  height: 18px;
  border: 1px solid #888;
}

.msn-color {
  width: 14px;
  height: 14px;
  border: 1px solid #555;
  cursor: pointer;
  padding: 0;
}

.msn-color.on {
  outline: 2px solid #000;
  outline-offset: 1px;
}

.msn-emo-popup {
  position: absolute;
  bottom: 90px;
  right: 8px;
  background: #fff;
  border: 1px solid #777;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(8, 22px);
  gap: 1px;
  z-index: 100;
}

.msn-emo-btn {
  width: 22px;
  height: 22px;
  font-size: 16px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0;
}

.msn-emo-btn:hover {
  background: #fff7c4;
  border: 1px solid #c0a060;
}

.msn-input-area {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #ece9d8;
}

.msn-input {
  flex: 1;
  height: 60px;
  border-top: 1px solid var(--w98-shadow);
  border-left: 1px solid var(--w98-shadow);
  border-right: 1px solid var(--w98-hilite);
  border-bottom: 1px solid var(--w98-hilite);
  box-shadow: inset 1px 1px 0 var(--w98-dark);
  padding: 4px 6px;
  font-family: Tahoma, sans-serif;
  font-size: 11px;
  resize: none;
  outline: none;
}

.msn-send {
  width: 70px;
  background: linear-gradient(180deg, #fafafa, #c8d6ea);
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  border-right: 1px solid #4a6a8c;
  border-bottom: 1px solid #4a6a8c;
  font-family: inherit;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  color: #1a3a5c;
}

.msn-send:active {
  background: linear-gradient(180deg, #c8d6ea, #fafafa);
  border-top: 1px solid #4a6a8c;
  border-left: 1px solid #4a6a8c;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
}

/* ===== Resize handle ===== */
.resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 50%, var(--w98-shadow) 50%, var(--w98-shadow) 60%, transparent 60%, transparent 70%, var(--w98-shadow) 70%, var(--w98-shadow) 80%, transparent 80%);
  z-index: 2;
}

/* ===== Boot sequence ===== */
.boot-screen {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: "MS Sans Serif", Tahoma, sans-serif;
  transition: opacity 0.5s ease;
}
.boot-screen.fadeout { opacity: 0; }
.boot-logo {
  display: flex;
  align-items: center;
  gap: 36px;
  margin-bottom: 80px;
}
.boot-wordmark { display: flex; flex-direction: column; }
.boot-microsoft {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 22px;
  color: #cfcfcf;
  margin-bottom: 4px;
}
.boot-windows {
  font-size: 60px;
  font-weight: bold;
  letter-spacing: -2px;
  color: #fff;
  line-height: 1;
}
.boot-98 {
  font-size: 28px;
  vertical-align: super;
  color: #ffcc00;
  margin-left: 6px;
}
.boot-progress-wrap {
  position: absolute;
  bottom: 140px;
  width: 340px;
  text-align: center;
}
.boot-progress-label {
  font-size: 12px;
  margin-bottom: 8px;
  color: #c8c8c8;
}
.boot-progress-track {
  width: 100%;
  height: 16px;
  background: #1a1a1a;
  border: 1px solid #555;
  padding: 2px;
  box-sizing: border-box;
}
.boot-progress-fill {
  height: 100%;
  background:
    repeating-linear-gradient(90deg, #2469b3 0 14px, transparent 14px 18px),
    #0a3a72;
  transition: width 0.12s linear;
}
.boot-copyright {
  position: absolute;
  bottom: 40px;
  font-size: 10px;
  color: #888;
}

/* ===== BSOD ===== */
.bsod {
  position: fixed;
  inset: 0;
  background: #0000aa;
  color: #fff;
  z-index: 99999;
  font-family: "Lucida Console", "Courier New", monospace;
  padding: 40px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  cursor: pointer;
}
.bsod-text {
  font-size: 16px;
  line-height: 1.4;
  white-space: pre-wrap;
  max-width: 800px;
}
.bsod-text::first-line {
  background: #fff;
  color: #0000aa;
  font-weight: bold;
}

/* ===== Winamp ===== */
.winamp {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #2a2a2a;
  color: #00ff66;
  font-family: "MS Sans Serif", Tahoma, sans-serif;
  padding: 0;
  overflow: hidden;
}
.winamp-title {
  background: linear-gradient(90deg, #1c1c1c, #3d3d3d, #1c1c1c);
  color: #b0b0b0;
  padding: 4px 8px;
  font-size: 10px;
  letter-spacing: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-transform: uppercase;
  border-bottom: 1px solid #000;
}
.winamp-llama {
  font-style: italic;
  font-size: 9px;
  color: #888;
  letter-spacing: 0;
  text-transform: none;
}
.winamp-main {
  display: flex;
  gap: 0;
  padding: 8px;
  background: #1a1a1a;
  border-bottom: 1px solid #000;
}
.winamp-display {
  flex: 1;
  background: #000;
  border: 1px inset #555;
  padding: 6px 8px;
  font-family: "Courier New", monospace;
  color: #00ff66;
  font-size: 11px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.winamp-time {
  font-size: 24px;
  font-family: "Courier New", monospace;
  color: #00ff66;
  text-shadow: 0 0 8px rgba(0, 255, 102, 0.6);
  letter-spacing: 2px;
}
.winamp-vis {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 32px;
  background: #000;
  padding: 2px 0;
}
.winamp-bar {
  flex: 1;
  background: linear-gradient(180deg, #ff3a3a 0%, #ffcc00 50%, #00ff66 100%);
  min-height: 2px;
  transition: height 0.08s ease;
}
.winamp-track {
  overflow: hidden;
  white-space: nowrap;
  font-size: 10px;
  color: #00ff66;
}
.winamp-track-scroll {
  display: inline-block;
  animation: marqueeScroll 18s linear infinite;
  padding-right: 60px;
}
@keyframes marqueeScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
.winamp-bitrate {
  font-size: 9px;
  color: #00aa44;
  display: flex;
  gap: 8px;
}
.winamp-controls {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  margin-left: 8px;
  flex-wrap: wrap;
}
.winamp-btn {
  background: linear-gradient(180deg, #5a5a5a, #2a2a2a);
  color: #d0d0d0;
  border: 1px outset #777;
  width: 28px;
  height: 22px;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}
.winamp-btn:active { border-style: inset; }
.winamp-btn-eject { color: #ff8a00; }
.winamp-controls {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 3px;
  align-self: center;
  margin-left: 6px;
}
.winamp-playlist {
  flex: 1;
  background: #000;
  display: flex;
  flex-direction: column;
  margin: 8px;
  margin-top: 0;
  border: 1px inset #555;
  overflow: hidden;
}
.winamp-playlist-title {
  background: linear-gradient(90deg, #1c1c1c, #4d4d4d, #1c1c1c);
  color: #b0b0b0;
  padding: 3px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.winamp-playlist-body {
  flex: 1;
  overflow-y: auto;
  font-family: "Courier New", monospace;
  font-size: 11px;
  color: #00ff66;
}
.winamp-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 6px;
  padding: 2px 6px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.winamp-row:hover { background: #00220a; }
.winamp-row.active {
  background: #003a14;
  color: #fff;
}
.winamp-row-num { text-align: right; color: #00aa44; }
.winamp-row-title {
  overflow: hidden;
  text-overflow: ellipsis;
}
.winamp-row-dur { color: #00aa44; }

/* ===== Logon screen ===== */
.logon-screen {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at center, #2a8aa7 0%, #006080 60%, #002030 100%);
  z-index: 99998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: "MS Sans Serif", Tahoma, sans-serif;
}
.logon-flag { margin-bottom: 30px; }
.logon-dialog {
  background: var(--w98-face);
  border: 1px solid #000;
  box-shadow:
    inset 1px 1px 0 var(--w98-light),
    inset -1px -1px 0 var(--w98-dark),
    4px 4px 12px rgba(0,0,0,0.5);
  padding: 0;
  width: 330px;
  font-size: 12px;
}
.logon-title {
  background: linear-gradient(90deg, var(--w98-title), var(--w98-title-light));
  color: #fff;
  font-weight: bold;
  padding: 4px 6px;
  font-size: 11px;
}
.logon-row {
  display: flex;
  gap: 12px;
  padding: 16px 16px 8px;
  align-items: flex-start;
}
.logon-keys { font-size: 36px; line-height: 1; }
.logon-text { flex: 1; font-size: 11px; line-height: 1.4; }
.logon-field {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  padding: 4px 16px;
  gap: 8px;
  font-size: 11px;
}
.logon-input {
  font-family: inherit;
  font-size: 12px;
  padding: 2px 4px;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #fff;
  background: #fff;
}
.logon-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 12px 16px 14px;
}
.btn.btn-primary {
  font-weight: bold;
}

/* ===== Hourglass ===== */
.hourglass-screen {
  position: fixed;
  inset: 0;
  background: var(--w98-teal);
  z-index: 99996;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hourglass-spinner {
  font-size: 64px;
  animation: hgflip 1s linear infinite;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.4));
}
@keyframes hgflip {
  0%   { transform: rotate(0); }
  50%  { transform: rotate(180deg); }
  100% { transform: rotate(360deg); }
}

/* ===== Shutdown dialog ===== */
.shutdown-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shutdown-dialog {
  background: var(--w98-face);
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 var(--w98-light), inset -1px -1px 0 var(--w98-dark), 4px 4px 12px rgba(0,0,0,0.5);
  width: 380px;
}
.shutdown-header {
  background: linear-gradient(90deg, var(--w98-title), var(--w98-title-light));
  color: #fff;
  font-weight: bold;
  padding: 4px 6px;
  font-size: 11px;
}
.shutdown-body {
  display: flex;
  gap: 16px;
  padding: 20px 20px 16px;
}
.shutdown-options { font-size: 12px; }
.shutdown-question {
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 10px;
}
.shutdown-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
}
.shutdown-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 12px 12px;
}

/* ===== Shutdown final / standby / DOS ===== */
.shutdown-final {
  position: fixed;
  inset: 0;
  background: #c8800c;
  background: radial-gradient(ellipse at center, #e69b1f 0%, #5a3a0a 100%);
  color: #ffeac0;
  z-index: 99500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  text-align: center;
  cursor: pointer;
  padding: 40px;
}
.shutdown-final.standby { background: #000; cursor: pointer; }
.shutdown-final-hint {
  margin-top: 20px;
  font-size: 11px;
  font-family: "MS Sans Serif", Tahoma, sans-serif;
  opacity: 0.6;
}
.dos-screen {
  position: fixed;
  inset: 0;
  background: #000;
  color: #c0c0c0;
  z-index: 99500;
  font-family: "Lucida Console", "Courier New", monospace;
  padding: 12px;
  cursor: pointer;
  font-size: 16px;
}
.dos-screen pre {
  white-space: pre;
  margin: 0;
}
.dos-screen pre::after {
  content: "█";
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* ===== Allow desktop-icons free positioning (override grid) ===== */
.desktop-icons { display: none !important; }

/* ===== Calculator ===== */
.calc {
  background: var(--w98-face);
  padding: 8px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.calc-display {
  background: #ffffd0;
  border: 1px solid #000;
  box-shadow: inset 1px 1px 0 #808080, inset -1px -1px 0 #fff;
  font-family: "Courier New", monospace;
  font-size: 18px;
  text-align: right;
  padding: 4px 6px;
  min-height: 26px;
}
.calc-mem-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}
.calc-mem-btn {
  background: var(--w98-face);
  border: 1px outset var(--w98-light);
  font-family: inherit;
  font-size: 11px;
  padding: 2px 0;
  cursor: pointer;
  color: #cc0000;
  font-weight: bold;
}
.calc-mem-btn:active { border-style: inset; }
.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 32px;
  gap: 3px;
  flex: 1;
}
.calc-btn {
  background: var(--w98-face);
  border: 1px outset var(--w98-light);
  font-family: inherit;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}
.calc-btn:active { border-style: inset; }
.calc-btn.calc-op { color: #cc0000; }
.calc-btn.calc-fn { color: #0000aa; font-size: 11px; }

/* ===== WordPad ===== */
.wordpad-toolbar {
  background: var(--w98-face);
  padding: 4px;
  display: flex;
  gap: 4px;
  align-items: center;
  border-bottom: 1px solid var(--w98-shadow);
}
.wordpad-toolbar select {
  font-family: inherit;
  font-size: 11px;
  height: 22px;
}
.wp-btn {
  width: 24px;
  height: 22px;
  background: var(--w98-face);
  border: 1px outset var(--w98-light);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.wp-btn.active { border-style: inset; background: var(--w98-light); }
.wp-btn:active { border-style: inset; }
.wp-sep {
  display: inline-block;
  width: 1px;
  height: 18px;
  background: var(--w98-shadow);
  border-right: 1px solid #fff;
  margin: 0 4px;
}
.wordpad-doc {
  flex: 1;
  background: #fff;
  padding: 12px;
  overflow: auto;
  outline: none;
  font-family: "Times New Roman", serif;
}
.wordpad-status {
  background: var(--w98-face);
  border-top: 1px solid var(--w98-shadow);
  padding: 2px 6px;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
}

/* ===== Solitaire ===== */
.solitaire {
  background: #008000;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 6px;
  overflow: hidden;
}
.sol-top {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.sol-stock-area, .sol-foundations {
  display: flex;
  gap: 6px;
}
.sol-pile {
  width: 62px;
  height: 88px;
  position: relative;
}
.sol-empty {
  width: 100%;
  height: 100%;
  border: 1px dashed rgba(255,255,255,0.5);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  font-size: 24px;
}
.sol-card {
  width: 62px;
  height: 88px;
  background: #fff;
  border: 1px solid #000;
  border-radius: 5px;
  position: relative;
  cursor: pointer;
  user-select: none;
  box-shadow: 1px 1px 2px rgba(0,0,0,0.4);
}
.sol-card.down {
  background:
    repeating-linear-gradient(45deg, #002050 0 4px, #003580 4px 8px);
  border-color: #fff;
}
.sol-card.selected {
  outline: 2px solid #ffff00;
  outline-offset: -2px;
}
.sol-face {
  height: 100%;
  padding: 3px;
  position: relative;
  font-family: Georgia, "Times New Roman", serif;
}
.sol-face.red { color: #cc0000; }
.sol-face.black { color: #000; }
.sol-corner {
  font-size: 11px;
  line-height: 1;
  font-weight: bold;
}
.sol-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.sol-tableau {
  display: flex;
  gap: 6px;
  flex: 1;
  align-items: flex-start;
}
.sol-tab-col {
  width: 62px;
  min-height: 88px;
  position: relative;
  display: flex;
  flex-direction: column;
}
.sol-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  color: #fff;
  font-size: 12px;
}

/* ===== Sound Recorder ===== */
.recorder {
  background: var(--w98-face);
  padding: 8px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.recorder-display {
  background: var(--w98-face);
  border: 1px inset var(--w98-light);
  padding: 6px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.recorder-time { font-family: "Courier New", monospace; }
.recorder-wave {
  width: 100%;
  height: 60px;
  background: var(--w98-face);
  border: 1px inset var(--w98-light);
}
.recorder-controls {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.rec-btn {
  background: var(--w98-face);
  border: 1px outset var(--w98-light);
  width: 38px;
  height: 28px;
  font-size: 14px;
  cursor: pointer;
}
.rec-btn:active { border-style: inset; }
.rec-record { color: #cc0000; font-size: 20px; }
.rec-record.on { background: #ffe0e0; animation: recblink 0.9s steps(1) infinite; }
@keyframes recblink {
  50% { color: #fff; background: #cc0000; }
}

/* ===== Microsoft Bob ===== */
.bob {
  background: linear-gradient(180deg, #87ceeb 0%, #87ceeb 60%, #6bbb37 60%, #4a9c2a 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 8px;
  font-family: Georgia, serif;
}
.bob-house {
  position: relative;
  width: 200px;
  height: 160px;
}
.bob-roof {
  width: 0;
  height: 0;
  border-left: 100px solid transparent;
  border-right: 100px solid transparent;
  border-bottom: 50px solid #aa3322;
}
.bob-walls {
  width: 180px;
  height: 80px;
  background: #ffe0a0;
  margin: 0 auto;
  border: 2px solid #553311;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 6px;
}
.bob-window {
  width: 28px;
  height: 28px;
  background: #5599cc;
  border: 1px solid #336699;
  box-shadow: inset 0 0 0 1px #fff;
}
.bob-door {
  width: 22px;
  height: 50px;
  background: #884422;
  border: 1px solid #221100;
  align-self: flex-end;
}
.bob-lawn {
  width: 220px;
  height: 8px;
  background: #4a9c2a;
  margin: 0 auto;
}
.bob-sun {
  position: absolute;
  top: -10px;
  right: -50px;
  font-size: 30px;
}
.bob-cloud {
  position: absolute;
  top: -20px;
  font-size: 28px;
}
.bob-pet {
  position: absolute;
  bottom: -28px;
  right: -10px;
  font-size: 30px;
  animation: bobpet 2s ease-in-out infinite;
}
@keyframes bobpet {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-20px); }
}
.bob-msg {
  background: #fff;
  border: 2px solid #555;
  padding: 8px 12px;
  font-size: 12px;
  text-align: center;
  font-family: "MS Sans Serif", Tahoma, sans-serif;
  max-width: 280px;
  border-radius: 8px;
}

/* ===== Mystify screensaver ===== */
.screensaver {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 98000;
  cursor: none;
}

/* ===== Context menu ===== */
.ctx-menu {
  position: fixed;
  background: var(--w98-face);
  border: 1px solid #000;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.4);
  min-width: 200px;
  padding: 2px;
  z-index: 9999;
  font-size: 12px;
}
.ctx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 18px 3px 22px;
  cursor: pointer;
  user-select: none;
}
.ctx-item:hover:not(.disabled) {
  background: var(--w98-title);
  color: #fff;
}
.ctx-item.disabled { color: #888; cursor: default; }
.ctx-sep {
  height: 1px;
  background: var(--w98-shadow);
  border-bottom: 1px solid #fff;
  margin: 2px 2px;
}
.ctx-right { margin-left: 12px; opacity: 0.7; }
