/* DanOSaur — pixel desktop. Palette: Sweetie-16. */
:root {
  --k: #1a1c2c; --p: #5d275d; --r: #b13e53; --o: #ef7d57; --y: #ffcd75; --l: #a7f070;
  --e: #38b764; --t: #257179; --n: #29366f; --B: #3b5dc9; --b: #41a6f6; --c: #73eff7;
  --w: #f4f4f4; --g: #94b0c2; --G: #566c86; --d: #333c57;
  --font-ui: 'Pixelify Sans', ui-monospace, Menlo, monospace;
  --font-px: 'Silkscreen', ui-monospace, Menlo, monospace;
  --font-term: 'VT323', ui-monospace, Menlo, monospace;
  --menubar-h: 30px;
  --shadow: 4px 4px 0 rgba(26, 28, 44, 0.6);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--k); color: var(--k);
  font-family: var(--font-ui); font-size: 17px; line-height: 1.4;
  font-variant-ligatures: none; font-feature-settings: "liga" 0, "clig" 0;
}
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--B); }
.px, canvas.px { image-rendering: pixelated; image-rendering: crisp-edges; }
.muted { color: var(--G); }
.small { font-size: 14px; }
.center { text-align: center; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px dashed var(--B); outline-offset: 2px; }

/* ---------- Wallpaper ---------- */
#wallpaper { position: fixed; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
/* Clickable things in the wallpaper: the Moon and the White Stag */
#wall-fx { position: fixed; inset: 0; pointer-events: none; }
#wall-fx button { position: absolute; pointer-events: auto; background: none; border: 0; padding: 0; cursor: pointer; }
.fx-moon { border-radius: 50%; aspect-ratio: 1; transform: translate(-50%, -50%); }
.fx-moon:focus-visible, .fx-stag:focus-visible { outline: 2px dashed var(--y); outline-offset: 2px; }
.fx-stag canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
#wall-fx > canvas { position: absolute; image-rendering: pixelated; }
.fx-bulbs { filter: drop-shadow(0 0 2px rgba(255, 205, 117, 0.75)); }
.fx-neon.red { filter: drop-shadow(0 0 1.5px #ff4d63) drop-shadow(0 0 4px rgba(255, 77, 99, 0.45)); }
.fx-neon.white { filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 4px rgba(255, 228, 196, 0.5)); }
.fx-neon.flicker { animation: neon-flicker 0.7s steps(1); }
@keyframes neon-flicker { 0%, 30%, 60% { opacity: 0.25; } 15%, 45%, 100% { opacity: 1; } }
/* A steady glow, like the real sign (a pulse here kept the page restyling every frame) */
.fx-nose { position: absolute; background: #ff4d63; box-shadow: 0 0 5px 2px rgba(255, 77, 99, 0.8); }
@media (prefers-reduced-motion: reduce) { .fx-stag.leap { animation: none; } }
.fx-stag.leap { animation: stag-leap 0.9s steps(1) both; }
@keyframes stag-leap { /* in whole wallpaper pixels (--ux/--uy), for a stop-motion hop */
  0% { transform: none; }
  10% { transform: translate(var(--ux), calc(var(--uy) * -2)); }
  20% { transform: translate(calc(var(--ux) * 2), calc(var(--uy) * -5)); }
  32%, 46% { transform: translate(calc(var(--ux) * 3), calc(var(--uy) * -7)); }
  58% { transform: translate(calc(var(--ux) * 2), calc(var(--uy) * -5)); }
  70% { transform: translate(var(--ux), calc(var(--uy) * -2)); }
  80%, 100% { transform: none; }
}


/* ---------- Menu bar ---------- */
#menubar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--menubar-h); z-index: 9000;
  display: flex; align-items: center; gap: 2px; padding: 0 8px;
  background: var(--w); border-bottom: 2px solid var(--k); font-size: 16px; user-select: none;
}
.menu { position: relative; }
.menu > button {
  background: none; border: 0; height: 26px; padding: 0 10px; cursor: pointer;
  display: flex; align-items: center;
}
.menu > button:hover, .menu > button[aria-expanded='true'] { background: var(--k); color: var(--w); }
.menu-logo > button { padding: 0 6px; }
.menu-logo img { width: 26px; height: 26px; }
.menu-app { padding: 0 10px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-list {
  position: absolute; top: 27px; left: 0; min-width: 210px; padding: 4px 0; display: none;
  background: var(--w); border: 2px solid var(--k); box-shadow: var(--shadow);
}
.menu-list.open { display: block; }
.menu-list button {
  display: flex; justify-content: space-between; gap: 16px; width: 100%;
  background: none; border: 0; padding: 4px 16px; text-align: left; cursor: pointer;
}
.menu-list button:hover, .menu-list button:focus-visible { background: var(--B); color: var(--w); outline: none; }
.menu-list kbd { font-family: var(--font-px); font-size: 11px; opacity: 0.7; }
.menu-list hr { border: 0; border-top: 2px dotted var(--g); margin: 4px 0; }
.spacer { flex: 1; }
.status { display: flex; align-items: center; gap: 14px; font-family: var(--font-px); font-size: 12px; white-space: nowrap; }
.status-btn { background: none; border: 0; cursor: pointer; padding: 2px 4px; font-family: var(--font-px); font-size: 12px; }
.status-btn:hover { background: var(--k); color: var(--w); }
.status-wx { display: flex; align-items: center; gap: 4px; background: none; border: 0; cursor: pointer; padding: 0 4px; height: 26px; font-family: var(--font-px); font-size: 12px; }
.status-wx:hover { background: var(--k); color: var(--w); }
.status-wx img { width: 22px; height: 22px; }

/* ---------- Weather ---------- */
.wx-now { display: flex; align-items: center; gap: 16px; }
.wx-now img { width: 77px; height: 77px; flex: none; }
.wx-place { font-weight: 600; font-size: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wx-tag { font-family: var(--font-px); font-size: 10px; font-weight: 400; background: var(--g); padding: 1px 6px; }
.wx-temp { font-family: var(--font-px); font-size: 30px; line-height: 1.2; }
.wx-temp span { font-family: var(--font-ui); font-size: 17px; margin-left: 10px; }
.specs.wx-specs { grid-template-columns: auto 1fr auto 1fr; }
.wx-h { display: block; font-family: var(--font-px); font-size: 12px; margin: 18px 0 6px; padding-bottom: 4px; border-bottom: 2px dotted var(--g); }
.wx-hours { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; text-align: center; }
.wx-hour { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.wx-hour img, .wx-day img { width: 22px; height: 22px; }
.wx-days { display: grid; gap: 2px; }
.wx-day { display: grid; grid-template-columns: 52px 26px 1fr 40px auto; align-items: center; gap: 8px; }
.wx-day-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-pop { color: var(--B); font-size: 14px; text-align: right; }
.wx-range { text-align: right; white-space: nowrap; }
.wx-row { display: flex; gap: 8px; }
.wx-row input { flex: 1; min-width: 0; border: 2px solid var(--k); padding: 4px 8px; background: #fff; }
.wx-results { display: grid; margin-top: 6px; }
.wx-result { text-align: left; background: none; border: 0; padding: 4px 6px; cursor: pointer; }
.wx-result:hover { background: var(--y); }
.wx-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.wx-units .btn + .btn { margin-left: 6px; }
.wx-credit { margin: 14px 0 0; }

/* ---------- Desktop icons ---------- */
#desktop-icons {
  position: fixed; top: calc(var(--menubar-h) + 18px); right: 18px; z-index: 1;
  display: flex; flex-direction: column; gap: 18px;
}
.desk-icon {
  width: 96px; background: none; border: 0; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-family: var(--font-px); font-size: 11px; color: var(--w);
}
.desk-icon span { background: rgba(26, 28, 44, 0.8); padding: 2px 5px; }
.desk-icon.selected span { background: var(--B); }
.desk-icon.selected img { filter: brightness(0.75); }

/* ---------- Windows ---------- */
#windows { position: fixed; top: var(--menubar-h); left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 10; }
.win {
  position: absolute; pointer-events: auto; display: flex; flex-direction: column;
  background: var(--w); border: 2px solid var(--k); box-shadow: var(--shadow);
  min-width: 260px; min-height: 140px;
}
.win-title {
  position: relative; flex: none; height: 28px; display: flex; align-items: center; gap: 8px;
  padding: 0 6px; border-bottom: 2px solid var(--k); cursor: grab; user-select: none; touch-action: none;
}
.win.dragging .win-title { cursor: grabbing; }
.win.active .win-title::before {
  content: ''; position: absolute; inset: 6px 4px;
  background: repeating-linear-gradient(var(--accent) 0 2px, transparent 2px 4px);
}
.win.active .win-title::after {
  content: ''; position: absolute; inset: 6px 4px;
  background: repeating-linear-gradient(var(--k) 0 2px, transparent 2px 4px);
  opacity: 0.25;
}
.win-name {
  position: relative; z-index: 1; margin: 0 auto; padding: 0 10px; background: var(--w);
  font-family: var(--font-px); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.win:not(.active) .win-name { color: var(--G); }
.win-btn {
  position: relative; z-index: 1; flex: none; width: 16px; height: 16px; padding: 0; cursor: pointer;
  border: 2px solid var(--k); background: var(--w);
}
.win:not(.active) .win-btn { border-color: var(--g); }
.win-close:hover::after { content: '×'; position: absolute; inset: -6px 0 0; font: 14px/1 var(--font-px); text-align: center; }
.win-zoom::after { content: ''; position: absolute; left: 1px; top: 1px; width: 6px; height: 6px; border: 2px solid currentColor; border-width: 0 2px 2px 0; }
.win-btn:active { background: var(--k); }
.win-body { flex: 1; min-height: 0; overflow: auto; position: relative; }
.win-body.pad { padding: 18px 20px; }
.win-body.dark { background: var(--k); color: var(--w); }
.win-grip {
  position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; touch-action: none;
  background: linear-gradient(135deg, transparent 0 50%, var(--G) 50% 58%, transparent 58% 70%, var(--G) 70% 78%, transparent 78%);
}
.zoomrect { position: fixed; z-index: 9500; border: 2px dotted var(--k); pointer-events: none; mix-blend-mode: difference; filter: invert(1); }

/* Pixel scrollbars */
.win-body::-webkit-scrollbar, .f-main::-webkit-scrollbar, .term-out::-webkit-scrollbar { width: 16px; height: 16px; }
.win-body::-webkit-scrollbar-track, .f-main::-webkit-scrollbar-track {
  background: repeating-conic-gradient(var(--g) 0 25%, var(--w) 0 50%) 0 0 / 4px 4px;
  border-left: 2px solid var(--k);
}
.win-body::-webkit-scrollbar-thumb, .f-main::-webkit-scrollbar-thumb { background: var(--w); border: 2px solid var(--k); }
.dark::-webkit-scrollbar-track, .term-out::-webkit-scrollbar-track { background: var(--d); }
.term-out::-webkit-scrollbar-thumb { background: var(--G); }

/* ---------- Buttons & dialogs ---------- */
.btn {
  background: var(--w); border: 2px solid var(--k); padding: 4px 14px; cursor: pointer;
  box-shadow: 2px 2px 0 var(--k); color: var(--k);
}
.btn:hover { background: var(--y); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn.primary { background: var(--B); color: var(--w); }
.btn.primary:hover { background: var(--b); }
.btn.small { padding: 1px 8px; font-size: 14px; }
.btn.big { padding: 8px 22px; font-size: 18px; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 16px; }
.linklike { background: none; border: 0; padding: 0; color: var(--B); text-decoration: underline; cursor: pointer; }

.modal-overlay { position: fixed; inset: 0; z-index: 9800; background: rgba(26, 28, 44, 0.35); display: grid; place-items: center; padding: 16px; }
.modal {
  width: min(440px, 100%); background: var(--w); border: 2px solid var(--k); box-shadow: var(--shadow);
  display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; padding: 20px;
  outline: 2px solid var(--w); outline-offset: -8px;
}
.modal-icon img { width: auto; height: auto; max-width: 64px; }
.modal-text strong { font-family: var(--font-px); font-size: 14px; display: block; margin-bottom: 6px; }
.modal-text p { margin: 0 0 8px; }
.modal-btns { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ---------- Dock ---------- */
#dock {
  position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 8000;
  display: flex; align-items: center; gap: 7px; padding: 10px 13px;
  background: rgba(244, 244, 244, 0.85); border: 2px solid var(--k); box-shadow: var(--shadow);
}
.dock-item {
  position: relative; width: 57px; height: 53px; padding: 0; background: none; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.dock-item img { display: block; width: 53px; height: auto; transition: transform 0.12s steps(3); }
.dock-item:hover img, .dock-item:focus-visible img { transform: translateY(-9px); }
.dock-item.running::after { content: ''; position: absolute; bottom: -8px; width: 4px; height: 4px; background: var(--k); }
.dock-item.bounce img { animation: bounce 0.5s steps(4) 2; }
@keyframes bounce { 50% { transform: translateY(-15px); } }
.tip {
  position: absolute; bottom: 70px; left: 50%; transform: translateX(-50%); display: none; white-space: nowrap;
  background: var(--k); color: var(--w); font-family: var(--font-px); font-size: 11px; padding: 3px 7px;
}
.dock-item:hover .tip, .dock-item:focus-visible .tip { display: block; }
.dock-sep { width: 2px; align-self: stretch; background: var(--G); margin: 2px 4px; }

/* ---------- Boot / login ---------- */
.boot {
  position: fixed; inset: 0; z-index: 10000; background: var(--k); color: var(--w);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  transition: opacity 0.35s steps(5);
}
.boot.fade { opacity: 0; }
.boot-logo img { width: 144px; height: 144px; filter: drop-shadow(3px 0 0 var(--g)) drop-shadow(-3px 0 0 var(--g)) drop-shadow(0 3px 0 var(--g)) drop-shadow(0 -3px 0 var(--g)); }
.boot-title { font-family: var(--font-px); font-size: 28px; letter-spacing: 2px; }
.progress { width: 240px; height: 18px; border: 2px solid var(--w); padding: 2px; }
.progress i { display: block; height: 100%; width: 0; background: var(--l); transition: width 0.2s steps(4); }
.boot-msg { font-family: var(--font-term); font-size: 20px; color: var(--g); min-height: 24px; }
.login-screen { background: transparent; backdrop-filter: blur(0); }
.login-screen::before { content: ''; position: absolute; inset: 0; background: rgba(26, 28, 44, 0.55); }
.login {
  position: relative; width: min(380px, calc(100% - 32px)); padding: 28px 24px 18px; text-align: center;
  background: var(--w); color: var(--k); border: 2px solid var(--k); box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.5);
}
.login-portrait { width: 120px; height: 120px; display: block; margin: 0 auto 10px; }
.login h1 { font-family: var(--font-px); font-size: 22px; margin: 0; }
.login p { margin: 6px 0 16px; }
.login-status { list-style: none; padding: 0; margin: 14px 0 0; font-family: var(--font-term); font-size: 19px; color: var(--t); min-height: 0; }
.hint { font-size: 13px; color: var(--G); margin-bottom: 0 !important; }
.boot.off { background: #000; }
.safe { font-family: var(--font-term); font-size: 30px; color: var(--o); text-align: center; padding: 0 20px; }

/* ---------- About ---------- */
.about-top { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: start; }
.portrait-frame { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.portrait { width: 144px; height: 144px; border: 2px solid var(--k); background: var(--g); border-radius: 0; }
img.portrait.real { object-fit: cover; }
.brand-os { font-weight: inherit; color: var(--e); }
.boot .brand-os { color: var(--l); }
.px-title { font-family: var(--font-px); font-size: 24px; margin: 0; }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 12px 0 0; font-size: 15px; }
.specs dt { font-weight: 600; }
.specs dd { margin: 0; }
.bio { margin-top: 16px; border-top: 2px dotted var(--g); padding-top: 8px; }

/* ---------- Résumé / Finder ---------- */
.finder { display: flex; flex-direction: column; }
.f-toolbar { flex: none; padding: 6px 12px; border-bottom: 2px solid var(--k); font-family: var(--font-px); font-size: 11px; background: var(--w); }
.tl-wrap { flex: none; padding: 10px 14px 4px; border-bottom: 2px solid var(--k); background: var(--k); }
.timeline { position: relative; height: 22px; display: flex; }
.tl-gap { flex: 0 1 0; }
.tl-seg {
  flex: 0 1 0; min-width: max-content; height: 22px; border: 2px solid var(--k); padding: 0 4px; cursor: pointer; overflow: hidden;
  font-family: var(--font-px); font-size: 10px; color: var(--k); text-align: left; white-space: nowrap;
}
.tl-seg.current { outline: 2px solid var(--w); outline-offset: 0; z-index: 1; }
.tl-ticks { position: relative; height: 16px; font-family: var(--font-px); font-size: 9px; color: var(--g); }
.tl-ticks span { position: absolute; transform: translateX(-50%); top: 3px; }
.f-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: 180px 1fr; }
.f-side { border-right: 2px solid var(--k); padding: 8px 0; overflow: auto; background: #e8ecf0; }
.f-head { font-family: var(--font-px); font-size: 10px; color: var(--G); padding: 8px 12px 4px; text-transform: uppercase; }
.f-item {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 12px; background: none; border: 0;
  text-align: left; cursor: pointer; color: var(--k); text-decoration: none;
}
.f-item:hover { background: var(--g); }
.f-item.current { background: var(--B); color: var(--w); }
.swatch { width: 12px; height: 12px; border: 2px solid var(--k); flex: none; }
.f-main { overflow: auto; padding: 18px 24px 28px; }
.job-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.job-head h2 { font-family: var(--font-px); font-size: 22px; margin: 0; }
.badge {
  width: 52px; height: 52px; border: 2px solid var(--k); display: grid; place-items: center; flex: none;
  font-family: var(--font-px); font-size: 14px; box-shadow: 2px 2px 0 var(--k);
}
.role h3 { margin: 18px 0 2px; font-size: 18px; }
.dates { display: inline-block; font-family: var(--font-px); font-size: 11px; background: var(--k); color: var(--w); padding: 2px 6px; }
.role ul { padding-left: 0; list-style: none; margin: 10px 0 0; }
.role li { position: relative; padding-left: 18px; margin-bottom: 7px; }
.role li::before { content: ''; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; background: var(--k); }

/* ---------- Values ---------- */
.prefs-bar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 2px solid var(--k); background: #e8ecf0; }
.prefs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding: 18px; }
.pref {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px;
  background: none; border: 2px solid transparent; cursor: pointer; text-align: center;
}
.pref:hover { border-color: var(--k); background: var(--y); }
.pane { padding: 18px 22px; }
.pane-head { display: flex; align-items: center; gap: 14px; }
.pane-head h2 { font-family: var(--font-px); font-size: 18px; margin: 0; }
.pane-list { margin: 16px 0; padding-left: 20px; }
.pane-list li { margin-bottom: 8px; }
.managed { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 2px dashed var(--G); color: var(--G); font-size: 14px; }

/* ---------- Lightbox ---------- */
.lightbox { display: flex; flex-direction: column; background: var(--d); }
.lb-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 12px; background: var(--w); border-bottom: 2px solid var(--k); }
.seg { display: flex; border: 2px solid var(--k); }
.seg button { background: var(--w); border: 0; border-left: 2px solid var(--k); padding: 2px 10px; cursor: pointer; font-size: 15px; }
.seg button:first-child { border-left: 0; }
.seg button[aria-selected='true'] { background: var(--k); color: var(--w); }
.thumbs { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; padding: 16px; align-content: start; }
.thumb { background: var(--w); border: 2px solid var(--k); padding: 6px 6px 4px; cursor: pointer; box-shadow: 3px 3px 0 var(--k); display: flex; flex-direction: column; gap: 4px; }
.thumb:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--k); }
.thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--g); }
.thumb span { font-family: var(--font-px); font-size: 9px; color: var(--G); text-align: left; }
.viewer { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--k); color: var(--w); }
.v-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; font-family: var(--font-px); font-size: 11px; border-bottom: 2px solid var(--G); }
.v-bar-pad { width: 70px; } /* balances the Grid button so the title stays centered */
.v-stage { flex: 1; min-height: 0; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; }
.v-nav { font-size: 18px; padding: 14px 10px; }
.v-img { height: 100%; min-width: 0; container-type: size; display: grid; place-items: center; }
/* As big as fits, at the photo's own aspect ratio (--ar), border included */
.v-img img { --ar: 1.5; width: min(100cqw, (100cqh - 4px) * var(--ar) + 4px); height: auto; border: 2px solid var(--w); display: block; }
.v-cap { flex: none; padding: 6px 12px 10px; text-align: center; color: var(--g); }

