/* ============================================================
   Chimera 95 — authentic Windows 95 desktop  (rebuilt)
   ------------------------------------------------------------
   UI primitives (beveled box-shadows, scrollbar + control
   glyphs, pixel font) follow the authentic Win9x technique
   popularised by 98.css (MIT, jdan/98.css); re-implemented here
   to fit this desktop-environment markup. See vendor/CREDITS.md.
   ============================================================ */

/* ---------- Authentic Windows 95 bitmap font ---------- */
@font-face {
  font-family: "Pixelated MS Sans Serif";
  font-style: normal; font-weight: 400;
  src: url("assets/fonts/ms_sans_serif.woff2") format("woff2"),
       url("assets/fonts/ms_sans_serif.woff")  format("woff");
}
@font-face {
  font-family: "Pixelated MS Sans Serif";
  font-style: normal; font-weight: 700;
  src: url("assets/fonts/ms_sans_serif_bold.woff2") format("woff2"),
       url("assets/fonts/ms_sans_serif_bold.woff")  format("woff");
}

:root {
  /* dark "black & blue" chrome palette — beveled like Win95 but in dark tones */
  --gray:        #191d33;   /* window / taskbar face (dark blue-black)  */
  --gray-light:  #3a4877;   /* inner highlight (upper-left, 2px in)     */
  --white:       #6376b8;   /* outer highlight (steel blue)             */
  --shadow:      #070a14;   /* inner shadow                             */
  --dark:        #000000;   /* outer shadow                             */
  --ink:         #dbe2ff;   /* light text on dark chrome                */
  --paper:       #ffffff;   /* white content/paper areas                */
  --teal:        #008080;   /* (legacy — desktop now uses the wallpaper)*/
  --navy:        #0b1240;   /* active title bar (dark blue)             */
  --navy-2:      #1c3fb0;   /* title-bar gradient end                   */
  --navy-text:   #ffffff;
  --font: "Pixelated MS Sans Serif", "MS Sans Serif", "Tahoma", "Segoe UI", sans-serif;

  /* blue duotone applied to the desktop/folder/start icons to match the
     dark-blue theme (no authentic dark icon pack exists — tuned here so it's
     a one-line change). Dial saturate/hue-rotate/brightness to taste. */
  --icon-tint: grayscale(1) sepia(1) hue-rotate(184deg) saturate(2.7) brightness(.96) contrast(1.06);

  /* the four-layer bevels that define the whole look */
  --bevel-out:    inset -1px -1px var(--dark), inset 1px 1px var(--white),
                  inset -2px -2px var(--shadow), inset 2px 2px var(--gray-light);
  --bevel-press:  inset -1px -1px var(--white), inset 1px 1px var(--dark),
                  inset -2px -2px var(--gray-light), inset 2px 2px var(--shadow);
  --bevel-in:     inset -1px -1px var(--white), inset 1px 1px var(--shadow),
                  inset -2px -2px var(--gray-light), inset 2px 2px var(--dark);
  --bevel-window: inset -1px -1px var(--dark), inset 1px 1px var(--gray-light),
                  inset -2px -2px var(--shadow), inset 2px 2px var(--white);
  --bevel-status: inset -1px -1px var(--gray-light), inset 1px 1px var(--shadow);

  /* silver bevels for the few controls that stay light so their black glyphs
     read: title-bar buttons and scrollbar thumbs */
  --bevel-light-out:   inset -1px -1px #0a0a0a, inset 1px 1px #fff,
                       inset -2px -2px #808080, inset 2px 2px #dfdfdf;
  --bevel-light-press: inset -1px -1px #fff, inset 1px 1px #0a0a0a,
                       inset -2px -2px #dfdfdf, inset 2px 2px #808080;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  font-size: 11px;
  color: var(--ink);
  background: #05061a;
  -webkit-user-select: none;
  user-select: none;
  -webkit-font-smoothing: none;   /* keep the bitmap font crisp */
  font-smooth: never;
}

