/* ==========================================================================
   NINJACAT OS — STYLESHEET
   Retro 95/98-inspired desktop UI, entirely CSS (no screenshot backgrounds).
   ========================================================================== */

@font-face {
  font-family: "PixelSans";
  src: local("Tahoma"), local("Segoe UI");
}

:root {
  --teal:        #008080;
  --teal-dark:   #005f5f;
  --win-gray:    #c0c0c0;
  --win-gray-lt: #dfdfdf;
  --win-white:   #ffffff;
  --win-dark:    #808080;
  --win-black:   #000000;
  --navy:        #000080;
  --navy-lt:     #1084d0;
  --inactive-title: #808080;
  --accent:      #ff6a00;
  --accent-2:    #ffb100;
  --font-ui: "Tahoma", "MS Sans Serif", "Segoe UI", "Pixelated MS Sans Serif", Geneva, Verdana, sans-serif;
  --font-mono: "Consolas", "Lucida Console", "Courier New", monospace;
  --radius: 0px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: var(--font-ui);
  background: #000;
  -webkit-tap-highlight-color: transparent;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

button { font-family: var(--font-ui); }

/* Reduced motion: kill non-essential animation globally */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ============================= BEVELS ============================= */
.raised {
  border-top: 2px solid var(--win-white);
  border-left: 2px solid var(--win-white);
  border-right: 2px solid var(--win-black);
  border-bottom: 2px solid var(--win-black);
  box-shadow: inset 1px 1px 0 var(--win-gray-lt), inset -1px -1px 0 var(--win-dark);
}
.sunken {
  border-top: 2px solid var(--win-black);
  border-left: 2px solid var(--win-black);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
  box-shadow: inset 1px 1px 0 var(--win-dark), inset -1px -1px 0 var(--win-gray-lt);
}

.btn-95 {
  background: var(--win-gray);
  border-top: 2px solid var(--win-white);
  border-left: 2px solid var(--win-white);
  border-right: 2px solid var(--win-black);
  border-bottom: 2px solid var(--win-black);
  padding: 5px 14px;
  font-size: 12px;
  color: #000;
  cursor: pointer;
  min-height: 30px;
}
.btn-95:active,
.btn-95.pressed {
  border-top: 2px solid var(--win-black);
  border-left: 2px solid var(--win-black);
  border-right: 2px solid var(--win-white);
  border-bottom: 2px solid var(--win-white);
  padding: 6px 13px 4px 15px;
}
.btn-95:focus-visible {
  outline: 1px dotted #000;
  outline-offset: -4px;
}
.btn-95:disabled { color: #808080; text-shadow: 1px 1px 0 var(--win-white); cursor: default; }

/* ============================= BOOT SCREEN ============================= */
#boot-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: #000;
  color: #c0c0c0;
  font-family: var(--font-mono);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  padding: 6vw;
}
#boot-screen[hidden] { display: none; }
.boot-inner { max-width: 640px; }
#boot-lines { font-size: clamp(12px, 2.4vw, 17px); line-height: 1.9; white-space: pre-wrap; }
#boot-lines .line { opacity: 0; animation: boot-in 0.15s forwards; }
#boot-lines .line.ok { color: #33ff66; }
@keyframes boot-in { to { opacity: 1; } }
.boot-cursor {
  display: inline-block; font-size: clamp(12px, 2.4vw, 17px);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.boot-bar-wrap { margin-top: 22px; width: min(70vw, 420px); }
.boot-bar-track {
  height: 14px; background: #111; border: 1px solid #33ff66; padding: 2px;
}
.boot-bar-fill { height: 100%; width: 0%; background: repeating-linear-gradient(90deg, #33ff66 0 6px, #0a0 6px 8px); transition: width 0.12s linear; }
#skip-boot {
  position: absolute; bottom: 24px; right: 24px;
  background: transparent; color: #33ff66; border: 1px solid #33ff66;
  font-family: var(--font-mono); font-size: 12px; padding: 8px 14px; cursor: pointer;
}
#skip-boot:hover { background: #33ff6622; }

/* ============================= DESKTOP ============================= */
#desktop {
  position: fixed; inset: 0;
  background:
    radial-gradient(1200px 800px at 15% -10%, #14a3a3 0%, transparent 60%),
    var(--teal);
  overflow: hidden;
  user-select: none;
  display: flex; flex-direction: column;
}
body.wallpaper-sky #desktop {
  background:
    linear-gradient(180deg, #06122e 0%, #0b2a5c 45%, #163f7a 100%);
}
body.wallpaper-sky #desktop::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 10% 20%, #fff 100%, transparent),
    radial-gradient(1px 1px at 30% 60%, #fff 100%, transparent),
    radial-gradient(1px 1px at 50% 15%, #fff 100%, transparent),
    radial-gradient(1px 1px at 70% 45%, #fff 100%, transparent),
    radial-gradient(1px 1px at 85% 75%, #fff 100%, transparent),
    radial-gradient(1px 1px at 92% 25%, #fff 100%, transparent),
    radial-gradient(1px 1px at 20% 85%, #fff 100%, transparent),
    radial-gradient(1px 1px at 60% 90%, #fff 100%, transparent);
  opacity: 0.8;
}

/* Dojo — dark, red-black, original pattern (no external assets) */
body.wallpaper-dojo #desktop {
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.02) 0 2px, transparent 2px 40px),
    linear-gradient(160deg, #1a0505 0%, #2b0a0a 40%, #3d0f0f 100%);
}
body.wallpaper-dojo #desktop::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: radial-gradient(circle at 50% 45%, rgba(255,90,60,0.18) 0%, transparent 55%);
}

/* Sunset grid — original retro synthwave-style gradient, no external assets */
body.wallpaper-sunset #desktop {
  background: linear-gradient(180deg, #2b0f4a 0%, #6a1b6b 35%, #d94f70 65%, #ff8a4c 100%);
}
body.wallpaper-sunset #desktop::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 45%; pointer-events: none;
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.18) 0 2px, transparent 2px 60px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.14) 0 2px, transparent 2px 34px);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 35%);
  mask-image: linear-gradient(180deg, transparent, #000 35%);
}

/* Code rain — original dark-green terminal-inspired pattern, no external assets */
body.wallpaper-matrix #desktop {
  background: linear-gradient(180deg, #010a03 0%, #041c0a 100%);
}
body.wallpaper-matrix #desktop::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background-image: repeating-linear-gradient(90deg, rgba(51,255,102,0.15) 0 1px, transparent 1px 22px);
}

#icon-layer {
  flex: 1;
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(auto-fill, 92px);
  grid-auto-columns: 88px;
  justify-content: start;
  gap: 2px 6px;
  padding: 10px 10px 118px 10px;
  align-content: start;
  height: 100%;
}

