/* desktop.css — the desktop itself, taskbar, start menu, boot/shutdown/BSOD screens, and app skins */

body {
  background: var(--desktop-teal);
  overflow: hidden;
  user-select: none;
}

[hidden] { display: none !important; }

/* ---------- full-screen overlays ---------- */

.screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  cursor: default;
}

#boot {
  background: #000;
  color: #aaa;
  font-family: var(--mono);
  font-size: 15px;
  padding: 24px 32px;
}
#boot pre { margin: 0; white-space: pre-wrap; font: inherit; }
#boot pre::after { content: "_"; animation: blink 1s steps(1) infinite; }
#boot .energy { position: absolute; right: 32px; top: 24px; color: #4f4; border: 2px solid #4f4; padding: 4px 8px; font-weight: bold; }

#splash {
  background: #111 url("../assets/art/splash.jpg") center / contain no-repeat;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-direction: column;
  padding-bottom: 6vh;
}
/* the splash artwork already shows the dsizzle.exe logo, so the text logo would double it */
#splash .logo { display: none; }
#splash .logo {
  font: bold 64px/1 Impact, "Arial Black", sans-serif;
  color: #000;
  letter-spacing: 2px;
  text-shadow: 3px 3px 0 #fff, 6px 6px 0 #808080;
}
#splash .logo b { color: var(--desktop-teal); }
#splash .sub { margin-top: 12px; font-size: 14px; color: #ddd; text-shadow: 1px 1px 0 #000; }
#splash .bar {
  margin-top: 40px;
  width: 320px; height: 14px;
  border: 1px solid #000;
  background: repeating-linear-gradient(90deg, #000080 0 12px, #1084d0 12px 16px, transparent 16px 20px);
  background-size: 200% 100%;
  animation: bar 1.4s linear infinite;
}
@keyframes bar { from { background-position: 0 0; } to { background-position: 80px 0; } }

#shutdown { background: #000; color: #ff8000; font: bold 26px/1.3 var(--mono); display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; }
#shutdown .p1, #shutdown .p2 { display: none; }
#shutdown.phase1 .p1 { display: block; color: #ccc; font-size: 20px; }
#shutdown.phase2 .p2 { display: block; }

#bsod {
  background: #0000aa;
  color: #fff;
  font: 16px/1.35 var(--mono);
  padding: 8vh 10vw;
  white-space: pre-wrap;
}
#bsod .t { background: #aaa; color: #0000aa; padding: 0 8px; display: inline-block; margin-bottom: 1em; }

#screensaver { background: #000; overflow: hidden; }
#screensaver .ss-text {
  position: absolute;
  left: 0; top: 0;
  font: bold 48px/1 Impact, "Arial Black", sans-serif;
  color: #0f0;
  letter-spacing: 2px;
  will-change: transform;
}

@keyframes blink { 50% { opacity: 0; } }

/* ---------- desktop ---------- */

#desktop {
  position: fixed;
  inset: 0;
  background: var(--desktop-teal) url("../assets/wallpaper.png") center / cover no-repeat;
}
#desktop.no-wallpaper { background-image: none; }

#icons {
  position: absolute;
  inset: 0 0 28px 0;
  padding: 6px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 4px;
}
.icon {
  width: 76px;
  height: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  outline: none;
  touch-action: manipulation;
}
.icon img { width: 32px; height: 32px; }
.icon span {
  color: #fff;
  text-align: center;
  text-shadow: 1px 1px 0 #000;
  padding: 0 2px;
  line-height: 1.2;
  word-break: break-word;
}
.icon.selected img { filter: brightness(0.6) sepia(1) hue-rotate(200deg) saturate(3); }
.icon.selected span { background: var(--dialog-blue); text-shadow: none; outline: 1px dotted #fff; outline-offset: -1px; }

#windows {
  position: absolute;
  inset: 0 0 28px 0;
  overflow: hidden;
  /* #windows covers exactly the same box as #icons and paints on top of it, so without
     this every click on a desktop icon lands here instead. Windows re-enable it below. */
  pointer-events: none;
}
#windows > .window { pointer-events: auto; }
.window.maximized {
  left: 0 !important; top: 0 !important;
  width: 100% !important; height: 100% !important;
}
.window.maximized .resize-handle { display: none; }