img {
  image-rendering: pixelated; -ms-interpolation-mode: nearest-neighbor;
  -webkit-user-drag: none; user-drag: none; -webkit-user-select: none; user-select: none;
  pointer-events: none;
}

[hidden] { display: none !important; }

/* legacy bevel helpers (kept for any inline use) */
.raised { box-shadow: var(--bevel-out); }
.sunken { box-shadow: var(--bevel-in); }

/* ---------- Authentic chunky scrollbars ---------- */
*::-webkit-scrollbar { width: 16px; }
*::-webkit-scrollbar:horizontal { height: 17px; }
*::-webkit-scrollbar-corner { background: var(--gray-light); }
*::-webkit-scrollbar-track {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='2' height='2' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M1 0H0v1h1v1h1V1H1V0z' fill='silver'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M2 0H1v1H0v1h1V1h1V0z' fill='%23fff'/%3E%3C/svg%3E");
}
*::-webkit-scrollbar-thumb {
  background-color: #cfcfcf;
  box-shadow: var(--bevel-light-out);
}
*::-webkit-scrollbar-button:horizontal:end:increment,
*::-webkit-scrollbar-button:horizontal:start:decrement,
*::-webkit-scrollbar-button:vertical:end:increment,
*::-webkit-scrollbar-button:vertical:start:decrement { display: block; }
*::-webkit-scrollbar-button:vertical:start {
  height: 17px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='17' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M15 0H0v16h1V1h14V0z' fill='%23DFDFDF'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M2 1H1v14h1V2h12V1H2z' fill='%23fff'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M16 17H0v-1h15V0h1v17z' fill='%23000'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M15 1h-1v14H1v1h14V1z' fill='gray'/%3E%3Cpath fill='silver' d='M2 2h12v13H2z'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M8 6H7v1H6v1H5v1H4v1h7V9h-1V8H9V7H8V6z' fill='%23000'/%3E%3C/svg%3E");
}
*::-webkit-scrollbar-button:vertical:end {
  height: 17px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='17' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M15 0H0v16h1V1h14V0z' fill='%23DFDFDF'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M2 1H1v14h1V2h12V1H2z' fill='%23fff'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M16 17H0v-1h15V0h1v17z' fill='%23000'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M15 1h-1v14H1v1h14V1z' fill='gray'/%3E%3Cpath fill='silver' d='M2 2h12v13H2z'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11 6H4v1h1v1h1v1h1v1h1V9h1V8h1V7h1V6z' fill='%23000'/%3E%3C/svg%3E");
}
*::-webkit-scrollbar-button:horizontal:start {
  width: 16px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='17' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M15 0H0v16h1V1h14V0z' fill='%23DFDFDF'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M2 1H1v14h1V2h12V1H2z' fill='%23fff'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M16 17H0v-1h15V0h1v17z' fill='%23000'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M15 1h-1v14H1v1h14V1z' fill='gray'/%3E%3Cpath fill='silver' d='M2 2h12v13H2z'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9 4H8v1H7v1H6v1H5v1h1v1h1v1h1v1h1V4z' fill='%23000'/%3E%3C/svg%3E");
}
*::-webkit-scrollbar-button:horizontal:end {
  width: 16px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='17' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M15 0H0v16h1V1h14V0z' fill='%23DFDFDF'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M2 1H1v14h1V2h12V1H2z' fill='%23fff'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M16 17H0v-1h15V0h1v17z' fill='%23000'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M15 1h-1v14H1v1h14V1z' fill='gray'/%3E%3Cpath fill='silver' d='M2 2h12v13H2z'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M7 4H6v7h1v-1h1V9h1V8h1V7H9V6H8V5H7V4z' fill='%23000'/%3E%3C/svg%3E");
}

/* ---------- Startup sequence (BIOS POST → Windows 95 splash) ---------- */
#boot {
  position: fixed; inset: 0; z-index: 9999; background: #000;
  transition: opacity .45s ease;
}
#boot.fade { opacity: 0; pointer-events: none; }
.boot-stage { position: absolute; inset: 0; }

