/* wwweb os. black, white line, greyscale. the only colour is the electricity: pale cyan #bfe6ff.
   type roles: system sans = window chrome, special elite = typed words, tiny5 = error screens, vt323 = cctv. */
:root {
  --cyan: #bfe6ff;
  --dim: #9a9a9a;
  --line-off: #8b8b8b;
  --tb: 38px;
  --chrome: Tahoma, Verdana, Arial, "Helvetica Neue", sans-serif;
  --type: "Special Elite", "Courier New", Courier, monospace;
  --seg: "Tiny5", "VT323", "Courier New", monospace;
  --crt: "VT323", "Courier New", monospace;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: #000; color: #fff; overflow: hidden; }
body { font: 13px/1.4 var(--chrome); text-transform: lowercase; -webkit-text-size-adjust: 100%; }
button, input { font-family: inherit; text-transform: lowercase; }
button { color: inherit; }
a { color: inherit; }
.sr { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
:focus-visible { outline: 2px dotted #fff; outline-offset: 3px; }
.np :focus-visible { outline-color: #000; }

#app { position: fixed; inset: 0; }
#desk { position: absolute; left: 0; right: 0; top: 0; bottom: var(--tb); overflow: hidden; }

/* ---------- ground: black with 4% concrete noise ---------- */
#wall {
  position: absolute; inset: 0; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.4 -.4'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
#web { position: absolute; inset: 0; z-index: 1; touch-action: manipulation; }
.glyph { margin: 0; font-family: var(--mono); white-space: pre; line-height: 1.2; letter-spacing: 0; color: var(--cyan); text-shadow: 0 0 6px rgba(191,230,255,.5); user-select: none; }
#hublogo { position: absolute; z-index: 2; opacity: 0; pointer-events: none; }

/* wallpaper poem, revealed when the last window closes */
#walltext { position: absolute; z-index: 3; left: 16%; top: 13%; width: 44%; height: 70%; pointer-events: none; font-family: var(--type); font-size: 19px; line-height: 1.5; opacity: 0; transition: opacity 2.6s ease .5s; }
body.cleared #walltext { opacity: 1; }
body.cleared-now #walltext { transition: none; }
.wt { position: absolute; white-space: nowrap; color: #fff; }
.wt.big { font-size: 30px; }

/* overlapping typed fragments printed across the open windows */
#overprint { position: absolute; z-index: 20; inset: 0; pointer-events: none; mix-blend-mode: difference; transition: opacity 1.4s; overflow: hidden; }
/* an app the visitor opened (games, player, cmd...) sits clear of the overprinted fragments */
body:has(#wins > .win.app.active) #overprint { opacity: 0 !important; transition: opacity .25s; }
#overprint .op { position: absolute; font-family: var(--type); color: #fff; opacity: .42; white-space: nowrap; letter-spacing: -.05em; line-height: 1; }
body.has-app #overprint { opacity: .25; }
body.cleared #overprint { opacity: 0; }
body.cleared-now #overprint { transition: none; }

#footline { position: absolute; z-index: 4; left: 108px; bottom: 6px; margin: 0; font-family: var(--type); font-size: 11px; color: #777; pointer-events: none; }

/* ---------- desktop icons ---------- */
#icons { position: absolute; z-index: 5; left: 8px; top: 8px; bottom: 8px; width: 200px; display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start; gap: 4px; pointer-events: none; }
.dicon { pointer-events: auto; width: 92px; padding: 6px 2px 4px; background: none; border: 2px solid transparent; display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 12px; cursor: default; color: #fff; }
.dicon[hidden] { display: none; }
.dicon .di svg { display: block; }
.dicon .dl { padding: 1px 4px; max-width: 100%; text-align: center; overflow-wrap: anywhere; line-height: 1.2; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.dicon.sel .dl { background: #fff; color: #000; text-shadow: none; }
/* the door: countdown under the label, a "1" when someone is there */
.dicon .door-t { display: block; font: 400 16px/1 var(--crt); color: var(--cyan); margin-top: 2px; }
.dicon.sel .door-t { color: #000; }
@media (max-width: 640px) { .dicon .door-t { display: inline; font-size: 14px; margin: 0 0 0 4px; } }
.dicon[data-id="door"] .di { position: relative; }
.dicon.msg .di::after { content: "1"; position: absolute; top: -6px; right: -10px; width: 18px; height: 18px; border-radius: 50%; background: var(--cyan); color: #000; font: 700 11px/18px var(--chrome); text-align: center; box-shadow: 0 0 10px rgba(191,230,255,.8); }
/* the photo library */
.ph { display: flex; flex-direction: column; gap: 10px; }
.ph-frame { background: #111; border: 2px solid #fff; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: pan-y; }
.ph-img { display: block; max-width: 100%; max-height: 100%; image-rendering: pixelated; user-select: none; -webkit-user-drag: none; }
.ph-row { display: flex; align-items: center; gap: 10px; }
.ph-nav { min-width: 44px; min-height: 40px; font: 400 22px/1 var(--crt); }
.ph-cap { flex: 1; text-align: center; font: 400 18px/1 var(--crt); text-transform: lowercase; }
.ph-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.ph-th { flex: none; width: 64px; height: 48px; padding: 0; border: 2px solid transparent; background: #111; cursor: pointer; opacity: .55; }
.ph-th img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ph-th.on { border-color: var(--cyan); opacity: 1; }
.ph-th:hover { opacity: .9; }
.ph-frame.square { aspect-ratio: 1 / 1; max-height: 60vh; margin: 0 auto; width: 100%; }
.ph-img.smooth { image-rendering: auto; }
.ph-saverow { display: flex; align-items: center; gap: 12px; }
.ph-save { text-decoration: none; min-width: 72px; text-align: center; }
.ph-tip { font-size: 12px; color: #999; }
.ph-live { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 2px dashed rgba(191,230,255,.6); }
.ph-live p { margin: 0; }
.ph-live-t { font: 400 18px/1.2 var(--crt); color: var(--cyan); }
.ph-live .ph-tip { margin-top: 4px; }
.ph-live-btns { display: flex; flex: none; gap: 8px; }
/* browser history */
.hist { list-style: none; margin: 8px 0 0; padding: 0; }
.hist li { display: flex; gap: 12px; align-items: baseline; padding: 5px 0; border-bottom: 1px dashed rgba(255,255,255,.2); }
.hist-d { flex: none; width: 92px; font-size: 12px; color: #999; }
.hist-q { overflow-wrap: anywhere; }
@media (max-width: 640px) { .hist li { flex-direction: column; gap: 2px; } .hist-d { width: auto; } }
/* the wicked tag: one red flash, fades out */
#wicked { position: fixed; inset: 0; z-index: 9500; pointer-events: none; background: radial-gradient(ellipse at center, rgba(255,20,40,.35), rgba(170,0,15,.75)); opacity: 0; mix-blend-mode: screen; }
#wicked.on { animation: wickedflash 1.3s ease-out forwards; }
#wicked .w { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font: 400 clamp(56px, 14vw, 160px)/1 var(--crt); color: #fff; letter-spacing: .1em; text-shadow: 0 0 24px rgba(255,40,60,.9); }
@keyframes wickedflash { 0% { opacity: 0; } 8% { opacity: 1; } 55% { opacity: .85; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #wicked.on { animation: wickedfade 1.3s ease-out forwards; } @keyframes wickedfade { 0% { opacity: 0; } 30% { opacity: .5; } 100% { opacity: 0; } } }
/* gary */
.gary { padding: 4px 0 2px; }
.gary-pol { background: #fff; width: 250px; max-width: 100%; margin: 6px auto; padding: 12px 12px 8px; transform: rotate(-2deg); box-sizing: border-box; }
.gary-img { background: #ddd; overflow: hidden; }
.gary-btn { background: none; border: 0; padding: 0; cursor: pointer; display: block; transform-origin: 50% 100%; }
.gary-btn { width: 100%; }
.gary-btn img { display: block; width: 100%; height: auto; image-rendering: pixelated; -webkit-user-drag: none; user-select: none; }
.gary-btn.hop { animation: garyhop .55s cubic-bezier(.3,.7,.4,1); }
@keyframes garyhop { 0% { transform: translateY(0) scale(1, 1); } 15% { transform: translateY(0) scale(1.08, .9); } 45% { transform: translateY(-22px) scale(.95, 1.06); } 75% { transform: translateY(0) scale(1.06, .94); } 100% { transform: translateY(0) scale(1, 1); } }
@media (prefers-reduced-motion: reduce) { .gary-btn.hop { animation: garywig .3s steps(2); } @keyframes garywig { 50% { transform: rotate(-4deg); } } }
.gary-cap { margin: 8px 0 0; text-align: center; color: #000; font: 19px var(--type); text-transform: lowercase; }
.dicon:hover { border-color: #555; }
.dl-short { display: none; }
.im-toggle { display: none; }
#icons .dicon[data-id="voicememo"] .di { color: var(--cyan); }
body.cleared:not(.cleared-now) .dicon[data-id="voicememo"] { animation: appear 1.4s ease-out 1; }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

/* ---------- windows ---------- */
#wins { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.win { position: absolute; pointer-events: auto; isolation: isolate; display: flex; flex-direction: column; max-height: calc(100% - 6px); }
.win.is-min { display: none; }
.win:focus-visible { outline: 2px dotted #fff; outline-offset: 6px; }
.win.moving { transition: left .24s ease-out, top .24s ease-out; }
.win.dragging { cursor: grabbing; }
.win.shake { animation: shake .42s; }
@keyframes shake { 15% { transform: translateX(-7px); } 35% { transform: translateX(6px); } 55% { transform: translateX(-4px); } 75% { transform: translateX(2px); } }
.win .body { position: relative; flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px; display: flex; flex-direction: column; }
.win .body > * { flex: 1 0 auto; }

/* skin 1: white outline wireframe (the "problem / ignore / solve" look) */
.win.wire, .win.err, .win.bare { --fg: #fff; --bg: #000; --gb: #fff; background: #000; color: #fff; border: 2px solid var(--gb); }
.win.wire:not(.active), .win.err:not(.active) { --gb: var(--line-off); color: #c4c4c4; }
.win.wire .tb, .win.err .tb { position: relative; z-index: 1; flex: none; display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 4px 0 12px; border-bottom: 2px solid var(--gb); background: #000; font-weight: 700; font-size: 13px; user-select: none; touch-action: none; cursor: default; }
.win.wire .body, .win.err .body, .win.bare .body { background: #000; z-index: 1; }
.win.popup.wire .tb-ico, .win.popup.err .tb-ico { display: none; }
.tb-ico { display: inline-flex; flex: none; }
.tb-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-count { flex: none; font: 400 10px var(--mono); opacity: .5; letter-spacing: 0; }
.tb-btn { flex: none; position: relative; width: 28px; height: 28px; border: 0; background: none; color: inherit; cursor: pointer; padding: 0; }
.tb-btn::before, .tb-btn::after { content: ""; position: absolute; background: currentColor; }
.tb-btn.min::before { left: 8px; right: 8px; bottom: 9px; height: 2px; }
.tb-btn.close::before, .tb-btn.close::after { left: 6px; right: 6px; top: 13px; height: 2px; transform: rotate(45deg); }
.tb-btn.close::after { transform: rotate(-45deg); }
.tb-btn:hover { background: #fff; color: #000; }
.win.wire .tb-btn:focus-visible, .win.err .tb-btn:focus-visible { outline-offset: -3px; }

/* ghost cards behind a stack window: same size, shifted up and left */
.ghosts { position: absolute; inset: -2px; z-index: -1; pointer-events: none; }
.ghost { position: absolute; inset: 0; border: 2px solid var(--gb); background: #000; transform: translate(calc(var(--g) * -20px), calc(var(--g) * -20px)); }

/* skin 2: greyscale notepad (the poem windows) */
.win.np { --fg: #000; --bg: #fff; background: #ececec; color: #000; border: 1px solid #5c5c5c; border-radius: 7px 7px 0 0; box-shadow: 0 0 0 1px #000, 0 10px 26px rgba(0,0,0,.75), inset 0 0 0 1px rgba(255,255,255,.8); font-family: var(--chrome); }
.win.np .tb { flex: none; display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 7px; border-radius: 6px 6px 0 0; background: linear-gradient(#f1f1f1, #b4b4b4 47%, #6a6a6a 53%, #a3a3a3); color: #000; font-size: 11px; font-weight: 400; text-shadow: 0 1px 0 rgba(255,255,255,.65); user-select: none; touch-action: none; }
.win.np:not(.active) .tb { background: linear-gradient(#f5f5f5, #d2d2d2 47%, #bdbdbd 53%, #d7d7d7); color: #555; }
.win.np .tb-count { opacity: .55; }
.win.np .tb-btn { width: 24px; height: 17px; border: 1px solid #3b3b3b; border-radius: 3px; background: linear-gradient(#f4f4f4, #a8a8a8); color: #000; margin-left: 1px; }
.win.np .tb-btn.close { width: 30px; background: linear-gradient(#e2e2e2, #6d6d6d); color: #fff; text-shadow: 0 1px 0 #000; }
.win.np .tb-btn.min::before { left: 6px; right: 6px; bottom: 4px; height: 3px; background: #000; }
.win.np .tb-btn.close::before, .win.np .tb-btn.close::after { left: 9px; right: 9px; top: 6px; height: 2px; background: #fff; }
.win.np .tb-btn:hover { background: #fff; }
.win.np .tb-btn.close:hover { background: #222; }
.np-menu { flex: none; display: flex; gap: 11px; padding: 2px 8px; background: #f0f0f0; border-bottom: 1px solid #c5c5c5; font-size: 11px; color: #222; }
.np-wrap { position: relative; flex: 1 1 auto; min-height: 0; display: flex; background: #fff; border: 1px solid #8a8a8a; margin: 0 2px 2px; }
.win.np .body { background: #fff; color: #000; padding: 8px 20px 8px 8px; overflow: hidden; flex: 1; }
.win.np .body.scroll, .win.np .np-wrap .body { overflow: auto; }
.np-vs { position: absolute; right: 0; top: 0; bottom: 15px; width: 15px; background: #ebebeb; border-left: 1px solid #c4c4c4; }
.np-hs { position: absolute; left: 0; right: 15px; bottom: 0; height: 15px; background: #ebebeb; border-top: 1px solid #c4c4c4; }
.np-vs .thumb { position: absolute; left: 1px; right: 1px; top: 16px; height: 28%; background: linear-gradient(90deg, #f3f3f3, #bbb); border: 1px solid #888; }
.np-hs .thumb { position: absolute; top: 1px; bottom: 1px; left: 16px; width: 55%; background: linear-gradient(#f3f3f3, #bbb); border: 1px solid #888; }
.np-vs i.up::before, .np-vs i.dn::before { content: ""; position: absolute; left: 3px; border: 4px solid transparent; }
.np-vs i.up::before { top: 3px; border-bottom-color: #444; border-top: 0; }
.np-vs i.dn::before { bottom: 3px; border-top-color: #444; border-bottom: 0; }
.np-line { margin: 0; font-family: var(--type); font-size: 17px; line-height: 1.3; color: #000; }
.np-pre { margin: 0; font-family: var(--type); font-size: 14px; line-height: 1.5; white-space: pre-wrap; color: #000; }
.win.np .btn { --fg: #000; --bg: #fff; }

/* skin 3: error screen (segment display, binary header, underscore text) */
.errscreen { padding: 2px 2px 6px; }
.seg-bits { font-family: var(--seg); font-size: 11px; letter-spacing: .06em; word-break: break-all; color: #d0d0d0; }
.seg-big { position: relative; font: 400 clamp(56px, 18vw, 98px)/1 var(--seg); margin: 26px 0 22px; letter-spacing: .02em; color: #fff; }
.seg-big::before, .seg-big::after { content: attr(data-t); position: absolute; left: 0; top: 0; pointer-events: none; }
.seg-big::before { transform: translateX(6px); clip-path: inset(16% 0 60% 0); opacity: .85; }
.seg-big::after { transform: translateX(-7px); clip-path: inset(62% 0 10% 0); opacity: .7; }
.seg-sm { margin: .35em 0; font-family: var(--seg); font-size: 15px; letter-spacing: .04em; color: #fff; word-break: break-word; min-height: 1.4em; }

/* skin 4: chrome-less popup, no title bar. the button is the only way out */
.win.bare { border-width: 2px; }
.bare-in { padding: 20px; }

/* ---------- shared bits ---------- */
.typed { font-family: var(--type); font-size: 15px; line-height: 1.5; margin: 0 0 .6em; }
.typed.small { font-size: 13px; color: #cfcfcf; }
.typed.big { font-size: 21px; line-height: 1.25; }
.btnrow { display: flex; gap: 12px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.btn { font: 700 13px var(--chrome); min-height: 36px; padding: 7px 22px; cursor: pointer; border: 2px solid var(--fg, #fff); background: var(--bg, #000); color: var(--fg, #fff); }
.btn.primary { background: var(--fg, #fff); color: var(--bg, #000); }
.btn:hover { outline: 2px solid var(--fg, #fff); outline-offset: 2px; }
.btn.sm { min-height: 34px; padding: 5px 12px; }
.btn[disabled] { opacity: .45; cursor: default; }
.linkbtn { display: inline-block; text-decoration: none; line-height: 22px; }
.caret { display: inline-block; width: .55em; height: 1em; margin-left: 2px; vertical-align: text-bottom; background: currentColor; animation: blink 1.1s steps(2, jump-none) infinite; }
@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }

.pop, .st, .confirm, .dlg { }
.st { display: flex; flex-direction: column; justify-content: space-between; min-height: 120px; }
.st-text { opacity: .8; }
.confirm { display: flex; flex-direction: column; justify-content: center; min-height: 80px; }
.dlg { display: flex; gap: 14px; align-items: flex-start; }
.dlg > div { flex: 1; min-width: 0; }
.dlg-ico { flex: none; }

.bar { height: 22px; border: 2px solid currentColor; padding: 2px; margin: 10px 0; }
.bar i { display: block; height: 100%; background: repeating-linear-gradient(90deg, currentColor 0 9px, transparent 9px 12px); }
.bar i.run { width: 0; animation: run 1.3s steps(12, end) forwards; }
@keyframes run { to { width: 100%; } }

.binary { flex: 1 1 auto; min-height: 120px; max-height: 210px; overflow: hidden; font-family: var(--mono); font-size: 11px; line-height: 1.55; color: #8d8d8d; white-space: pre; }
.drift { animation: drift 160s linear infinite alternate; }
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(-62%); } }

.broken { position: relative; overflow: hidden; min-height: 220px; }
.broken h1 { font-size: 24px; font-weight: 400; margin: 0 0 .5em; }
.broken ul { margin: 0 0 1em; padding-left: 1.2em; }
.brokenimg { display: inline-block; border: 2px dashed #aaa; padding: 26px 14px 12px; color: #aaa; font: 11px var(--mono); margin: 0 14px 0 0; text-transform: none; }
.ghostlink { color: #000; background: #000; text-decoration: none; padding: 2px 4px; font-family: var(--type); }
.ghostlink:hover, .ghostlink:focus-visible { color: #fff; text-decoration: underline; }
.giant { position: absolute; left: -8px; bottom: -16px; pointer-events: none; font-family: var(--type); font-size: 84px; line-height: .85; letter-spacing: -.07em; white-space: nowrap; color: #fff; opacity: .3; }

/* ---------- apps ---------- */
.browser { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; gap: 6px; align-items: center; }
.addr { flex: 1; min-width: 0; background: #000; color: #fff; border: 2px solid #fff; padding: 7px 10px; font: 14px var(--mono); text-transform: none; }
.addr::placeholder { color: #777; }
.page { flex: 1; min-height: 190px; border: 2px solid #fff; padding: 16px; overflow: auto; }
.page h1 { font-family: var(--type); font-weight: 400; font-size: 26px; margin: 0 0 .5em; }
.plink { color: #fff; text-decoration: underline; font-family: var(--type); }
.robots { font-size: 14px; white-space: pre-wrap; }

.camwrap { display: flex; flex-direction: column; gap: 10px; }
.cam { position: relative; aspect-ratio: 5 / 6; background: #000; border: 2px solid #fff; overflow: hidden; font-family: var(--crt); font-size: 22px; line-height: 1; color: #fff; text-shadow: 0 0 4px rgba(255,255,255,.5); }
.cam-noise { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.cam-fig { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.cam-vig { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 42%, rgba(0,0,0,.9) 100%), repeating-linear-gradient(0deg, rgba(0,0,0,.28) 0 1px, transparent 1px 3px); }
.cam-msg { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; font-size: 36px; }
.cam-msg[hidden] { display: none; }
.cam-msg .sm { font-size: 20px; opacity: .75; }
.cam-tl { position: absolute; top: 10px; left: 14px; }
.cam-br { position: absolute; bottom: 10px; right: 14px; }
.cam-rec { position: absolute; top: 10px; right: 14px; display: flex; align-items: center; gap: 6px; }
.cam-rec .dot { width: 11px; height: 11px; border-radius: 50%; background: #fff; animation: blink 1.4s steps(2, jump-none) infinite; }
.cam-bl { position: absolute; bottom: 10px; left: 14px; display: flex; flex-direction: column; gap: 2px; }
.cam-lab { font-size: 12px; flex: none; }
.cam-ts { letter-spacing: .06em; }

/* index card drawer: my music, found */
.drawer { padding: 2px 2px 8px; font-family: var(--chrome); }
.d-head { text-align: center; padding: 6px 0 4px; display: flex; flex-direction: column; align-items: center; }
.d-head h2 { margin: 0; font: 700 17px var(--chrome); }
.d-head p { margin: 4px 0 0; font-size: 11px; color: var(--dim); }
.d-back { margin-top: 32px; }
.d-cards { list-style: none; margin: 0; padding: 0; }
.d-card { position: relative; height: 31px; margin: 0; border: 2px solid #fff; border-bottom: 0; border-radius: 15px 15px 0 0; background: #000; }
.d-card:last-child { height: 52px; }
.d-tab { position: absolute; left: var(--tx); bottom: calc(100% - 2px); width: 31%; height: 28px; padding: 0; border: 0; background: none; color: #fff; font: 12px var(--chrome); cursor: pointer; text-align: left; }
.d-tabsvgw { position: absolute; inset: 0; display: block; }
.d-tabsvg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; display: block; }
.d-tabsvg path { fill: #000; stroke: #fff; stroke-width: 2; }
.d-tab .n { position: absolute; left: 12%; top: 8px; font-size: 11px; }
.d-tab .t { position: absolute; right: 11%; top: 8px; max-width: 64%; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-tab.on .d-tabsvg path { fill: #fff; }
.d-tab.on { color: #000; font-weight: 700; }
.d-tab.off { color: #8a8a8a; }
.d-tab.off .d-tabsvg path { stroke: #6a6a6a; }
.d-tab.off .t { text-decoration: line-through; }
.d-tab:hover .d-tabsvg path { stroke-width: 3; }
.d-tab:focus-visible { outline: 2px dotted #fff; outline-offset: 2px; }
.d-lip { height: 16px; margin: 0 -9px; border: 2px solid #fff; background: #000; position: relative; }
.d-front { position: relative; height: 74px; margin: 0 -2px; }
.d-frontsvg { position: absolute; inset: 0; display: block; }
.d-frontsvg svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.d-front path { fill: #000; stroke: #fff; stroke-width: 2; }
.d-front .d-plate { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 13px; }

.binlist .row { display: grid; grid-template-columns: 2fr 1.3fr .6fr; gap: 8px; width: 100%; text-align: left; padding: 7px 8px; background: none; border: 0; border-bottom: 1px solid #444; color: #fff; font: 12px var(--chrome); cursor: default; }
.binlist .row.head { color: var(--dim); }
.binlist .row.sel { background: #fff; color: #000; }
.binlist .nm svg { vertical-align: middle; margin-right: 4px; }
.bin { display: flex; flex-direction: column; gap: 8px; }

.term { display: flex; flex-direction: column; min-height: 220px; font-family: var(--mono); font-size: 13px; }
.term-out { flex: 1; overflow: auto; white-space: pre-wrap; text-transform: none; }
.term-out .echo { color: var(--dim); }
.term-row { display: flex; gap: 8px; align-items: center; flex: none; margin-top: 6px; }
.term-in { flex: 1; min-width: 0; background: none; border: 0; color: #fff; font: inherit; caret-color: var(--cyan); text-transform: none; padding: 6px 0; }
.term-in:focus-visible { outline-offset: 4px; }
.ps { color: var(--dim); }

.pl { display: flex; flex-direction: column; gap: 12px; }
.pl-name { margin: 0; font-family: var(--type); font-size: 15px; word-break: break-all; text-transform: none; }
.pl-wavewrap { border: 2px solid #fff; background: #000; }
.pl-wave { display: block; width: 100%; height: 112px; cursor: pointer; touch-action: none; }
.pl-wave:focus-visible { outline-offset: 4px; }
.pl-row { display: flex; align-items: center; gap: 14px; }
.pl-play { flex: none; width: 66px; height: 66px; border-radius: 50%; border: 2px solid #fff; background: #000; color: #fff; position: relative; cursor: pointer; padding: 0; }
.pl-play::before { content: ""; position: absolute; left: 26px; top: 17px; border-left: 22px solid currentColor; border-top: 15px solid transparent; border-bottom: 15px solid transparent; }
.pl-play.on::before { left: 21px; top: 20px; width: 8px; height: 24px; border: 0; background: currentColor; box-shadow: 16px 0 0 currentColor; }
.pl-play:hover { background: #fff; color: #000; }
.pl-time { font: 13px var(--mono); }
.pl-note { margin: 0; font-size: 12px; color: #aaa; }
.pl-note:empty { display: none; }
/* the tuner: two glyph knobs and a signal meter. every memo arrives broken until both knobs sit on their spot */
.pl-how { margin: 0; font-size: 14px; }
.pl-tuner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 6px 4px; border: 2px dashed rgba(255,255,255,.45); }
.pl-tuner.clean { border-style: solid; border-color: var(--cyan); }
.kn-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.kn { width: 108px; height: 108px; cursor: grab; touch-action: none; border-radius: 50%; outline-offset: 2px; }
.kn.on { cursor: grabbing; }
.kn[aria-disabled="true"] { cursor: default; }
.kn-cv { display: block; width: 108px; height: 108px; pointer-events: none; }
.kn-row { display: flex; align-items: center; gap: 4px; }
.kn-lab { font: 400 20px/1 var(--crt); min-width: 52px; text-align: center; }
.btn.kn-b { min-width: 34px; min-height: 34px; padding: 0 6px; font: 400 20px/1 var(--crt); }
.pl-tuner.clean .kn-b { visibility: hidden; }
.pl-tuner.clean .kn-lab { color: var(--cyan); }
.pl-mid { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.pl-sig { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; white-space: nowrap; }
.pl-sigl { font: 400 16px/1 var(--crt); color: #bbb; }
.pl-sigv { font: 400 30px/1 var(--crt); }
.pl-tuner.clean .pl-sig { color: var(--cyan); text-shadow: 0 0 10px rgba(191,230,255,.6); }
.pl-sigbar { width: 100%; max-width: 110px; height: 10px; border: 2px solid #fff; position: relative; }
.pl-sigbar::after { content: ""; position: absolute; left: 1px; top: 1px; bottom: 1px; width: calc(var(--sig, 0%) - 2px); background: repeating-linear-gradient(90deg, #fff 0 3px, transparent 3px 5px); transition: width .12s; }
.pl-tuner.clean .pl-sigbar { border-color: var(--cyan); }
.pl-tuner.clean .pl-sigbar::after { background: var(--cyan); }
@media (max-width: 640px) {
  .pl-tuner { gap: 4px; padding: 6px 2px 2px; }
  .kn, .kn-cv { width: 92px; height: 92px; }
  .kn-lab { min-width: 44px; font-size: 18px; }
  .pl-sigv { font-size: 24px; }
  .pl-wave { height: 84px; }
}


.reward { text-align: center; }
.reward-logo { display: block; margin: 8px auto 18px; width: max-content; max-width: 100%; }
.rw-stats { margin: 0 0 14px; font: 400 20px/1.2 var(--crt); color: var(--cyan); }
.rw-box { margin: 0 0 14px; padding: 12px; border: 2px dashed rgba(255,255,255,.5); }
.rw-k { margin: 0 0 8px; font-size: 13px; color: #bbb; }
.rw-code { display: inline-block; padding: 8px 16px; border: 2px solid var(--cyan); background: #000; color: var(--cyan); font: 400 30px/1 var(--crt); letter-spacing: .12em; cursor: copy; text-transform: none; }
.rw-copied { display: block; min-height: 1.2em; margin-top: 6px; font-size: 12px; color: #bbb; }
.rw-box .plink { font-size: 14px; }
.rw-btns { justify-content: center; flex-wrap: wrap; }
.rw-sign { text-align: left; }
.rw-sign .rw-k { color: #fff; font-size: 14px; }
.rw-small { margin: 0 0 10px; font-size: 13px; color: #bbb; }
.rw-form { display: grid; gap: 8px; }
.rw-in { width: 100%; box-sizing: border-box; font-size: 16px; }
.rw-ok { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #ddd; line-height: 1.35; cursor: pointer; }
.rw-ok input { margin: 2px 0 0; width: 18px; height: 18px; flex: none; accent-color: var(--cyan); }
.rw-bot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.rw-sent { margin: 0 0 4px; font: 400 20px/1.25 var(--crt); color: var(--cyan); }
.rw-dm { margin: 10px 0 0; }
.rw-sign .btnrow { margin-top: 4px; }

/* ---------- start menu, taskbar, tray ---------- */
#taskbar { position: fixed; left: 0; right: 0; bottom: 0; height: var(--tb); z-index: 50; display: flex; align-items: stretch; gap: 6px; padding: 3px max(6px, env(safe-area-inset-right, 0px)) calc(3px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px)); background: #000; border-top: 2px solid #fff; }
#start { display: flex; align-items: center; gap: 7px; padding: 0 14px; background: #000; border: 2px solid #fff; font: 700 13px var(--chrome); cursor: pointer; }
#start[aria-expanded="true"], #start:hover { background: #fff; color: #000; }
#tasks { flex: 1; min-width: 0; display: flex; gap: 4px; overflow: hidden; }
.task { flex: 0 1 150px; min-width: 30px; display: flex; align-items: center; gap: 6px; padding: 0 8px; background: #000; border: 2px solid var(--line-off); font-size: 12px; cursor: pointer; overflow: hidden; }
.task .task-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task:hover { border-color: #fff; }
#tray { display: flex; align-items: center; gap: 10px; padding: 0 4px; }
#clock { font: 12px var(--mono); white-space: nowrap; }
#mute { background: none; border: 2px solid transparent; padding: 3px; cursor: pointer; display: grid; place-items: center; }
#mute:hover { border-color: #fff; }
#mute.muted { background: #fff; color: #000; border-color: #fff; }
#mute.muted::after { content: "muted"; font: 11px var(--chrome); margin-left: 4px; }
#resetbtn { background: none; border: 2px solid #8b8b8b; padding: 2px 8px; font: 11px var(--chrome); cursor: pointer; align-self: center; min-height: 26px; }
#resetbtn:hover, #resetbtn:focus-visible { background: #fff; color: #000; border-color: #fff; }
#mute { gap: 0; grid-auto-flow: column; }
#mute .off { display: none; }
#mute.muted .on { display: none; }
#mute.muted .off { display: block; }

#startmenu { position: fixed; left: 6px; bottom: calc(var(--tb) + 2px); width: 236px; z-index: 60; display: none; background: #000; border: 2px solid #fff; }
#startmenu.open { display: block; }
.sm-head { display: flex; align-items: center; gap: 12px; padding: 12px; border-bottom: 2px solid #fff; font-weight: 700; }
.sm-logo { flex: none; }
.sm-list { list-style: none; margin: 0; padding: 4px; }
.sm-list li[hidden] { display: none; }
.sm-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; background: none; border: 0; font: 13px var(--chrome); text-align: left; cursor: pointer; }
.sm-item:hover, .sm-item:focus-visible { background: #fff; color: #000; outline-offset: -3px; }

#balloon { position: fixed; right: 8px; top: 8px; max-width: min(320px, calc(100vw - 16px)); z-index: 55; padding: 9px 13px; background: #000; border: 2px solid var(--cyan); color: var(--cyan); font-size: 12px; opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s; pointer-events: none; }
#balloon.show { opacity: 1; transform: none; }

#flash { position: absolute; inset: 0; z-index: 100; pointer-events: none; opacity: 0; background: radial-gradient(circle at var(--fx, 50%) var(--fy, 50%), rgba(255,255,255,.8), rgba(191,230,255,.32) 20%, transparent 52%); }
#flash.go { animation: flash .5s ease-out 1; }
@keyframes flash { 0% { opacity: 0; } 14% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- the brownout ---------- */
#blackout { position: fixed; inset: 0; z-index: 9000; background: #000; opacity: 0; pointer-events: none; display: grid; place-items: center; }
#blackout.flick { opacity: .55; }
#blackout.black { opacity: 1; }
#blackout.dim { opacity: .88; transition: opacity .7s ease; }
.bo-in { width: min(900px, 92vw); font-family: var(--seg); opacity: 0; }
#blackout.black .bo-in, #blackout.dim .bo-in { opacity: 1; }
.bo-bits { font-size: 11px; letter-spacing: .05em; color: #ccc; word-break: break-all; }
.bo-err { font-size: clamp(60px, 20vw, 190px); line-height: 1.05; margin: 3vh 0; color: #fff; text-shadow: 6px 0 0 rgba(255,255,255,.55), -6px 0 0 rgba(255,255,255,.35); }
.bo-msg { font-size: 15px; letter-spacing: .05em; }

/* ---------- boot ---------- */
#boot { position: fixed; inset: 0; z-index: 9500; background: #000; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 5vh 8vw; font-family: var(--crt); font-size: 22px; line-height: 1.25; color: #fff; text-transform: lowercase; outline: none; cursor: default; }
#boot.gone { opacity: 0; transition: opacity .25s; pointer-events: none; }
#bootlogo { min-height: 8em; margin-bottom: 18px; }
#bootlines .prompt { margin-top: 10px; }
#boot .skip { position: absolute; right: 18px; bottom: 14px; margin: 0; font-size: 16px; color: #777; }

@media (pointer: coarse) {
  .dicon .dl { font-size: 12px; }
}

/* ---------- reduced motion: static web, dim fade instead of flicker, no blinking ---------- */
@media (prefers-reduced-motion: reduce) {
  .drift, .caret, .cam-rec .dot, .win.shake, #flash.go, .bar i.run { animation: none; }
  .bar i.run { width: 100%; }
  .win.moving, #walltext, #overprint { transition: none; }
  body.cleared:not(.cleared-now) .dicon[data-id="voicememo"] { animation: none; }
}

/* ---------- v3: the guide ("line"), the open count, pointing ---------- */
#line { position: fixed; right: 14px; bottom: calc(var(--tb) + 12px); width: min(332px, calc(100vw - 28px)); z-index: 40; display: flex; flex-direction: column; background: #000; color: #fff; border: 2px solid #fff; }
#line[hidden], #linebtn[hidden], #opencount[hidden] { display: none; }
#line .tb { flex: none; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 4px 0 10px; border-bottom: 2px solid #fff; font-weight: 700; font-size: 13px; user-select: none; }
.im-buddy { display: flex; align-items: baseline; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #444; font-size: 12px; }
.im-buddy b { font-size: 14px; }
.im-buddy span { color: var(--dim); }
.im-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid #fff; align-self: center; }
.im-log { height: 190px; overflow-y: auto; padding: 10px 12px 4px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 90%; padding: 6px 10px; border: 1px solid #fff; font: 14px/1.4 var(--type); overflow-wrap: anywhere; }
.msg.g { align-self: flex-start; }
.msg.me { align-self: flex-end; background: #fff; color: #000; }
.im-typing { min-height: 22px; padding: 2px 12px 6px; font-size: 12px; color: var(--dim); visibility: hidden; }
.im-typing.on { visibility: visible; }
.im-typing.on::after { content: ""; display: inline-block; width: .5em; height: .9em; margin-left: 3px; vertical-align: text-bottom; background: currentColor; animation: blink 1.1s steps(2, jump-none) infinite; }
.im-btns { display: flex; gap: 8px; padding: 8px 12px 12px; border-top: 1px solid #444; }
.im-btns .btn { flex: 1; padding: 6px 8px; font-size: 12px; }

#opencount { align-self: center; padding: 3px 9px; border: 1px solid #555; font: 12px var(--mono); white-space: nowrap; color: #cfcfcf; }
#linebtn { position: relative; background: none; border: 2px solid transparent; padding: 3px; cursor: pointer; display: grid; place-items: center; }
#linebtn:hover { border-color: #fff; }
#linebtn .udot { display: none; position: absolute; top: 1px; right: 1px; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); }
#linebtn.unread .udot { display: block; animation: blink 1.2s steps(2, jump-none) infinite; }

/* pointing: 3 slow cyan pulses, then a steady faint outline until it is used */
.point { outline: 2px solid rgba(191,230,255,.5); outline-offset: 4px; animation: pointpulse 1.8s ease-in-out 3; }
.point:focus-visible { outline: 2px dotted #fff; }
@keyframes pointpulse { 0%, 100% { outline-color: rgba(191,230,255,.2); outline-offset: 3px; } 50% { outline-color: rgba(191,230,255,.95); outline-offset: 8px; } }
.win.arrive { animation: arrive .3s ease-out 1; }
@keyframes arrive { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }

/* found drawer: all 8 slots, grey cards say where to look */
.drawer.tall .d-card { height: 58px; }
.drawer.tall .d-card:last-child { height: 76px; }
.d-note { position: absolute; left: 14px; right: 14px; top: 9px; font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.d-note.on { color: #fff; }
.d-memo { position: absolute; left: calc(var(--tx) + 6px); top: 6px; width: calc(31% - 12px); height: 19px; padding: 0 6px; border: 1px solid var(--cyan); border-radius: 10px; background: #000; color: var(--cyan); font: 11px var(--chrome); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-memo:hover, .d-memo:focus-visible { background: var(--cyan); color: #000; outline: none; }

@media (prefers-reduced-motion: reduce) {
  .point, .win.arrive, #linebtn.unread .udot, .im-typing.on::after { animation: none; }
}

/* ---------- phones (up to 640 wide): app dock, one line IM bar, popups spread over the whole desk ---------- */
@media (max-width: 640px) {
  :root { --tb: calc(46px + env(safe-area-inset-bottom, 0px)); --dock: 150px; --imb: 48px; }
  /* the desk is everything above the IM bar and the dock */
  #desk { bottom: calc(var(--tb) + var(--dock) + var(--imb)); }
  #overprint .op { font-size: 30px !important; opacity: .16; }
  body.has-app:not(.cleared) #overprint { opacity: .5; }
  #footline { left: 8px; bottom: 4px; font-size: 10px; }
  #walltext { left: 6%; top: 34%; width: 90%; height: 60%; font-size: 15px; }
  .wt.big { font-size: 21px; }

  /* the dock: 6 columns, two rows (a third only when login.exe arrives), always visible, always above the windows */
  #icons { position: fixed; z-index: 45; left: 0; right: 0; top: auto; bottom: var(--tb); width: auto; height: var(--dock);
    display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: 68px; align-content: start; gap: 0; pointer-events: auto;
    padding: 4px max(6px, env(safe-area-inset-right, 0px)) 4px max(6px, env(safe-area-inset-left, 0px)); background: #000; border-top: 2px solid #fff; }
  .dicon { width: auto; min-width: 44px; min-height: 64px; padding: 4px 0; gap: 3px; font-size: 11px; }
  .dicon .di svg { width: 40px; height: 40px; }
  .dicon .dl { padding: 0 2px; font-size: 11px; white-space: nowrap; }
  .dl-full { display: none; }
  .dl-short { display: inline; }
  .dicon.point { outline-offset: -3px; animation-name: pointpulse-m; }
  @keyframes pointpulse-m { 0%, 100% { outline-color: rgba(191,230,255,.2); } 50% { outline-color: rgba(191,230,255,.95); } }

  /* line: a one line bar just above the dock, a half height sheet when open */
  #line { left: 0; right: 0; bottom: calc(var(--tb) + var(--dock)); width: auto; z-index: 46; border-width: 2px 0 0; height: min(50vh, calc(100vh - var(--tb) - var(--dock) - 70px)); }
  #line.m-collapsed { height: var(--imb); }
  #line.m-collapsed .im-buddy, #line.m-collapsed .im-log, #line.m-collapsed .im-typing, #line.m-collapsed .im-btns { display: none; }
  #line .tb { height: var(--imb); padding: 0; border-bottom-width: 0; }
  #line:not(.m-collapsed) .tb { border-bottom: 2px solid #fff; }
  #line .tb > :not(.im-toggle) { display: none; }
  .im-toggle { display: flex; flex: 1; align-items: center; gap: 10px; min-width: 0; height: 100%; padding: 0 14px; background: none; border: 0; color: #fff; text-align: left; cursor: pointer; font: 14px var(--type); }
  .im-peek { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #line:not(.m-collapsed) .im-peek { font: 700 14px var(--chrome); }
  #line:not(.m-collapsed) .im-peek::before { content: "line"; }
  #line:not(.m-collapsed) .im-peek { font-size: 0; }
  #line:not(.m-collapsed) .im-peek::before { font: 700 14px var(--chrome); }
  .im-udot { display: none; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--cyan); }
  #line.unread .im-udot { display: block; animation: blink 1.2s steps(2, jump-none) infinite; }
  .im-chev { flex: none; width: 10px; height: 10px; border-left: 2px solid #fff; border-top: 2px solid #fff; transform: rotate(45deg); margin-top: 4px; }
  #line:not(.m-collapsed) .im-chev { transform: rotate(225deg); margin-top: -2px; }
  .im-log { flex: 1; height: auto; min-height: 0; }
  .im-btns .btn { min-height: 46px; font-size: 14px; }
  .msg { font-size: 15px; }
  #linebtn { display: none; }
  #opencount { padding: 3px 7px; font-size: 12px; }
  #balloon { top: 6px; }
  #startmenu { bottom: calc(var(--tb) + 2px); }

  /* popups: spread across the desk, inline left/top/width set by the window manager */
  .win.popup { height: auto !important; max-height: calc(100% - 8px); }
  .win.popup.np .body { min-height: 60px; }
  .win .tb, .win.np .tb { font-size: 14px; }
  .win.wire .tb, .win.err .tb { height: 44px; }
  .win.np .tb { height: 38px; font-size: 13px; }
  .tb-count { font-size: 12px; }
  .np-menu { font-size: 13px; }
  .tb-btn { width: 44px; height: 44px; }
  .win.np .tb-btn { width: 44px; height: 30px; }
  .win.np .tb-btn.close { width: 48px; }
  .win.popup .tb-btn.min { display: none; }
  .tb-btn.close::before, .tb-btn.close::after { left: 13px; right: 13px; top: 21px; }
  .tb-btn.min::before { left: 13px; right: 13px; bottom: 16px; }
  .win.np .tb-btn.close::before, .win.np .tb-btn.close::after { left: 16px; right: 16px; top: 14px; }
  .win.np .tb-btn.min::before { left: 14px; right: 14px; bottom: 8px; }
  .btn { min-height: 44px; font-size: 14px; }
  .btn.sm { min-height: 44px; }
  .typed { font-size: 16px; }
  .typed.small { font-size: 14px; }
  .np-line { font-size: 18px; }
  .seg-sm { font-size: 16px; }
  .giant { font-size: 60px; }
  .ghost { transform: translate(calc(var(--g) * -10px), calc(var(--g) * -10px)); }
  .st { min-height: 110px; }
  .seg-big { margin: 14px 0; }

  /* apps: nearly full screen in the desk area */
  .win.app { left: 8px !important; top: 8px !important; width: calc(100% - 16px) !important; height: calc(100% - 16px) !important; max-height: none; }
  .win.app .tb { height: 46px; }
  .win.app .tb-btn { width: 46px; height: 46px; }
  .win.app .tb-btn.close::before, .win.app .tb-btn.close::after { left: 14px; right: 14px; top: 22px; }
  .win.app .tb-btn.min::before { left: 14px; right: 14px; bottom: 17px; }
  .win.dialog { left: 12px !important; right: 12px; width: auto !important; height: auto !important; top: 20% !important; }
  .win.np.app .np-menu { display: flex; }
  .addr, .term-in { font-size: 16px; }
  .d-card { height: 33px; }
  .drawer.tall .d-card { height: 62px; }
  .drawer.tall .d-card:last-child { height: 80px; }
  .d-tab { height: 30px; width: 34%; }
  .d-tab .n { top: 9px; } .d-tab .t { top: 9px; font-size: 11px; }
  .d-note { font-size: 12px; }
  .d-memo { width: calc(34% - 12px); height: 21px; }
  .cam { font-size: 18px; }
  #boot { font-size: 19px; padding: 4vh 22px; }
  #bootlogo { min-height: 6em; }
}
@media (min-width: 641px) { .im-toggle { display: none; } }
@media (max-width: 640px) {
  .trace .tpad { display: flex; }
  #mute.muted::after { content: none; }
  #tray { gap: 6px; padding: 0 2px; }
  #clock { font-size: 11px; }
  #resetbtn { min-height: 34px; padding: 2px 6px; }
  .rcanvas { height: 184px; }
  .btn.glb { min-height: 44px; }
  .rdigits { font-size: 64px; right: 70px; }
  .rflash { font-size: 96px; }
}

/* ---------- glitch variants: stretch, tear, freeze ---------- */
.fxsnap { z-index: 8500; pointer-events: none; background: #000; overflow: hidden; }
.fxwrap { position: fixed; inset: 0; z-index: 8500; pointer-events: none; }
.fxwrap .fxsnap { z-index: auto; }
.fxnoise { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; opacity: .3; }
.fxmsg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 6px 20px 8px; background: #000; border: 2px solid #fff; color: #fff; font: 400 clamp(34px, 9vw, 72px)/1 var(--crt); letter-spacing: .04em; white-space: nowrap; }
.fxfreeze { position: fixed; inset: 0; z-index: 8800; cursor: none; }
.fxcursor { position: fixed; z-index: 8801; pointer-events: none; transform: translate(-1px, -1px); }
html.is-frozen, html.is-frozen * { cursor: none !important; animation-play-state: paused !important; }

/* ---------- v4: mini-games (trace, radio, untangle) and login. white wireframe, cyan only when something works ---------- */
.how { margin: 0 0 12px; font: 15px/1.4 var(--type); color: #cfcfcf; }
.radio { display: flex; flex-direction: column; gap: 10px; }
.rwrap { position: relative; }
.rcanvas { display: block; width: 100%; height: 190px; border: 2px solid #fff; background: #000; }
.win.lock .rcanvas { border-color: var(--cyan); }
.glab { display: block; }
.glt { font: 400 21px/1 var(--crt); letter-spacing: .04em; text-transform: lowercase; pointer-events: none; }
.btn.glb[hidden] { display: none; }
.btn.glb:active, .btn.glb.on { color: var(--cyan); border-color: var(--cyan); }
.btn.glb.primary:active { background: var(--cyan); color: #000; border-color: var(--cyan); }
.rdigits { position: absolute; left: 12px; right: 76px; top: 6px; height: 92px; display: flex; align-items: center; justify-content: center; font: 400 72px/1 var(--crt); letter-spacing: .06em; color: #fff; text-shadow: 0 0 10px rgba(255,255,255,.35); pointer-events: none; }
.win.lock .rdigits { color: var(--cyan); text-shadow: 0 0 12px rgba(191,230,255,.7); }
.rmhz { position: absolute; right: 12px; top: 62px; font: 400 26px/1 var(--crt); color: #cfcfcf; pointer-events: none; }
.rflash { position: absolute; left: 2px; right: 2px; top: 2px; height: 100px; display: grid; place-items: center; background: #000; font: 400 108px/1 var(--crt); color: var(--cyan); text-shadow: 0 0 14px rgba(191,230,255,.8); pointer-events: none; z-index: 1; }
.rflash:empty { display: none; }
.radio > .btn.glb { align-self: flex-start; }
.btn.glb { display: inline-flex; align-items: center; justify-content: center; padding: 8px 10px; min-height: 44px; }
.tboard { cursor: grab; outline-offset: 3px; }
.trace { display: flex; flex-direction: column; gap: 8px; }
.tpad { display: none; gap: 8px; }
.tpad .btn { flex: 1; }
.lgwrap { position: relative; width: 100%; max-width: 320px; margin: 0 auto; }
/* the password filling in, one letter per found memo */
.d-word { display: flex; justify-content: center; gap: 6px; margin: 10px 0 2px; }
.d-word span { width: 28px; height: 36px; display: grid; place-items: center; border-bottom: 2px solid #fff; font: 400 32px/1 var(--crt); }
.d-word span.gap { color: transparent; border-bottom-color: rgba(255,255,255,.4); }
.d-word span.got { color: var(--cyan); text-shadow: 0 0 10px rgba(191,230,255,.6); border-bottom-color: var(--cyan); }
.lg-hint { margin: 0; text-align: center; font-size: 13px; color: #bbb; }
.lg-word { margin: 6px 0 12px; }
@media (max-width: 640px) { .d-word { gap: 4px; } .d-word span { width: 24px; height: 32px; font-size: 28px; } }
.lgcv { display: block; width: 100%; height: 262px; }
.lgpass { position: absolute; height: 44px; margin: 0; padding: 0 12px; border: 0; background: transparent; color: transparent; -webkit-text-fill-color: transparent; caret-color: transparent; font: 16px var(--mono); outline: none; z-index: 2; }
.win.dip { animation: dip .26s; }
@keyframes dip { 0%, 100% { filter: none; } 30% { filter: brightness(.22); } 60% { filter: brightness(.7); } }
.dicon.fresh { outline: 2px solid rgba(191,230,255,.5); outline-offset: 4px; animation: pointpulse 1.8s ease-in-out 2; }



.rrange { position: absolute; width: 100%; height: 44px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; touch-action: pan-y; opacity: 0; cursor: grab; z-index: 2; }
.rrange::-webkit-slider-runnable-track { height: 2px; background: #fff; }
.rrange::-moz-range-track { height: 2px; background: #fff; }
.rrange::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 40px; margin-top: -19px; background: #fff; border: 2px solid #000; }
.rrange::-moz-range-thumb { width: 18px; height: 38px; background: #fff; border: 2px solid #000; border-radius: 0; }
.rrange:focus-visible { outline: 2px dotted #fff; outline-offset: 2px; }
.rsteps { display: flex; gap: 8px; }
.rsteps .btn { flex: 1; padding-left: 4px; padding-right: 4px; }
.rstat { min-height: 1.5em; }
.rdig { flex: 1; letter-spacing: .3em; }

.untangle { display: flex; flex-direction: column; gap: 8px; }
.uboard { display: block; width: 100%; max-width: 420px; aspect-ratio: 1; margin: 0 auto; border: 2px solid #fff; background: #000; touch-action: none; user-select: none; cursor: grab; }
.uboard .th { stroke: #7d7d7d; stroke-width: 3; stroke-linecap: round; stroke-dasharray: .1 7; transition: stroke .5s; }
.uboard .th.x { stroke: #fff; stroke-width: 4; }
.unode circle { fill: #000; stroke: #fff; stroke-width: 2; cursor: grab; }
.unode text { fill: #fff; font: 11px var(--mono); text-anchor: middle; pointer-events: none; }
.unode.drag circle { fill: #fff; cursor: grabbing; }
.unode.drag text { fill: #000; }
.uboard.won .th { stroke: var(--cyan); stroke-width: 4; transition-delay: calc(var(--i) * 80ms); }
.uboard.won .unode circle { stroke: var(--cyan); }
.uboard.won .unode text { fill: var(--cyan); }

.login { display: flex; flex-direction: column; gap: 6px; }
.login .addr { flex: none; }
.login .btnrow { justify-content: center; }
.lglab { font-size: 13px; color: #cfcfcf; margin-top: 6px; }

@media (max-width: 640px) {
  .how { margin-bottom: 8px; font-size: 14px; }
  .jcol { gap: 8px; padding: 6px 8px; }
  .jack { min-height: 46px; min-width: 96px; }
  .jboard { padding: 2px; }
        }
@media (prefers-reduced-motion: reduce) {
  .win.dip, .dicon.fresh, .jspark { animation: none; }
  .uboard .th { transition: none; }
}
