/* A faithful-spirited Windows 3.1 desktop, not a modern landing page. */
:root {
  --desktop:#008080; --win:#c0c0c0; --white:#fff; --black:#000;
  --shade:#808080; --deep:#404040; --navy:#000080;
  --ui: "MS Sans Serif", "Microsoft Sans Serif", "Arial", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin:0; width:100%; height:100%; height:100dvh; overflow:hidden; }
body { font-family:var(--ui); color:#000; font-size:14px; }
button, input, select { font:inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline:2px dotted #000; outline-offset:2px; }
[hidden] { display:none !important; }
.sprite { position:absolute; width:0; height:0; overflow:hidden; }
#desktop { position:relative; width:100%; height:100dvh; overflow:hidden; background-color:var(--desktop);
  background-image: repeating-linear-gradient(135deg,rgba(0,0,0,.05) 0 1px,transparent 1px 5px); }
.win-frame { background:var(--win); border:2px solid; border-color:#fff #000 #000 #fff; box-shadow: 1px 1px 0 #404040, inset 1px 1px 0 #dfdfdf; }
.program-manager { position:absolute; left:50%; top: max(18px, calc((100dvh - min(630px, 91dvh))/2)); width:min(940px, calc(100vw - 60px)); height:min(630px, 91dvh); transform:translateX(-50%); padding:3px; display:flex; flex-direction:column; z-index:2; }
.titlebar { display:flex; align-items:center; min-height:25px; height:25px; flex:0 0 25px; background:var(--navy); color:white; padding:0 2px; gap:7px; font-weight:bold; user-select:none; }
.titlebar.inactive { background:#808080; }
.title-label { flex:1; text-align:center; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.controlbox, .title-controls button, .group-titlebar button, .window-controls button {
  display:grid; place-items:center; padding:0; border:2px solid; border-color:#fff #404040 #404040 #fff; background:var(--win); color:#000; height:19px; width:21px; line-height:1; font:bold 11px var(--ui); flex-shrink:0;
}
.controlbox:active,.title-controls button:active,.group-titlebar button:active,.window-controls button:active {border-color:#404040 #fff #fff #404040;}
.title-controls {display:flex; gap:2px; }
.menu-bar { display:flex; flex:0 0 27px; align-items:center; gap:1px; background:var(--win); padding:2px 6px; border-bottom:1px solid #8c8c8c; }
.menu-bar button, .app-menubar button { background:transparent; border:0; padding:3px 9px; color:#000; }
.menu-bar button:hover,.menu-bar button[aria-expanded="true"],.app-menubar button:hover {background:var(--navy); color:white; }
.manager-workspace { flex:1; min-height:0; background:var(--win); position:relative; overflow:hidden; }
.group-window {position:absolute; top:10px; left:12px; right:12px; height:calc(100% - 119px); min-height:0; border:2px solid; border-color:#fff #404040 #404040 #fff; box-shadow:inset 1px 1px 0 #808080; background:#fff; padding:2px; display:flex; flex-direction:column; }
.group-titlebar {flex:0 0 22px; height:22px; display:flex; align-items:center; gap:4px; background:var(--navy); color:white; user-select:none; font-weight:bold; padding:1px 2px; }
.group-titlebar span {flex:1; text-align:center;}
.group-titlebar button { width:18px; height:17px; font-size:10px;}
.group-title-controls {display:flex; gap:2px;}
.group-items {background:white; flex:1; min-height:0; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); grid-auto-rows:92px; align-content:start; justify-items:center; padding:22px 12px; overflow:hidden; gap:2px;}
.program-item,.group-choice {display:flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:4px; border:0; background:transparent; color:#000; text-align:center; min-width:0; width:100%; max-width:125px; padding:2px 1px; font-size:13px; text-decoration:none; }
.program-item:hover .item-label,.program-item:focus-visible .item-label,.group-choice:hover span,.group-choice:focus-visible span,.group-choice.selected span { background:var(--navy); color:white; }
.program-item .item-label {max-width:100%; padding:1px 3px; min-height:19px; line-height:1.15; }
.program-icon { display:block; width:39px; height:39px; image-rendering:pixelated; shape-rendering:crispEdges; flex:0 0 auto; }
.group-shelf {display:flex; position:absolute; left:13px; right:10px; bottom:7px; height:92px; gap:16px; align-items:flex-start; justify-content:flex-start; padding-left:8px; }
.group-choice {width:96px; gap:4px; flex:0 0 auto; padding-top:6px; }
.manager-status {display:flex; flex:0 0 25px; align-items:center; padding:0 8px; justify-content:space-between; gap:10px; border-top:1px solid #808080; font-size:12px; background:#c0c0c0; overflow:hidden; white-space:nowrap;}
.desktop-note {position:absolute; bottom:5px; right:12px; font-size:11px; color:white; margin:0; text-shadow:1px 1px #004444; }
/* Original 3.1-style application windows. */
#open-windows {position:static;}
.app-window {position:absolute; left:calc(50% - 220px); top:calc(50% - 175px); width:440px; max-height:calc(100dvh - 30px); z-index:10; padding:3px; display:flex; flex-direction:column; min-width:240px; min-height:100px; }
.app-window .titlebar {cursor:move; touch-action:none; }
.app-window .title-label {text-align:left; padding-left:4px; }
.window-controls {display:flex; gap:2px;}
.app-menubar {display:flex; align-items:center; min-height:25px; background:var(--win); padding-left:3px;}
.window-content {min-height:0; background:white; border:2px solid; border-color:#808080 #fff #fff #808080; padding:14px 18px; overflow:auto; }
.notepad-content {font-family:"Lucida Console", "Courier New", monospace; font-size:13px; line-height:1.54; white-space:pre-wrap; overflow-wrap:anywhere; }
.notepad-content p {margin:0 0 15px;}
.notepad-content p:last-child {margin-bottom:0;}
.notepad-content .doc-title {display:block; margin-bottom:12px; font-weight:bold;}
.app-status { background:var(--win); border-top:1px solid #808080; padding:4px 7px; font-size:11px; }
.win-button {background:#c0c0c0; border:2px solid; border-color:#fff #404040 #404040 #fff; border-radius:0; padding:5px 12px; color:#000; box-shadow:1px 1px #000; }
.win-button:active {border-color:#404040 #fff #fff #404040;box-shadow:none;}
.dialog-body {background:#c0c0c0; padding:18px; border:0; line-height:1.45;}
.dialog-actions {display:flex; gap:12px; margin-top:18px; justify-content:flex-end;}
#system-popover {position:absolute; z-index:999; background:#c0c0c0; border:2px solid; border-color:#fff #000 #000 #fff; box-shadow:2px 2px 0 #404040; width:max-content; min-width:190px; padding:3px; }
#system-popover button {width:100%; text-align:left; background:transparent; border:0; padding:6px 15px; white-space:nowrap;}
#system-popover button:hover,#system-popover button:focus-visible {background:var(--navy);color:#fff;outline:none;}
#system-popover hr {border:0; border-top:1px solid #808080; margin:3px 0;}
#minimized-apps {position:absolute; left:10px; bottom:12px; display:flex; gap:9px; z-index:5; flex-wrap:wrap; max-width:70%; }
.min-app {background:#c0c0c0; border:2px outset white; padding:5px 8px; font-size:12px; }
.run-form label {display:block; margin-bottom:7px;}
.run-form input {width:100%; height:27px; border:2px inset #fff; border-radius:0; padding:3px 6px; outline-offset:1px;}
.win-clock {width:165px;height:165px;background:#fff; border:4px solid #000; border-radius:50%;margin:9px auto; position:relative; }
.win-clock .tick {position:absolute; width:2px; height:10px; background:#000; top:2px; left:calc(50% - 1px); transform-origin:1px 78px;}
.hand {position:absolute;left:calc(50% - 2px); bottom:50%; width:4px; background:#000;transform-origin:bottom center;}
.hour-hand {height:44px;}.minute-hand {height:62px; width:3px;}.second-hand {height:66px; width:1px; background:#f00;left:calc(50% - .5px);}
.clock-pin {position:absolute;top:calc(50% - 4px);left:calc(50% - 4px);width:8px;height:8px;background:#000;border-radius:50%;}
.clock-digital {text-align:center;font-family:"Courier New",monospace;font-size:20px;margin:8px 0;}
.colors-list {display:flex;gap:9px; flex-wrap:wrap;}
.colors-list label {display:flex; flex-direction:column; align-items:center; gap:6px; cursor:pointer; width:70px;}
.color-chip {display:block;width:50px;height:35px;border:2px solid; border-color:#fff #000 #000 #fff;}
/* Windows 3.1 Minesweeper-inspired playable game, 9x9, 10 mines */
.mine-body {padding:12px 13px; background:#c0c0c0; border:0; }
.mine-top {display:flex;align-items:center;justify-content:space-between; border:3px inset #fff; padding:5px; margin-bottom:8px;}
.digits {font-family:"Courier New",monospace; color:#f00; background:#000; font-size:21px; font-weight:bold; letter-spacing:2px; min-width:52px; text-align:center;}
.face {font:bold 19px Arial; width:30px;height:30px;padding:0; border:3px outset #fff; background:#c0c0c0;}
.mine-grid {display:grid;grid-template-columns:repeat(9,24px);width:max-content;border:3px inset #fff;}
.mine-cell {display:grid;place-items:center;width:24px;height:24px; border:2px outset #fff; background:#c0c0c0; padding:0;font:bold 15px Arial;}
.mine-cell.open {background:#bfbfbf; border:1px solid #808080; }
.mine-cell.flagged {color:#f00;}
.mine-cell[data-count="1"] {color:#00f;}.mine-cell[data-count="2"] {color:#008000;}.mine-cell[data-count="3"] {color:#f00;}.mine-cell[data-count="4"] {color:#000080;}.mine-cell[data-count="5"] {color:#800000;}.mine-cell[data-count="6"] {color:#008080;}
.mine-instructions {font-size:11px;line-height:1.4;margin:9px 0 0;}
.mobile-flag {display:none; margin:8px 0 0; align-items:center;gap:8px;}
.mobile-flag input {accent-color:#000080;}
@media(max-width:720px) {
  .program-manager {width:calc(100vw - 10px);height:calc(100dvh - 10px);left:5px;top:5px;transform:none;}
  .manager-status {font-size:10px;}
  .group-window {left:6px;right:6px;top:7px;height:calc(100% - 108px);}
  .group-items {grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:89px; padding:13px 4px;}
  .group-shelf {bottom:2px;height:84px; gap:4px;left:6px;padding:0;}
  .group-choice {width:94px;}
  .desktop-note {display:none;}
  .app-window {left:8px!important; top:52px!important; width:calc(100vw - 16px)!important; max-height:calc(100dvh - 59px)!important;transform:none!important;}
  .notepad-content {font-size:12px; line-height:1.43; padding:11px 12px; }
  .mobile-flag {display:flex;}
}
@media(max-width:390px) {
  .group-items {grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:78px;padding:6px 2px;}
  .program-icon {width:34px;height:34px;}
  .program-item,.group-choice {font-size:12px;}
  .group-window {height:calc(100% - 102px);}
  .group-shelf {height:77px;}
  .group-choice {width:78px;}
  .manager-status span:last-child {display:none;}
}
@media(max-height:610px) and (min-width:721px) {
 .program-manager {height:calc(100dvh - 16px);top:8px;}
 .group-window {height:calc(100% - 94px);}
 .group-shelf {height:70px;}
 .group-choice .program-icon {width:30px;height:30px;}
}
@media(max-height:530px) and (max-width:720px) {
 .group-items {grid-auto-rows:65px; padding-top:3px;}
 .group-items .program-icon {width:29px;height:29px;}
 .group-shelf {height:58px;}
 .group-shelf .program-icon {width:25px;height:25px;}
 .group-window {height:calc(100% - 78px);}
 .group-choice {font-size:11px;gap:1px;}
}
@media(prefers-reduced-motion:reduce) { * {scroll-behavior:auto!important;} }
.manager-fullscreen {left:3px; top:3px; width:calc(100vw - 6px); height:calc(100dvh - 6px); transform:none;}
@media(max-width:720px) {.manager-fullscreen {left:3px;top:3px;width:calc(100vw - 6px);height:calc(100dvh - 6px);}}

@media(max-height:570px) { .notepad-content { font-size:11px; line-height:1.27; padding:9px 12px; } .notepad-content p {margin-bottom:9px;} }
