:root {
  --desk: #008080;
  --face: #c0c0c0;
  --hi: #ffffff;
  --lo: #808080;
  --dk: #000000;
  --title1: #000080;
  --title2: #1084d0;
  --font: "Tahoma", "MS Sans Serif", "Segoe UI", Geneva, Verdana, sans-serif;
  --k: 1; /* desktop scale, set from JS */
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { background: var(--desk); font: 12px/1.4 var(--font); color: #000; user-select: none; }
input, textarea, select, button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- bevels ---------- */
.raised, .btn, .tbtn {
  background: var(--face);
  box-shadow: inset -1px -1px var(--dk), inset 1px 1px var(--hi), inset -2px -2px var(--lo), inset 2px 2px #dfdfdf;
}
.sunken, .field {
  background: #fff;
  box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--lo), inset -2px -2px #dfdfdf, inset 2px 2px var(--dk);
}
.btn { border: 0; padding: 4px 12px; min-width: 75px; min-height: 23px; cursor: pointer; }
.btn:active:not(:disabled), .btn.pressed {
  box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--dk), inset -2px -2px #dfdfdf, inset 2px 2px var(--lo);
}
.btn:disabled { color: var(--lo); text-shadow: 1px 1px #fff; cursor: default; }
.btn.default { outline: 1px solid #000; outline-offset: -1px; }
button:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }
.field { border: 0; padding: 4px 5px; width: 100%; outline: none; user-select: text; }
textarea.field { resize: vertical; font: 13px/1.4 var(--font); }
label { display: block; margin: 8px 0 3px; }
.muted { color: #555; }
.small { font-size: 11px; }
a { color: #0000ee; }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; display: none; }
.screen.on { display: block; }
.center { place-items: center; padding: 16px; overflow: auto; }
.center.on { display: grid; }

.logo { color: #fff; font: bold italic 34px/1 var(--font); text-shadow: 2px 2px 0 #000; letter-spacing: -1px; text-align: center; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; justify-content: center; }
.logo svg { width: 40px; height: 40px; }
.logo sup { font-size: 14px; font-style: normal; color: #ffe08a; }

/* ---------- dialogs ---------- */
.dlg { padding: 3px; width: min(420px, 100%); display: flex; flex-direction: column; }
.dlg .body { padding: 14px; }
.dlg-row { display: flex; gap: 14px; align-items: flex-start; }
.dlg-row > svg { width: 40px; height: 40px; flex: none; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.dlg-btns .spacer { flex: 1; }
.err { display: flex; gap: 6px; align-items: center; margin-top: 10px; background: #ffffe1; border: 1px solid #000; padding: 4px 6px; }
.demo-tag { display: inline-block; background: #ffe08a; border: 1px solid #000; padding: 0 4px; font-size: 10px; font-weight: bold; }
.avatars { display: flex; flex-wrap: wrap; gap: 3px; }
.avatars button { width: 32px; height: 32px; font-size: 18px; border: 0; padding: 0; cursor: pointer; background: var(--face); }
.avatars button[aria-pressed="true"] { background: var(--title1); outline: 1px dotted #fff; outline-offset: -3px; }

#modal { position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.25); }

/* ---------- windows ---------- */
.win { position: absolute; min-width: 240px; min-height: 120px; padding: 3px; display: flex; flex-direction: column;
  max-width: calc(100vw - 8px); max-height: calc(100vh - 40px); }
.win.max { left: 0 !important; top: 0 !important; width: 100vw !important; height: calc(100vh - 32px) !important; max-height: none; }
.titlebar { display: flex; align-items: center; gap: 4px; padding: 3px 3px 3px 4px;
  background: linear-gradient(90deg, #808080, #b5b5b5); color: #dfdfdf; font-weight: bold; cursor: move; touch-action: none; }
.win.active .titlebar, .dlg .titlebar { background: linear-gradient(90deg, var(--title1), var(--title2)); color: #fff; }
.dlg .titlebar { cursor: default; }
.titlebar .t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.titlebar .t svg { width: 16px; height: 16px; flex: none; }
.tbtn { width: 18px; height: 16px; padding: 0; border: 0; cursor: pointer; font: bold 10px/1 monospace; }
.tbtn:active { box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--dk); }
.menubar { display: flex; gap: 2px; padding: 2px 0; }
.menubar span { padding: 1px 6px; }
.win .body { flex: 1; overflow: auto; padding: 12px; margin-top: 2px; user-select: text; }
.win .body.flat { background: var(--face); box-shadow: none; padding: 8px 6px; user-select: none; }
.statusbar { display: flex; gap: 2px; margin-top: 2px; }
.statusbar div { flex: 1; padding: 2px 6px; box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--lo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rz { position: absolute; z-index: 2; touch-action: none; }
.rz-e { top: 0; right: -3px; width: 7px; height: 100%; cursor: ew-resize; }
.rz-s { left: 0; bottom: -3px; height: 7px; width: 100%; cursor: ns-resize; }
.rz-se { right: 2px; bottom: 2px; width: 14px; height: 14px; cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 0 45%, var(--hi) 45% 52%, var(--lo) 52% 60%, transparent 60% 65%, var(--hi) 65% 72%, var(--lo) 72% 80%, transparent 80%); }
.win.max .rz { display: none; }

h1 { font-size: 20px; margin: 0 0 2px; }
h2 { font-size: 13px; margin: 14px 0 6px; border-bottom: 1px solid var(--lo); }
h3 { font-size: 13px; margin: 0; }
.row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.bigavatar { width: 96px; height: 96px; flex: none; display: grid; place-items: center; font-size: 56px; }
.linkbtns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 8px; align-items: flex-start; padding: 6px 2px; border-bottom: 1px dotted #aaa; }
.list .av { font-size: 20px; line-height: 1; }
.linky { background: none; border: 0; padding: 0; color: #0000ee; text-decoration: underline; cursor: pointer; }
.marquee { overflow: hidden; white-space: nowrap; background: #000; color: #0f0; font: 12px monospace; padding: 2px 0; margin-top: 12px; }
.marquee span { display: inline-block; padding-left: 100%; animation: scroll 18s linear infinite; }
@keyframes scroll { to { transform: translateX(-100%); } }

/* tabs (Display Properties) */
.tabs { display: flex; gap: 0; padding-left: 2px; position: relative; z-index: 1; flex-wrap: wrap; }
.tabs button { border: 0; padding: 3px 9px; margin-right: -1px; cursor: pointer; background: var(--face);
  box-shadow: inset 1px 1px var(--hi), inset -1px 0 var(--dk), inset -2px 0 var(--lo); margin-top: 2px; }
.tabs button[aria-selected="true"] { margin-top: 0; padding-bottom: 5px; margin-bottom: -2px; position: relative; }
.tabpanel { padding: 10px; box-shadow: inset -1px -1px var(--dk), inset 1px 1px var(--hi), inset -2px -2px var(--lo), inset 2px 2px #dfdfdf; flex: 1; overflow: auto; }
.monitor { width: 168px; margin: 0 auto 10px; padding: 8px 8px 0; border-radius: 4px 4px 0 0; }
.monitor .scr { height: 96px; box-shadow: inset 1px 1px var(--lo), inset -1px -1px var(--hi); display: grid; place-items: center; font-size: 34px; overflow: hidden; }
.monitor .stand { height: 10px; width: 60px; margin: 6px auto 0; }
.listbox { height: 120px; overflow: auto; padding: 2px; }
.listbox button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 2px 4px; cursor: pointer; }
.listbox button[aria-selected="true"] { background: var(--title1); color: #fff; }
.emogrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; padding: 4px; max-height: 210px; overflow: auto; }
.emogrid button { aspect-ratio: 1; font-size: 22px; border: 0; padding: 0; cursor: pointer; background: var(--face);
  box-shadow: inset -1px -1px var(--dk), inset 1px 1px var(--hi); }
.emogrid button:active { box-shadow: inset 1px 1px var(--dk), inset -1px -1px var(--hi); }
#emoq { width: 100%; }
.emocats { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 6px; }
.emocats button { font-size: 16px; width: 30px; height: 26px; padding: 0; border: 0; cursor: pointer; background: var(--face);
  box-shadow: inset -1px -1px var(--dk), inset 1px 1px var(--hi); }
.emocats button[aria-selected="true"] { background: var(--title1); box-shadow: inset 1px 1px var(--dk), inset -1px -1px var(--hi); }
#emogrid { margin-top: 6px; height: 220px; max-height: none; align-content: start; }
.phgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; padding: 6px; height: 200px; overflow: auto; align-content: start; }
.phgrid button { aspect-ratio: 1; padding: 3px; border: 0; cursor: pointer; background: #fff; box-shadow: inset -1px -1px var(--dk), inset 1px 1px var(--hi); }
.phgrid img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.swatches { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.swatches button { width: 26px; height: 22px; border: 0; cursor: pointer; box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--dk); }
.swatches button[aria-pressed="true"] { outline: 2px solid #000; outline-offset: 1px; }
.wagrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.wagrid button { height: 48px; border: 0; cursor: pointer; background: #fff; font-size: 18px; overflow: hidden;
  box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--lo), inset -2px -2px #dfdfdf, inset 2px 2px var(--dk); }
.wagrid button[aria-pressed="true"] { outline: 2px dotted var(--title1); outline-offset: -5px; }
.inline { display: flex; gap: 6px; align-items: center; }
.inline .field { flex: 1; }
input[type="color"] { width: 40px; height: 24px; padding: 0 2px; border: 0; background: var(--face); box-shadow: inset 1px 1px var(--dk), inset -1px -1px var(--hi); cursor: pointer; }

/* ---------- folders, docs, pictures ---------- */
.win .body.files, .win .body.photo { display: flex; flex-direction: column; gap: 4px; padding: 4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.toolbar .btn { min-width: 0; padding: 3px 8px; }
.toolbar .spacer { flex: 1; }
.addr { display: flex; align-items: center; gap: 4px; padding: 2px 6px; white-space: nowrap; overflow: hidden; user-select: text; }
.addr svg { width: 16px; height: 16px; flex: none; }
.addr span { overflow: hidden; text-overflow: ellipsis; }
.fgrid { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); align-content: start; gap: 6px; padding: 8px; }
.fgrid.drop { outline: 2px dashed var(--title1); outline-offset: -6px; background: #eef4ff; }
.fgrid .empty { grid-column: 1 / -1; margin: 4px; }
.ficon { border: 0; background: none; cursor: pointer; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.ficon > svg { width: 44px; height: 44px; margin: 6px 0 4px; }
.ficon .thumb { width: 76px; height: 58px; padding: 3px; background: #fff; box-shadow: 1px 1px 0 #000, inset 0 0 0 1px #999; }
.ficon .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ficon .fn { font-size: 11px; line-height: 1.25; max-width: 100%; padding: 0 2px; overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ficon.sel .fn, .ficon:focus-visible .fn { background: var(--title1); color: #fff; }
.ficon:focus { outline: none; }
.doc { font: 15px/1.65 Georgia, "Times New Roman", serif; max-width: 640px; margin: 0 auto; }
.doc h1 { font: bold 24px/1.2 Georgia, "Times New Roman", serif; margin: 4px 0 6px; overflow-wrap: anywhere; }
.doc p { margin: 0 0 1em; overflow-wrap: anywhere; }
.byline { font: 11px var(--font); color: #555; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid #ccc; }
.doc-actions { max-width: 640px; margin: 18px auto 0; padding-top: 10px; border-top: 1px dotted #aaa; }
.editor { display: flex; flex-direction: column; gap: 6px; height: 100%; }
.editor .title { font: bold 16px Georgia, serif; }
.editor textarea { flex: 1; min-height: 140px; resize: none; font: 15px/1.55 Georgia, "Times New Roman", serif; }
.editor .err { margin-top: 0; }
.photo .frame { flex: 1; min-height: 120px; display: grid; place-items: center; background: #1b1b1b; overflow: hidden;
  box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--lo), inset -2px -2px #dfdfdf, inset 2px 2px var(--dk); padding: 4px; }
.photo .frame img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; min-height: 0; }
.photo .cap { padding: 2px 4px; overflow-wrap: anywhere; user-select: text; }
.photo .linkbtns .btn { min-width: 0; }
.ficon .cc { font-size: 10px; color: #444; white-space: nowrap; }
/* comments under a post or picture */
.comments { max-width: 640px; margin: 18px auto 0; font: 12px/1.4 var(--font); user-select: text; }
.comments h2 { margin-top: 0; }
.comments .clist li { align-items: flex-start; }
.comments .ctext { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; font-size: 13px; }
.comments .nx { border: 0; background: none; cursor: pointer; padding: 0 2px; font: bold 13px/1 monospace; color: #888; }
.comments .nx:hover { color: #c00; }
.cform { margin-top: 8px; }
.cform textarea { resize: vertical; }
.cform .err { margin-top: 4px; }
.photo .comments { margin: 4px 0 0; padding: 6px 8px; flex: 0 1 auto; max-height: 42%; overflow: auto; background: #fff;
  box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--lo), inset -2px -2px #dfdfdf, inset 2px 2px var(--dk); }
.photo .comments .cform textarea { min-height: 0; }

/* ---------- login / picker / boot ---------- */
#login, #picker { background: var(--desk); }
.pickerwin { width: min(760px, 100%); }
.pickerwin .body { padding: 12px; }
.me-row { display: flex; gap: 14px; align-items: center; padding: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; padding: 10px; max-height: min(52vh, 460px); overflow: auto; }
.tile { border: 0; background: none; cursor: pointer; padding: 6px 4px; text-align: center; }
.tile .mini { width: 100%; max-width: 116px; margin: 0 auto 6px; padding: 5px 5px 0; }
.tile .mini .scr { aspect-ratio: 4/3; display: grid; place-items: center; font-size: 30px; box-shadow: inset 1px 1px var(--lo), inset -1px -1px var(--hi); overflow: hidden; }
.tile .mini .stand { height: 6px; width: 40%; margin: 3px auto 0; }
.tile .nm { font-weight: bold; display: block; }
.tile .un { color: #444; display: block; font-size: 11px; }
.tile:hover .nm, .tile:focus-visible .nm { background: var(--title1); color: #fff; }
.tile.mine .mini { outline: 2px solid #ffe08a; }
.badge { display: inline-block; background: #e00; color: #fff; border-radius: 8px; padding: 0 6px; font-size: 10px; font-weight: bold; margin-left: 4px; }

#boot { background: radial-gradient(ellipse at 50% 40%, #1a9a9a, #004848 70%); color: #fff; }
#boot .wrap { text-align: center; }
#boot .logo { font-size: 46px; }
.progress { width: 240px; height: 18px; margin: 18px auto 10px; padding: 2px; display: flex; gap: 2px; overflow: hidden; }
.progress i { width: 10px; flex: none; background: var(--title1); animation: blink 1.2s steps(1) infinite; }
.progress i:nth-child(n) { animation-delay: calc(var(--i) * .08s); }
@keyframes blink { 0% { opacity: 0; } 30% { opacity: 1; } }
#boot .msg { font-size: 14px; text-shadow: 1px 1px #000; }

/* ---------- desktop ---------- */
#wall { position: absolute; inset: 0 0 32px 0; overflow: hidden; background: var(--desk); }
#items, #notes { position: absolute; inset: 0; z-index: 0; }
#notes { pointer-events: none; z-index: 1; }
#icons { position: absolute; top: 0; left: 0; bottom: 32px; display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 10px; pointer-events: none; z-index: 1500; }
.icon { width: 78px; padding: 4px 2px; text-align: center; color: #fff; cursor: pointer; background: none; border: 0; pointer-events: auto; text-shadow: 1px 1px 1px #000; }
.icon svg { width: 36px; height: 36px; display: block; margin: 0 auto 4px; filter: drop-shadow(1px 1px 0 rgba(0,0,0,.3)); }
.icon span { padding: 0 2px; }
.icon.sel span, .icon:focus-visible span { background: var(--title1); outline: 1px dotted #fff; text-shadow: none; }
.icon:focus { outline: none; }

.item { position: absolute; transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  font-size: calc(var(--s) * var(--k) * 1px); line-height: 1; white-space: nowrap; touch-action: none; }
.editing .item { cursor: move; }
.editing .item:hover { outline: 1px dashed rgba(255,255,255,.8); outline-offset: 3px; }
.item.sel { outline: 2px dashed #fff !important; outline-offset: 4px; box-shadow: 0 0 0 1px #000; }
/* photos on the desktop */
.item.pi img { display: block; width: calc(var(--s) * var(--k) * 1px); height: auto; pointer-events: none; user-select: none; }
.item.fr-polaroid { background: #fff; padding: calc(7px * var(--k)) calc(7px * var(--k)) calc(26px * var(--k)); box-shadow: 2px 3px 6px rgba(0,0,0,.35); }
.item.fr-wood { padding: calc(10px * var(--k)); background: linear-gradient(135deg, #8b5a2b, #5d3a1a 40%, #9c6b3c 70%, #5d3a1a);
  box-shadow: inset 0 0 0 2px #3e2410, inset 0 0 0 calc(8px * var(--k)) rgba(0,0,0,.15), 2px 3px 6px rgba(0,0,0,.4); }
.item.fr-wood img { box-shadow: 0 0 0 2px #2b1a0b; }
.item.fr-tape { background: #fff; padding: calc(4px * var(--k)); box-shadow: 1px 2px 4px rgba(0,0,0,.3); }
.item.fr-tape::before { content: ""; position: absolute; left: 50%; top: calc(-9px * var(--k)); width: 40%; height: calc(18px * var(--k));
  transform: translateX(-50%) rotate(-3deg); background: rgba(255, 245, 200, .75); box-shadow: 0 1px 1px rgba(0,0,0,.15); }
.item.fr-none img { filter: drop-shadow(2px 3px 4px rgba(0,0,0,.35)); }
.item .gone { font-size: calc(40px * var(--k)); opacity: .7; }
.wa { font-family: Impact, "Arial Black", var(--font); letter-spacing: 1px; }
.wa-rainbow { background: linear-gradient(90deg, #ff3b3b, #ff9f1c, #ffe11c, #3bd16f, #2fb7ff, #a35bff); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 1px rgba(0,0,0,.5); filter: drop-shadow(2px 2px 0 rgba(0,0,0,.35)); }
.wa-shadow { color: #fff4d6; text-shadow: 1px 1px 0 #b0552d, 2px 2px 0 #b0552d, 3px 3px 0 #7a3517, 4px 4px 0 #7a3517, 5px 5px 4px rgba(0,0,0,.4); }
.wa-neon { color: #fff; text-shadow: 0 0 4px #fff, 0 0 10px #ff4fd8, 0 0 20px #ff4fd8, 0 0 34px #9b30ff; font-family: "Courier New", monospace; font-weight: bold; }
.wa-chrome { background: linear-gradient(#fdfdfd, #9aa3ad 48%, #3d4752 52%, #c9d2db); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 1px #20262c; }
.wa-outline { color: #ffe36e; -webkit-text-stroke: 2px #000; paint-order: stroke fill; }
.wa-pixel { font-family: "Courier New", monospace; font-weight: bold; color: #39ff14; background: #000; padding: .1em .3em; letter-spacing: 0; }
.wa-script { font-family: "Brush Script MT", "Segoe Script", cursive; color: #fff; font-style: italic; text-shadow: 2px 2px 0 rgba(0,0,0,.45); letter-spacing: 0; }

/* notes */
.note { position: absolute; width: 176px; transform: translate(-50%, -50%) rotate(var(--r, 0deg)); background: var(--c);
  border: 1px solid rgba(0,0,0,.45); box-shadow: 3px 4px 0 rgba(0,0,0,.28); pointer-events: auto; user-select: text; font-size: 12px; }
.note::before { content: ""; position: absolute; top: -7px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff8a8a, #c20000 60%); box-shadow: 1px 1px 1px rgba(0,0,0,.5); }
.note .nh { display: flex; align-items: center; gap: 4px; padding: 5px 5px 3px; border-bottom: 1px dashed rgba(0,0,0,.25); touch-action: none; }
.note.movable .nh { cursor: move; }
.note .who { border: 0; background: none; padding: 0; cursor: pointer; font-weight: bold; display: flex; align-items: center; gap: 3px; min-width: 0; text-align: left; }
.note .who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note .who:hover span:last-child { text-decoration: underline; }
.note .when { margin-left: auto; color: rgba(0,0,0,.55); font-size: 10px; white-space: nowrap; }
.note .nx { border: 0; background: none; cursor: pointer; padding: 0 2px; font: bold 13px/1 monospace; color: rgba(0,0,0,.55); }
.note .nx:hover { color: #c00; }
.note .nb { padding: 6px 8px 9px; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.35 "Comic Sans MS", "Chalkboard SE", "Marker Felt", var(--font); max-height: 200px; overflow: auto; }
.note.flash { animation: flash .5s 3; }
@keyframes flash { 50% { box-shadow: 0 0 0 4px #fff, 0 0 0 7px #000; } }
.note.mine-new { animation: drop .35s ease-out; }
@keyframes drop { from { transform: translate(-50%, -80%) rotate(var(--r)) scale(1.15); opacity: 0; } }

#editbar { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 1600; padding: 4px 6px 4px 10px; display: flex; gap: 10px; align-items: center; max-width: calc(100vw - 16px); }
#itemtools { position: absolute; z-index: 1700; padding: 3px; display: flex; gap: 2px; }
#itemtools button { min-width: 0; width: 28px; height: 24px; padding: 0; }

/* other people's cursors */
#cursors { position: absolute; inset: 0 0 32px 0; pointer-events: none; z-index: 8990; overflow: hidden; }
.rcursor { position: absolute; transition: left .1s linear, top .1s linear; will-change: left, top; }
.rcursor svg { width: 18px; height: 22px; display: block; filter: drop-shadow(1px 1px 0 rgba(0,0,0,.35)); }
.rcursor span { position: absolute; left: 14px; top: 18px; white-space: nowrap; background: var(--c); color: #fff; font-size: 11px; font-weight: bold;
  padding: 1px 6px 2px; border: 1px solid rgba(0,0,0,.35); box-shadow: 1px 1px 0 rgba(0,0,0,.3); }
#tray .here { font-weight: bold; }
@media (prefers-reduced-motion: reduce) { .rcursor { transition: none; } }

/* taskbar */
#taskbar { position: absolute; left: 0; right: 0; bottom: 0; height: 32px; z-index: 9000; display: flex; align-items: center; gap: 4px; padding: 3px;
  background: var(--face); box-shadow: inset 0 1px var(--face), inset 0 2px var(--hi); }
#start { font-weight: bold; display: flex; align-items: center; gap: 4px; min-width: 0; padding: 3px 6px; height: 24px; }
#start svg { width: 16px; height: 16px; }
#tasks { flex: 1; display: flex; gap: 3px; overflow: hidden; min-width: 0; }
#tasks button { flex: 0 1 160px; min-width: 40px; height: 24px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tasks button.pressed { background: repeating-conic-gradient(#fff 0 25%, var(--face) 0 50%) 0 0/2px 2px; font-weight: bold; }
#tray { height: 24px; padding: 0 8px; display: flex; align-items: center; gap: 8px; white-space: nowrap; box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--lo); }
#tray .where { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
#startmenu { position: absolute; left: 2px; bottom: 30px; z-index: 9001; display: none; padding: 3px; width: 240px; }
#startmenu.open { display: flex; }
#startmenu .side { width: 24px; background: linear-gradient(0deg, var(--title1), var(--title2)); color: #c0c0c0; writing-mode: vertical-rl; transform: rotate(180deg);
  font: bold 16px var(--font); padding: 6px 2px; letter-spacing: 1px; }
#startmenu .side b { color: #fff; }
#startmenu ul { list-style: none; margin: 0; padding: 0; flex: 1; }
#startmenu li button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 5px 8px; border: 0; background: none; cursor: pointer; text-align: left; }
#startmenu li button svg { width: 24px; height: 24px; flex: none; }
#startmenu li button:hover, #startmenu li button:focus { background: var(--title1); color: #fff; outline: none; }
#startmenu hr { border: 0; border-top: 1px solid var(--lo); border-bottom: 1px solid var(--hi); margin: 2px 0; }
#balloon { position: absolute; right: 8px; bottom: 40px; z-index: 9002; max-width: 260px; background: #ffffe1; border: 1px solid #000; border-radius: 6px; padding: 8px 26px 8px 10px; box-shadow: 2px 2px 0 rgba(0,0,0,.3); cursor: pointer; }
#balloon::after { content: ""; position: absolute; right: 30px; bottom: -10px; border: 10px solid transparent; border-top-color: #000; border-bottom: 0; }
#balloon b { display: block; margin-bottom: 2px; }
#balloon .x { position: absolute; top: 4px; right: 6px; border: 0; background: none; cursor: pointer; font: bold 12px monospace; }

@media (max-width: 640px) {
  .rz { display: none; }
  .win:not(.max) { left: 4px !important; right: 4px; width: auto !important; top: 8px !important; height: auto !important; max-height: calc(100vh - 48px); }
  #icons { flex-direction: row; bottom: auto; right: 0; }
  .icon { width: 70px; }
  .note { width: 150px; }
  #tray .clock { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee span, .progress i, .note.flash, .note.mine-new { animation: none; }
  .marquee span { padding-left: 4px; }
}

/* drag-to-select box (yours: dotted like Windows; other people's: dashed in their cursor color) */
#selbox { position: absolute; z-index: 1600; pointer-events: none; border: 1px dotted #fff; outline: 1px dotted #000; outline-offset: -1px;
  background: rgba(255, 255, 255, .08); }
#selbox[hidden], .rsel[hidden] { display: none; }
#rsels { position: absolute; inset: 0 0 32px 0; pointer-events: none; z-index: 1600; overflow: hidden; }
.rsel { position: absolute; border: 2px dashed var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
  transition: left .1s linear, top .1s linear, width .1s linear, height .1s linear; }

/* highlighted decorations (outside decorate mode) */
.item.picked { outline: 2px dotted #fff; outline-offset: 4px; box-shadow: 0 0 0 1px #000, 0 0 0 9999px transparent;
  background-color: rgba(0, 0, 128, .28); }
.item.pi.picked { background-color: #fff; }
.item.pi.fr-none.picked, .item.pi.fr-wood.picked { background-color: transparent; }
#desk.mine:not(.editing) .item.picked { cursor: move; }
.note.picked { outline: 2px dotted #000080; outline-offset: 3px; box-shadow: 0 0 0 4px rgba(0, 0, 128, .22), 2px 3px 6px rgba(0,0,0,.3); }

/* desktop picker: desktops + What's New */
.pickerwin { width: min(1100px, 100%); }
.pgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 12px; align-items: start; }
@media (max-width: 800px) { .pgrid { grid-template-columns: minmax(0, 1fr); } }
.feedcol h2 { font-size: 13px; margin: 0; }
.ftabs { display: flex; gap: 2px; flex-wrap: wrap; }
.ftabs .btn, .btn.sm { min-width: 0; padding: 2px 7px; min-height: 20px; font-size: 11px; }
.ftabs .btn[aria-pressed="true"] { box-shadow: inset 1px 1px var(--lo), inset -1px -1px var(--hi); background: #dcdcdc; font-weight: bold; }
.feed { margin-top: 8px; background: #fff; padding: 4px 10px; max-height: min(62vh, 560px); overflow: auto; }
.fi { padding: 8px 0; border-bottom: 1px dotted #999; }
.fi:last-child { border-bottom: 0; }
.fh { line-height: 1.4; }
.fwho { font-weight: bold; }
.fcard { display: block; width: 100%; text-align: left; background: #fffef6; border: 1px solid #888; padding: 7px 8px; margin: 6px 0; cursor: pointer; font: inherit; color: #000; }
.fcard:hover b, .fcard:focus-visible b { text-decoration: underline; }
.fcard img { display: block; max-width: 100%; max-height: 180px; margin: 0 auto 6px; border: 1px solid #000; }
.fcard .snip { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: #333; margin-top: 3px; white-space: pre-line; }
.fnote { background: var(--c); padding: 7px 9px; margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow: auto;
  font: 13px/1.35 "Comic Sans MS", "Chalkboard SE", "Marker Felt", var(--font); box-shadow: 1px 2px 4px rgba(0,0,0,.25); }
.fa { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fa .spacer { flex: 1; }
/* a post link inside a note */
.rp { display: flex; gap: 6px; align-items: center; width: 100%; margin-top: 4px; padding: 4px; text-align: left; white-space: normal;
  background: rgba(255,255,255,.75); border: 1px solid rgba(0,0,0,.4); cursor: pointer; font: 12px/1.25 var(--font); color: #000; }
.rp img { width: 46px; height: 46px; object-fit: cover; flex: none; border: 1px solid #000; }
.rp .rpi { font-size: 22px; flex: none; }
.rp .rpt { min-width: 0; overflow-wrap: anywhere; }
.rp .rpt b { display: block; }
.rp .by { font-size: 11px; color: #444; }
.rp:hover b, .rp:focus-visible b { text-decoration: underline; }
.rp.gone { opacity: .6; cursor: default; }
.rp.gone b { text-decoration: none !important; }

/* welcome tour */
.win .body.tourbody { display: flex; flex-direction: column; padding: 10px; user-select: text; }
.tour { flex: 1; min-height: 0; display: flex; gap: 14px; }
.tart { width: 120px; flex: none; display: grid; place-items: center; font-size: 60px; background: linear-gradient(160deg, var(--title1), var(--title2));
  box-shadow: inset 1px 1px var(--lo), inset -1px -1px var(--hi); }
.tmain { flex: 1; min-width: 0; overflow: auto; line-height: 1.45; }
.tmain h2 { font-size: 16px; margin: 2px 0 8px; }
.tmain p { margin: 0 0 8px; }
.tfoot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--lo); box-shadow: inset 0 1px var(--hi); }
.tfoot .spacer { flex: 1; }
.tfoot .btn { min-width: 64px; }
.tdots i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #9a9a9a; margin-right: 3px; }
.tdots i.on { background: var(--title1); }
@media (max-width: 520px) { .tart { width: 54px; font-size: 30px; } .tdots { display: none; } }

/* What's New window */
.win .body.newsbody { display: flex; flex-direction: column; gap: 6px; padding: 6px; }
.newsbody .feed { flex: 1; min-height: 0; max-height: none; margin-top: 0; }

/* arcade */
.win .body.arcadebody { display: flex; flex-direction: column; gap: 8px; padding: 8px; }
.carts { display: flex; flex-direction: column; gap: 6px; }
.cart { display: flex; gap: 10px; align-items: center; padding: 8px; }
.cart .ci { font-size: 32px; width: 46px; text-align: center; flex: none; }
.cart .cm { flex: 1; min-width: 0; }
.cart .cm .small { margin-top: 2px; }
.tbanner { padding: 8px 10px; background: linear-gradient(135deg, #fff6c9, #ffe08a); border: 2px solid #b8860b; }
.tbanner.done { background: #ececec; border-color: #888; }
.tbanner .th { font-size: 14px; margin-bottom: 2px; }
.warnbox { margin: 0; padding: 6px 8px; background: #ffffe1; border: 1px solid #000; }
.lb { list-style: none; margin: 6px 0; padding: 0; }
.lb li { display: flex; gap: 6px; align-items: center; padding: 2px 3px; border-bottom: 1px dotted #aaa; }
.lb li.me { background: rgba(255, 224, 138, .7); }
.lb .rk { width: 26px; text-align: center; flex: none; }
.lb b { margin-left: auto; font-family: "Lucida Console", "Courier New", monospace; }
.win .body.gamebody { display: flex; gap: 8px; padding: 6px; align-items: flex-start; }
.gstage { flex: none; width: min(372px, 100%); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.gcan { display: block; width: 100%; height: auto; border: 2px solid #000; background: #0b0f1a; outline: none; }
.gcan:focus-visible { outline: 2px dotted #000; outline-offset: 2px; }
.gside { flex: 1; min-width: 0; align-self: stretch; overflow: auto; padding: 8px; background: #fff; }
.gside h3 { margin: 8px 0 2px; font-size: 13px; }
.gmsg:not(:empty) { padding: 6px 8px; background: #ffffe1; border: 1px solid #000; margin-bottom: 4px; line-height: 1.4; }
.gpad { display: grid; grid-template-columns: repeat(3, 48px); grid-template-areas: ". up ." "left down right"; gap: 3px; }
.gpad [data-d="up"] { grid-area: up; } .gpad [data-d="left"] { grid-area: left; } .gpad [data-d="down"] { grid-area: down; } .gpad [data-d="right"] { grid-area: right; }
.gpad .btn { min-width: 0; min-height: 36px; padding: 0; }
@media (hover: hover) and (pointer: fine) { .gpad { display: none; } }
.gtype { width: 100%; font: 16px "Lucida Console", "Courier New", monospace; }
@media (max-width: 640px) { .win .body.gamebody { flex-direction: column; align-items: stretch; } .gstage { width: 100%; } }
label.chk { display: flex; gap: 6px; align-items: center; margin-top: 10px; }

/* music: the MP3 player */
.win .body.mp3body { padding: 8px; overflow: auto; }
.mp3 { min-height: 100%; display: flex; flex-direction: column; gap: 8px; padding: 12px 12px 10px; border-radius: 16px;
  background: linear-gradient(160deg, #7f6bff, #b25cff 55%, #ff7ad9);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.55), inset 0 -3px 0 rgba(0,0,0,.25), 0 0 0 1px #000; }
.lcd { padding: 4px 7px 5px; border: 2px solid #2d2a55; border-radius: 6px; background: linear-gradient(#c8ebff, #8fcaf0);
  box-shadow: inset 0 2px 4px rgba(0,0,0,.3); color: #0d2c48; font: bold 12px/1.35 "Courier New", Courier, monospace; }
.lcdtop { display: flex; gap: 6px; align-items: flex-end; font-size: 10px; }
.lsrc { flex: 1; letter-spacing: 1px; }
.eq { display: inline-flex; gap: 1px; align-items: flex-end; height: 10px; }
.eq i { width: 3px; height: 2px; background: currentColor; }
.mp3.playing .eq i { animation: eq .7s ease-in-out infinite alternate; }
.mp3.playing .eq i:nth-child(2) { animation-delay: -.35s; } .mp3.playing .eq i:nth-child(3) { animation-delay: -.6s; }
.mp3.playing .eq i:nth-child(4) { animation-delay: -.15s; } .mp3.playing .eq i:nth-child(5) { animation-delay: -.5s; }
@keyframes eq { to { height: 10px; } }
.marq { overflow: hidden; white-space: nowrap; font-size: 13px; }
.marq span { display: inline-block; }
.marq.go span { padding-left: 100%; animation: marq 12s linear infinite; }
@keyframes marq { to { transform: translateX(-100%); } }
.lmsg { min-height: 14px; font-size: 10px; opacity: .85; }
.mp3.blocked .lmsg { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.mpscreen { border: 2px solid #2d2a55; border-radius: 4px; background: #111; overflow: hidden; }
.mpscreen iframe { display: block; width: 100%; border: 0; }
.mp-youtube iframe { height: 200px; } .mp-spotify iframe { height: 152px; } .mp-soundcloud iframe { height: 166px; }
.mpscreen.mp-audio { display: none; }
.mppad { position: relative; flex: none; width: 108px; height: 108px; margin: 0 auto; border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff, #d6dbe2 55%, #9aa3ae); box-shadow: 0 2px 0 rgba(0,0,0,.35), 0 0 0 1px #000, inset 0 -2px 3px rgba(0,0,0,.2); }
.mppad .pb { position: absolute; width: 30px; height: 30px; padding: 0; border: 0; background: none; color: #2b3440; font: bold 15px/1 var(--font); cursor: pointer; }
.pb.up { top: 2px; left: 39px; } .pb.dn { bottom: 2px; left: 39px; } .pb.lf { left: 3px; top: 39px; } .pb.rt { right: 3px; top: 39px; font-size: 13px; }
.mppad .pb.ctr { left: 32px; top: 32px; width: 44px; height: 44px; border-radius: 50%; font-size: 14px;
  background: radial-gradient(circle at 40% 35%, #fff, #b8c0ca); box-shadow: 0 1px 0 #000, inset 0 0 0 1px #7a828c; }
.mppad .pb:active:not(:disabled) { transform: translateY(1px); }
.mppad .pb:disabled { opacity: .3; cursor: default; }
.mppad .pb:focus-visible { outline: 1px dotted #000; }
.mp3.blocked .pb.ctr { animation: mppulse 1.1s ease-in-out infinite; }
@keyframes mppulse { 50% { box-shadow: 0 1px 0 #000, inset 0 0 0 1px #7a828c, 0 0 0 5px rgba(255,255,255,.8); } }
.mpown { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.mpadd { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid #000; border-radius: 6px; background: rgba(255,255,255,.9); }
.mpadd .btn { align-self: flex-start; }
.mpadd p { margin: 0; }
.mp3 label.chk { margin: 0; justify-content: center; color: #fff; text-shadow: 0 1px 0 #000; }
#tray .mpchip { max-width: 22vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 3px; border: 0; background: none; cursor: pointer; }
#tray .mpchip.on span { font-style: italic; }
#tray .mpchip.blocked { background: #ffe08a; outline: 1px solid #000; }
@media (prefers-reduced-motion: reduce) { .mp3 .eq i, .marq.go span, .mp3.blocked .lmsg, .mp3.blocked .pb.ctr { animation: none !important; } .marq.go span { padding-left: 0; } }

/* live games, tournaments and the Hall of Fame in the feed */
.livedot { display: inline-block; flex: none; padding: 0 4px; border-radius: 3px; background: #e00; color: #fff; font: bold 9px/14px var(--font); letter-spacing: .5px; animation: livepulse 1.6s ease-in-out infinite; }
.livedot.off { background: #777; animation: none; }
@keyframes livepulse { 50% { opacity: .55; } }
.fnow { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; padding: 6px 8px; background: #fff3f3; border: 1px solid #000; box-shadow: 2px 2px 0 rgba(0,0,0,.2); }
.flg { display: flex; gap: 6px; align-items: center; }
.flg .fl, .fame .fl { flex: 1; min-width: 0; }
.ftour .ftt { padding: 6px 8px; margin-top: 4px; background: #f3ecff; border: 1px solid #7b2fd6; }
.ftour.on .ftt { background: linear-gradient(#fff6d6, #ffe9a8); border-color: #b38600; }
.fscore { font: bold 12px "Lucida Console", "Courier New", monospace; }
.fame { margin-bottom: 8px; padding: 4px 6px; background: #fff; border: 1px solid #c0c0c0; }
.fame h3 { margin: 2px 0; font-size: 13px; }
.gwatch:not(:empty) { margin-bottom: 4px; padding: 3px 6px; background: #ffe0e0; border: 1px solid #000; font-weight: bold; }
.watchhead { display: flex; gap: 6px; align-items: center; font-size: 13px; }
.gamebody.watching .gside { display: flex; flex-direction: column; gap: 6px; }
.alive:not(:empty) { margin-bottom: 8px; }
.trophies li { align-items: flex-start; }
.trophies .av { font-size: 24px; }

/* ---------- phones: roomier, bigger touch targets ---------- */
@media (max-width: 640px) {
  /* desktop icons become one swipeable toolbar along the top, and the desktop starts underneath it,
     so icons never sit on top of notes and stickers */
  #icons { top: 0; left: 0; right: 0; bottom: auto; height: 76px; flex-direction: row; flex-wrap: nowrap; align-items: flex-start; align-content: normal;
    gap: 0; padding: 4px 4px 0; overflow-x: auto; overflow-y: hidden; pointer-events: auto; scroll-snap-type: x proximity; scrollbar-width: none;
    overscroll-behavior-x: contain; background: var(--face); box-shadow: inset 0 -1px var(--lo), 0 1px 0 var(--dk); }
  #icons::-webkit-scrollbar { display: none; }
  #icons .icon { flex: none; width: 68px; padding: 3px 1px; color: #000; text-shadow: none; scroll-snap-align: start; font-size: 11px; line-height: 1.15; }
  #icons .icon svg { width: 30px; height: 30px; margin-bottom: 3px; filter: none; }
  #icons .icon span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #wall, #rsels, #cursors { top: 76px; }

  /* taskbar: only what matters */
  #tray { gap: 6px; padding: 0 5px; }
  #tray .who, #tray .demo-tag { display: none; }
  #tray .where { max-width: 24vw; }
  #tray .mpchip { max-width: 30vw; }
  #tasks button { flex-basis: 96px; }

  /* windows: full width, never taller than the screen, bigger title bar buttons */
  .win:not(.max) { max-height: calc(100dvh - 44px); }
  .win.max { bottom: 32px; }
  .titlebar { padding: 4px 4px 4px 6px; }
  .titlebar .t { font-size: 13px; }
  .tbtn { width: 28px; height: 24px; font-size: 12px; }
  .btn { min-height: 32px; }
  .ftabs .btn, .btn.sm { min-height: 30px; padding: 3px 10px; font-size: 12px; }
  .ftabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .ftabs::-webkit-scrollbar { display: none; }
  .ftabs .btn { flex: none; }
  .fa, .flg { flex-wrap: wrap; }
  .flg .btn { margin-left: auto; }
  input.field, textarea.field, select.field { font-size: 16px; }   /* stops phones zooming in when you tap a box */

  #startmenu li button { min-height: 40px; font-size: 13px; }
  #balloon { left: 8px; right: 8px; max-width: none; }
  #modal { padding: 8px; }
  .dlg-btns .btn { flex: 1; }

  /* games: the board on top, scores underneath */
  .win .body.gamebody { padding: 4px; }
  .gside { padding: 6px; }
  .carts .cart .btn { min-width: 0; }
  .gpad { grid-template-columns: repeat(3, 64px); gap: 4px; }
  .gpad .btn { min-height: 48px; font-size: 16px; }
}

/* phones: the "Choose a Desktop" screen. Your row is compact, friends' desktops swipe sideways,
   and What's New sits right under them instead of far below */
@media (max-width: 640px) {
  #picker { padding: 8px !important; }
  .pickerwin { width: 100%; max-width: calc(100vw - 16px); min-width: 0; }
  .pickerwin .body { padding: 8px; }
  .me-row { flex-wrap: nowrap; gap: 8px; padding: 6px; margin-bottom: 8px; }
  .me-row > div:first-child { width: 78px !important; flex: none; }
  .me-row > div:last-child { min-width: 0 !important; }
  .me-row h1 { font-size: 16px; margin: 0 0 2px; }
  .me-row .tile .un, .me-row .tile .nm { font-size: 11px; }
  .pgrid > div, .feedcol { min-width: 0; }
  .pgrid .inline .field { min-width: 0; flex: 1; }
  .tiles { display: flex; overflow-x: auto; max-height: none; gap: 2px; padding: 6px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .tiles::-webkit-scrollbar { display: none; }
  .tiles .tile { flex: none; width: 92px; scroll-snap-align: start; }
  .tiles .muted { white-space: normal; }
  .tile .mini .scr { font-size: 22px; }
  .feedcol .inline { flex-wrap: wrap; }
  .ftabs { min-width: 0; max-width: 100%; }
  .feed { max-height: none; }
}
/* "Play" card inside a note (tournament notes, challenge links) */
.rp.gchip { background: linear-gradient(#fff6d6, #ffe9a8); }

.flg.mine { margin: 0 -4px; padding: 3px 4px; background: #ffe08a; border: 1px solid #b38600; }

/* tournament results podium (inside a note) */
.podium { margin: 2px 0 4px; }
.podium .ptt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; margin-bottom: 4px; }
.podium .ptt span { font-size: 11px; opacity: .75; }
.pstands { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; align-items: end; }
.pst { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.pst .pwho { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.pst .psc { font: bold 11px "Lucida Console", "Courier New", monospace; }
.pblock { width: 100%; display: grid; place-items: center; font-size: 18px; border: 1px solid #000; border-bottom: 0;
  background: linear-gradient(#fff, #d8d8e8); box-shadow: inset -1px 0 rgba(0,0,0,.15); }
.p1 .pblock { height: 44px; background: linear-gradient(#fff6c2, #ffd23f); }
.p2 .pblock { height: 32px; background: linear-gradient(#fff, #c9d1dc); }
.p3 .pblock { height: 24px; background: linear-gradient(#ffe6cc, #e2a36b); }
/* replay controls */
.rpbar { width: 100%; }
.rpctl { display: flex; flex-wrap: wrap; gap: 4px; }

/* ======== phones, round two ======== */
#mobbar, #swipehint { display: none; }
#winsheet[hidden] { display: none; }
@keyframes hintwiggle { 50% { transform: translateX(calc(-50% + 8px)); } }
@media (max-width: 640px) {
  :root { --tb: calc(58px + env(safe-area-inset-bottom)); }

  /* bigger text */
  body { font-size: 14px; }
  .small { font-size: 12px; }
  .note { font-size: 13px; }
  .note .nb { font-size: 15px; }
  .note .when { font-size: 11px; }
  .lb, .fi, .list { font-size: 14px; }

  /* the desktop keeps its shape: a wide picture you swipe across, laid out just like on a computer */
  #wall { bottom: var(--tb); overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; background-attachment: local !important; scrollbar-width: none; }
  #wall::-webkit-scrollbar { display: none; }
  #items, #notes { right: auto; width: var(--stageW, 100%); }
  #desk:not(.editing) .item { touch-action: pan-x; }
  #rsels, #cursors, #selbox { display: none !important; }
  #swipehint { display: block; position: absolute; left: 50%; top: 88px; transform: translateX(-50%); z-index: 1400;
    padding: 6px 14px; border-radius: 16px; background: rgba(0,0,0,.7); color: #fff; font-size: 13px; white-space: nowrap; pointer-events: none;
    animation: hintwiggle 1.6s ease-in-out infinite; }
  #swipehint[hidden] { display: none; }

  /* a bottom bar of big buttons instead of the thin taskbar */
  #taskbar { height: var(--tb); padding: 5px 4px calc(5px + env(safe-area-inset-bottom)); gap: 3px; align-items: stretch; }
  #start { height: auto; flex-direction: column; justify-content: center; gap: 2px; padding: 2px 8px; font-size: 11px; }
  #start svg { width: 22px; height: 22px; }
  #tasks, #tray { display: none; }
  #mobbar { display: flex; flex: 1; gap: 3px; min-width: 0; }
  .mbb { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 2px; border: 0; cursor: pointer;
    background: var(--face); box-shadow: inset -1px -1px var(--dk), inset 1px 1px var(--hi), inset -2px -2px var(--lo), inset 2px 2px #dfdfdf; }
  .mbb:active, .mbb.on { box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--dk), inset -2px -2px #dfdfdf, inset 2px 2px var(--lo); }
  .mbi { font-size: 20px; line-height: 1; }
  .mbl { font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #startmenu { left: 0; right: 0; width: auto; bottom: var(--tb); max-height: calc(100dvh - var(--tb) - 8px); overflow: auto; }
  #balloon { bottom: calc(var(--tb) + 10px); }
  #balloon::after { display: none; }
  #winsheet { position: absolute; left: 0; right: 0; bottom: var(--tb); z-index: 9001; padding: 8px; max-height: 60dvh; overflow: auto; }
  .wsh { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
  .wsh .spacer { flex: 1; }
  .wsi { display: flex; gap: 4px; margin-bottom: 4px; }
  .wsgo { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; text-align: left; font-size: 14px; cursor: pointer;
    background: #fff; box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--lo), inset -2px -2px #dfdfdf, inset 2px 2px var(--dk); }
  .wsgo svg { width: 20px; height: 20px; flex: none; }
  .wsgo span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* every window fills the screen, with big Hide and Close buttons */
  .win, .win:not(.max), .win.max { left: 0 !important; top: 0 !important; right: 0; width: 100% !important; height: calc(100dvh - var(--tb)) !important; max-height: none; padding: 2px; }
  .win[data-win="decor"] { top: auto !important; bottom: var(--tb); height: 50dvh !important; }   /* decorating: you still see the desktop */
  .titlebar { min-height: 42px; padding: 4px 4px 4px 10px; }
  .titlebar .t { font-size: 15px; }
  .titlebar .t svg { width: 20px; height: 20px; }
  .tbtn { width: auto; min-width: 44px; height: 34px; padding: 0 10px; font: bold 13px var(--font); }
  .tbtn[data-a="max"] { display: none; }
  .tbtn[data-a="min"] { font-size: 0; }
  .tbtn[data-a="min"]::after { content: "▾ Hide"; font-size: 13px; }
  .tbtn[data-a="close"]::after { content: " Close"; }
  .statusbar div + div { display: none; }
}
@media (max-width: 640px) {
  #editbar { top: 82px; left: 6px; right: 6px; transform: none; max-width: none; font-size: 12px; }
  #editbar span { flex: 1; min-width: 0; }
}

/* "be friends?" pop-up on a non-friend's desktop: front and center, with a warm glow behind it */
#friendpop { position: absolute; left: 0; right: 0; top: 0; bottom: 32px; z-index: 9003; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(circle at 50% 46%, rgba(255, 224, 120, .45), rgba(255, 200, 80, .12) 38%, rgba(0, 0, 0, .38) 78%); }
#friendpop[hidden] { display: none; }
#friendpop:not([hidden]) { animation: fp-fade .3s ease-out; }
#friendpop .dlg { width: min(420px, 100%); max-height: 100%; overflow: auto; box-shadow: 0 0 0 3px #ffe08a, 0 12px 40px rgba(0,0,0,.45); animation: fp-pop .45s cubic-bezier(.2, 1.5, .4, 1); }
#friendpop .fpb { padding: 18px 18px 16px; text-align: center; background: linear-gradient(180deg, #fffdf2, #ffeaa0); border: 1px solid var(--lo); }
#friendpop .fpav { position: relative; display: inline-grid; place-items: center; width: 92px; height: 92px; font-size: 56px; line-height: 1;
  background: #fff; border: 3px solid #b8860b; border-radius: 50%; box-shadow: 0 4px 0 #b8860b; animation: fp-bob 2.4s ease-in-out .5s infinite; }
#friendpop .fplock { position: absolute; right: -8px; bottom: -6px; font-size: 26px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.25)); animation: fp-wiggle 1.6s ease-in-out .9s 3; }
#friendpop h2 { margin: 10px 0 0; font-size: 20px; }
#friendpop .fpu { color: #555; }
#friendpop p { margin: 10px 0 0; }
#friendpop .fpwhy { font-size: 14px; font-weight: bold; }
#friendpop .fpsub { color: #444; }
#friendpop .fptease { margin-top: 10px; padding: 8px; background: rgba(255,255,255,.65); border: 1px dashed #b8860b; }
#friendpop .fpth { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #7a5a00; margin-bottom: 6px; }
#friendpop .fpchips { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
#friendpop .fpchip { padding: 3px 8px; background: #fff; border: 1px solid #c9a227; border-radius: 12px; font-size: 12px; white-space: nowrap; filter: saturate(.9); }
#friendpop .fpbtns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
#friendpop .fpbtns .btn { min-width: 0; padding: 5px 14px; }
#friendpop .fpgo { font-size: 15px; font-weight: bold; padding: 8px 18px !important; animation: fp-glow 1.8s ease-in-out 1s infinite; }
@keyframes fp-fade { from { opacity: 0; } }
@keyframes fp-pop { from { transform: scale(.5) translateY(30px); opacity: 0; } }
@keyframes fp-bob { 50% { transform: translateY(-5px); } }
@keyframes fp-wiggle { 20%, 60% { transform: rotate(-16deg); } 40%, 80% { transform: rotate(16deg); } }
@keyframes fp-glow { 50% { box-shadow: inset -1px -1px var(--dk), inset 1px 1px var(--hi), 0 0 0 4px rgba(255, 200, 60, .75); } }
/* after "Just looking": a bar across the top so the desktop doesn't look empty */
#lockbar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 9001; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center;
  max-width: calc(100% - 24px); padding: 6px 8px 6px 14px; background: #fff3c4; border: 2px solid #b8860b; box-shadow: 0 4px 0 rgba(0,0,0,.25); font-weight: bold; }
#lockbar[hidden] { display: none; }
#lockbar:not([hidden]) { animation: fp-drop .35s ease-out; }
#lockbar .btn { min-width: 0; padding: 4px 12px; }
@keyframes fp-drop { from { transform: translate(-50%, -24px); opacity: 0; } }
@media (max-width: 640px) {
  #friendpop { bottom: var(--tb); padding: 10px; }
  #lockbar { top: auto; bottom: calc(var(--tb) + 8px); left: 8px; right: 8px; transform: none; max-width: none; padding: 6px 8px; font-size: 12px; }
  @keyframes fp-drop { from { transform: translateY(16px); opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) { #friendpop:not([hidden]), #friendpop .dlg, #friendpop .fpav, #friendpop .fplock, #friendpop .fpgo, #lockbar:not([hidden]) { animation: none; } }

/* desktop picker: who you're friends with, at a glance */
.tw { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.tw .tile { width: 100%; }
.tw .mini { position: relative; }
.tcorner { position: absolute; right: -6px; top: -8px; width: 24px; height: 24px; display: grid; place-items: center; font-size: 13px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.tbadge { display: inline-block; margin-top: 4px; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: bold; white-space: nowrap; }
.st-friend .tcorner, .st-friend .tbadge { background: #2e9e44; color: #fff; }
.st-friend .mini { outline: 2px solid #2e9e44; }
.st-public .tcorner, .st-public .tbadge { background: #1e6fd9; color: #fff; }
.st-public .mini { outline: 2px solid #1e6fd9; }
.st-locked .tcorner, .st-asked .tcorner { background: #fff3c4; }
.st-locked .tbadge, .st-asked .tbadge { background: #eee; color: #555; border: 1px solid #bbb; }
.st-locked .scr, .st-asked .scr { filter: saturate(.55) brightness(.92); }
.st-asking .tcorner, .st-asking .tbadge { background: #ffe08a; color: #000; }
.st-asking .mini { outline: 2px solid #e0a800; }
.tact { min-width: 0; margin-top: 4px; padding: 2px 10px; font-size: 11px; }
.tlegend { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 10px; color: #333; }
.tlegend[hidden] { display: none; }
.tlg-f { color: #1f7a33; font-weight: bold; } .tlg-p { color: #1e5bb0; font-weight: bold; }
@media (max-width: 640px) { .tiles .tw { flex: none; width: 92px; scroll-snap-align: start; } .tiles .tw .tile { width: 100%; } .tbadge { font-size: 10px; padding: 1px 5px; } }

/* Decorate → Profile: who can see your stuff */
fieldset.privacy { margin: 12px 0 0; padding: 6px 10px 10px; border: 1px solid var(--lo); }
fieldset.privacy legend { padding: 0 4px; font-weight: bold; }
fieldset.privacy label.chk { align-items: flex-start; margin-top: 8px; }

/* Decorate → Profile: delete your account */
fieldset.danger { margin: 14px 0 0; padding: 6px 10px 10px; border: 1px solid #c00; }
fieldset.danger legend { padding: 0 4px; font-weight: bold; color: #a00; }