/* ---------- taskbar ---------- */

#taskbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 28px;
  background: var(--surface);
  box-shadow: inset 0 1px var(--button-highlight), inset 0 2px var(--button-face);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 2px 2px;
  z-index: 9000;
}
#startbtn {
  min-width: 0;
  padding: 0 6px 0 4px;
  height: 22px;
  min-height: 22px;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
#startbtn img { width: 16px; height: 16px; }
#taskbar .sep {
  width: 2px; height: 20px;
  box-shadow: inset 1px 0 var(--button-shadow), inset -1px 0 var(--button-highlight);
  flex: 0 0 2px;
  margin: 0 2px;
}
#tasks {
  flex: 1 1 auto;
  display: flex;
  gap: 3px;
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
  scrollbar-width: none;
}
#tasks::-webkit-scrollbar { display: none; }
#tasks .task {
  min-width: 60px;
  max-width: 160px;
  width: 160px;
  height: 22px;
  min-height: 22px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 160px;
}
#tasks .task img { width: 16px; height: 16px; flex: 0 0 16px; }
#tasks .task.pressed {
  box-shadow: var(--border-sunken-outer), var(--border-sunken-inner);
  background: repeating-conic-gradient(var(--surface) 0 25%, #fff 0 50%) 0 0 / 2px 2px;
  font-weight: bold;
}
#tray {
  flex: 0 0 auto;
  height: 22px;
  box-shadow: var(--border-status-field);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 6px;
}
#tray img { width: 16px; height: 16px; cursor: pointer; }
#clock { white-space: nowrap; }

/* ---------- start menu ---------- */

#startmenu {
  position: absolute;
  left: 2px;
  bottom: 28px;
  background: var(--surface);
  box-shadow: var(--border-window-outer), var(--border-window-inner);
  padding: 3px;
  display: flex;
  z-index: 9500;
  min-width: 190px;
}
#startmenu .banner {
  width: 24px;
  background: linear-gradient(0deg, var(--dialog-blue-light), var(--dialog-blue) 60%, #000 100%);
  color: var(--surface);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font: bold 18px/24px Arial, sans-serif;
  padding: 6px 0;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
}
#startmenu .banner b { color: #fff; }
#startmenu .items { flex: 1 1 auto; padding: 0; }
.sm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 24px 4px 6px;
  position: relative;
  white-space: nowrap;
}
.sm-item > img { width: 32px; height: 32px; flex: 0 0 32px; }
.sm-sub .sm-item { padding: 3px 20px 3px 6px; }
.sm-sub .sm-item > img { width: 16px; height: 16px; flex: 0 0 16px; }
.sm-item:hover, .sm-item.open { background: var(--dialog-blue); color: #fff; }
.sm-item.has-sub::after {
  content: "";
  position: absolute; right: 8px; top: 50%;
  border: 4px solid transparent;
  border-left-color: currentColor;
  transform: translateY(-50%);
}
.sm-item.checked > span::before { content: "\2713 "; }
.sm-sub {
  display: none;
  position: absolute;
  left: 100%;
  top: -3px;
  background: var(--surface);
  color: #000;
  box-shadow: var(--border-window-outer), var(--border-window-inner);
  padding: 3px;
  min-width: 170px;
}
.sm-item.open > .sm-sub { display: block; }
#startmenu hr {
  border: none;
  border-top: 1px solid var(--button-shadow);
  border-bottom: 1px solid var(--button-highlight);
  margin: 3px 2px;
}

/* ---------- dialogs ---------- */

.about { display: flex; gap: 14px; align-items: flex-start; }
.about img { width: 96px; height: auto; flex: 0 0 96px; box-shadow: var(--border-field); }
.find label, .run label, .shutdown-opts label { display: block; margin: 4px 0; }
.find .results .row { padding: 2px 4px; display: flex; align-items: center; gap: 4px; }
.run p { margin: 0 0 8px; }
.shutdown-opts p { margin: 0 0 6px; }