/* ---------- Telescope ---------- */
.scope { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px; }
.lens {
  position: relative; width: min(380px, 80%); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  border: 6px solid var(--G); box-shadow: 0 0 0 4px var(--d), 0 0 0 6px var(--k); background: #000;
}
.lens img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s steps(6); }
.lens.zoomed img { transform: scale(2); }
.crosshair::before, .crosshair::after { content: ''; position: absolute; background: rgba(167, 240, 112, 0.55); }
.crosshair::before { left: 50%; top: 10%; bottom: 10%; width: 2px; transform: translateX(-1px); }
.crosshair::after { top: 50%; left: 10%; right: 10%; height: 2px; transform: translateY(-1px); }
.static { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: repeating-linear-gradient(0deg, #fff 0 2px, #000 2px 4px); mix-blend-mode: screen; }
.lens.slewing .static { animation: static 0.36s steps(6); }
@keyframes static { 0%, 100% { opacity: 0; } 30%, 70% { opacity: 0.6; transform: translateY(3px); } 50% { opacity: 0.9; transform: translateY(-2px); } }
.hud { font-family: var(--font-term); font-size: 20px; line-height: 1.15; color: var(--l); width: min(380px, 100%); }
.hud-note { color: var(--c); }
.scope-ctl { display: flex; gap: 10px; }
.scope .btn { font-family: var(--font-px); font-size: 11px; }

/* ---------- Tapedeck ---------- */
.tapedeck { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tape {
  width: 300px; max-width: 100%; padding: 14px 16px 18px; background: var(--r); border: 2px solid var(--k);
  box-shadow: 4px 4px 0 var(--k); border-radius: 6px 6px 2px 2px;
}
.tape-label { background: var(--w); border: 2px solid var(--k); padding: 4px 8px; font-family: var(--font-px); font-size: 11px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reels { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 8px 18px; background: var(--d); border: 2px solid var(--k); }
.reel {
  width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--w); background:
    conic-gradient(var(--w) 0 10%, transparent 10% 33%, var(--w) 33% 43%, transparent 43% 66%, var(--w) 66% 76%, transparent 76%);
}
.tape.playing .reel { animation: spin 1.2s steps(8) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.tape-window { flex: 1; height: 16px; margin: 0 10px; background: var(--h, #8a4b38); border: 2px solid var(--k); }
.viz { width: 256px; height: 32px; border: 2px solid var(--k); }
.deck-row { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; width: 100%; }
.tape-art { width: 128px; height: 128px; flex: none; border: 2px solid var(--k); box-shadow: 4px 4px 0 var(--k); }
.tape-ctl { display: flex; gap: 10px; }
.tape-ctl .btn { min-width: 48px; font-size: 18px; }
.tape-progress { width: 256px; max-width: 100%; height: 4px; margin-top: -10px; background: var(--d); border: 2px solid var(--k); box-sizing: content-box; }
.tape-progress i { display: block; height: 100%; width: 0; background: var(--l); }
.am-link { font-family: var(--font-px); font-size: 11px; color: var(--w); background: var(--k); padding: 4px 10px; text-decoration: none; margin-top: -4px; }
.am-link::before { content: '♫'; }
.am-link:hover { background: var(--r); }
.tape-h { align-self: stretch; font-family: var(--font-px); font-size: 12px; padding-bottom: 4px; border-bottom: 2px dotted var(--g); margin-top: 4px; }
.bands { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; width: 100%; }
.band {
  text-align: left; padding: 6px 8px 6px 14px; background: var(--w); border: 2px solid var(--k); cursor: pointer;
  box-shadow: inset 6px 0 0 var(--band), 2px 2px 0 var(--k); font-size: 15px; line-height: 1.2;
}
.band:hover { background: var(--y); }
.band[aria-selected='true'] { background: var(--k); color: var(--w); }
.tracks { list-style: none; padding: 0; margin: 0; width: 100%; border: 2px solid var(--k); }
.tracks li { display: flex; align-items: stretch; }
.tracks li + li { border-top: 2px solid var(--g); }
.tracks .track { flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 5px 10px; background: none; border: 0; cursor: pointer; text-align: left; }
.tracks .track span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tracks .track:hover { background: var(--y); }
.tracks .am-mini { display: flex; align-items: center; padding: 0 10px; color: var(--G); text-decoration: none; border-left: 2px solid var(--g); }
.tracks .am-mini:hover { background: var(--k); color: var(--w); }
.tracks li.current .track { background: var(--k); color: var(--w); }
.tracks li.current .muted { color: var(--g); }

/* ---------- Mail ---------- */
.socials { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.status-socials { display: flex; align-items: center; gap: 2px; }
.status-social { display: flex; align-items: center; height: 26px; padding: 0 3px; }
.status-social:hover { background: var(--k); }
.status-social img { width: 22px; height: 22px; }
.connect { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.connect-btn { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--k); padding: 3px 10px 3px 6px; text-decoration: none; color: var(--k); background: var(--w); box-shadow: 2px 2px 0 var(--k); font-size: 15px; }
.connect-btn:hover { background: var(--y); }
.connect-btn img { width: 22px; height: 22px; }
.tb-link { font-family: var(--font-ui); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--k); white-space: nowrap; }
.tb-link img { width: 11px; height: 11px; }
.lb-right { display: flex; align-items: center; gap: 12px; }
.f-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vcard { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.biz { width: 100%; max-width: 440px; background: #fff; border: 2px solid var(--k); box-shadow: 6px 6px 0 var(--k); padding: 18px 20px; }
.biz-top { display: flex; align-items: center; gap: 16px; padding-bottom: 14px; border-bottom: 2px dotted var(--g); }
.biz-top img { width: 96px; height: 96px; flex: none; }
.biz-name { font-family: var(--font-px); font-size: 22px; }
.biz-links { display: flex; justify-content: space-around; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.biz-link { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: var(--k); padding: 6px; }
.biz-link:hover { background: var(--y); }
.biz-link span { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.biz-link span img { width: 22px; height: 22px; }
.center-row { justify-content: center; margin-top: 0; }
.socials a { border: 2px solid var(--k); padding: 3px 10px; text-decoration: none; color: var(--k); box-shadow: 2px 2px 0 var(--k); background: var(--w); }
.socials a:hover { background: var(--y); }
.compose { display: flex; flex-direction: column; gap: 8px; }
.compose label { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 8px; }
.compose label span { font-family: var(--font-px); font-size: 11px; text-align: right; }
.compose input, .compose textarea { border: 2px solid var(--k); padding: 6px 8px; background: #fff; width: 100%; }
.compose input[readonly] { background: #e8ecf0; }
.compose textarea { resize: vertical; margin-top: 4px; }

/* ---------- Terminal ---------- */
.term { display: flex; flex-direction: column; font-family: var(--font-term); font-size: 20px; line-height: 1.15; color: var(--l); padding: 10px 12px; cursor: text; }
.term-out { flex: none; white-space: pre-wrap; word-break: break-word; }
.term-row.echo { color: var(--w); }
.term-row.err { color: var(--o); }
.term-row.dim { color: var(--G); }
.term-row.green { color: var(--l); }
.term-line { display: flex; }
.term-prompt { white-space: pre; color: var(--c); }
.term-in { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--w); font-family: var(--font-term); font-size: 20px; padding: 0; caret-color: var(--l); }
.term-link { background: none; border: 0; color: var(--c); font-family: var(--font-term); font-size: 20px; padding: 0; cursor: pointer; text-decoration: underline; }

/* ---------- Trash / Finder file grids ---------- */
.trashcan { display: flex; flex-direction: column; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; padding: 14px; }
.file { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; background: none; border: 2px solid transparent; cursor: pointer; font-size: 13px; word-break: break-all; text-align: center; }
.file:hover, .file:focus-visible { border-color: var(--k); background: var(--y); }

/* ---------- Sticky note ---------- */
.win.sticky { background: var(--y); }
.win.sticky .win-title { background: var(--y); }
.win.sticky .win-name, .win.sticky.active .win-name { background: var(--y); }
.note h2 { font-family: var(--font-px); font-size: 16px; margin: 0 0 10px; }
.note ul { padding-left: 20px; }
.note li { margin-bottom: 4px; }
.note-links { font-size: 18px; }
.note code { background: var(--k); color: var(--l); padding: 0 4px; font-family: var(--font-term); font-size: 18px; }

/* ---------- Screensaver ---------- */
#screensaver { position: fixed; inset: 0; z-index: 10000; background: var(--k); cursor: none; opacity: 0; transition: opacity 0.3s; }
#screensaver.on { opacity: 1; }
#screensaver canvas { display: block; width: 100%; height: 100%; }

/* ---------- Extinction (Konami code) ---------- */
#extinction { position: fixed; inset: 0; z-index: 10001; cursor: none; }
#extinction canvas { display: block; width: 100%; height: 100%; }
#extinction.white { background: var(--w); cursor: pointer; }
.gameover { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--k); gap: 10px; padding: 16px; }
.gameover h1 { font-family: var(--font-px); font-size: clamp(44px, 11vw, 140px); line-height: 1; margin: 0; letter-spacing: 0.04em; animation: gameover-in 0.6s steps(4) both; }
.gameover p { font-family: var(--font-px); font-size: clamp(12px, 2vw, 18px); margin: 0; }
.gameover .blink { margin-top: 28px; animation: blink 1.1s steps(1) infinite; }
@keyframes gameover-in { from { transform: scale(2.4); opacity: 0; } }
@keyframes blink { 50% { visibility: hidden; } }
/* `translate` (not transform) so it stacks on the dock's centering; main's
   children shake instead of main, which would re-anchor the fixed windows. */
body.quake > :not(#extinction, main), body.quake main > * { animation: quake 0.09s steps(1) infinite; }
@keyframes quake {
  0% { translate: var(--quake, 0) 0; }
  25% { translate: 0 var(--quake, 0); }
  50% { translate: calc(var(--quake, 0) * -1) 0; }
  75% { translate: 0 calc(var(--quake, 0) * -1); }
}

/* ---------- Ticket Blaster ---------- */
.blaster { background: var(--k); color: var(--w); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; }
.blaster canvas { width: 100%; max-width: 720px; aspect-ratio: 240 / 135; height: auto; border: 2px solid var(--G); cursor: crosshair; touch-action: none; }
.blaster .muted { color: var(--g); margin: 0; }

/* ---------- Mobile: windows become full-screen sheets ---------- */
@media (max-width: 720px) {
  .menu:not(.menu-logo) { display: none; }
  .status-btn { display: none; }
  #desktop-icons { right: 10px; top: calc(var(--menubar-h) + 12px); gap: 12px; }
  #dock {
    left: 0; right: 0; bottom: 0; transform: none; overflow-x: auto; justify-content: flex-start;
    border-width: 2px 0 0; box-shadow: none; padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  }
  /* 2x icons (32px, whole pixels) with 44px tap targets, centered when they
     fit; the auto margins keep the first icon reachable when they don't. */
  #dock { gap: 4px; }
  .dock-item { flex: none; width: 44px; height: 44px; }
  .dock-item img { width: 32px; }
  .dock-item:first-child { margin-left: auto; }
  .dock-item:last-child { margin-right: auto; }
  .dock-item.running::after { bottom: -6px; }
  .tip { display: none !important; }
  #windows { bottom: calc(66px + env(safe-area-inset-bottom)); }
  .win {
    left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important;
    border-width: 0 0 2px; box-shadow: none; min-width: 0;
  }
  /* Except the welcome note: a card that fits its text, floating on the desktop */
  .win.sticky {
    left: 12px !important; top: 12px !important; width: calc(100% - 24px) !important; height: auto !important;
    max-height: calc(100% - 24px); border-width: 2px; box-shadow: var(--shadow);
  }
  .win-grip { display: none; }
  .win-zoom { visibility: hidden; }
  .about-top { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .specs { text-align: left; }
  .f-cols { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .f-side { display: flex; overflow-x: auto; padding: 6px; border-right: 0; border-bottom: 2px solid var(--k); }
  .f-side .f-head { display: none; }
  .f-item { width: auto; white-space: nowrap; }
  .f-main { padding: 14px 16px 24px; }
  .tl-seg span { display: none; }
  .win-body.pad { padding: 14px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
