/* RUGSWEEPER 95 desktop: window manager, apps, Rugsy, BSOD, screensaver (js/desktop.js, js/desktopApps.js) */

.icon[hidden] { display: none !important; }
.icon img.icon-pic { image-rendering: pixelated; }

/* Right-hand icon group; flows right-to-left so the first icon hugs the edge. */
.icons-r { left: auto; right: 6px; bottom: 84px; direction: rtl; }
.icons-r > .icon { direction: ltr; }

/* Returning visit: Main Menu is the big centred icon. */
.icon-big { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -60%); }
.icon-big .icon-pic { width: 64px; height: 64px; }
.icon-big .icon-label { width: calc(var(--w) * 2px); height: calc(var(--h) * 2px); max-width: none; }

@media (max-width: 640px) {
  .icons-r { top: auto; bottom: calc(84px + env(safe-area-inset-bottom)); left: 6px; right: 6px; direction: ltr; }
}

/* Taskbar buttons */
.taskbar { gap: 4px; }
.tasks { flex: 1; display: flex; gap: 3px; min-width: 0; overflow: hidden; }
.task-btn {
  display: inline-flex; align-items: center; gap: 4px; flex: 0 1 160px; min-width: 36px; height: 32px; padding: 0 6px;
  font: 13px Tahoma, Verdana, Geneva, sans-serif; color: #000; background: #c0c0c0; text-align: left;
  border: 2px solid; border-color: #fff #000 #000 #fff; box-shadow: inset -1px -1px 0 #808080; cursor: pointer;
}
.task-btn span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.task-btn.down { border-color: #000 #fff #fff #000; box-shadow: inset 1px 1px 0 #808080; background: #dcdcdc; font-weight: bold; }
.win-ico { width: 16px; height: 16px; flex: none; image-rendering: pixelated; }
@media (max-width: 640px) { .task-btn span { display: none; } .task-btn { flex: 0 0 auto; } .tray-token { display: none; } }

/* Start menu Programs flyout */
.start-menu { overflow: visible; }
.sm-sub { position: relative; }
.sm-arrow { margin-left: auto; }
.sm-pix { width: 24px; height: 24px; image-rendering: pixelated; }
.sm-flyout {
  position: absolute; left: calc(100% - 4px); top: 0; min-width: 220px; padding: 2px;
  background: #c0c0c0; border: 2px solid; border-color: #fff #000 #000 #fff; box-shadow: inset -2px -2px 0 #808080;
}
.sm-flyout[hidden] { display: none; }
.sm-flyout button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 10px; border: 0; background: none;
  font: 14px Tahoma, Verdana, Geneva, sans-serif; text-align: left; cursor: pointer; color: #000;
}
.sm-flyout button:hover { background: #000080; color: #fff; }
@media (max-width: 640px) { .sm-flyout { left: 24px; top: auto; bottom: 100%; } }

/* Windows */
.win[hidden] { display: none !important; }
.win:not(.active) .win-title { background: #808080; color: #c0c0c0; }
.win-name { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.win-ctl { display: flex; gap: 2px; flex: none; }
.win-min, .win-max {
  position: relative; width: 20px; height: 18px; padding: 0; background: #c0c0c0;
  border: 2px solid; border-color: #fff #000 #000 #fff; cursor: pointer;
}
.win-min i { position: absolute; left: 4px; bottom: 3px; width: 7px; height: 2px; background: #000; }
.win-max i { position: absolute; left: 3px; top: 2px; width: 9px; height: 7px; border: 1px solid #000; border-top-width: 2px; }
.win.max .win-max i { width: 6px; height: 5px; left: 5px; top: 1px; box-shadow: -3px 3px 0 -1px #c0c0c0, -3px 3px 0 0 #000; }
.win-ctl .win-x { margin-left: 2px; }
.win.app { display: flex; flex-direction: column; min-width: 200px; }
.win.app .win-body { flex: 1; min-height: 0; overflow: auto; padding: 2px; display: flex; flex-direction: column; }
.win.app .win-body > * { flex: 1; min-height: 0; }
.win.max { left: 0 !important; top: 0 !important; width: 100% !important; max-width: none; height: calc(100% - 42px - env(safe-area-inset-bottom)) !important; }
.win.shake { animation: w95shake 0.1s 4; }
@keyframes w95shake { 50% { transform: translateX(6px); } }

/* Notepad inside an app window */
.np-wrap { display: flex; flex-direction: column; }
.np-wrap .notepad { flex: 1; width: auto; height: auto; min-height: 0; }

/* Explorer */
.ex-wrap { display: flex; flex-direction: column; }
.ex-tools { padding: 2px 4px 4px; }
.ex-view {
  flex: 1; min-height: 0; overflow: auto; background: #fff; border: 2px solid; border-color: #808080 #fff #fff #808080;
  display: flex; flex-wrap: wrap; align-content: flex-start; gap: 4px; padding: 6px;
}
.ex-view .icon { width: 96px; color: #000; }
.ex-view .icon-label { filter: invert(1); }
.ex-view .icon.sel .icon-label { filter: none; }
.ex-empty { color: #808080; margin: 8px; font-size: 13px; }
.ex-status { padding: 3px 6px; font-size: 12px; border: 1px solid; border-color: #808080 #fff #fff #808080; margin-top: 2px; }
.gain-shot { display: block; width: 100%; height: auto; image-rendering: auto; }
.viewer .win-body { background: #000; }

/* Rugsplorer */
.rx-wrap { display: flex; flex-direction: column; }
.rx-addr { display: flex; align-items: center; gap: 6px; padding: 2px 4px 4px; font-size: 12px; }
.rx-addr input { flex: 1; min-width: 0; height: 22px; font: 12px Tahoma, sans-serif; border: 2px solid; border-color: #808080 #fff #fff #808080; padding: 0 4px; }
.rx-addr .w95-btn { min-width: 40px; height: 24px; }
.rx-page {
  flex: 1; overflow: auto; padding: 10px 14px; text-align: center; color: #ffff00; font-family: "Times New Roman", Times, serif;
  background: #000 radial-gradient(#ffffff 1px, transparent 1px) 0 0 / 23px 23px;
  border: 2px solid; border-color: #808080 #fff #fff #808080;
}
.rx-page a { color: #00ffff; }
.rx-page a:visited { color: #ff66ff; }
.rx-marquee { overflow: hidden; white-space: nowrap; background: #000080; color: #fff; font: bold 13px "Courier New", monospace; padding: 3px 0; }
.rx-marquee span { display: inline-block; padding-left: 100%; animation: rxmarq 18s linear infinite; }
@keyframes rxmarq { to { transform: translateX(-100%); } }
.rx-h1 { margin: 12px 0 4px; font: bold 34px "Comic Sans MS", "Comic Sans", cursive; color: #2fe07a; text-shadow: 3px 3px 0 #ff00ff; }
.rx-blink { color: #ff3b4a; font-weight: bold; animation: rxblink 1s steps(1) infinite; }
@keyframes rxblink { 50% { visibility: hidden; } }
.rx-uc { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; background: #ffd21a; color: #000; font: bold 13px Arial, sans-serif; }
.rx-uc i { width: 26px; height: 12px; background: repeating-linear-gradient(45deg, #000 0 6px, #ffd21a 6px 12px); }
.rx-table { margin: 14px auto; border: 3px ridge #c0c0c0; border-spacing: 8px; color: #fff; font-size: 15px; line-height: 1.6; }
.rx-table td { vertical-align: top; padding: 6px 12px; border: 2px groove #808080; text-align: left; }
.rx-soon { color: #c0c0c0; }
.rx-counter { display: inline-flex; gap: 2px; margin: -6px 0 10px; }
.rx-counter b { width: 16px; background: #000; color: #2fe07a; border: 1px solid #555; font: bold 16px "Courier New", monospace; }
.rx-guest { margin: 6px auto; max-width: 420px; padding: 8px; border: 3px double #ff00ff; color: #fff; text-align: left; font-size: 14px; }
.rx-guest p { margin: 4px 0; }
.rx-guest i { color: #ffd21a; }
.rx-foot { font-size: 12px; color: #c0c0c0; }

/* MS Pump */
.mp-wrap { display: flex; flex-direction: column; }
.mp-main { flex: 1; display: flex; gap: 4px; min-height: 0; }
.mp-tools { display: grid; grid-template-columns: 28px; align-content: start; gap: 2px; }
.mp-tool { width: 28px; height: 28px; padding: 0; font-size: 15px; background: #c0c0c0; border: 2px solid; border-color: #fff #000 #000 #fff; cursor: pointer; }
.mp-tool.on { border-color: #000 #fff #fff #000; background: #e0e0e0; }
.mp-canvas { flex: 1; min-width: 0; overflow: auto; background: #808080; padding: 4px; }
.mp-canvas canvas { display: block; max-width: 100%; background: #fff; touch-action: none; cursor: crosshair; }
.mp-palette { display: flex; align-items: center; gap: 2px; padding: 4px 0 0; flex-wrap: wrap; }
.mp-col { width: 20px; height: 20px; padding: 0; border: 2px solid; border-color: #808080 #fff #fff #808080; cursor: pointer; }
.mp-col.on { outline: 2px solid #000; outline-offset: 1px; }
.mp-hint { margin-left: 8px; font-size: 12px; }

/* Command prompt */
.cmd .win-body { background: #000; }
.cmd-wrap { overflow: auto; background: #000; color: #c0c0c0; font: 14px/1.3 "Courier New", monospace; padding: 4px 6px; cursor: text; }
.cmd-out div { white-space: pre-wrap; }
.cmd-line { display: flex; }
.cmd-in { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #c0c0c0; font: inherit; padding: 0 0 0 2px; caret-color: #c0c0c0; }

/* Calculator */
.calc-wrap { display: flex; flex-direction: column; gap: 6px; padding: 4px; }
.calc-disp { height: 32px; padding: 0 6px; background: #fff; border: 2px solid; border-color: #808080 #fff #fff #808080; text-align: right; font: 18px/28px "Courier New", monospace; overflow: hidden; white-space: nowrap; }
.calc-keys { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.calc-keys .w95-btn { min-width: 0; height: auto; min-height: 30px; padding: 0; }

/* Rugsweeper Lite */
.ml-wrap { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 3px solid; border-color: #fff #808080 #808080 #fff; flex: none !important; }
.ml-head { display: flex; justify-content: space-between; align-items: center; padding: 4px; border: 2px solid; border-color: #808080 #fff #fff #808080; }
.ml-head span { background: #000; color: #ff2020; font: bold 20px "Courier New", monospace; padding: 0 3px; }
.ml-face { width: 30px; height: 30px; padding: 0; font-size: 17px; background: #c0c0c0; border: 2px solid; border-color: #fff #808080 #808080 #fff; cursor: pointer; }
.ml-grid { display: grid; grid-template-columns: repeat(9, 22px); border: 3px solid; border-color: #808080 #fff #fff #808080; justify-content: center; }
.ml-c { width: 22px; height: 22px; padding: 0; background: #c0c0c0; border: 2px solid; border-color: #fff #808080 #808080 #fff; font: bold 13px Tahoma, sans-serif; cursor: default; touch-action: manipulation; }
.ml-c.on { border: 1px solid #808080; }
.ml-c.boom { background: #ff0000; }
.ml-c.flag { color: #c00000; }
.ml-c[data-n="1"] { color: #0000ff; } .ml-c[data-n="2"] { color: #008000; } .ml-c[data-n="3"] { color: #ff0000; } .ml-c[data-n="4"] { color: #000080; }

/* Message box extras */
.msg-ico.error { background: #c00000; }
.msg-ico.error::after { content: "✕"; font: bold 18px Tahoma, sans-serif; }
.msg code.det { display: block; margin-top: 8px; font: 12px "Courier New", monospace; }
.sd label { display: block; margin: 6px 0; cursor: pointer; }
.w95-btn:disabled { color: #808080; text-shadow: 1px 1px 0 #fff; }

/* Rugsy */
.rugsy { position: absolute; right: 130px; bottom: 52px; z-index: 9000; display: flex; flex-direction: column; align-items: flex-end; animation: rugsyIn 0.35s ease-out; font-family: Tahoma, Verdana, sans-serif; }
@keyframes rugsyIn { from { transform: translateY(30px); opacity: 0; } }
.rugsy-bubble { position: relative; max-width: 240px; padding: 10px 12px; margin-bottom: 10px; background: #ffffe1; color: #000; border: 1px solid #000; border-radius: 8px; font-size: 13px; box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.25); }
.rugsy-bubble::after { content: ""; position: absolute; right: 40px; bottom: -10px; border: 10px solid transparent; border-bottom: 0; border-top-color: #ffffe1; }
.rugsy-bubble p { margin: 0 0 8px; line-height: 1.35; }
.rugsy-btns { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.rugsy-btns .w95-btn { min-width: 0; height: 24px; font-size: 12px; padding: 0 8px; }
.rugsy-art { width: 64px; height: 80px; margin-right: 18px; animation: rugsyBob 2.4s ease-in-out infinite; }
.rugsy-eye { animation: rugsyLook 4s infinite; }
@keyframes rugsyBob { 50% { transform: translateY(-4px) rotate(-3deg); } }
@keyframes rugsyLook { 0%, 40% { transform: none; } 50%, 90% { transform: translateX(-3px); } }

/* BSOD, boot, screensaver, shut down */
.bsod { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: #0000aa; color: #fff; font: clamp(13px, 2vw, 18px)/1.5 "Courier New", monospace; cursor: pointer; }
.bsod > div { max-width: 720px; }
.bsod-h { display: block; width: max-content; margin: 0 auto 18px; background: #aaa; color: #0000aa; font-weight: bold; }
.bsod-c { text-align: center; }
.boot95 { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: linear-gradient(#5a9ad8, #1c4f9c); color: #fff; font-family: Tahoma, sans-serif; }
.boot95 b { font-size: clamp(28px, 6vw, 56px); letter-spacing: 0.04em; }
.boot95 span { font-size: 28px; color: #ffd21a; font-weight: bold; }
.boot95 i { width: 200px; height: 8px; background: repeating-linear-gradient(90deg, #000080 0 20px, #1e64f0 20px 40px); background-size: 80px 8px; animation: bootbar 0.8s linear infinite; }
@keyframes bootbar { to { background-position: 80px 0; } }
.saver { position: fixed; inset: 0; z-index: 99; width: 100vw; height: 100vh; background: #000; cursor: none; }

/* Tray: live $SWEEP mcap (js/desktop.js paintTray) */
.tray-mkt { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 6px; font: 12px Tahoma, Verdana, Geneva, sans-serif; color: #000; background: transparent; border: 0; cursor: pointer; white-space: nowrap; }
.tray-mkt:hover { background: rgba(0, 0, 0, 0.06); }
.tray-mkt .tray-cap { font-weight: bold; }
.tray-chg.up { color: #007a2a; }
.tray-chg.down { color: #b00000; }
.tray-chg:empty { display: none; }
@media (max-width: 640px) { .tray-mkt .tray-token { display: none; } .tray-mkt { padding: 0 3px; gap: 3px; font-size: 11px; } .tray-mkt .tray-chg { display: none; } }
/* Buy $SWEEP window */
.buy95 { padding: 10px 12px; font: 12px Tahoma, Verdana, Geneva, sans-serif; color: #000; max-width: 360px; }
.buy95 p { margin: 0 0 8px; }
.buy95-ca { margin: 0 0 10px; }
.buy95-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.buy95-act .lk-lastbuy { flex-basis: 100%; order: 3; color: #007a2a; font-family: Tahoma, Arial, sans-serif; letter-spacing: 0; font-size: 11px; }
.buy95-act .lk-lastbuy::before { background: #00a83a; box-shadow: none; }
.buy95-fine { margin-top: 10px !important; color: #555; font-size: 11px; }
.rx-loop { margin: 6px auto; max-width: 420px; padding: 8px; border: 3px ridge #ffd21a; color: #ffd21a; text-align: left; font-size: 13px; }
.rx-loop ul { margin: 4px 0 0; padding-left: 18px; color: #fff; }
