/* Desktop surface, icons, taskbar, Start menu, boot/shutdown screens. */

#desktop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--desktop);
}

/* Desktop wallpaper is painted by the shell onto #desktop-wall. */
#desktop-wall { position: absolute; inset: 0; }

#desk-icons {
  position: absolute;
  inset: 4px 4px 0 4px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 2px;
  pointer-events: none;
}
#desk-icons > * { pointer-events: auto; }

.desk-icon {
  width: 76px;
  padding: 3px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #fff;
  text-align: center;
  cursor: default;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.6);
}
.desk-icon .di-img { width: 32px; height: 32px; display: block; }
.desk-icon .di-img svg { width: 32px; height: 32px; display: block; }
.desk-icon .di-label {
  padding: 1px 3px;
  max-width: 72px;
  line-height: 1.25;
  word-break: break-word;
}
.desk-icon.selected .di-img { filter: url(#none); opacity: 0.7; }
.desk-icon.selected .di-label { background: var(--sel); color: var(--sel-text); text-shadow: none; }
.desk-icon.drop-target .di-label { box-shadow: inset 0 0 0 1px #000; }

/* Rubber-band selection rectangle. */
#desk-band {
  position: absolute;
  border: 1px dotted #fff;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
  z-index: 5;
}

/* ------------------------------------------------------------- taskbar */
#taskbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--taskbar-h);
  /* Anchored to the bottom of #desk, whose height the shell measures from the
     visual viewport, so Safari's overlapping UI cannot clip the taskbar. */
  background: var(--face);
  box-shadow: inset 0 1px var(--hilite), inset 0 2px var(--face-lt);
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px;
  z-index: 2000;
}

#start-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 22px;
  padding: 0 6px 0 3px;
  border: none;
  background: var(--face);
  font: bold 11px var(--font);
  color: var(--text);
  cursor: default;
  flex: 0 0 auto;
  box-shadow:
    inset -1px -1px var(--dark),
    inset  1px  1px var(--hilite),
    inset -2px -2px var(--shadow),
    inset  2px  2px var(--face-lt);
}
#start-btn.open,
#start-btn:active {
  box-shadow:
    inset  1px  1px var(--dark),
    inset -1px -1px var(--hilite),
    inset  2px  2px var(--shadow),
    inset -2px -2px var(--face-lt);
  padding: 1px 5px 0 4px;
}
#start-btn .sb-icon { width: 16px; height: 16px; }
#start-btn .sb-icon svg { width: 16px; height: 16px; display: block; }

.tb-divider {
  width: 2px;
  align-self: stretch;
  margin: 1px 2px;
  box-shadow: inset 1px 0 var(--shadow), inset -1px 0 var(--hilite);
  flex: 0 0 auto;
}

#quick-launch { display: flex; gap: 2px; flex: 0 0 auto; }
#quick-launch button {
  width: 22px; height: 22px;
  border: none; background: transparent;
  display: grid; place-items: center;
  cursor: default;
  box-shadow: none;
}
#quick-launch button:hover { box-shadow: inset -1px -1px var(--shadow), inset 1px 1px var(--hilite); }
#quick-launch button:active { box-shadow: inset 1px 1px var(--shadow), inset -1px -1px var(--hilite); }
#quick-launch button svg { width: 16px; height: 16px; display: block; }

#task-buttons {
  flex: 1 1 auto;
  display: flex;
  gap: 3px;
  overflow: hidden;
  min-width: 0;
}
.task-btn {
  flex: 0 1 160px;
  min-width: 40px;
  height: 22px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  border: none;
  background: var(--face);
  font: 11px var(--font);
  color: var(--text);
  cursor: default;
  overflow: hidden;
  box-shadow:
    inset -1px -1px var(--dark),
    inset  1px  1px var(--hilite),
    inset -2px -2px var(--shadow),
    inset  2px  2px var(--face-lt);
}
.task-btn .tb-icon { width: 16px; height: 16px; flex: 0 0 16px; }
.task-btn .tb-icon svg { width: 16px; height: 16px; display: block; }
.task-btn .tb-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-btn.active {
  box-shadow:
    inset  1px  1px var(--dark),
    inset -1px -1px var(--hilite),
    inset  2px  2px var(--shadow),
    inset -2px -2px var(--face-lt);
  background-color: var(--face);
  background-image:
    linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%),
    linear-gradient(45deg, #fff 25%, transparent 25%, transparent 75%, #fff 75%);
  background-size: 2px 2px;
  background-position: 0 0, 1px 1px;
  font-weight: bold;
  padding: 1px 5px 0 7px;
}