/* ---------- embeds ---------- */

.embed { display: block; width: 100%; height: 100%; border: 0; background: #000; }
.embed-empty {
  display: flex; align-items: center; justify-content: center;
  color: #0f0; font-family: var(--mono); text-align: center; padding: 12px; line-height: 1.5;
}
.embed-empty small { color: #8f8; }

/* ---------- Notepad ---------- */

.app-notepad textarea {
  flex: 1 1 auto;
  width: 100%;
  font: 13px/1.4 var(--mono);
  padding: 4px 6px;
  white-space: pre;
  overflow: auto;
  color: #000;
}

/* ---------- Explorer (My Computer) ---------- */

.explorer .addr { display: flex; align-items: center; gap: 6px; padding: 2px 4px; flex: 0 0 auto; }
.explorer .addr input { flex: 1 1 auto; }
.explorer .panes { flex: 1 1 auto; display: flex; min-height: 0; gap: 3px; }
.explorer .tree-pane { width: 170px; flex: 0 0 170px; overflow: auto; }
.explorer .content-pane { flex: 1 1 auto; overflow: auto; padding: 6px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 2px; }
.explorer .fs-item {
  width: 84px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 2px; text-align: center; word-break: break-word;
}
.explorer .fs-item.selected span { background: var(--dialog-blue); color: #fff; }
.explorer .fs-item img { width: 32px; height: 32px; }
.props { display: flex; flex-direction: column; gap: 8px; padding: 6px; flex: 1 1 auto; min-height: 0; }
.props .player { flex: 1 1 auto; min-height: 240px; background: #000; box-shadow: var(--border-field); }
.props table { border-collapse: collapse; }
.props td { padding: 2px 8px 2px 0; vertical-align: top; }
.props td:first-child { color: var(--button-shadow); white-space: nowrap; }

/* ---------- Recycle Bin ---------- */

.recycle .list-wrap { flex: 1 1 auto; overflow: auto; }
.recycle .why { padding: 6px; }
.recycle.shake { animation: shake .3s linear 2; }
@keyframes shake { 0%,100% { transform: translateX(0);} 25% { transform: translateX(-6px);} 75% { transform: translateX(6px);} }

/* ---------- MyReel.avi (Media Player) ---------- */

.mplayer { background: #000; }
.mplayer .screen-area { flex: 1 1 auto; min-height: 0; background: #000; position: relative; }
.mplayer .screen-area > * { position: absolute; inset: 0; }
/* the click-for-sound badge sits over the video rather than filling the area */
.mplayer .screen-area > .sound-cta {
  inset: auto auto 12px 12px;
  width: auto; height: auto;
  display: flex; align-items: center; gap: 6px;
  padding: 7px 11px;
  font: bold 12px var(--font);
  color: #fff; background: rgba(0,0,0,.75);
  border: 1px solid #fff; box-shadow: 2px 2px 0 rgba(0,0,0,.5);
  cursor: pointer; z-index: 5;
}
.mplayer .screen-area > .sound-cta:hover { background: rgba(0,0,0,.9); }
.mplayer .screen-area > .sound-cta:active { transform: translate(1px, 1px); }
.mplayer .controls {
  flex: 0 0 auto;
  background: var(--surface);
  padding: 3px 4px;
  display: flex; align-items: center; gap: 3px;
}
.mplayer .controls button { min-width: 26px; width: 26px; min-height: 22px; padding: 0; font-size: 12px; }
.mplayer .seek {
  flex: 1 1 auto; height: 10px; margin: 0 6px;
  box-shadow: var(--border-field); background: #fff; position: relative;
}
.mplayer .seek i { position: absolute; left: 0; top: 2px; bottom: 2px; width: 0; background: var(--dialog-blue); }
.mplayer .readout {
  flex: 0 0 auto;
  background: #000; color: #0f0;
  font: 11px var(--mono);
  padding: 2px 6px;
  display: flex; justify-content: space-between;
}
.mplayer .playlist { flex: 0 0 auto; max-height: 120px; overflow: auto; background: #fff; box-shadow: var(--border-field); }
.mplayer .playlist div { padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mplayer .playlist div.now { background: var(--dialog-blue); color: #fff; }
.mplayer .playlist div small { color: #808080; }
.mplayer .playlist div.now small { color: #cfe; }

/* ---------- Winamp ---------- */

.winamp { background: #232323; color: #ccc; padding: 4px; font-family: var(--font); }
.winamp .wa-main {
  background: #232323 url("../assets/art/winamp-skin.jpg") center / cover;
  border: 1px solid #000;
  box-shadow: inset 1px 1px #5a5a5a;
  padding: 6px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  flex: 0 0 auto;
}
.winamp .wa-lcd {
  background: #000;
  color: #00ff00;
  font: bold 22px/1 var(--mono);
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #333;
}
.winamp .wa-lcd .state { font-size: 12px; color: #0a0; width: 14px; }
.winamp .wa-lcd canvas { flex: 1 1 auto; height: 28px; width: 100%; image-rendering: pixelated; }
.winamp .wa-marquee {
  background: #000; color: #00ff00;
  font: 11px/16px var(--mono);
  height: 16px; overflow: hidden; white-space: nowrap; position: relative;
  border: 1px solid #333;
}
.winamp .wa-marquee span { position: absolute; left: 0; white-space: nowrap; animation: marquee 12s linear infinite; padding-left: 100%; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.winamp .wa-meta { display: flex; gap: 10px; font: 10px var(--mono); color: #0f0; }
.winamp .wa-meta span { background: #000; padding: 1px 4px; border: 1px solid #333; }
.winamp .wa-row { display: flex; align-items: center; gap: 4px; }
.winamp .wa-row input[type=range] { flex: 1 1 auto; accent-color: #0f0; }
.winamp .wa-btns button {
  min-width: 26px; width: 26px; min-height: 20px; padding: 0;
  background: linear-gradient(180deg, #4a4a4a, #222);
  color: #ddd; box-shadow: inset 1px 1px #666, inset -1px -1px #000; font-size: 11px;
}
.winamp .wa-btns button.on { color: #0f0; box-shadow: inset -1px -1px #666, inset 1px 1px #000; }
.winamp .wa-btns button:active { box-shadow: inset -1px -1px #666, inset 1px 1px #000; padding: 1px 0 0 1px; }
.winamp .wa-pl {
  flex: 1 1 auto; min-height: 60px; overflow: auto;
  background: #000; border: 1px solid #333; margin-top: 4px;
  font: 11px/16px var(--mono); color: #0f0;
}
.winamp .wa-pl div { padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; }
.winamp .wa-pl div span:first-child { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
.winamp .wa-pl div.now { color: #fff; background: #0000a0; }
.winamp .wa-pl .none { color: #888; padding: 6px; white-space: normal; display: block; }

/* ---------- Solitaire ---------- */

.solitaire { background: #008000; }
.solitaire .table {
  flex: 1 1 auto; position: relative; overflow: auto;
  background: #008000;
  --cw: 62px; --ch: 86px; --gap: 8px;
}
.solitaire .pile {
  position: absolute; width: var(--cw); height: var(--ch);
  border: 1px solid rgba(0,0,0,.35); border-radius: 3px;
}
.solitaire .pile.stock::after {
  content: "\21bb"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: rgba(0,0,0,.4); font-size: 28px;
}
.solitaire .card {
  position: absolute; left: -1px; top: -1px;
  width: var(--cw); height: var(--ch);
  border-radius: 3px; border: 1px solid #000;
  background: #fff;
  font: bold 14px/1 Arial, sans-serif;
  box-shadow: 1px 1px 0 rgba(0,0,0,.3);
  touch-action: none;
}
.solitaire .card.red { color: #d00; }
.solitaire .card.black { color: #000; }
.solitaire .card .tl, .solitaire .card .br { position: absolute; line-height: 1; text-align: center; }
.solitaire .card .tl { left: 3px; top: 3px; }
.solitaire .card .br { right: 3px; bottom: 3px; transform: rotate(180deg); }
.solitaire .card .mid { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 28px; }
.solitaire .card.back {
  background: #1a4fb4 url("../assets/art/cardback.png") center / cover;
  border: 1px solid #000; box-shadow: inset 0 0 0 3px #fff, 1px 1px 0 rgba(0,0,0,.3);
}
.solitaire .card.selected { outline: 3px solid #ff0; outline-offset: -3px; }
.solitaire .card.dragging { pointer-events: none; z-index: 1000; box-shadow: 4px 4px 6px rgba(0,0,0,.4); }
.solitaire .pile.drop-ok { box-shadow: 0 0 0 2px #ff0; }
.solitaire .status-bar { background: var(--surface); }
#cascade { position: fixed; inset: 0; z-index: 9800; }

/* ---------- Minesweeper ---------- */

.minesweeper .ms-wrap { padding: 6px; display: inline-flex; flex-direction: column; gap: 6px; box-shadow: var(--border-raised-outer), var(--border-raised-inner); margin: 3px; align-self: flex-start; }
.minesweeper .ms-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 6px;
  box-shadow: var(--border-sunken-outer), var(--border-sunken-inner);
}
.minesweeper .lcd {
  background: #000; color: #f00;
  font: bold 22px/1 var(--mono);
  padding: 1px 3px; min-width: 42px; text-align: right;
  box-shadow: var(--border-status-field);
}
.minesweeper .smiley {
  width: 26px; height: 26px; min-width: 26px; min-height: 26px; padding: 0;
  font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.minesweeper .grid {
  display: grid;
  gap: 0;
  box-shadow: var(--border-sunken-outer), var(--border-sunken-inner);
  padding: 3px;
  touch-action: manipulation;
}
.minesweeper .cell {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font: bold 13px/1 Arial, sans-serif;
  background: var(--surface);
  box-shadow: inset -2px -2px var(--button-shadow), inset 2px 2px var(--button-highlight);
  user-select: none;
}
.minesweeper .cell.open { box-shadow: inset 1px 1px var(--button-shadow); }
.minesweeper .cell.open.mine { background: #f00; }
.minesweeper .cell.n1 { color: #0000ff; } .minesweeper .cell.n2 { color: #008000; }
.minesweeper .cell.n3 { color: #ff0000; } .minesweeper .cell.n4 { color: #000080; }
.minesweeper .cell.n5 { color: #800000; } .minesweeper .cell.n6 { color: #008080; }
.minesweeper .cell.n7 { color: #000000; } .minesweeper .cell.n8 { color: #808080; }
.minesweeper .cell.wrong { background: #f88; }

/* ---------- CALL_DAVE.BAT ---------- */

.dos { background: #000; }
.dos .term {
  flex: 1 1 auto; overflow: auto;
  background: #000; color: #c0c0c0;
  font: 14px/1.35 var(--mono);
  padding: 6px 8px;
  white-space: pre-wrap;
  word-break: break-word;
}
.dos .term .cur::after { content: "_"; animation: blink 1s steps(1) infinite; }
.dos .term a { color: #5ff; }
.dos .term .hi { color: #fff; }
.dos .term .warn { color: #ff5; }
.dos .term .bad { color: #f55; }

/* ---------- mobile ---------- */

@media (max-width: 640px) {
  #icons { flex-direction: row; align-content: flex-start; justify-content: flex-start; gap: 2px; padding: 8px 4px; }
  .icon { width: 30%; }
  .window { min-width: 0; }
  .window.maximized { padding: 2px; }
  #tasks .task { width: 110px; flex-basis: 110px; }
  .explorer .tree-pane { display: none; }
  .solitaire .table { --cw: 44px; --ch: 62px; --gap: 4px; }
  .solitaire .card { font-size: 11px; }
  .solitaire .card .mid { font-size: 20px; }
  .minesweeper .cell { width: 24px; height: 24px; }
  #splash .logo { font-size: 40px; }
  #bsod { font-size: 12px; padding: 20px; }
  .about { flex-direction: column; }
}