/* Stage 1 — BIOS power-on self test */
#boot-bios {
  background: #000; color: #cfcfcf; padding: 26px 30px;
  font-family: "Courier New", "Lucida Console", monospace;
}
.bios-text { margin: 0; font-size: 16px; line-height: 1.5; white-space: pre-wrap; color: #d6d6d6; }
.bios-text b { color: #fff; }
.bios-foot { position: absolute; left: 30px; bottom: 26px; font-family: "Courier New", monospace;
  font-size: 15px; line-height: 1.5; color: #cfcfcf; white-space: pre; }
.bios-foot b { color: #fff; }
.bios-star { position: absolute; top: 24px; right: 34px; text-align: center; color: #d9c84a; }
.bios-star .star { font-size: 58px; line-height: 1; text-shadow: 0 0 10px rgba(217,200,74,.45); }
.bios-star .star-label { font-family: "Times New Roman", serif; font-style: italic; color: #2fb56a; font-size: 16px; letter-spacing: 1px; }

/* Stage 2 — Windows 95-style splash (CSS recreation) */
#boot-splash {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 80% at 50% 18%, rgba(255,255,255,.55), rgba(255,255,255,0) 60%),
    radial-gradient(90% 60% at 78% 82%, rgba(255,255,255,.4), rgba(255,255,255,0) 55%),
    linear-gradient(180deg, #cfe8ff 0%, #93c6f2 48%, #bfe2ff 100%);
  font-family: "Tahoma", "Segoe UI", sans-serif;
}
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; transform: translateY(-26px); }
.splash-brand { font-size: 17px; font-weight: 700; color: #1a1a1a; letter-spacing: .5px; align-self: flex-start; margin-left: 8px; }
.splash-logo { display: flex; align-items: center; gap: 18px; }
.win-flag {
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 5px;
  width: 84px; height: 84px;
  transform: perspective(260px) rotateY(-14deg) skewY(-7deg);
  filter: drop-shadow(3px 4px 4px rgba(0,0,0,.35));
}
.win-flag .q { border-radius: 3px 3px 4px 3px; }
.win-flag .q1 { background: #e8443a; } /* red   */
.win-flag .q2 { background: #36c24a; } /* green */
.win-flag .q3 { background: #2aa3ff; } /* blue  */
.win-flag .q4 { background: #ffcc00; } /* yellow*/
.win-word { font-size: 64px; font-weight: 700; color: #111; line-height: .9; letter-spacing: -1px; text-shadow: 2px 2px 0 rgba(255,255,255,.5); }
.win-word b { color: #111; font-style: italic; }
.splash-tag { font-size: 16px; color: #25406b; font-style: italic; margin-top: 4px; align-self: flex-end; margin-right: 6px; }
.splash-load {
  position: absolute; bottom: 84px; width: 240px; height: 14px; background: #0d1b3a;
  box-shadow: var(--bevel-in); overflow: hidden;
}
.splash-load i {
  position: absolute; top: 0; left: -45%; width: 45%; height: 100%;
  background: repeating-linear-gradient(90deg,#000a64 0,#000a64 5px,#1f6bff 5px,#1f6bff 11px);
  animation: splashload 1.25s linear infinite;
}
@keyframes splashload { from { left: -45%; } to { left: 100%; } }
.splash-msg { position: absolute; bottom: 54px; font-size: 14px; color: #1a2c52; }

.boot-skip { position: absolute; bottom: 14px; right: 16px; font-size: 12px; color: #8a8a8a;
  font-family: "Tahoma", sans-serif; opacity: .8; }
#boot-splash ~ .boot-skip, #boot-splash:not([hidden]) ~ .boot-skip { color: #355; }

/* ---------- Desktop ---------- */
#desktop { position: fixed; inset: 0 0 30px 0;
  background: #00012a url("assets/wallpaper/setup-bg.jpg") center center / cover no-repeat; }
#bubbles { display: none; }
#icons { position: absolute; inset: 0; }

.desk-icon {
  position: absolute; width: 80px; padding: 4px 2px 2px; text-align: center;
  cursor: default; border: 1px dotted transparent;
}
.desk-icon .glyph { display: block; height: 36px; margin-bottom: 4px; }
.desk-icon .glyph img { width: 32px; height: 32px; filter: var(--icon-tint) drop-shadow(1px 1px 0 rgba(0,0,0,.4)); }
.desk-icon .label { font-size: 11px; line-height: 1.25; color: #fff; padding: 1px 3px; display: inline-block; word-break: break-word;
  text-shadow: 1px 1px 0 rgba(0,0,0,.6); }
.desk-icon.selected .glyph img { filter: brightness(.55) sepia(1) hue-rotate(195deg) saturate(5); }
.desk-icon.selected .label { background: var(--navy); color: #fff; text-shadow: none; }
.desk-icon.selected { border: 1px dotted #fff; }
.desk-icon.dragging { opacity: .55; cursor: move; }

/* ---------- Windows ---------- */
.win {
  position: absolute; min-width: 220px; min-height: 130px;
  background: var(--gray);
  box-shadow: var(--bevel-window);
  display: flex; flex-direction: column; outline: none;
  padding: 3px;
}

.title-bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 20px; padding: 0 2px 0 3px; cursor: move; user-select: none;
  background: linear-gradient(90deg, var(--navy), var(--navy-2));
  color: var(--navy-text); font-weight: 700;
}
.win.inactive .title-bar { background: linear-gradient(90deg, var(--shadow), #b5b5b5); color: #d8d4cf; }
.title-bar-text { display: flex; align-items: center; gap: 5px; overflow: hidden; white-space: nowrap; padding-left: 1px; }
.title-icon { width: 16px; height: 16px; display: inline-block; }
.title-icon img { width: 16px; height: 16px; }
.title-label { overflow: hidden; text-overflow: ellipsis; letter-spacing: .2px; }

/* title-bar control buttons — authentic SVG glyphs (text hidden) */
.title-bar-controls { display: flex; gap: 0; }
.title-bar-controls button {
  width: 16px; height: 14px; padding: 0; cursor: pointer;
  color: transparent; font-size: 0;
  background: #c0c0c0; box-shadow: var(--bevel-light-out);
  background-repeat: no-repeat;
}
.title-bar-controls button:active { box-shadow: var(--bevel-light-press); }
.title-bar-controls button:focus { outline: none; }
.title-bar-controls .tb-min {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='6' height='2' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23000' d='M0 0h6v2H0z'/%3E%3C/svg%3E");
  background-position: bottom 3px left 3px;
}
.title-bar-controls .tb-max {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='9' height='9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9 0H0v9h9V0zM8 2H1v6h7V2z' fill='%23000'/%3E%3C/svg%3E");
  background-position: top 2px left 3px;
}
/* when the window is maximized, the maximize button shows the "restore" glyph */
.win.maximized .tb-max {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='8' height='9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23000' d='M2 0h6v2H2zM7 2h1v4H7zM2 2h1v1H2zM6 5h1v1H6zM0 3h6v2H0zM5 5h1v4H5zM0 5h1v4H0zM1 8h4v1H1z'/%3E%3C/svg%3E");
  background-position: top 2px left 3px;
}
.title-bar-controls .tb-close {
  margin-left: 2px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='8' height='7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M0 0h2v1h1v1h2V1h1V0h2v1H7v1H6v1H5v1h1v1h1v1h1v1H6V6H5V5H3v1H2v1H0V6h1V5h1V4h1V3H2V2H1V1H0V0z' fill='%23000'/%3E%3C/svg%3E");
  background-position: top 3px left 4px;
}

.window-body { flex: 1; overflow: auto; padding: 3px; background: var(--gray); }

.status-bar { display: flex; gap: 1px; padding: 3px 0 0; margin: 0 1px; }
.status-field {
  flex: 1; padding: 2px 4px; font-size: 11px;
  box-shadow: var(--bevel-status);
}

/* document reading area */
.doc-content {
  background: var(--paper); color: #000; padding: 12px 14px; height: 100%;
  box-shadow: var(--bevel-in);
  overflow: auto; user-select: text; line-height: 1.6; font-size: 11px;
}
.doc-content h1 { font-size: 16px; margin: 0 0 8px; color: var(--navy); font-weight: 700; }
.doc-content h2 { font-size: 13px; margin: 14px 0 4px; color: #000080; border-bottom: 1px solid #c0c0c0; padding-bottom: 2px; }
.doc-content a { color: #0000ee; }
.doc-content a:visited { color: #551a8b; }
.doc-content code { background: #e8e8e8; padding: 0 3px; font-family: "Courier New", monospace; }
.doc-content ul { margin: 6px 0; padding-left: 22px; }
.doc-content li { margin: 3px 0; }
.doc-content .tag { display: inline-block; background: var(--gray); color: #000; padding: 2px 8px; margin: 3px 4px 3px 0; font-size: 11px;
  box-shadow: var(--bevel-out); }
.doc-content .meta { color: var(--shadow); font-size: 11px; }
.doc-content hr { border: none; height: 2px; box-shadow: var(--bevel-status); margin: 12px 0; }

/* ---------- Generic 95 controls ---------- */
.btn {
  font-family: var(--font); font-size: 11px; padding: 4px 12px; cursor: pointer;
  background: var(--gray); min-width: 72px; min-height: 23px; color: var(--ink);
  box-shadow: var(--bevel-out); border: none;
}
.btn:active { box-shadow: var(--bevel-press); padding: 5px 11px 3px 13px; }
.btn:focus-visible { outline: 1px dotted var(--ink); outline-offset: -4px; }
.field {
  font-family: var(--font); font-size: 11px; padding: 3px 5px; width: 100%; color: #000;
  box-shadow: var(--bevel-in); border: none;
  background: #fff;
}
.field:focus { outline: none; }
textarea.field { resize: vertical; min-height: 200px; font-family: "Courier New", monospace; line-height: 1.45; padding: 4px 5px; }
label.row { display: block; margin: 9px 0 3px; font-weight: 700; }

select.field {
  height: 23px; appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 30px; cursor: pointer;
  background-color: #fff;
  background-repeat: no-repeat; background-position: top 2px right 2px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg width='16' height='17' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M15 0H0v16h1V1h14V0z' fill='%23DFDFDF'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M2 1H1v14h1V2h12V1H2z' fill='%23fff'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M16 17H0v-1h15V0h1v17z' fill='%23000'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M15 1h-1v14H1v1h14V1z' fill='gray'/%3E%3Cpath fill='silver' d='M2 2h12v13H2z'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11 6H4v1h1v1h1v1h1v1h1V9h1V8h1V7h1V6z' fill='%23000'/%3E%3C/svg%3E");
}

/* ---------- Site Manager ---------- */
.mgr { display: flex; gap: 8px; height: 100%; }
.mgr-list {
  width: 186px; background: #fff; color: #000; overflow: auto; padding: 2px;
  box-shadow: var(--bevel-in);
}
.mgr-item { padding: 4px 6px; cursor: default; display: flex; gap: 6px; align-items: center; }
.mgr-item img { width: 16px; height: 16px; }
.mgr-item.active { background: var(--navy); color: #fff; }
.mgr-edit { flex: 1; display: flex; flex-direction: column; overflow: auto; padding-right: 2px; }
.mgr-actions { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.hint { font-size: 11px; color: var(--ink); margin: 6px 0; line-height: 1.5; }
.hint code { color: #9fd0ff; }
.folder-view .hint { color: #000; }
.icon-grid { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px;
  background:#fff; padding:5px; box-shadow: var(--bevel-in); }
.icon-grid button { width: 30px; height: 30px; cursor: pointer; padding: 2px;
  background: var(--gray); box-shadow: var(--bevel-out); border: none; }
.icon-grid button:active { box-shadow: var(--bevel-press); }
.icon-grid button img { width: 20px; height: 20px; }
.icon-grid button.sel { box-shadow: var(--bevel-in); background: #c8d4f0; }

/* ---------- Taskbar ---------- */
#taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 30px; z-index: 5000;
  display: flex; align-items: center; gap: 4px; padding: 2px 3px;
  background: var(--gray);
  box-shadow: inset 0 1px var(--white), inset 0 2px var(--gray-light);
}
#start-button {
  display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 11px;
  color: var(--ink); cursor: pointer; padding: 1px 9px 1px 4px; height: 22px; font-family: var(--font);
  background: var(--gray); box-shadow: var(--bevel-out); border: none;
}
#start-button:active, #start-button.open { box-shadow: var(--bevel-press); }
#start-button.open { background: #b8b8b8; }
.start-orb img { width: 18px; height: 18px; display: block; }

#task-buttons { flex: 1; display: flex; gap: 3px; overflow: hidden; align-items: center; }
.task-btn {
  max-width: 160px; min-width: 120px; height: 22px; padding: 0 6px;
  display: flex; align-items: center; gap: 5px; cursor: pointer; color: var(--ink);
  font-family: var(--font); font-size: 11px; overflow: hidden; white-space: nowrap;
  background: var(--gray); box-shadow: var(--bevel-out); border: none;
}
.task-btn img { width: 16px; height: 16px; }
.task-btn.active { box-shadow: var(--bevel-press);
  background-image: repeating-conic-gradient(#2a3358 0% 25%, #1d2442 0% 50%); background-size: 3px 3px; font-weight: 700; }
.task-btn span { overflow: hidden; text-overflow: ellipsis; }

#tray {
  display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 11px; height: 22px;
  padding: 0 8px; box-shadow: var(--bevel-status);
}
#tray-icons { display: none; }
#clock { font-variant-numeric: tabular-nums; min-width: 42px; text-align: center; }

/* ---------- Start menu ---------- */
#start-menu {
  position: fixed; bottom: 30px; left: 2px; z-index: 6000; width: 240px;
  display: flex; background: var(--gray);
  box-shadow: var(--bevel-out), 2px 2px 6px rgba(0,0,0,.4);
  padding: 2px;
}
.start-side {
  width: 30px; writing-mode: vertical-rl; transform: rotate(180deg);
  text-align: left; padding: 8px 4px; font-weight: 700; font-size: 20px; color: #fff;
  background: linear-gradient(180deg, var(--navy), #2a2a8a);
}
.start-side span { color: var(--gray); }
.start-main { flex: 1; padding: 2px; }
.start-entry {
  display: flex; align-items: center; gap: 9px; padding: 5px 20px 5px 6px; cursor: default;
}
.start-entry img { width: 24px; height: 24px; filter: var(--icon-tint); }
.start-entry:hover { background: var(--navy); color: #fff; }
.start-sep { height: 2px; margin: 3px 2px; box-shadow: var(--bevel-status); }

/* ---------- Desktop right-click context menu ---------- */
.context-menu {
  position: fixed; z-index: 7000; min-width: 168px; padding: 2px;
  background: var(--gray); box-shadow: var(--bevel-out), 2px 2px 5px rgba(0,0,0,.35);
  font-size: 11px;
}
.context-menu .ctx-item {
  display: flex; align-items: center; gap: 8px; padding: 4px 22px; cursor: default;
  white-space: nowrap; position: relative;
}
.context-menu .ctx-item:hover { background: var(--navy); color: #fff; }
.context-menu .ctx-item.disabled { color: #7a83ad; }
.context-menu .ctx-item.disabled:hover { background: transparent; color: #7a83ad; }
.context-menu .ctx-sep { height: 2px; margin: 3px 2px; box-shadow: var(--bevel-status); }

/* ---------- Terminal windows (Read Me / About Me) ---------- */
.term-content {
  background: #000; color: #c0c0c0; height: 100%; overflow: auto; user-select: text;
  font-family: "Courier New", "Lucida Console", monospace; font-size: 13px; line-height: 1.45;
  padding: 8px 10px; box-shadow: var(--bevel-in);
}
.term-content .term-head { color: #c0c0c0; white-space: pre-wrap; margin-bottom: 10px; }
.term-content h1 { color: #00ff3b; font-size: 14px; margin: 0 0 6px; text-transform: none; }
.term-content h2 { color: #00ffff; font-size: 13px; border: none; margin: 12px 0 4px; }
.term-content p  { margin: 6px 0; }
.term-content a  { color: #6fa8ff; }
.term-content code { background: #062006; color: #00ff3b; padding: 0 3px; }
.term-content .meta { color: #707070; }
.term-content hr { border: none; border-top: 1px dashed #444; margin: 10px 0; }
.term-content .tag { display: inline-block; padding: 0 6px; margin: 1px 3px 1px 0; font-size: 12px;
  background: #062006; color: #00ff3b; border: 1px solid #00802b; }
.term-content ul { margin: 6px 0; padding-left: 20px; }
.term-content .cursor { background: #00ff3b; color: #00ff3b; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Folder windows (Projects / Skills) ---------- */
.folder-view {
  background: #fff; height: 100%; overflow: auto; padding: 8px;
  display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px;
  box-shadow: var(--bevel-in);
}
.folder-item {
  width: 84px; padding: 6px 2px; text-align: center; cursor: default;
  border: 1px dotted transparent;
}
.folder-item .glyph { display: block; height: 34px; margin-bottom: 3px; }
.folder-item .glyph img { width: 32px; height: 32px; filter: var(--icon-tint); }
.folder-item .label { font-size: 11px; color: #000; line-height: 1.2; word-break: break-word; }
.folder-item.selected { border: 1px dotted var(--navy); }
.folder-item.selected .label { background: var(--navy); color: #fff; }

/* ---------- Shut Down screen ---------- */
#shutdown {
  position: fixed; inset: 0; z-index: 99999; background: #000;
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 28px;
  font-family: "Courier New", monospace;
}
#shutdown .sd-msg {
  color: #ff8c00; font-size: 26px; font-weight: 700; text-align: center; line-height: 1.5;
  text-shadow: 0 0 14px rgba(255,140,0,.5);
}
#shutdown .sd-hint { color: #b07000; font-size: 13px; }

/* ---------- Fake firmware screens (DEL = setup, F8 = boot menu) ---------- */
#fw-uefi, #fw-award, #fw-plain {
  position: fixed; inset: 0; z-index: 9000;
  font-family: "Courier New", "Lucida Console", monospace;
}

/* DEL — gray TianoCore/UEFI-style setup */
#fw-uefi {
  background: #000; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 26px;
}
.uefi-panel { width: 84%; max-width: 1040px; height: 70%; background: #b6b6b6; padding: 40px 46px; }
.uefi-cols { display: grid; grid-template-columns: 1.5fr 1fr; gap: 34px; height: 100%; }
.uefi-list { display: flex; flex-direction: column; gap: 7px; align-content: start; padding-top: 26px; }
.uefi-item {
  display: flex; align-items: center; gap: 10px; font-size: clamp(15px,1.8vw,21px); color: #1c1c86;
  text-decoration: none; cursor: pointer; padding: 1px 6px; width: fit-content;
}
.uefi-item .arrow { width: 14px; color: #1c1c86; }
.uefi-item .lab { min-width: 200px; }
.uefi-item .val { color: #1c1c86; }
.uefi-item.sel { background: #000; color: #fff; }
.uefi-item.sel .arrow, .uefi-item.sel .val { color: #fff; }
.uefi-help { color: #2626cc; font-size: clamp(14px,1.7vw,20px); line-height: 1.5; padding-top: 26px; }
.uefi-foot { color: #d0d0d0; font-size: clamp(13px,1.5vw,19px); letter-spacing: .5px; }

/* F8 — blue Phoenix/Award-style boot menu */
#fw-award {
  background: #0000a8; color: #d6d6d6; padding: 10px 16px;
  display: flex; flex-direction: column; font-size: clamp(13px,1.6vw,20px);
}
.award-title { text-align: center; color: #f4f4f4; }
.award-title b { color: #fff; }
.award-sub { text-align: center; color: #7ee0e0; margin-bottom: 6px; }
.award-box { flex: 1; border: 3px double #cfcfcf; display: grid; grid-template-columns: 1fr 320px; min-height: 0; }
.award-main { border-right: 3px double #cfcfcf; padding: 12px 16px; overflow: auto; }
.award-row { display: flex; justify-content: space-between; gap: 20px; padding: 1px 4px; cursor: pointer; }
.award-row .val { color: #f6f65c; white-space: nowrap; }
.award-row.sel { background: #a80000; color: #fff; }
.award-row.sel .val { color: #fff; }
.award-help { padding: 12px 16px; color: #d6d6d6; }
.award-help .hh { color: #fff; text-align: center; border-bottom: 1px solid #6a6ad0; margin-bottom: 10px; padding-bottom: 4px; }
.award-help .hb { line-height: 1.5; }
.award-foot { text-align: center; color: #7ee0e0; padding-top: 8px; }

/* plain-text terminal view of a document (opened from the F8 menu) */
#fw-plain {
  z-index: 9200; background: #000; color: #cfcfcf; padding: 18px 22px;
  overflow: auto; white-space: pre-wrap; font-size: 16px; line-height: 1.5;
}
#fw-plain .pt-head { color: #cfcfcf; white-space: pre-wrap; }
#fw-plain .pt-body { color: #dcdcdc; white-space: pre-wrap; margin: 4px 0; }
#fw-plain .pt-foot { color: #00ff3b; margin-top: 20px; white-space: pre-wrap; }
#fw-plain a { color: #6fd3ff; text-decoration: underline; }

/* ---------- Active 14" SVGA CRT overlay (scanlines + rolling scan + tube) ----------
   A full-screen layer above everything (desktop, windows, boot). It never blocks
   clicks (pointer-events:none). Three moving parts: a soft scan band rolling down,
   shimmering scanlines, and a faint mains-hum flicker. */
#crt {
  position: fixed; inset: 0; z-index: 2147483000; pointer-events: none;
  /* the rolling "scan band" — a soft bright sweep travelling down the tube */
  background: linear-gradient(180deg,
    rgba(120,160,255,0)   0%,
    rgba(140,180,255,.05) 42%,
    rgba(205,228,255,.15) 50%,
    rgba(140,180,255,.05) 58%,
    rgba(120,160,255,0)  100%);
  background-size: 100% 34vh;
  background-repeat: no-repeat;
  background-position: 0 -45vh;
  animation: crt-roll 5s linear infinite, crt-flicker 4s linear infinite;
}
@keyframes crt-roll   { to { background-position: 0 145vh; } }
@keyframes crt-flicker {
  0%,100% { opacity: 1; }  3% { opacity: .96; }  6% { opacity: 1; }
  48% { opacity: .99; }  50% { opacity: .93; }  52% { opacity: 1; }  80% { opacity: .98; }
}
/* scanlines — the line structure of an ~800x600 SVGA tube, with a subtle jitter */
#crt::before {
  content: ""; position: absolute; inset: -3px 0;
  background: repeating-linear-gradient(0deg,
    rgba(0,0,0,.17) 0, rgba(0,0,0,.17) 1px, transparent 1px, transparent 3px);
  opacity: .6;
  animation: crt-scan .16s steps(2) infinite;
}
@keyframes crt-scan { to { transform: translateY(3px); } }
/* faint RGB shadow-mask + curved-tube vignette + phosphor glow in the corners */
#crt::after {
  content: ""; position: absolute; inset: 0;
  background:
    repeating-linear-gradient(90deg,
      rgba(255,0,0,.04) 0, rgba(0,255,0,.02) 1px, rgba(0,0,255,.04) 2px, transparent 3px),
    radial-gradient(132% 132% at 50% 50%, transparent 58%, rgba(0,0,0,.32) 88%, rgba(0,0,10,.6) 100%);
  box-shadow: inset 0 0 100px rgba(0,0,0,.42);
}
@media (prefers-reduced-motion: reduce) {
  #crt, #crt::before { animation: none; }
}

@media (max-width: 560px) {
  .desk-icon { width: 72px; }
  .task-btn { min-width: 40px; }
  .task-btn span { display: none; }
}