#tray {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 4px;
  box-shadow: inset -1px -1px var(--hilite), inset 1px 1px var(--shadow);
}
#tray button:not(#tray-clock) {
  border: none; background: transparent; cursor: default;
  display: grid; place-items: center; width: 16px; height: 16px;
}
#tray button svg { width: 16px; height: 16px; display: block; }
#tray-clock {
  border: none; background: transparent; cursor: default; color: var(--text);
  font: 11px var(--font);
  padding: 0 2px;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* ---------------------------------------------------------- start menu */
#start-menu {
  position: absolute;
  left: 2px;
  bottom: var(--taskbar-h);
  display: flex;
  height: 320px;
  z-index: 2100;
  padding: 3px;
  background: var(--face);
  box-shadow:
    inset -1px -1px var(--dark),
    inset  1px  1px var(--hilite),
    inset -2px -2px var(--shadow),
    inset  2px  2px var(--face-lt),
    2px 2px 4px rgba(0, 0, 0, 0.3);
}
.sm-side {
  width: 21px;
  flex: 0 0 21px;
  background: linear-gradient(180deg, var(--title-2) 0%, var(--title-1) 60%, #000030 100%);
  position: relative;
  overflow: hidden;
}
.sm-side span {
  /* Win98's banner reads bottom-to-top and spans the full column height. */
  position: absolute;
  left: 0; right: 0;
  bottom: 6px;
  height: calc(100% - 12px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
  color: #fff;
  font: bold 15px var(--font);
  letter-spacing: 0.5px;
  opacity: 0.92;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
}
.sm-side span b { font-weight: 900; }
.sm-items { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 178px; }
.sm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 18px 3px 6px;
  font: 11px var(--font);
  white-space: nowrap;
  position: relative;
  cursor: default;
}
.sm-item .smi-icon { width: 22px; height: 22px; flex: 0 0 22px; }
.sm-item .smi-icon svg { width: 22px; height: 22px; display: block; }
.sm-item.sep { padding: 0; margin: 3px 2px; height: 2px; box-shadow: inset 0 1px var(--shadow), inset 0 -1px var(--hilite); }
.sm-item.hot { background: var(--sel); color: var(--sel-text); }
.sm-item.top { font-weight: bold; padding-top: 5px; padding-bottom: 5px; }
.sm-item.top .smi-icon { width: 22px; height: 22px; }
.sm-item .smi-arrow { margin-left: auto; width: 7px; height: 7px; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='7'><path d='M0 0l4 3.5L0 7z' fill='%23000'/></svg>") no-repeat center; }
.sm-item.hot .smi-arrow { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='4' height='7'><path d='M0 0l4 3.5L0 7z' fill='%23fff'/></svg>"); }

/* ----------------------------------------------------- boot / shutdown */
.screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: #fff;
}
#boot-screen { background: #000; }
.boot-logo { display: flex; align-items: flex-end; gap: 8px; }
.boot-logo .bl-flag { width: 64px; height: 64px; }
.boot-logo .bl-flag svg { width: 64px; height: 64px; display: block; }
.boot-logo .bl-text { font: bold 44px var(--font); letter-spacing: -1px; text-shadow: 2px 2px 0 #000080; }
.boot-logo .bl-text small { font-size: 20px; vertical-align: super; }
.boot-copy { font: 11px var(--font); color: #9a9a9a; }
.boot-bar { width: 220px; height: 14px; padding: 2px; box-shadow: inset 0 0 0 1px #404040; }
.boot-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, #1084d0 0 8px, transparent 8px 10px); transition: width 0.2s linear; }

#shutdown-screen {
  background: #000;
  display: none;
}
#shutdown-screen.show { display: flex; }
.sd-text { font: bold 30px var(--font); text-align: center; line-height: 1.4; }

/* "It is now safe to turn off your computer" orange-on-black ending. */
#off-screen {
  position: fixed; inset: 0; z-index: 10001;
  background: #000;
  display: none;
  align-items: center;
  justify-content: center;
}
#off-screen.show { display: flex; }
#off-screen .off-text {
  color: #ff9c00;
  font: 20px var(--font);
  text-align: center;
  line-height: 1.6;
  text-shadow: 0 0 12px rgba(255, 156, 0, 0.5);
}

/* ---------------------------------------------------------------- misc */
.splash {
  position: fixed;
  left: 50%; top: 45%;
  transform: translate(-50%, -50%);
  z-index: 3000;
  padding: 3px;
  background: var(--face);
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--hilite), inset -2px -2px var(--shadow), inset 2px 2px var(--face-lt), 3px 3px 6px rgba(0,0,0,0.4);
}
.splash .sp-body { display: flex; gap: 10px; padding: 10px 14px; align-items: center; }
.splash .sp-body svg { width: 32px; height: 32px; }
