:root {
  --desktop: #3f766d;
  --panel: #c6c6c6;
  --light: #fff;
  --mid-light: #dedede;
  --mid-dark: #858585;
  --dark: #202020;
  --title: #1d3c61;
  --selection: #173f70;
  --disabled: #777;
  --taskbar-height: 34px;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: #111;
  background: var(--desktop);
  font: 13px/1.25 "MS Sans Serif", Tahoma, Arial, sans-serif;
  user-select: none;
}

button { font: inherit; }
[hidden] { display: none !important; }

.desktop {
  position: relative;
  width: 100%;
  height: calc(100% - var(--taskbar-height));
  min-height: 180px;
  overflow: hidden;
  background: var(--desktop);
}

.desktop-icon {
  position: absolute;
  top: 18px;
  left: 12px;
  width: 88px;
  padding: 4px 2px;
  color: white;
  border: 1px solid transparent;
  background: transparent;
  text-align: center;
  cursor: default;
  touch-action: none;
}

.desktop-icon-picos { top: 18px; left: 12px; }
.desktop-icon-computer { top: 100px; left: 12px; }
.desktop-icon-recycle { top: 182px; left: 12px; }
.desktop-icon-glb { top: 264px; left: 12px; }

.desktop-icon.dragging { cursor: grabbing; }

.desktop-icon img {
  pointer-events: none;
  -webkit-user-drag: none;
}

.desktop-icon:focus-visible {
  outline: 1px dotted white;
  outline-offset: 1px;
}

.desktop-icon.selected .icon-picture { filter: brightness(.8) saturate(.75); }

.desktop-icon.selected .icon-label {
  color: white;
  background: var(--selection);
  outline: 1px dotted white;
}

.icon-picture {
  display: block;
  width: 42px;
  height: 42px;
  margin: 0 auto 5px;
  image-rendering: pixelated;
  shape-rendering: crispEdges;
}

.icon-label {
  display: inline-block;
  min-width: 42px;
  padding: 1px 3px;
  text-shadow: 1px 1px #24463f;
}

.version {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: rgba(230, 246, 241, .68);
  font-size: 11px;
  letter-spacing: .03em;
}

/* Shared classic GUI edges */
.raised {
  border: 2px solid;
  border-color: var(--light) var(--dark) var(--dark) var(--light);
  box-shadow: inset 1px 1px var(--mid-light), inset -1px -1px var(--mid-dark);
}

.raised:active,
.start-button.active {
  border-color: var(--dark) var(--light) var(--light) var(--dark);
  box-shadow: inset 1px 1px var(--mid-dark);
}

.taskbar {
  position: fixed;
  z-index: 1000;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--taskbar-height);
  padding: 3px 4px;
  background: var(--panel);
  border-top: 2px solid var(--light);
  box-shadow: inset 0 1px var(--mid-light);
}

.start-button {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  padding: 1px 8px 1px 5px;
  color: #111;
  background: var(--panel);
  font-weight: 700;
  cursor: default;
}

.start-button:focus-visible,
.classic-button:focus-visible,
.close-button:focus-visible,
.menu-item:focus-visible {
  outline: 1px dotted #111;
  outline-offset: -4px;
}

.mini-penguin {
  width: 20px;
  height: 20px;
  shape-rendering: crispEdges;
}

.task-spacer { flex: 1; }

.clock {
  min-width: 61px;
  padding: 5px 8px 4px;
  border: 2px solid;
  border-color: var(--mid-dark) var(--light) var(--light) var(--mid-dark);
  box-shadow: inset 1px 1px #aaa;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.start-menu {
  position: fixed;
  z-index: 1100;
  bottom: calc(var(--taskbar-height) + 1px);
  left: 4px;
  width: 190px;
  padding: 3px;
  background: var(--panel);
}

.menu-heading {
  padding: 8px 10px 7px;
  font-weight: 700;
  letter-spacing: .02em;
}

.menu-separator {
  height: 2px;
  margin: 0 3px 3px;
  border-top: 1px solid var(--mid-dark);
  border-bottom: 1px solid white;
}

.menu-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  color: #111;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: default;
}

.menu-item:hover,
.menu-item:focus,
.menu-item.submenu-open {
  color: white;
  background: var(--selection);
  outline: none;
}

.menu-item.app-entry {
  justify-content: flex-start;
  gap: 7px;
}

.menu-icon {
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
}

.arrow { font-size: 15px; }
.applications-wrap { position: relative; }

.submenu {
  position: absolute;
  top: -3px;
  left: calc(100% - 1px);
  width: 132px;
  min-height: 34px;
  padding: 4px;
  background: var(--panel);
}

.submenu-empty {
  display: block;
  padding: 7px 9px;
  color: var(--disabled);
  text-shadow: 1px 1px white;
}

/* Windows generated by the OS for modular applications */
.app-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  min-height: 150px;
  padding: 3px;
  background: var(--panel);
}

.app-window.resizable { overflow: hidden; }

.resize-handle {
  position: absolute;
  z-index: 2;
  right: 3px;
  bottom: 3px;
  width: 17px;
  height: 17px;
  padding: 0;
  border: 0;
  cursor: nwse-resize;
  touch-action: none;
  background:
    linear-gradient(135deg, transparent 0 48%, var(--dark) 49% 55%, transparent 56% 63%, var(--mid-dark) 64% 70%, transparent 71%);
}

.resize-handle:focus-visible { outline: 1px dotted var(--dark); }

.app-window.active .titlebar { background: var(--title); }
.app-window:not(.active) .titlebar { background: #727272; }

.titlebar {
  display: flex;
  flex: 0 0 22px;
  align-items: center;
  justify-content: space-between;
  height: 22px;
  padding: 2px 2px 2px 6px;
  color: white;
  background: var(--title);
  font-weight: 700;
}

.app-window .titlebar {
  cursor: move;
  touch-action: none;
}

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

.close-button {
  width: 18px;
  height: 18px;
  padding: 0 0 2px;
  color: #111;
  background: var(--panel);
  font-weight: 700;
  line-height: 12px;
  cursor: default;
}

.app-frame-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 3px;
  overflow: hidden;
  border: 1px solid;
  border-color: var(--mid-dark) var(--light) var(--light) var(--mid-dark);
  background: white;
}

.app-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: white;
}

.dialog-layer {
  position: fixed;
  z-index: 1200;
  inset: 0 0 var(--taskbar-height);
  pointer-events: none;
}

.dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(330px, calc(100vw - 30px));
  padding: 3px;
  background: var(--panel);
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.dialog-content {
  min-height: 116px;
  padding: 30px 22px 15px;
  text-align: center;
}

.dialog-content strong {
  display: block;
  margin-bottom: 9px;
  font-size: 15px;
}

.muted { color: #555; }

.dialog-actions {
  padding: 0 0 13px;
  text-align: center;
}

.classic-button {
  min-width: 78px;
  padding: 4px 14px;
  color: #111;
  background: var(--panel);
}

.boot-screen {
  position: fixed;
  z-index: 2000;
  inset: 0;
  display: grid;
  place-items: center;
  color: #e8f3f0;
  background: #162f2b;
  text-align: center;
  letter-spacing: .05em;
  transition: opacity 80ms linear;
}

.boot-screen strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 400;
}

.boot-screen.is-ending { opacity: 0; }

@media (max-width: 380px) {
  .version { display: none; }
  .start-menu { width: 176px; }
  .submenu {
    right: calc(100% - 1px);
    left: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot-screen { transition: none; }
}
