/*
  VOICE   1999 at midnight: a LAN-party PC, CRT hum, a kid who just discovered Counter-Strike.
  IDEA    The site is a dark-mode 1999 desktop (JSPaimbot 99): windows, icons, taskbar, Start menu.
  PICTURE Chrome WordArt "JSPaimbot" on a starfield wallpaper, seen through a curved CRT.
  COLOUR  Phosphor-dark navy #050A1A, beveled slate chrome #232A3D, title-bar blue #0B2A8A→#2F7BFF, LCD cyan #6FD0FF.
  TYPE    Big Shoulders Display (WordArt), VT323 (BIOS, LCDs), Tahoma/Verdana (1999 system UI).
  LAYOUT  ≥900px: free-floating draggable windows on a fixed desktop. <900px: windows stack in a scrolling page.
*/

/* Self-hosted fonts (SIL OFL) */
@font-face { font-family: 'Big Shoulders Display'; src: url('../fonts/big-shoulders-display-latin-900-normal.woff2') format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'VT323'; src: url('../fonts/vt323-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('../fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --bg: #050a1a;
  --face: #232a3d;
  --face-2: #1b2133;
  --hi: #4a5578;
  --hi-2: #343d5a;
  --lo: #05070d;
  --lo-2: #11151f;
  --field: #070b16;
  --text: #e6ebf7;
  --mute: #98a3bf;
  --blue: #2f6bff;
  --blue-hi: #5a8cff;
  --blue-deep: #0b2a8a;
  --cyan: #6fd0ff;
  --title: linear-gradient(90deg, #0b2a8a 0%, #2f6bff 100%);
  --title-off: linear-gradient(90deg, #2a3047 0%, #4a5270 100%);
  --ok: #4ade80;
  --bad: #ff8a8a;

  --raised: inset -1px -1px var(--lo), inset 1px 1px var(--hi), inset -2px -2px var(--lo-2), inset 2px 2px var(--hi-2);
  --sunken: inset -1px -1px var(--hi), inset 1px 1px var(--lo), inset -2px -2px var(--hi-2), inset 2px 2px var(--lo-2);
  --win-shadow: 0 18px 50px -12px rgba(0, 0, 0, .75), 0 0 0 1px rgba(0, 0, 0, .5);

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --specks: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='p' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='1' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 6 0 0 0 -4.3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23p%29'/%3E%3C/svg%3E");
  --distress: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='360'%3E%3Cfilter id='d' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.11' numOctaves='4' seed='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -12 0 0 0 8.7'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23d%29'/%3E%3C/svg%3E");
  --scan: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px);

  --ui: Tahoma, Verdana, 'Segoe UI', system-ui, sans-serif;
  --pixel: 'VT323', 'Lucida Console', monospace;
  --mono: 'JetBrains Mono', 'Lucida Console', ui-monospace, monospace;
  --display: 'Big Shoulders Display', Impact, 'Arial Black', sans-serif;
  --task-h: 42px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.45 var(--ui); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img, svg, canvas, iframe { display: block; max-width: 100%; }
a { color: var(--cyan); }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button, input, textarea { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: .9em; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px dotted var(--cyan); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 8px; top: -60px; z-index: 10001; background: var(--blue); color: #fff; padding: 8px 14px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 8px; }
.i { display: inline-flex; } .i svg { width: 16px; height: 16px; }
.win-ico { display: inline-flex; flex: none; }
.win-ico svg { width: 16px; height: 16px; }

/* 1999 pointer (desktop mice only) */
@media (pointer: fine) {
  html { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='28' shape-rendering='crispEdges'%3E%3Cpath d='M1 1v20l5-5 4 9 3-1-4-9h7z' fill='%23fff' stroke='%23000' stroke-width='1.2'/%3E%3C/svg%3E") 1 1, auto; }
  a, button, summary, label, [role="button"], .win-title { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='26' shape-rendering='crispEdges'%3E%3Cpath d='M7 1h3v9h2V7h3v4h2V9h3v12l-2 4H8l-5-7 2-2 2 2z' fill='%23fff' stroke='%23000' stroke-width='1.2'/%3E%3C/svg%3E") 7 1, pointer; }
  input, textarea { cursor: text; }
}

/* ── Chrome primitives ────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 32px; padding: 0 14px; border: 0; border-radius: 0;
  background: var(--face); color: var(--text); box-shadow: var(--raised);
  font: 700 13px/1 var(--ui); text-decoration: none; white-space: nowrap; cursor: pointer;
}
.btn:hover { background: #2a3248; }
.btn:active, .btn[aria-pressed="true"] { box-shadow: var(--sunken); padding-top: 2px; padding-left: 18px; }
.btn-blue { background: linear-gradient(180deg, #3f7bff, #1f56e0); color: #fff; box-shadow: inset -1px -1px #071a55, inset 1px 1px #9bbcff, inset -2px -2px #133a9e, inset 2px 2px #5a8cff; }
.btn-blue:hover { background: linear-gradient(180deg, #5a8cff, #2a62ee); }
.btn-blue:active { box-shadow: inset 1px 1px #071a55, inset -1px -1px #9bbcff; }
.btn-tip { background: linear-gradient(180deg, #ff6f6b, #e0403c); color: #fff; box-shadow: inset -1px -1px #6b1210, inset 1px 1px #ffb3b0, inset -2px -2px #a82623, inset 2px 2px #ff8f8c; }
.btn-tip:hover { background: linear-gradient(180deg, #ff8682, #ea4f4b); }
.btn-tip:active { box-shadow: inset 1px 1px #6b1210, inset -1px -1px #ffb3b0; }
.btn-sm { min-height: 28px; padding: 0 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: var(--raised); padding: 0 16px; }
.field-sunken { background: var(--field); box-shadow: var(--sunken); border: 0; color: var(--text); }
input.field-sunken, textarea.field-sunken { width: 100%; padding: 7px 9px; font-size: 16px; border-radius: 0; }
input.field-sunken:focus, textarea.field-sunken:focus { outline: 2px solid var(--blue); outline-offset: 0; }
textarea.field-sunken { resize: vertical; min-height: 88px; line-height: 1.45; }
.group { border: 0; margin: 0; padding: 14px 10px 10px; box-shadow: inset 1px 1px var(--lo), inset -1px -1px var(--hi-2), 1px 1px var(--hi-2); position: relative; display: grid; gap: 8px; }
.group legend { position: absolute; top: -8px; left: 8px; padding: 0 5px; background: var(--face-2); font-weight: 700; font-size: 12.5px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mute); }
.check input { width: 16px; height: 16px; accent-color: var(--blue); }

/* ── Boot screen ──────────────────────────────────── */
.boot { position: fixed; inset: 0; z-index: 10000; background: #000; color: #c7cbd4; font: 22px/1.25 var(--pixel); padding: 28px 34px; overflow: hidden; }
.boot-bios { margin: 0; font: inherit; white-space: pre-wrap; }
.boot-splash { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; background: radial-gradient(ellipse at center, #0b2a8a 0%, #020617 70%); opacity: 0; transition: opacity .35s; }
.boot.splash .boot-splash { opacity: 1; }
.boot-sub { font: 26px var(--pixel); color: var(--cyan); letter-spacing: .2em; }
.boot-bar { width: 220px; height: 14px; box-shadow: var(--sunken); background: var(--field); padding: 3px; margin-top: 18px; }
.boot-bar span { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--blue) 0 10px, transparent 10px 12px); transition: width 1s steps(10); }
.boot.splash .boot-bar span { width: 100%; }
.boot-skip { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: #6b7280; font-size: 18px; }
.boot.done { opacity: 0; transition: opacity .3s; pointer-events: none; }

/* ── Screen + wallpaper ───────────────────────────── */
.wallpaper {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 55% at 55% 42%, rgba(47, 107, 255, .26), transparent 70%),
    radial-gradient(ellipse 90% 70% at 50% 110%, rgba(11, 42, 138, .5), transparent 70%),
    var(--bg);
}
.wallpaper::after { content: ''; position: absolute; inset: 0; background: var(--specks), var(--grain); opacity: .08; }
.stars { position: absolute; inset: 0; width: 100%; height: 100%; }

/* WordArt: chrome face + extruded depth layer */
.wordart { position: relative; display: inline-block; font-family: var(--display); font-weight: 900; line-height: .9; letter-spacing: -.01em; transform: skewX(-7deg); }
.wordart::before {
  content: attr(data-text); position: absolute; inset: 0; z-index: 0; color: #061038;
  text-shadow: 1px 1px 0 #0a1f66, 2px 2px 0 #0a1f66, 3px 3px 0 #0b2373, 4px 4px 0 #0b2373, 5px 5px 0 #0c267d, 6px 6px 0 #0c267d, 7px 7px 0 #081a57, 8px 8px 0 #081a57, 9px 9px 0 #061340, 10px 10px 0 #061340, 12px 16px 24px rgba(0, 0, 0, .7);
}
.wordart span {
  position: relative; z-index: 1; display: block;
  background: var(--specks), linear-gradient(180deg, #ffffff 0%, #dce8ff 30%, #8fb2ff 47%, #0e2f9e 50%, #2457e0 64%, #9ec0ff 86%, #f2f7ff 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #fff;
  -webkit-mask-image: var(--distress); mask-image: var(--distress); -webkit-mask-size: 320px; mask-size: 320px;
}
.wordart-sm { font-size: 46px; }
.wordart-sm span { -webkit-mask-image: none; mask-image: none; }
.wordart-sm::before { text-shadow: 1px 1px 0 #0a1f66, 2px 2px 0 #0b2373, 3px 3px 0 #0c267d, 4px 4px 0 #081a57, 6px 8px 12px rgba(0, 0, 0, .6); }
.wordart-hero { font-size: clamp(64px, 15vw, 230px); }
.wall-sub { font: 22px/1.2 var(--pixel); color: var(--cyan); text-shadow: 0 0 10px rgba(111, 208, 255, .55); letter-spacing: .04em; }

/* ── Desktop icons ────────────────────────────────── */
.icons { display: grid; gap: 4px; }
.icon {
  display: grid; justify-items: center; gap: 3px; width: 78px; padding: 4px 3px; border: 1px dotted transparent;
  background: none; color: #fff; text-align: center; font: 12px/1.2 var(--ui); text-shadow: 1px 1px 1px #000, 0 0 6px rgba(0, 0, 0, .8); cursor: pointer;
}
.icon svg { width: 30px; height: 30px; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .55)); }
.icon:hover span { background: rgba(47, 107, 255, .35); }
.icon:focus-visible { outline: none; border-color: #fff; }
.icon:focus-visible span, .icon.sel span { background: var(--blue); }
.icon span { padding: 1px 3px; }

/* ── Windows ──────────────────────────────────────── */
.win { display: none; flex-direction: column; background: var(--face); box-shadow: var(--raised), var(--win-shadow); padding: 3px; outline: none; }
.win.open { display: flex; }
.win-title { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 3px 0 6px; background: var(--title-off); color: #c9cfe0; flex: none; user-select: none; touch-action: none; }
.win.active .win-title { background: var(--title); color: #fff; }
.win-title h2 { flex: 1; font: 700 12.5px/1 var(--ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-ctl { display: flex; gap: 2px; }
.win-ctl button { width: 22px; height: 19px; padding: 0; border: 0; display: grid; place-items: center; background: var(--face); color: var(--text); box-shadow: var(--raised); cursor: pointer; }
.win-ctl button:active { box-shadow: var(--sunken); }
.win-ctl button[data-act="close"] { margin-left: 2px; }
.win-ctl svg { width: 10px; height: 10px; }
.win-body { flex: 1; overflow: auto; padding: 10px; background: var(--face-2); box-shadow: var(--sunken); margin-top: 3px; overscroll-behavior: contain; }
.win-status { flex: none; margin-top: 3px; padding: 3px 8px; font-size: 12px; color: var(--mute); box-shadow: var(--sunken); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win-status a { color: var(--cyan); }
.win.min .win-body, .win.min .win-status { display: none; }

/* Welcome */
.welcome { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 0; padding: 0; }
.welcome-side { background: linear-gradient(180deg, #0b2a8a, #050a1a); padding: 16px 10px; display: grid; align-content: start; justify-items: center; gap: 6px; overflow: hidden; }
.welcome-side .wordart { font-size: 32px; }
.welcome-ed { font: 18px var(--pixel); color: var(--cyan); letter-spacing: .15em; }
.welcome-main { padding: 12px 14px; display: grid; gap: 10px; align-content: start; }
.welcome-lede { font-size: 13.5px; line-height: 1.5; }
.welcome-list { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
.welcome-list button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 4px 6px; border: 0; background: none; color: var(--text); text-align: left; font-size: 13px; cursor: pointer; }
.welcome-list button:hover, .welcome-list button:focus-visible { background: var(--blue); color: #fff; outline: none; }
.welcome-list svg { width: 22px; height: 22px; flex: none; }
.welcome-cta { display: flex; flex-wrap: wrap; gap: 8px; }

/* Faceit Player (LCD) */
.player { display: grid; gap: 8px; }
.lcd { background: #02060f; box-shadow: var(--sunken); padding: 8px 10px; color: var(--cyan); font-family: var(--pixel); text-shadow: 0 0 8px rgba(111, 208, 255, .6); }
.lcd-top { display: flex; align-items: center; gap: 14px; }
.lvl { width: 44px; height: 44px; flex: none; }
.lcd-main { flex: 1; }
.lcd-k { font-size: 18px; opacity: .75; line-height: 1; }
.lcd-big { font-size: 44px; line-height: .9; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.eq { display: flex; align-items: flex-end; gap: 3px; height: 38px; }
.eq i { width: 6px; background: linear-gradient(0deg, #2f6bff, #6fd0ff 70%, #e6f6ff); box-shadow: 0 0 6px rgba(111, 208, 255, .5); animation: eq 1s ease-in-out infinite alternate; }
@keyframes eq { from { height: 15%; } to { height: 100%; } }
.marquee { overflow: hidden; white-space: nowrap; font-size: 18px; margin-top: 6px; border-top: 1px dashed rgba(111, 208, 255, .25); padding-top: 4px; }
.marquee span { display: inline-block; padding-left: 100%; animation: marquee 16s linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }
.seek { height: 12px; box-shadow: var(--sunken); background: var(--field); padding: 2px; }
.seek span { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--blue) 0 8px, #1f4fd0 8px 10px); transition: width 1.1s steps(14); }
.seek-label { font-size: 12.5px; color: var(--mute); margin-top: -4px; min-height: 1.5em; }
.stat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 0; }
.stat-grid div { box-shadow: var(--sunken); background: var(--field); padding: 4px 7px; }
.stat-grid dt { font-size: 11.5px; color: var(--mute); }
.stat-grid dd { margin: 0; font: 24px/1 var(--pixel); color: #fff; white-space: nowrap; }
.playlist { display: flex; align-items: center; gap: 10px; }
.playlist-k { font-size: 12px; color: var(--mute); }
.form { list-style: none; display: flex; gap: 4px; min-height: 22px; }
.form li { width: 26px; height: 22px; display: grid; place-items: center; font: 20px/1 var(--pixel); box-shadow: var(--raised); background: var(--face); }
.form .w { background: var(--blue); color: #fff; }
.form .l { color: var(--mute); }

/* Config */
.cfg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; padding-top: 18px; align-items: start; }
.cfg-col { display: grid; gap: 18px; }
.code-plate { min-height: 48px; display: grid; place-items: center; padding: 10px; text-align: center; background: var(--scan), #02060f; }
.code-plate code { font: 22px var(--pixel); color: var(--cyan); text-shadow: 0 0 8px rgba(111, 208, 255, .6); letter-spacing: .05em; }
.code-plate.empty code { font: 14px var(--ui); color: var(--mute); text-shadow: none; letter-spacing: 0; }
.steps { padding-left: 18px; display: grid; gap: 2px; color: var(--mute); font-size: 12.5px; }
.steps strong { color: var(--text); }
.steps code { color: var(--cyan); }
.props { display: grid; grid-template-columns: 1fr auto; margin: 0; }
.props dt, .props dd { padding: 4px 0; border-bottom: 1px solid var(--lo-2); box-shadow: 0 1px var(--hi-2); }
.props dt { color: var(--mute); }
.props dd { margin: 0; text-align: right; font-weight: 700; }
.copy-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; color: var(--mute); }
.copy-line code { padding: 6px 8px; color: var(--text); }
.dl { display: grid; gap: 6px; }
.dl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.dl-row .btn { min-height: 26px; }
.dl-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: center; padding: 5px 6px; width: 100%; border: 0; background: none; text-align: left; cursor: pointer; text-decoration: none; color: var(--text); }
.dl-item:hover { background: var(--blue); color: #fff; }
.dl-item:hover .dl-blurb { color: #dfe8ff; }
.dl-item svg { width: 24px; height: 24px; }
.dl-name { display: block; font-weight: 700; font-family: var(--mono); font-size: 13px; }
.dl-blurb { display: block; font-size: 12.5px; color: var(--mute); }
.dl-go { font-size: 12.5px; font-weight: 700; }
.peek summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.peek .steps { margin: 8px 0; }
.cfg-text { margin: 0; padding: 10px; max-height: 240px; overflow: auto; font: 12.5px/1.5 var(--mono); color: #b9c6de; }

/* JSPad (text viewer) */
.pad-bar { display: flex; gap: 4px; padding: 4px 2px 0; flex: none; }
.pad-bar .btn[aria-pressed="true"] { box-shadow: var(--sunken); }
.pad-body { padding: 0; background: #02060f; display: flex; }
.pad-text { flex: 1; margin: 0; padding: 8px 0; counter-reset: ln; font: 13px/1.55 var(--mono); color: #c9d4ea; white-space: pre; overflow: auto; outline: none; tab-size: 4; }
.pad-text.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.pad-text .l { display: block; counter-increment: ln; padding: 0 12px 0 4.2em; text-indent: -3.4em; min-height: 1.55em; }
.pad-text .l::before { content: counter(ln); display: inline-block; width: 2.6em; margin-right: .8em; text-align: right; color: #3d4a6b; text-indent: 0; user-select: none; }
.pad-text .l:hover { background: rgba(47, 107, 255, .08); }
.pad-text .c { color: #5f6f94; font-style: italic; }
.pad-text .k { color: var(--cyan); }
.pad-text .v { color: #ffd479; }
.pad-text .e { color: #b49cff; }
.pad-text:focus-visible { box-shadow: inset 0 0 0 2px var(--blue); }

/* TV */
.tv { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 10px; align-items: start; }
.tv-screen { position: relative; aspect-ratio: 16 / 9; background: #000; box-shadow: var(--sunken); overflow: hidden; border-radius: 6px / 10px; }
.tv-screen iframe { width: 100%; height: 100%; border: 0; }
.static { position: absolute; inset: 0; background: var(--grain); background-size: 120px; opacity: .35; animation: static .2s steps(3) infinite; }
@keyframes static { 33% { background-position: 40px 20px; } 66% { background-position: -30px 50px; } }
.tv-off { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 6px; padding: 16px; background: radial-gradient(ellipse at center, rgba(11, 42, 138, .6), rgba(0, 0, 0, .85) 70%); font-family: var(--pixel); color: var(--cyan); text-shadow: 0 0 8px rgba(111, 208, 255, .6); }
.tv-ch { position: absolute; top: 10px; right: 14px; font: 28px var(--pixel); color: #7cff9a; text-shadow: 0 0 8px rgba(124, 255, 154, .6); }
.tv-off .big { font-size: clamp(22px, 2.6vw, 30px); color: #fff; line-height: 1; }
.tv-off .small { font-size: 17px; }
.tv-off .btn { justify-self: center; margin-top: 8px; font-family: var(--ui); text-shadow: none; }
.sched-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.sched h3 { font: 700 14px var(--ui); }
.sched ul { list-style: none; box-shadow: var(--sunken); background: var(--field); }
.sched li { display: grid; grid-template-columns: 34px 62px minmax(0, 1fr); gap: 6px; padding: 4px 8px; font-size: 12.5px; }
.sched li:nth-child(even) { background: rgba(255, 255, 255, .025); }
.sched li.next { background: var(--blue); color: #fff; }
.sched .d { font-weight: 700; }
.sched .w { color: var(--mute); }
.sched li.next .w { color: #dfe8ff; }

/* Media player */
.media { display: grid; gap: 8px; }
.media-tabs { display: flex; gap: 2px; margin-bottom: -8px; position: relative; z-index: 1; }
.media-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 0; background: var(--face); color: var(--mute); box-shadow: var(--raised); font-weight: 700; font-size: 12.5px; cursor: pointer; }
.media-tabs button[aria-selected="true"] { background: var(--face-2); color: var(--text); padding-bottom: 8px; }
.media-screen { position: relative; aspect-ratio: 16 / 9; background: #000; box-shadow: var(--sunken); overflow: hidden; border-radius: 8px / 14px; }
.media-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media-screen::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,.5)); }
.media-idle { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; text-align: center; padding: 14px; font-family: var(--pixel); color: var(--cyan); text-shadow: 0 0 8px rgba(111,208,255,.6); background: radial-gradient(ellipse at center, rgba(11,42,138,.55), rgba(0,0,0,.9) 70%); }
.media-idle .big { font-size: 28px; color: #fff; }
.media-idle .small { font-size: 17px; }
.media-idle .rec { position: absolute; top: 10px; left: 14px; font-size: 20px; color: #ff4d4d; text-shadow: 0 0 8px rgba(255,77,77,.6); }
.media-idle .tc { position: absolute; bottom: 10px; right: 14px; font-size: 20px; color: #fff; }
.media-controls { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.media-btn { width: 40px; padding: 0; }
.media-btn svg { width: 14px; height: 14px; }
.media-btn:active { padding: 2px 0 0 2px; }
.media-btn[disabled] { padding: 0; }
.media-lcd { font-size: 18px; padding: 4px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Display properties */
.display { display: grid; gap: 14px; }
.monitor { justify-self: center; width: 220px; padding: 10px 10px 22px; background: #c9d2e6; box-shadow: inset -2px -2px #8d97ad, inset 2px 2px #fff; position: relative; }
.monitor::after { content: ''; position: absolute; left: 50%; bottom: -14px; width: 80px; height: 14px; translate: -50% 0; background: #a9b3c9; box-shadow: inset 0 -3px #8d97ad; }
.monitor canvas { display: block; width: 100%; aspect-ratio: 4 / 3; box-shadow: inset 0 0 0 1px #000; }
.wall-list { display: grid; box-shadow: var(--sunken); background: var(--field); padding: 3px; max-height: 160px; overflow: auto; }
.wall-list button { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 0; background: none; color: var(--text); text-align: left; font-size: 13px; cursor: pointer; }
.wall-list button[aria-checked="true"] { background: var(--blue); color: #fff; }
.wall-list button:focus-visible { outline: 1px dotted #fff; outline-offset: -3px; }
.display-acts { display: flex; justify-content: flex-end; gap: 6px; }

/* My Videos: theater player */
.vids { display: grid; gap: 8px; align-content: start; }
.vid-stage { position: relative; aspect-ratio: 16 / 9; background: var(--scan), #000; box-shadow: var(--sunken); overflow: hidden; }
.vid-stage iframe, .vid-stage img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.vid-poster { position: absolute; inset: 0; width: 100%; border: 0; padding: 0; cursor: pointer; background: #000; }
.vid-poster::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgba(0, 0, 0, .65)); }
.vid-poster .big-play { position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 1; width: 84px; height: 60px; display: grid; place-items: center; background: var(--face); box-shadow: var(--raised); color: #fff; transition: transform .15s; }
.vid-poster:hover .big-play, .vid-poster:focus-visible .big-play { transform: scale(1.08); background: var(--blue); }
.vid-poster .big-play svg { width: 28px; height: 28px; }
.vid-src { position: absolute; left: 12px; top: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; font: 700 12px var(--ui); color: #fff; background: rgba(0, 0, 0, .6); }
.vid-src.twitch { background: #6e3cd6; }
.vid-src.youtube { background: #d41f1f; }
.vid-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; font: 22px var(--pixel); color: var(--cyan); text-shadow: 0 0 8px rgba(111, 208, 255, .6); }
.vid-bar { display: flex; align-items: center; gap: 10px; }
.vid-title { flex: 1; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vid-list { list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(170px, 1fr); gap: 8px; overflow-x: auto; padding: 4px 2px 6px; scroll-snap-type: x mandatory; }
.vid-list li { scroll-snap-align: start; }
.vid-item { width: 100%; display: grid; gap: 5px; padding: 4px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }
.vid-item .thumb { position: relative; aspect-ratio: 16 / 9; background: var(--scan), #02060f; box-shadow: var(--sunken); overflow: hidden; display: grid; place-items: center; color: var(--mute); }
.vid-item .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vid-item .thumb .tag-src { position: absolute; left: 4px; bottom: 4px; padding: 1px 5px; font: 700 10.5px var(--ui); color: #fff; }
.vid-item .t { font-size: 12.5px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vid-item:hover .thumb, .vid-item:focus-visible .thumb { outline: 2px solid var(--blue-hi); }
.vid-item[aria-current="true"] { background: var(--blue); color: #fff; }

/* aim.exe high scores */
.aim-hud { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; }
.aim-hs { align-self: stretch; height: auto; }
.aim-board { position: absolute; inset: 0; z-index: 2; display: grid; align-content: start; justify-items: center; gap: 8px; padding: 14px; overflow: auto; background: radial-gradient(ellipse at center, #0b1c4a, #02060f 80%); }
.hs-list { list-style: none; width: min(380px, 100%); font: 22px/1.25 var(--pixel); color: var(--cyan); text-shadow: 0 0 8px rgba(111, 208, 255, .5); }
.hs-list li { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; gap: 10px; padding: 1px 6px; }
.hs-list li:nth-child(1) { color: #ffd479; }
.hs-list li.me { background: rgba(47, 107, 255, .35); color: #fff; }
.hs-list .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-note { font-size: 12.5px; color: var(--mute); text-align: center; max-width: 340px; }
.hs-submit { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.hs-submit input { width: 170px; }
.hs-msg { font-size: 13px; min-height: 1.4em; }
.hs-msg.ok { color: var(--ok); }
.hs-msg.bad { color: var(--bad); }

/* Guestbook */
.guest { display: grid; gap: 10px; align-content: start; grid-template-rows: auto minmax(120px, 1fr); }
.guest-form { display: grid; gap: 6px; padding: 10px; background: linear-gradient(180deg, #1a2440, #141b30); box-shadow: var(--sunken); }
.guest-hi { font-size: 12.5px; color: var(--mute); }
.guest-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; align-items: start; }
.guest-row label { font-size: 12.5px; color: var(--mute); padding-top: 7px; }
.guest-row textarea { min-height: 60px; }
.guest-foot { display: flex; align-items: center; gap: 10px; }
.guest-count { font: 17px var(--pixel); color: var(--mute); }
.guest-foot .form-status { flex: 1; }
.guest-list { list-style: none; margin: 0; padding: 6px; overflow: auto; display: grid; gap: 6px; align-content: start; }
.guest-list li { padding: 8px 10px; background: rgba(255, 255, 255, .03); border-left: 3px solid var(--blue); }
.guest-list li.new { border-left-color: var(--ok); }
.guest-list .who { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; }
.guest-list .when { font-weight: 400; font-size: 11.5px; color: var(--mute); white-space: nowrap; }
.guest-list .msg { margin-top: 2px; color: #cfd8ea; overflow-wrap: anywhere; }
.guest-list .empty { border: 0; background: none; text-align: center; color: var(--mute); font: 20px var(--pixel); padding: 20px; }

/* Clips folder */
.clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.clip { display: grid; gap: 6px; }
.clip-media { position: relative; aspect-ratio: 16 / 9; background: var(--scan), #02060f; box-shadow: var(--sunken); overflow: hidden; }
.clip-media img, .clip-media iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.clip-play { position: absolute; inset: 0; width: 100%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.clip-play span { width: 46px; height: 34px; display: grid; place-items: center; background: var(--face); box-shadow: var(--raised); color: #fff; }
.clip-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; color: var(--mute); font-size: 12.5px; }
.clip-title { font-size: 13px; font-weight: 700; }
.clip-note { font-size: 12px; color: var(--mute); }

/* Projects */
.projects { display: grid; gap: 8px; }
.proj { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 10px; padding: 8px; box-shadow: var(--sunken); background: var(--field); }
.proj > svg { grid-row: span 4; width: 32px; height: 32px; }
.proj-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.proj h3 { font: 700 14.5px var(--ui); }
.tag { font-size: 11.5px; padding: 1px 7px; box-shadow: var(--raised); background: var(--face); color: var(--mute); }
.tag.live { background: var(--blue); color: #fff; }
.proj p { color: var(--mute); font-size: 12.5px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; }
.chips li { font: 16px/1.2 var(--pixel); color: var(--cyan); padding: 0 6px; box-shadow: var(--sunken); }
.proj-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }

/* Device Manager tree */
.tree { list-style: none; box-shadow: var(--sunken); background: var(--field); padding: 6px 10px; font-size: 12.5px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.tree > li { padding: 3px 0; }
.tree-k { display: flex; align-items: center; gap: 6px; color: var(--mute); }
.tree-k::before { content: '−'; width: 11px; height: 11px; display: grid; place-items: center; font-size: 10px; line-height: 1; border: 1px solid var(--hi); color: var(--text); }
.tree-v { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px 22px; padding-left: 12px; border-left: 1px dotted var(--hi); font-weight: 700; }
.tree-v a { margin-left: auto; font-weight: 400; font-size: 12.5px; }

/* Aim trainer */
.aim { display: grid; gap: 10px; }
.aim-hud { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.lcd-sm { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 10px; }
.lcd-n { font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.aim-field { position: relative; height: 250px; overflow: hidden; touch-action: manipulation; background: radial-gradient(ellipse at center, #0b1c4a, #02060f 75%); }
.aim-msg { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 20px; color: var(--mute); }
.aim-title { font: 34px var(--pixel); color: var(--cyan); text-shadow: 0 0 8px rgba(111, 208, 255, .6); }
.target { position: absolute; border: 0; padding: 0; border-radius: 50%; transform: translate(-50%, -50%); background: radial-gradient(circle, #fff 0 14%, #2f6bff 15% 34%, #fff 35% 54%, #2f6bff 55% 74%, #fff 75%); box-shadow: 0 0 0 2px #000, 0 0 16px rgba(111, 208, 255, .6); cursor: pointer; animation: pop .12s ease-out; }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.2); } }
.hit { position: absolute; transform: translate(-50%, -50%); font: 22px var(--pixel); color: #7cff9a; pointer-events: none; animation: rise .6s ease-out forwards; }
@keyframes rise { to { transform: translate(-50%, -130%); opacity: 0; } }

/* Buddy list */
.buddies { padding: 0; display: grid; align-content: start; }
.buddy-me { display: flex; align-items: center; gap: 10px; padding: 9px 10px; background: linear-gradient(180deg, #16204a, #0b1230); }
.buddy-me strong { display: block; font-size: 14px; }
.buddy-me span:not(.status-dot) { font-size: 12.5px; color: var(--mute); }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: #f2c94c; box-shadow: 0 0 0 2px #000; flex: none; }
.status-dot.on { background: var(--ok); box-shadow: 0 0 0 2px #000, 0 0 10px var(--ok); }
.buddy-k { padding: 8px 12px 4px; font-size: 12.5px; font-weight: 700; color: var(--mute); }
.buddy-list { list-style: none; padding: 0 6px 8px; }
.buddy-list a { display: flex; align-items: center; gap: 9px; padding: 4px 8px; text-decoration: none; color: var(--text); }
.buddy-list a:hover, .buddy-list a:focus-visible { background: var(--blue); color: #fff; outline: none; }
.buddy-list svg { width: 18px; height: 18px; color: var(--brand, var(--cyan)); flex: none; }
.buddy-list a:hover svg { color: #fff; }
.buddy-list .h { margin-left: auto; font-size: 12px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buddy-list a:hover .h { color: #dfe8ff; }

/* Mail */
.mail { display: grid; gap: 7px; align-content: start; }
.mail-blurb { color: var(--mute); }
.mail-row { display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: start; gap: 8px; border: 0; padding: 0; margin: 0; }
.mail-k { font-size: 12.5px; color: var(--mute); padding-top: 7px; }
.mail-to { padding: 6px 9px; font-weight: 700; }
.reasons-row legend { float: left; width: 62px; margin-right: 8px; padding-top: 6px; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.reasons label { position: relative; }
.reasons input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.reasons span { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; background: var(--face); box-shadow: var(--raised); font-size: 13px; }
.reasons input:checked + span { background: var(--blue); color: #fff; box-shadow: var(--sunken); }
.reasons input:focus-visible + span { outline: 2px dotted var(--cyan); outline-offset: 2px; }
.err { color: var(--bad); font-size: 12.5px; margin-top: 3px; }
.err:empty { display: none; }
[aria-invalid="true"] { outline: 2px solid var(--bad) !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mail-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.form-status { font-size: 13px; color: var(--mute); }
.form-status.ok { color: var(--ok); }
.form-status.bad { color: var(--bad); }

/* Tip Jar (Ko-fi) */
.kofi { display: grid; gap: 8px; align-content: start; grid-template-rows: auto minmax(0, 1fr) auto; }
.kofi-lede { color: var(--mute); }
.kofi-frame { position: relative; min-height: 420px; background: #f9f9f9; overflow: hidden; }
.kofi-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #f9f9f9; }
.kofi-wait { position: absolute; inset: 0; display: grid; place-items: center; font: 22px var(--pixel); color: #3a3f4e; background: #f9f9f9; }
#kofi-out { justify-self: start; }

/* Help */
.faq { display: grid; gap: 4px; }
.faq details { box-shadow: var(--raised); background: var(--face); }
.faq summary { list-style: none; padding: 6px 10px; font-weight: 700; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: '?'; width: 20px; height: 20px; display: grid; place-items: center; background: var(--blue-deep); color: #fff; font: 16px var(--pixel); flex: none; }
.faq details[open] summary { background: var(--blue); color: #fff; }
.faq details p { padding: 8px 10px 10px 40px; color: var(--mute); }

/* Recycle bin */
.bin-file { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 8px; padding: 4px 8px 4px 4px; border: 0; background: none; color: var(--text); cursor: pointer; }
.bin-file:hover, .bin-file:focus-visible { background: var(--blue); color: #fff; outline: none; }
.bin-file svg { width: 24px; height: 24px; }
.bin-text { margin: 0; padding: 10px 12px; font: 20px/1.3 var(--pixel); color: var(--text); white-space: pre-wrap; }

/* ── Taskbar + Start menu ─────────────────────────── */
.taskbar { display: flex; align-items: center; gap: 4px; height: var(--task-h); padding: 3px 4px; background: var(--face); box-shadow: inset 0 1px var(--hi), inset 0 2px var(--hi-2); z-index: 900; }
.start-btn { display: inline-flex; align-items: center; gap: 6px; height: 100%; padding: 0 10px 0 6px; border: 0; background: var(--face); box-shadow: var(--raised); font: 900 15px var(--ui); color: var(--text); cursor: pointer; flex: none; }
.start-btn svg { width: 20px; height: 20px; }
.start-btn[aria-expanded="true"] { box-shadow: var(--sunken); }
.task-buttons { flex: 1; display: flex; gap: 3px; height: 100%; overflow: hidden; }
.task-btn { flex: 0 1 170px; display: flex; align-items: center; gap: 6px; height: 100%; padding: 0 8px; border: 0; background: var(--face); box-shadow: var(--raised); font-size: 12.5px; color: var(--text); text-align: left; cursor: pointer; overflow: hidden; }
.task-btn span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-btn.active { box-shadow: var(--sunken); background: repeating-conic-gradient(var(--face) 0 25%, #2b3350 0 50%) 0 0 / 2px 2px; font-weight: 700; }
.tray { display: flex; align-items: center; gap: 6px; height: 100%; padding: 0 8px; box-shadow: var(--sunken); flex: none; }
.tray-social { list-style: none; display: flex; gap: 2px; }
.tray-social a, .tray-btn { width: 26px; height: 26px; display: grid; place-items: center; color: var(--mute); border: 0; background: none; padding: 0; cursor: pointer; }
.tray-social a:hover, .tray-btn:hover { color: var(--brand, #fff); }
.tray-social svg, .tray-btn svg { width: 15px; height: 15px; }
.clock { font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 58px; text-align: right; }
.live-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; background: #d81b23; color: #fff; font: 700 11.5px var(--ui); text-decoration: none; box-shadow: var(--raised); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.start-menu { position: fixed; left: 2px; bottom: var(--task-h); z-index: 950; display: flex; width: 300px; max-height: calc(100vh - var(--task-h) - 8px); overflow: auto; background: var(--face); box-shadow: var(--raised), var(--win-shadow); padding: 3px; }
.start-banner { width: 32px; flex: none; background: linear-gradient(0deg, #0b2a8a, #2f6bff); display: flex; align-items: flex-end; justify-content: center; padding-bottom: 10px; }
.start-banner span { writing-mode: vertical-rl; transform: rotate(180deg); font: 900 22px var(--display); color: #fff; letter-spacing: .02em; }
.start-banner b { color: var(--cyan); }
.start-menu nav { flex: 1; display: grid; align-content: start; }
.start-list { list-style: none; padding: 2px 0; }
.start-sub { border-top: 1px solid var(--lo); box-shadow: inset 0 1px var(--hi-2); }
.start-list a, .start-list button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 5px 10px; border: 0; background: none; color: var(--text); text-decoration: none; font-size: 13.5px; text-align: left; cursor: pointer; }
.start-list a:hover, .start-list button:hover, .start-list a:focus-visible, .start-list button:focus-visible { background: var(--blue); color: #fff; outline: none; }
.start-list svg { width: 24px; height: 24px; }
.start-ico { width: 24px; display: grid; place-items: center; }
.start-ico svg { width: 20px; height: 20px; }
.power { width: 24px; text-align: center; font-size: 18px; }
.start-copy { padding: 8px 10px; font-size: 11.5px; color: var(--mute); border-top: 1px solid var(--lo); }

.balloon { position: fixed; right: 12px; bottom: calc(var(--task-h) + 12px); z-index: 960; max-width: 280px; padding: 10px 12px 10px 14px; background: #ffffe1; color: #111; border: 1px solid #000; border-radius: 8px; font-size: 13px; box-shadow: 4px 4px 0 rgba(0, 0, 0, .4); }
.balloon::after { content: ''; position: absolute; right: 60px; bottom: -10px; border: 10px solid transparent; border-top-color: #ffffe1; border-bottom: 0; }
.balloon strong { display: block; margin-bottom: 2px; }
.balloon a { color: #0b2a8a; font-weight: 700; }

/* ── Overlays ─────────────────────────────────────── */
.overlay { position: fixed; inset: 0; z-index: 9990; }
.bsod { background: #0b1fb0; color: #fff; display: grid; place-items: center; padding: 24px; font: 24px/1.35 var(--pixel); }
.bsod-in { max-width: 640px; display: grid; gap: 18px; }
.bsod-tag { justify-self: center; background: #c0c4cc; color: #0b1fb0; padding: 0 8px; }
.bsod-press { justify-self: center; }
.shutdown { background: #000; color: #ff9a2e; display: grid; place-content: center; justify-items: center; gap: 30px; text-align: center; font: clamp(28px, 4vw, 44px)/1.2 var(--pixel); }
.shutdown .btn { font-family: var(--ui); }
.saver { background: #000; width: 100vw; height: 100vh; }
.crt {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse 120% 100% at 50% 50%, transparent 62%, rgba(0, 0, 0, .55) 100%);
  animation: flicker 6s infinite steps(1);
}
@keyframes flicker { 0%, 97%, 100% { opacity: 1; } 98% { opacity: .85; } }

.toast { position: fixed; left: 50%; bottom: calc(var(--task-h) + 16px); z-index: 970; transform: translate(-50%, 16px); padding: 8px 14px; background: #ffffe1; color: #111; border: 1px solid #000; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .15s, transform .2s; box-shadow: 3px 3px 0 rgba(0, 0, 0, .4); max-width: calc(100vw - 24px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #ffe1e1; }

/* ── Desktop mode (≥900px): fixed screen, floating windows ── */
@media (min-width: 900px) {
  body { overflow: hidden; }
  .screen { position: fixed; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr) var(--task-h); }
  .desktop { position: relative; overflow: hidden; }
  .wordart-hero { position: absolute; left: 42%; top: 24%; translate: -50% -50%; z-index: 1; pointer-events: none; white-space: nowrap; font-size: clamp(64px, 12.5vw, 200px); }
  .wall-sub { position: absolute; left: 42%; top: calc(24% + clamp(36px, 6.8vw, 110px)); translate: -50% 0; z-index: 1; pointer-events: none; white-space: nowrap; }
  .icons { position: absolute; z-index: 2; left: 8px; top: 8px; bottom: 8px; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 72px); align-content: start; }
  .win { position: absolute; z-index: 10; max-width: calc(100% - 16px); max-height: calc(100% - 16px); }
  .win.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; max-width: none; max-height: none; }
  .win.min { display: none; }
  #w-welcome { width: 560px; }
  #w-stats { width: 400px; }
  #w-config { width: 720px; }
  #w-tv { width: 680px; }
  #w-media { width: 600px; }
  #w-display { width: 380px; }
  #w-guest { width: 480px; height: min(620px, calc(100% - 24px)); }
  #w-kofi { width: 420px; height: min(660px, calc(100% - 24px)); }
  #w-pad { width: 600px; height: min(560px, calc(100% - 40px)); }
  #w-clips { width: min(880px, calc(100% - 220px)); }
  #w-projects { width: 500px; }
  #w-setup { width: 460px; }
  #w-aim { width: 520px; }
  #w-buddies { width: 240px; }
  #w-mail { width: 480px; }
  #w-help { width: 460px; }
  #w-bin { width: 340px; }
}

/* ── Stacked mode (<900px): windows flow like a page ── */
@media (max-width: 899.98px) {
  .screen { padding-bottom: calc(var(--task-h) + 8px); }
  .desktop { position: relative; padding: 28px 12px 12px; display: grid; gap: 14px; }
  .wallpaper { position: fixed; }
  .wordart-hero { position: relative; z-index: 1; justify-self: start; font-size: clamp(56px, 19vw, 150px); margin-left: 4px; }
  .wall-sub { position: relative; z-index: 1; font-size: 20px; }
  .icons { position: relative; z-index: 2; grid-template-columns: repeat(4, minmax(0, 1fr)); justify-items: center; padding: 6px 0; }
  .icon { width: 100%; max-width: 92px; }
  .win { position: relative; z-index: 3; width: auto !important; left: auto !important; top: auto !important; }
  .win-ctl button[data-act="max"] { display: none; }
  .win.min .win-body, .win.min .win-status { display: none; }
  .win.min .win-title { cursor: pointer; }
  .desktop { gap: 8px; }
  .cfg, .tv { grid-template-columns: minmax(0, 1fr); }
  .pad-body { max-height: 70vh; }
  .tree { grid-template-columns: minmax(0, 1fr); }
  .taskbar { position: fixed; left: 0; right: 0; bottom: 0; }
  .tray-social { display: none; }
  .task-buttons { visibility: hidden; }
  .welcome { grid-template-columns: minmax(0, 1fr); }
  .welcome-side { padding: 14px; }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .start-menu { left: 0; right: 0; width: auto; }
}
@media (max-width: 520px) {
  .welcome-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lcd-big { font-size: 44px; }
  .eq { display: none; }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .copy-line { grid-template-columns: minmax(0, 1fr) auto; }
  .copy-line span { grid-column: 1 / -1; }
  .mail-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .mail-k { padding-top: 0; }
  .reasons-row legend { float: none; }
  .aim-field { height: 260px; }
  .task-btn { flex-basis: 40px; }
  .aim-hud { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .aim-hs { grid-column: 1 / -1; }
  .guest-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .guest-row label { padding-top: 0; }
  .vid-list { grid-auto-columns: 150px; }
  .task-btn span:last-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .marquee span { padding-left: 0; }
}
