/* Simulated desktop: icons, app windows (iframes), taskbar. */

#desktop-root {
  position: fixed;
  inset: 0 0 30px 0;
  overflow: hidden;
}

/* ── Desktop icons ───────────────────────────────────────────── */
#icons {
  position: absolute;
  top: 14px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.desk-icon {
  width: 84px;
  text-align: center;
  cursor: pointer;
}

.desk-icon .glyph {
  display: block;
  font-size: 34px;
  line-height: 42px;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.4));
}

.desk-icon .label {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 4px;
  font-family: 'W95F', sans-serif;
  font-size: 14px;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
}

.desk-icon.selected .label {
  background: var(--title-active);
  color: var(--title-text);
  outline: 1px dotted var(--title-text);
  text-shadow: none;
}

/* ── App windows (iframe hosts) ──────────────────────────────── */
.wm-window {
  position: absolute;
  /* The drop shadow lives here; the window inside the frame keeps only
     its bevel insets (see body.embedded rules in retro.css). */
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.43);
}

.wm-window.minimized { display: none; }

.wm-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* About window body (plain DOM window, not an iframe) */
.about-body {
  padding: 10px 12px 12px;
  font-family: 'W95F', sans-serif;
  color: var(--body-text);
}
.about-body h1 { margin: 0 0 8px; font-size: 22px; }
.about-body p { margin: 0 0 10px; font-size: 14px; line-height: 1.4; }
.about-body p:last-child { margin-bottom: 0; }
.about-body a { color: var(--body-text); }

/* Folder windows */
.folder-body {
  min-height: 164px;
  padding: 12px 10px 10px;
  display: grid;
  grid-template-columns: repeat(3, 96px);
  align-content: start;
  gap: 10px 8px;
}

.folder-icon {
  width: 96px;
  min-height: 62px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--body-text);
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.folder-icon:focus { outline: 1px dotted var(--body-text); }

.folder-icon .glyph {
  display: block;
  font-size: 28px;
  line-height: 34px;
}

.folder-icon .label {
  display: block;
  padding: 1px 2px;
  font-size: 14px;
  line-height: 1.1;
}

.folder-icon:active .label,
.folder-icon:focus .label {
  background: var(--title-active);
  color: var(--title-text);
}

/* ── Screensaver / Koi Pond overlays (screensaver/saver.js) ───── */
/* Full-viewport canvas above the app windows but below the taskbar's
   popups; pointer-events: none keeps the desktop usable underneath —
   only the control pill (and, for the pond, water clicks intercepted at
   the window level) take the pointer. z-index is !important because
   bringToFront() writes a small inline z meant for .wm-window stacking. */
.saver-overlay {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  bottom: 30px;            /* keep the taskbar visible + clickable */
  z-index: 6000 !important;
  pointer-events: none;
}

.saver-overlay canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.saver-overlay.minimized { display: none; }

.saver-pill {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  pointer-events: auto;
  background: var(--face);
  border: 1px solid var(--highlight);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.43);
  font-family: 'W95F', sans-serif;
}

.saver-pill .retro-btn {
  height: 22px;
  font-size: 13px;
  padding: 1px 8px;
}

.saver-pill-name {
  min-width: 110px;
  text-align: center;
  font-size: 13px;
  color: var(--body-text);
  padding: 0 4px;
}

/* ── Taskbar ─────────────────────────────────────────────────── */
#taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30px;
  z-index: 5000;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  background: var(--face);
  border-top: 1px solid var(--highlight);
  box-shadow: inset 0 1px 0 var(--face-light);
  font-family: 'W95F', sans-serif;
}

#start-btn {
  height: 24px;
  font-size: 14px;
  padding: 2px 8px;
  flex: none;
}

#task-buttons {
  flex: 1;
  display: flex;
  gap: 3px;
  overflow: hidden;
  min-width: 0;
}

.task-btn {
  height: 24px;
  width: 150px;
  min-width: 60px;
  flex: 0 1 auto;
  font-size: 14px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#task-clock {
  height: 24px;
  flex: none;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 14px;
  color: var(--body-text);
}

/* Start menu reuses the theme-picker popup styling, pinned above Start. */
#start-menu {
  position: fixed;
  left: 4px;
  top: auto;
  bottom: 34px;
}

/* Popups must clear the app windows whose z-index grows as they're focused. */
.retro-theme-picker { z-index: 7000; }