.d-icon {
  width: 84px;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 6px 2px;
  cursor: pointer;
  border: 1px dotted transparent;
}
.d-icon .glyph {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.5));
}
.d-icon .label {
  color: #fff; font-size: 11px; text-align: center;
  text-shadow: 1px 1px 1px #000;
  padding: 1px 3px;
  line-height: 1.25;
  max-width: 82px;
}
.d-icon.selected .glyph { background: rgba(0,0,128,0.4); }
.d-icon.selected .label { background: var(--navy); outline: 1px dotted #fff; outline-offset: 1px; }
.d-icon:focus-visible { outline: 1px dotted #fff; }
.d-icon.priority .glyph { font-size: 30px; }

/* =========================== CONTEXT MENU =========================== */
.context-menu {
  position: fixed; z-index: 4000;
  list-style: none; margin: 0; padding: 2px;
  background: var(--win-gray);
  min-width: 180px;
  font-size: 12px;
}
.context-menu[hidden] { display: none; }
.context-menu li {
  padding: 5px 10px 5px 22px;
  cursor: pointer;
  position: relative;
}
.context-menu li:hover { background: var(--navy); color: #fff; }
.context-menu li.sep { height: 1px; padding: 0; margin: 3px 2px; border-top: 1px solid var(--win-dark); border-bottom: 1px solid var(--win-white); cursor: default; }
.context-menu li.sep:hover { background: none; }

/* =========================== START MENU =========================== */
#start-menu {
  position: fixed; left: 3px; bottom: 34px; z-index: 3500;
  width: 260px;
  display: flex;
  font-size: 13px;
}
#start-menu[hidden] { display: none; }
.start-sidebar {
  writing-mode: vertical-rl; transform: rotate(180deg);
  background: linear-gradient(180deg, var(--navy) 0%, #1084d0 100%);
  color: #fff; font-weight: 700; letter-spacing: 3px;
  padding: 10px 6px; font-size: 16px;
  display: flex; align-items: flex-end; justify-content: center;
}
.start-list { list-style: none; margin: 0; padding: 3px; flex: 1; background: var(--win-gray); }
.start-item {
  padding: 7px 10px; cursor: pointer; position: relative;
  display: flex; align-items: center; gap: 8px;
}
.start-item:hover, .start-item:focus-visible { background: var(--navy); color: #fff; outline: none; }
.start-icon { width: 18px; text-align: center; }
.start-item.sep, li.sep { height: 1px; padding: 0; margin: 4px 4px; border-top: 1px solid var(--win-dark); border-bottom: 1px solid var(--win-white); cursor: default; }
.start-sub {
  display: none;
  position: absolute; left: 100%; top: -3px;
  list-style: none; margin: 0; padding: 3px;
  background: var(--win-gray); min-width: 190px;
  box-shadow: 2px 2px 6px rgba(0,0,0,0.5);
}
.start-item.has-sub.open .start-sub,
.start-item.has-sub:hover .start-sub { display: block; }
.start-sub li { padding: 7px 10px; cursor: pointer; }
.start-sub li:hover { background: var(--navy); color: #fff; }

/* =========================== TASKBAR =========================== */
#taskbar {
  height: 34px;
  background: var(--win-gray);
  border-top: 2px solid var(--win-white);
  display: flex; align-items: center; gap: 6px;
  padding: 3px 4px;
  position: relative; z-index: 3000;
  flex-shrink: 0;
}
#start-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--win-gray);
  border-top: 2px solid var(--win-white); border-left: 2px solid var(--win-white);
  border-right: 2px solid var(--win-black); border-bottom: 2px solid var(--win-black);
  padding: 3px 10px 3px 6px; font-weight: 700; font-size: 13px; cursor: pointer;
  height: 27px;
}
#start-btn.active, #start-btn:active {
  border-top: 2px solid var(--win-black); border-left: 2px solid var(--win-black);
  border-right: 2px solid var(--win-white); border-bottom: 2px solid var(--win-white);
}
.ninja-flag { font-size: 15px; }
#taskbar-divider { width: 2px; align-self: stretch; border-left: 1px solid var(--win-dark); border-right: 1px solid var(--win-white); margin: 2px 2px; }
#taskbar-buttons { flex: 1; display: flex; gap: 4px; overflow: hidden; height: 27px; }
.task-btn {
  display: flex; align-items: center; gap: 6px;
  max-width: 165px; min-width: 100px;
  background: var(--win-gray);
  border-top: 2px solid var(--win-white); border-left: 2px solid var(--win-white);
  border-right: 2px solid var(--win-black); border-bottom: 2px solid var(--win-black);
  font-size: 12px; padding: 0 8px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  height: 27px;
}
.task-btn.active {
  border-top: 2px solid var(--win-black); border-left: 2px solid var(--win-black);
  border-right: 2px solid var(--win-white); border-bottom: 2px solid var(--win-white);
  background: #d4d0c8;
}
#tray {
  display: flex; align-items: center; gap: 6px;
  border-top: 2px solid var(--win-dark); border-left: 2px solid var(--win-dark);
  border-right: 1px solid var(--win-white); border-bottom: 1px solid var(--win-white);
  padding: 3px 8px; height: 25px; font-size: 12px;
}
#tray button { background: none; border: none; cursor: pointer; font-size: 14px; padding: 0 2px; }
#clock { font-family: var(--font-ui); font-size: 12px; color: #000; }

/* =========================== WINDOWS =========================== */
#window-layer { position: absolute; inset: 0; pointer-events: none; }
.win {
  position: absolute;
  min-width: 260px; min-height: 160px;
  background: var(--win-gray);
  border-top: 2px solid var(--win-white); border-left: 2px solid var(--win-white);
  border-right: 2px solid var(--win-black); border-bottom: 2px solid var(--win-black);
  box-shadow: 3px 3px 10px rgba(0,0,0,0.45);
  display: flex; flex-direction: column;
  pointer-events: auto;
}
.win.maximized { border-radius: 0; }
.win[hidden] { display: none; }
.win-titlebar {
  height: 26px; flex-shrink: 0;
  background: linear-gradient(90deg, var(--inactive-title), #b5b5b5);
  color: #dcdcdc;
  display: flex; align-items: center; gap: 6px;
  padding: 0 3px 0 6px;
  cursor: default;
}
.win.active .win-titlebar {
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-lt) 100%);
  color: #fff;
}
.win-titlebar .t-icon { font-size: 13px; }
.win-titlebar .t-text { flex: 1; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-controls { display: flex; gap: 2px; }
.win-controls button {
  width: 19px; height: 18px; font-size: 11px; line-height: 1;
  background: var(--win-gray); color: #000;
  border-top: 1px solid var(--win-white); border-left: 1px solid var(--win-white);
  border-right: 1px solid var(--win-black); border-bottom: 1px solid var(--win-black);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 0;
}
.win-controls button:active { border-color: var(--win-black) var(--win-white) var(--win-white) var(--win-black); }
.win-menubar {
  display: flex; gap: 2px; background: var(--win-gray);
  border-bottom: 1px solid var(--win-dark);
  padding: 2px 4px; font-size: 12px; flex-shrink: 0;
}
.win-menubar span { padding: 3px 8px; cursor: default; }
.win-menubar span:hover { background: var(--navy); color: #fff; }
.win-body {
  flex: 1; overflow: auto; background: var(--win-gray);
  padding: 12px; font-size: 13px; line-height: 1.5; color: #111;
}
.win-statusbar {
  flex-shrink: 0; font-size: 11px; padding: 3px 8px;
  border-top: 1px solid var(--win-white);
  background: var(--win-gray); color: #333;
}
.win-resize-handle {
  position: absolute; right: 0; bottom: 0; width: 16px; height: 16px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 0 40%, var(--win-dark) 40% 46%, transparent 46% 56%, var(--win-dark) 56% 62%, transparent 62%);
}

/* =========================== SHARED CONTENT STYLES =========================== */
.field-grid { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 10px 0; }
.field-grid dt { font-weight: 700; color: #000; }
.field-grid dd { margin: 0; }
.mono-box {
  background: #fff; border: 1px solid var(--win-dark);
  box-shadow: inset 1px 1px 0 var(--win-dark);
  font-family: var(--font-mono); padding: 6px 8px; font-size: 12px;
}
.callout {
  background: #fff9db; border: 1px solid #cbb84a; padding: 8px 10px; margin: 10px 0; font-size: 12.5px;
}
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 8px; margin: 10px 0; }
.stat-tile { background: #fff; border: 1px solid var(--win-dark); box-shadow: inset -1px -1px 0 var(--win-white); padding: 8px; }
.stat-tile b { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: #555; }
.stat-tile span { font-size: 14px; }

.tree-layout { display: flex; height: 100%; gap: 0; margin: -12px; height: calc(100% + 24px); }
.tree-nav { width: 190px; flex-shrink: 0; background: #fff; border-right: 2px solid var(--win-dark); overflow: auto; padding: 6px 0; }
.tree-nav .node { padding: 6px 10px; cursor: pointer; font-size: 12.5px; border-left: 3px solid transparent; }
.tree-nav .node:hover { background: #e6e6e6; }
.tree-nav .node.active { background: var(--navy); color: #fff; border-left-color: var(--accent); }
.tree-article { flex: 1; overflow: auto; padding: 16px; }
.tree-article h3 { margin-top: 0; }

.disclaimer-box {
  font-size: 11px; color: #444; background: #eee; border: 1px solid var(--win-dark);
  padding: 8px; margin-top: 14px;
}

/* Timeline */
.tl-wrap { display: flex; height: 100%; margin: -12px; height: calc(100% + 24px); }
.tl-rail { width: 170px; flex-shrink: 0; overflow: auto; background: #fff; border-right: 2px solid var(--win-dark); }
.tl-rail .yr { padding: 8px 10px; font-size: 12px; cursor: pointer; border-bottom: 1px dotted #bbb; }
.tl-rail .yr:hover { background: #e6e6e6; }
.tl-rail .yr.active { background: var(--navy); color: #fff; }
.tl-detail { flex: 1; padding: 16px; overflow: auto; }

/* Control panel / Why NinjaCat */
.cp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 10px; }
.cp-module { background: #fff; border: 1px solid var(--win-dark); box-shadow: inset -1px -1px 0 var(--win-white); padding: 10px; cursor: pointer; text-align: center; }
.cp-module:hover { background: #eef8f8; }
.cp-module .ico { font-size: 22px; }
.cp-module .ttl { font-size: 11.5px; font-weight: 700; margin-top: 4px; }
.cp-detail { margin-top: 12px; background: #fffbe6; border: 1px solid #cbb84a; padding: 10px; font-size: 12.5px; min-height: 40px; }

/* Meme gallery */
.mg-wrap { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.mg-stage { flex: 1; display: flex; align-items: center; justify-content: center; background: #101010; position: relative; min-height: 160px; overflow: hidden; }
.mg-stage img { max-width: 92%; max-height: 92%; object-fit: contain; box-shadow: 0 0 0 4px #000, 4px 4px 10px rgba(0,0,0,0.6); cursor: zoom-in; }
.mg-nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: var(--win-gray); border: 2px outset #fff; font-size: 18px; width: 34px; height: 44px; cursor: pointer;
}
.mg-nav-btn.prev { left: 8px; } .mg-nav-btn.next { right: 8px; }
.mg-counter { position: absolute; top: 8px; right: 10px; background: #000c; color: #0f0; font-family: var(--font-mono); font-size: 11px; padding: 2px 6px; }
.mg-title-bar {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
  background: var(--win-gray-lt);
  border-bottom: 1px solid var(--win-dark);
  box-shadow: inset 0 1px 0 var(--win-white);
  padding: 4px 8px; font-size: 11.5px; font-weight: 700; color: #333;
}
.mg-title-bar .mg-addr-icon { font-size: 13px; }
.mg-title-bar .mg-addr-box {
  flex: 1;
  background: #fff; border: 1px solid var(--win-dark); box-shadow: inset 1px 1px 0 var(--win-dark);
  padding: 2px 6px; font-family: var(--font-mono); font-weight: 400; font-size: 11px; color: #111;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mg-controls { display: flex; gap: 6px; padding: 6px 8px; background: var(--win-gray); border-top: 1px solid var(--win-white); flex-wrap: wrap; flex-shrink: 0; }
.mg-thumbs { display: flex; gap: 4px; overflow-x: auto; padding: 6px 8px; background: #a9a9a9; border-top: 1px solid var(--win-dark); }
.mg-thumb { width: 52px; height: 52px; flex-shrink: 0; object-fit: cover; cursor: pointer; border: 2px solid #6d6d6d; background: #333; }
.mg-thumb.active { border-color: var(--accent-2); box-shadow: 0 0 0 1px #000; }

/* Lightbox */
#lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 5000; display: flex; align-items: center; justify-content: center; }
#lightbox[hidden] { display: none; }
#lightbox img { max-width: 90vw; max-height: 84vh; box-shadow: 0 0 40px rgba(0,0,0,0.8); }
#lightbox-close { position: absolute; top: 18px; right: 22px; background: var(--win-gray); border: 2px outset #fff; width: 34px; height: 30px; font-size: 15px; cursor: pointer; }
#lightbox-cap { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; color: #fff; font-size: 13px; font-family: var(--font-mono); }

/* Terminal */
.term-wrap { background: #000; color: #33ff66; font-family: var(--font-mono); font-size: 13px; height: 100%; margin: -12px; padding: 10px; overflow: auto; }
.term-line { white-space: pre-wrap; word-break: break-word; }
.term-row { display: flex; gap: 6px; }
.term-prompt { color: #33ff66; }
#term-input { flex: 1; background: transparent; border: none; color: #33ff66; font-family: var(--font-mono); font-size: 13px; outline: none; }
.term-wrap a { color: #7fffab; }

/* How to buy wizard */
.wiz-steps { display: flex; gap: 3px; margin-bottom: 12px; }
.wiz-steps div { flex: 1; height: 6px; background: var(--win-dark); }
.wiz-steps div.done { background: var(--navy); }
.wiz-nav { display: flex; justify-content: space-between; margin-top: 14px; }
.wiz-panel h3 { margin-top: 0; }

/* Community links / network neighborhood */
.net-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 14px; }
.net-item { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 10px; background: #fff; border: 1px solid var(--win-dark); text-decoration: none; color: #111; }
.net-item .ico { font-size: 30px; }
.net-item:hover { background: #eef8f8; }
.net-item.disabled { opacity: 0.5; pointer-events: none; }

/* Dialogs (welcome, shutdown, run, alerts) */
.dialog-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 4500; display: flex; align-items: center; justify-content: center; }
.welcome-body { text-align: center; padding: 20px 16px; }
.welcome-cat { font-size: 46px; }
.welcome-tag { font-style: italic; color: #333; margin: 8px 0 16px; }
.welcome-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* Recycle bin */
.bin-list { list-style: none; margin: 0; padding: 0; }
.bin-list li { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px dotted #bbb; font-family: var(--font-mono); font-size: 12px; }

/* Run dialog / find */
.run-row { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.run-row input[type=text] { flex: 1; padding: 5px 6px; font-family: var(--font-ui); font-size: 12px; }

/* Toast messages */
#toast-layer { position: fixed; bottom: 44px; right: 14px; z-index: 6000; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--win-gray); border-top: 2px solid #fff; border-left: 2px solid #fff; border-right: 2px solid #000; border-bottom: 2px solid #000; padding: 8px 12px; font-size: 12px; max-width: 260px; box-shadow: 3px 3px 8px rgba(0,0,0,0.4); }

/* scrollbars retro-ish */
.win-body::-webkit-scrollbar, .tree-nav::-webkit-scrollbar, .tl-rail::-webkit-scrollbar, .term-wrap::-webkit-scrollbar { width: 16px; }
.win-body::-webkit-scrollbar-track { background: var(--win-gray); }
.win-body::-webkit-scrollbar-thumb { background: var(--win-gray); border: 1px solid var(--win-dark); box-shadow: inset 1px 1px 0 #fff; }

/* =========================== SURPRISE ICON (fixed, bottom-left) =========================== */
#surprise-icon {
  position: fixed; left: 10px; bottom: 44px; z-index: 15;
  width: 84px;
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 6px 2px;
  cursor: pointer;
  background: none; border: none;
}
#surprise-icon .glyph {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.5));
  animation: surprise-pulse 2.2s ease-in-out infinite;
}
#surprise-icon .label {
  color: #fff0f0; font-size: 11px; font-weight: 700; text-align: center;
  text-shadow: 1px 1px 1px #000;
  letter-spacing: 0.5px;
}
#surprise-icon:hover .glyph, #surprise-icon:focus-visible .glyph { animation-duration: 0.6s; }
@keyframes surprise-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* =========================== RETRO MEDIA PLAYER =========================== */
.wmp-wrap { display: flex; flex-direction: column; height: 100%; background: #0b0b0b; }
.wmp-menubar { display: flex; gap: 2px; background: var(--win-gray); border-bottom: 1px solid var(--win-dark); padding: 2px 4px; font-size: 12px; flex-shrink: 0; }
.wmp-menubar span { padding: 3px 8px; cursor: default; color: #111; }
.wmp-menubar span:hover { background: var(--navy); color: #fff; }
.wmp-screen {
  flex: 1; background: #000; display: flex; align-items: center; justify-content: center;
  position: relative; min-height: 120px; overflow: hidden;
}
.wmp-screen video { max-width: 100%; max-height: 100%; }
.wmp-placeholder { color: #7fffab; font-family: var(--font-mono); font-size: 12px; text-align: center; padding: 20px; }
.wmp-placeholder .big { font-size: 34px; margin-bottom: 8px; }
.wmp-viz { position: absolute; left: 0; right: 0; bottom: 0; height: 46px; display: flex; align-items: flex-end; gap: 2px; padding: 0 6px; pointer-events: none; }
.wmp-viz .bar { flex: 1; background: linear-gradient(180deg, #7fffab, #0a6b2f); height: 4px; }
.wmp-controls-bar { flex-shrink: 0; background: var(--win-gray); border-top: 2px solid var(--win-white); padding: 6px 8px; }
.wmp-seek { width: 100%; margin-bottom: 6px; }
.wmp-btn-row { display: flex; align-items: center; gap: 6px; }
.wmp-btn-row .spacer { flex: 1; }
.wmp-time { font-family: var(--font-mono); font-size: 11px; color: #222; min-width: 84px; text-align: center; }
.wmp-vol { width: 70px; }

/* =========================== RESPONSIVE ============================= */
@media (max-width: 820px) {
  #icon-layer { grid-template-rows: repeat(auto-fill, 86px); grid-auto-flow: row; grid-template-columns: repeat(auto-fill, 78px); }
  .d-icon { width: 78px; }
  .win { left: 0 !important; top: 0 !important; right: 0; width: 100% !important; height: calc(100% - 34px) !important; }
  .win-resize-handle { display: none; }
  #start-menu { width: 92vw; max-width: 320px; }
  .tree-layout, .tl-wrap { flex-direction: column; height: auto; margin: -12px; }
  .tree-nav, .tl-rail { width: auto; max-height: 140px; border-right: none; border-bottom: 2px solid var(--win-dark); display: flex; overflow-x: auto; }
  .tl-rail .yr { flex-shrink: 0; }
}

@supports (padding: max(0px)) {
  #taskbar { padding-bottom: max(3px, env(safe-area-inset-bottom)); }
}
