/* Wallpaper, desktop icons, marquee selection, context menus, and toasts */
.screen-root {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.desktop {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.wallpaper {
  position: absolute;
  inset: 0;
  background-color: #1d3557;
  background-size: cover;
  transition: background 0.4s ease;
}

.wallpaper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, rgba(255, 255, 255, 0.07), transparent 60%);
  pointer-events: none;
}

.desktop-icons {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.desk-icon {
  position: absolute;
  width: 84px;
  height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  cursor: default;
  transition: left 0.14s var(--ease), top 0.14s var(--ease);
}

.desk-icon.dragging {
  transition: none;
  opacity: 0.85;
  z-index: 5;
}

.desk-icon.selected {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.desk-tile {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: none;
  box-shadow: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.desk-tile .ico {
  width: 26px;
  height: 26px;
}

/* Real Windows icons sit directly on the wallpaper, the way they do on a real desktop */
.desk-tile:has(img) {
  background: none;
  box-shadow: none;
}

.desk-tile:has(img) .ico {
  width: 46px;
  height: 46px;
}

.desk-tile.sys-tile {
  background: none;
}

.desk-tile:not(.app-tile):not(.sys-tile) {
  background: none;
  box-shadow: none;
  color: #ffd166;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.desk-tile:not(.app-tile):not(.sys-tile) .ico {
  width: 44px;
  height: 44px;
}

.desk-label {
  font-size: 12px;
  line-height: 1.2;
  text-align: center;
  max-width: 84px;
  padding: 0 3px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.desk-rename {
  width: 80px;
  height: 22px;
  padding: 0 4px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  text-align: center;
  outline: none;
  user-select: text;
}

.marquee {
  position: fixed;
  z-index: 2;
  border: 1px solid rgba(var(--accent-rgb), 0.9);
  background: rgba(var(--accent-rgb), 0.22);
  pointer-events: none;
}

/* Context menus: Windows 11 style panel with an optional icon row */
.ctx {
  position: fixed;
  min-width: 200px;
  max-width: 320px;
  padding: 4px;
  background: var(--flyout);
  border-radius: var(--radius);
  box-shadow: var(--shadow-flyout);
  z-index: 1300;
  animation: ctx-in 0.14s var(--ease-out);
  transform-origin: top left;
}

[data-transparency="on"] .ctx {
  backdrop-filter: blur(40px) saturate(1.6);
}

@keyframes ctx-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.ctx-iconrow {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  padding: 2px;
}

.ctx-iconbtn {
  width: 36px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
}

.ctx-iconbtn .ico {
  width: 16px;
  height: 16px;
}

.ctx-iconbtn:hover:not(:disabled) {
  background: var(--subtle);
}

.ctx-iconbtn:disabled {
  color: var(--text-3);
}

.ctx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 32px;
  padding: 0 10px 0 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  white-space: nowrap;
  cursor: default;
}

.ctx-item:hover:not(:disabled),
.ctx-item.has-sub:hover {
  background: var(--subtle);
}

.ctx-item:disabled {
  color: var(--text-3);
}

.ctx-ico {
  width: 16px;
  display: flex;
  justify-content: center;
  color: var(--text);
}

.ctx-ico .ico {
  width: 16px;
  height: 16px;
}

.ctx-label {
  flex: 1;
}

.ctx-key {
  color: var(--text-2);
  font-size: 12px;
}

.ctx-arrow {
  margin-left: 8px;
  color: var(--text-2);
}

.ctx-arrow .ico {
  width: 12px;
  height: 12px;
}

.ctx-sep {
  height: 1px;
  margin: 4px 8px;
  background: var(--stroke);
}

/* Toasts: Windows 11 style cards in the bottom-right corner */
.toasts {
  position: fixed;
  right: 12px;
  bottom: calc(var(--taskbar-h) + 12px);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  width: 360px;
  padding: 12px 14px 14px;
  background: var(--flyout);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow-flyout);
  opacity: 0;
  transform: translateX(24px);
  transition: opacity 0.24s var(--ease-out), transform 0.28s var(--ease);
  pointer-events: auto;
  cursor: default;
}

[data-transparency="on"] .toast {
  backdrop-filter: blur(30px) saturate(1.5);
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast.leaving {
  opacity: 0;
  transform: translateX(24px);
}

.toast-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
}

.toast-app-icon .ico {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.toast-app {
  flex: 1;
}

.toast-close {
  width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
}

.toast-close .ico {
  width: 12px;
  height: 12px;
}

.toast-close:hover {
  background: var(--subtle);
}

.toast-title {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
}

.toast-body {
  margin-top: 2px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}

.toast-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.toast-error .toast-title {
  color: var(--danger);
}
