/* nani-os: one stylesheet for the room, the boot screen and the desktop. */

@font-face { font-family: 'Silkscreen'; src: url('../fonts/silkscreen.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'VT323'; src: url('../fonts/vt323.woff2') format('woff2'); font-display: swap; }

:root {
  --ink: #1a1030;
  --night: #0d0b18;
  --paper: #efe9f7;
  --paper-2: #e2dbee;
  --mute: #9b93b0;
  --text: #ece6ff;
  --accent: #7a4fc4;
  --accent-2: #6a40b3;
  --accent-hi: #9b7be0;
  --accent-dark: #2b1f4a;
  --pixel: 'Silkscreen', ui-monospace, monospace;
  --mono: 'VT323', ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--night); color: var(--text); overflow: hidden; }
body { font: 20px/1.2 var(--mono); font-variant-ligatures: none; -webkit-font-smoothing: none; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; font-variant-ligatures: none; }
button { cursor: pointer; }
canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
:focus-visible { outline: 3px dashed var(--accent-hi); outline-offset: 2px; }
::selection { background: var(--accent); color: #fff; }

/* ---------- the room ---------- */
.room { position: fixed; inset: 0; display: grid; place-items: center; outline: none; }
#room-canvas { display: block; transition: transform 0.95s cubic-bezier(0.7, 0, 0.3, 1), filter 0.95s; will-change: transform; }
#room-canvas.zoomed { transform: scale(11); filter: brightness(1.4); }
#room-canvas.no-anim { transition: none; }
.room-brand, .room-clock, .room-help, .room-sound, .boot-btn { transition: opacity 0.3s; z-index: 3; }
.room.zooming .room-brand, .room.zooming .room-clock, .room.zooming .room-help, .room.zooming .room-sound { opacity: 0; }
.room-brand { position: fixed; left: 28px; bottom: 22px; margin: 0; font: 400 26px/1 var(--pixel); letter-spacing: 1px; color: var(--text); text-shadow: 3px 3px 0 #000; }
.room-brand small { display: block; margin-top: 6px; font: 22px/1 var(--mono); letter-spacing: 0; color: #a59fd0; }
.room-clock { position: fixed; right: 28px; top: 20px; margin: 0; text-align: right; font: 400 13px/1.8 var(--pixel); color: #a59fd0; }
.room-clock span:first-child { color: var(--text); }
.room-help { position: fixed; right: 28px; bottom: 22px; margin: 0; font-size: 20px; color: #7d77a8; }
.room-people { z-index: 3; position: fixed; left: 50%; top: 20px; transform: translateX(-50%); margin: 0; padding: 4px 12px; font: 400 11px var(--pixel); color: #ffd166; background: rgba(13, 11, 24, 0.8); border: 3px solid #3a3460; white-space: nowrap; }
.room.zooming .room-people { opacity: 0; }
.say { position: fixed; left: 50%; top: 58px; transform: translateX(-50%); display: grid; justify-items: center; gap: 6px; z-index: 6; width: min(560px, calc(100vw - 32px)); }
.say-btn { padding: 4px 12px; font: 400 11px var(--pixel); color: #ece6ff; background: rgba(13, 11, 24, 0.85); border: 3px solid #7a4fc4; }
.say-btn:hover, .say-btn[aria-expanded='true'] { background: #7a4fc4; }
.say-panel, .chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.say-panel { padding: 8px; background: rgba(13, 11, 24, 0.92); border: 3px solid #4a3a78; }
.chip { padding: 2px 10px; font-size: 19px; color: var(--ink); background: #fffbe8; border: 2px solid var(--ink); box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4); }
.chip:hover { background: #ffd166; }
.room.zooming .say { opacity: 0; }
.chat-head { margin: 12px 0 6px; font: 400 11px var(--pixel); letter-spacing: 1px; color: var(--accent-2); }
.chat-log { list-style: none; margin: 0; padding: 6px 8px; display: grid; gap: 2px; background: #fff; border: 3px solid var(--ink); max-height: 160px; overflow: auto; font-size: 19px; }
.chat-log li.you b { color: var(--accent); }
.visitors .chips { justify-content: flex-start; }
.room-player { z-index: 3; position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; background: rgba(13, 11, 24, 0.88); border: 3px solid #4a3a78; font-size: 19px; color: #c9c2ee; max-width: calc(100vw - 32px); }
.room-player #room-track { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 280px; }
.room-player-note { color: #7ee0c3; }
.room-player button { width: 30px; height: 28px; padding: 0; background: #1d1730; border: 2px solid #4a3a78; color: #ece6ff; font-size: 14px; }
.room-player button:hover { border-color: #9b7be0; }
.room-player button.on { color: #7dff8a; }
.room.zooming .room-player { opacity: 0; }
.room-toast { position: fixed; left: 50%; bottom: 72px; transform: translateX(-50%); margin: 0; padding: 6px 12px; font: 400 11px var(--pixel); color: var(--ink); background: #ffd166; border: 3px solid var(--ink); box-shadow: 4px 4px 0 #000; animation: pop 0.25s steps(3); z-index: 7; }
.room-sound { position: fixed; left: 28px; top: 20px; background: none; border: 3px solid #3a3460; padding: 4px 10px; font: 400 11px var(--pixel); color: #a59fd0; }
.room-sound:hover { border-color: #7d77a8; color: var(--text); }
.boot-btn {
  position: fixed; transform: translate(-50%, calc(-100% - 70px)); white-space: nowrap;
  font: 400 12px var(--pixel); letter-spacing: 1px; color: #5ef2d6; background: var(--night);
  border: 4px solid #5ef2d6; padding: 8px 12px; box-shadow: 4px 4px 0 #000; animation: bob 1.6s steps(2) infinite;
}
.boot-btn::after { content: ''; position: absolute; left: 50%; top: 100%; width: 4px; height: 58px; background: #5ef2d6; transform: translateX(-50%); }
.boot-btn:hover { background: #5ef2d6; color: var(--night); }
@keyframes bob { 50% { margin-top: -4px; } }
.room-tip { position: fixed; z-index: 5; pointer-events: none; font: 400 11px var(--pixel); color: var(--night); background: #ffd166; padding: 4px 8px; box-shadow: 3px 3px 0 #000; }
.quip { position: fixed; z-index: 6; margin: 0; max-width: 260px; font: 21px/1.1 var(--mono); color: var(--ink); background: #fffbe8; border: 3px solid var(--ink); padding: 4px 10px; box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5); pointer-events: none; }
.quip.pop { animation: pop 0.25s steps(3); }
@keyframes pop { from { transform: translateY(6px) scale(0.9); } }

/* ---------- boot ---------- */
.boot { position: fixed; inset: 0; z-index: 50; background: #05040c; color: #c9c2ee; padding: 6vh 6vw; font: 24px/1.25 var(--mono); }
.boot.out { animation: flash 0.25s steps(2) forwards; }
@keyframes flash { 50% { background: #fff; } to { opacity: 0; } }
.boot .bright { color: #fff; }
.boot .dim, .boot-skip { color: #6a63a0; }
.boot-skip { position: fixed; right: 24px; bottom: 16px; margin: 0; font-size: 20px; }
.splash { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; }
.splash-logo { font: 400 clamp(36px, 8vw, 72px)/1 var(--pixel); color: #fff; text-shadow: 4px 4px 0 var(--accent), 8px 8px 0 #000; }
.splash-sub { color: #a59fd0; }
.splash .bar { width: min(320px, 70vw); height: 20px; border: 3px solid #c9c2ee; padding: 3px; }
.splash .bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, #5ef2d6 0 10px, transparent 10px 14px); }
.safe { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; text-align: center; color: #ffb45c; font-size: 28px; padding: 20px; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; padding: 20px; text-align: center; background: var(--night); color: var(--text); font: 24px var(--mono); }

/* ---------- desktop ---------- */
.os { position: fixed; inset: 0; z-index: 40; overflow: hidden; }
.os > .wallpaper { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.os.party > .wallpaper { animation: party 0.8s steps(6) infinite; }
@keyframes party { to { filter: hue-rotate(360deg) saturate(1.6); } }
.desk-icons {
  position: absolute; left: 0; top: 0; bottom: 48px; margin: 0; padding: 14px 10px; list-style: none;
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 96px); grid-auto-columns: 100px; gap: 4px;
}
.desk-icon { width: 96px; padding: 6px 2px; background: none; border: 2px solid transparent; text-align: center; color: #fff; text-shadow: 2px 2px 0 var(--ink); font-size: 20px; line-height: 1; }
.desk-icon canvas { display: block; width: 48px; height: 48px; margin: 0 auto 6px; }
.desk-icon span { padding: 0 4px; }
.desk-icon.sel span, .desk-icon:focus-visible span { background: var(--accent); }
.desk-icon.sel { border-style: dotted; border-color: rgba(255, 255, 255, 0.6); }
.layer { position: absolute; inset: 0 0 48px 0; pointer-events: none; }
.layer > * { pointer-events: auto; }
.crt { position: absolute; inset: 0; z-index: 30; pointer-events: none; display: none; }
.os.crt-on .crt {
  display: block;
  background: repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.13) 0 1px, transparent 1px 3px), radial-gradient(ellipse at center, transparent 62%, rgba(0, 0, 0, 0.42));
}

/* taskbar */
.taskbar { position: absolute; left: 0; right: 0; bottom: 0; height: 48px; z-index: 20; display: flex; align-items: center; gap: 6px; padding: 0 6px; background: var(--ink); border-top: 4px solid var(--accent); }
.start { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; font: 400 14px var(--pixel); letter-spacing: 1px; color: var(--ink); background: #ffd166; border: 3px solid #fff3c4; box-shadow: inset -3px -3px 0 #d9a43a; }
.start[aria-expanded='true'] { box-shadow: inset 3px 3px 0 #d9a43a; }
.start-mark { width: 12px; height: 12px; background: var(--accent); box-shadow: 4px 4px 0 var(--ink); }
.tabs { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tab { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; max-width: 190px; height: 34px; padding: 0 10px; font-size: 19px; color: var(--text); background: var(--accent-dark); border: 3px solid var(--accent-2); }
.tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab.on { background: var(--accent-2); border-color: var(--accent-hi); }
.tab-icon { width: 16px; height: 16px; flex: none; }
.tray { display: flex; align-items: center; gap: 6px; }
.tray-btn { height: 34px; padding: 0 10px; background: none; border: 3px solid var(--accent-dark); color: var(--text); font-size: 19px; }
.tray-radio { color: #7ee0c3; max-width: 140px; overflow: hidden; white-space: nowrap; }
.clock { padding: 0 10px; font-size: 21px; color: var(--text); }
.tray-people { padding: 0 8px; font-size: 19px; color: #7dff8a; white-space: nowrap; }

/* menus */
.menu { position: absolute; z-index: 25; min-width: 220px; padding: 4px; background: var(--paper); border: 3px solid var(--ink); box-shadow: 6px 6px 0 rgba(10, 6, 24, 0.55); color: var(--ink); }
.start-menu { left: 6px; bottom: 54px; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 5px 10px; background: none; border: 0; text-align: left; color: var(--ink); font-size: 21px; }
.menu button:hover, .menu button:focus-visible { background: var(--accent); color: #fff; outline: none; }
.menu button canvas { width: 24px; height: 24px; }
.menu hr { border: 0; border-top: 3px dotted var(--mute); margin: 4px 6px; }

/* notifications */
.toasts { position: absolute; right: 12px; bottom: 60px; z-index: 26; display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.toast { max-width: min(360px, 80vw); padding: 8px 12px; background: var(--ink); color: var(--text); border: 3px solid var(--accent-hi); box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5); font-size: 20px; animation: slide 0.25s steps(3); }
.toast.out { opacity: 0; transition: opacity 0.4s; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.saver { position: absolute; inset: 0; z-index: 45; width: 100%; height: 100%; background: #05040c; cursor: none; }

/* windows */
.win { position: absolute; display: flex; flex-direction: column; min-width: 200px; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); box-shadow: 8px 8px 0 rgba(10, 6, 24, 0.55); outline: none; }
.win.opening { animation: open 0.18s steps(3); }
@keyframes open { from { transform: scale(0.85); opacity: 0.4; } }
.win.maxed { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; box-shadow: none; }
.win-bar { display: flex; align-items: center; gap: 6px; height: 32px; flex: none; padding: 0 4px 0 8px; background: repeating-linear-gradient(0deg, #9b93b0 0 4px, #8d85a3 4px 8px); border-bottom: 3px solid var(--ink); cursor: grab; touch-action: none; user-select: none; }
.win.focused .win-bar { background: repeating-linear-gradient(0deg, var(--accent) 0 4px, var(--accent-2) 4px 8px); }
.win-bar:active { cursor: grabbing; }
.win-icon { width: 16px; height: 16px; flex: none; }
.win-title { flex: 1; margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 400 12px var(--pixel); letter-spacing: 1px; color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.win-btn { width: 22px; height: 22px; padding: 0; display: grid; place-items: center; font: 400 11px/1 var(--pixel); color: var(--ink); background: var(--paper); border: 3px solid var(--ink); }
.win-btn:hover { background: #fff; }
.win-btn.close:hover { background: #e05a47; color: #fff; }
.win-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.win-grip { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; touch-action: none; background: linear-gradient(135deg, transparent 50%, var(--mute) 50% 62%, transparent 62% 74%, var(--mute) 74% 86%, transparent 86%); }
.win.maxed .win-grip { display: none; }

/* shared bits */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 2px 12px; font-size: 20px; color: var(--ink); background: var(--paper-2); border: 3px solid var(--ink); box-shadow: inset -3px -3px 0 #b9b3c9, inset 3px 3px 0 #fff; text-decoration: none; }
.btn:hover { background: #fff; }
.btn:active, .btn[aria-pressed='true'], .btn[aria-checked='true'] { box-shadow: inset 3px 3px 0 #b9b3c9; background: #d4cbe6; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.small { min-height: 28px; padding: 0 8px; font-size: 18px; }
.btn.danger { background: #f6c6bf; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px; border-bottom: 3px solid var(--ink); background: var(--paper-2); }
.status { margin-top: auto; padding: 3px 10px; border-top: 3px solid var(--ink); background: var(--paper-2); color: #4a3f66; font-size: 18px; }
.dim { color: #6e6884; }
.lcd { display: inline-block; min-width: 54px; padding: 0 6px; font: 26px/1.1 var(--mono); color: #ff4f4f; background: #1a0808; border: 3px solid var(--ink); text-align: center; }

/* terminal */
.term { flex: 1; overflow: auto; padding: 10px 14px; background: #120d24; color: var(--text); font: 21px/1.15 var(--mono); cursor: text; }
.tl { white-space: pre-wrap; word-break: break-word; min-height: 1.15em; }
.tl.echo { color: #fff; }
.tl.err { color: #ff8f7a; }
.tl.dim { color: #8a83b3; }
.tl.dir { color: #79bbeb; }
.tl.app { color: #7ee0c3; }
.term-line { display: flex; gap: 0; }
.term-prompt { color: #7ee0c3; white-space: pre; }
.term-in { flex: 1; min-width: 0; padding: 0; background: none; border: 0; outline: none; color: #fff; font: inherit; caret-color: #ffd166; }

/* files */
.files { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.files-path { padding: 0 8px; font-size: 20px; color: #4a3f66; }
.files-grid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); align-content: start; gap: 6px; padding: 10px; background: #fff; }
.file { padding: 6px 2px; background: none; border: 2px solid transparent; text-align: center; font-size: 19px; line-height: 1.05; color: var(--ink); word-break: break-word; }
.file canvas { display: block; width: 40px; height: 40px; margin: 0 auto 4px; }
.file.sel { border: 2px dotted var(--accent); background: #ece6fa; }

/* notes */
.notes { flex: 1; overflow: auto; padding: 14px 18px; background: repeating-linear-gradient(180deg, #fffbe8 0 24px, #e8dfc2 24px 25px); outline: none; }
.notes pre { margin: 0; font: 21px/25px var(--mono); white-space: pre-wrap; color: var(--ink); }

/* paint */
.paint { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.paint-main { flex: 1; display: flex; gap: 12px; padding: 12px; align-items: flex-start; justify-content: center; flex-wrap: wrap; overflow: auto; background: #cfc8dd; }
.paint-frame { border: 3px solid var(--ink); box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3); line-height: 0; }
.paint-canvas { width: min(320px, 70vw); height: min(320px, 70vw); cursor: crosshair; touch-action: none; }
.palette { display: grid; grid-template-columns: repeat(4, 30px); gap: 4px; }
.swatch { width: 30px; height: 30px; padding: 0; border: 3px solid var(--ink); }
.swatch[aria-pressed='true'] { outline: 3px solid #fff; outline-offset: -7px; box-shadow: 0 0 0 3px var(--accent); }

/* mines */
.mines { display: flex; flex-direction: column; flex: 1; }
.mines-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; }
.face { min-width: 56px; font: 400 14px var(--pixel); }
.mines-grid { display: grid; gap: 0; margin: 0 10px 10px; border: 3px solid var(--ink); align-self: center; }
.cell { width: 26px; height: 26px; padding: 0; border: 0; background: #e2dbee 0 0 / 100% 100% no-repeat; image-rendering: pixelated; }
.cell:not(.open):hover { filter: brightness(1.06); }

/* snake */
.snake { display: flex; flex-direction: column; flex: 1; }
.snake-frame { display: grid; place-items: center; padding: 10px; background: #0b140e; flex: 1; }
.snake-canvas { width: min(320px, 80vw); height: min(240px, 60vw); border: 3px solid #5bba6f; outline: none; touch-action: none; }
.snake-canvas:focus-visible { border-color: #b8ff7a; }
.dpad { display: none; grid-template-areas: '. up .' 'left . right' '. down .'; gap: 4px; justify-content: center; padding: 8px; background: #0b140e; }
.dpad .up { grid-area: up; } .dpad .down { grid-area: down; } .dpad .left { grid-area: left; } .dpad .right { grid-area: right; }
@media (pointer: coarse) { .dpad { display: grid; } }

/* radio */
.radio { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: #d4cbe6; flex: 1; }
.boombox-frame { display: grid; place-items: center; padding: 8px; background: #1d1730; border: 3px solid var(--ink); }
.boombox { width: 100%; max-width: 440px; aspect-ratio: 220 / 120; }
.radio-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.preset b { font-weight: 400; color: #e05a47; }
.power.on { background: #b8ff7a; }
.radio-now { margin: 0 0 0 6px; flex: 1; min-width: 160px; font-size: 20px; }
.sliders label { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 160px; font-size: 19px; }
.radio-credit { margin: 0; font-size: 17px; color: #4a3f66; }
input[type='range'] { flex: 1; accent-color: var(--accent); }

/* settings */
.settings { padding: 10px 16px 16px; overflow: auto; }
.settings h3 { margin: 12px 0 6px; font: 400 12px var(--pixel); letter-spacing: 1px; color: var(--accent-2); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { display: grid; justify-items: center; gap: 4px; padding: 6px; background: var(--paper-2); border: 3px solid var(--ink); font-size: 18px; color: var(--ink); }
.choice[aria-checked='true'] { background: #fff; box-shadow: 0 0 0 3px var(--accent); }
.thumb { width: 96px; height: 54px; border: 2px solid var(--ink); }
.dot { display: block; width: 28px; height: 28px; border: 3px solid var(--ink); }
.toggle { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; cursor: pointer; }
.toggle input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); }
.toggle span { display: grid; }
.toggle b { font-weight: 400; }
.toggle small { font-size: 17px; color: #6e6884; }

/* about */
.about { padding: 14px 18px; display: grid; gap: 10px; align-content: start; }
.about-head { padding: 8px; background: var(--ink); border: 3px solid var(--ink); }
.about-logo { width: 240px; height: 80px; display: block; }
.about p { margin: 0; }
.specs { margin: 0; display: grid; gap: 2px; }
.spec { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
.spec dt { color: var(--accent-2); }
.spec dd { margin: 0; }

/* phones */
@media (max-width: 720px), (max-height: 480px) {
  .room-brand { font-size: 18px; left: 16px; bottom: 16px; }
  .room-brand small { font-size: 18px; }
  .room-help { display: none; }
  .room-clock { right: 16px; top: 14px; font-size: 10px; }
  .room-sound { left: 16px; top: 14px; }
  .room-people { top: auto; bottom: 64px; font-size: 9px; }
  .say { top: 52px; }
  .chip { font-size: 17px; }
  .room-player { bottom: 96px; }
  .room-player #room-track { max-width: 150px; }
  .boot-btn { font-size: 10px; transform: translate(-50%, calc(-100% - 46px)); }
  .boot-btn::after { height: 34px; }
  .desk-icons { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, 84px); grid-template-rows: none; grid-auto-rows: 88px; right: 0; justify-content: center; }
  .desk-icon { width: 84px; font-size: 18px; }
  .desk-icon canvas { width: 40px; height: 40px; }
  .win { border-width: 0; }
  .start-menu { left: 0; right: 0; bottom: 48px; }
  .tab { max-width: 120px; }
  .clock { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- v2: games, sticky, trophies, visitors, widget ---------- */
.menu-head { margin: 4px 10px 2px; font: 400 10px var(--pixel); letter-spacing: 1px; color: var(--accent-2); }
.start-menu { max-height: calc(100% - 64px); overflow: auto; }
.menu .menu-folder span { flex: 1; }
.menu .menu-folder small { font: 400 10px var(--pixel); color: var(--mute); }
.menu .menu-folder::after { content: '+'; font: 400 12px var(--pixel); }
.menu .menu-folder[aria-expanded='true'] { background: var(--ink); color: #fff; }
.menu .menu-folder[aria-expanded='true']::after { content: '-'; }
.menu .menu-folder:hover small, .menu .menu-folder[aria-expanded='true'] small { color: #fff; }
.menu-folder-items { margin: 2px 0 4px 14px; border-left: 3px dotted var(--mute); }
.menu-folder-items button { font-size: 19px; }
.widget { position: absolute; right: 18px; top: 16px; display: grid; justify-items: end; gap: 2px; color: #fff; text-shadow: 3px 3px 0 var(--ink); pointer-events: none; }
.widget b { font: 400 34px/1 var(--pixel); letter-spacing: 2px; }
.widget span { font-size: 20px; }
.widget-now { color: #7ee0c3; }

.game2048 { display: flex; flex-direction: column; flex: 1; }
.g2048-frame { flex: 1; display: grid; place-items: center; padding: 12px; background: #2b1f4a; }
.g2048 { display: grid; grid-template-columns: repeat(4, 72px); grid-template-rows: repeat(4, 72px); gap: 6px; padding: 6px; background: #1a1030; border: 3px solid var(--ink); outline: none; touch-action: none; }
.g2048:focus-visible { box-shadow: 0 0 0 3px var(--accent-hi); }
.tile { background: #3a2d5e 0 0 / 100% 100% no-repeat; image-rendering: pixelated; }
.tile.new { animation: open 0.15s steps(2); }

.blocks { display: flex; flex-direction: column; flex: 1; background: #1a1030; }
.blocks-main { display: flex; gap: 12px; padding: 10px; justify-content: center; flex: 1; }
.blocks-frame { align-self: flex-start; border: 3px solid #9b7be0; line-height: 0; }
.blocks-canvas { width: 160px; height: 320px; outline: none; touch-action: none; }
.blocks-side { display: flex; flex-direction: column; gap: 4px; color: #ece6ff; min-width: 110px; }
.blocks-side small { font: 400 10px var(--pixel); color: #9b93b0; margin-top: 6px; }
.blocks-side p { margin: 0; }
.blocks-next { width: 64px; height: 64px; background: #0f0c20; border: 3px solid #4a3a78; }
.touchpad { display: none; gap: 6px; justify-content: center; padding: 0 10px 10px; }
.touchpad .btn { min-width: 48px; }
@media (pointer: coarse) { .touchpad { display: flex; } }

.arcade { display: flex; flex-direction: column; flex: 1; }
.arcade-frame { flex: 1; display: grid; place-items: center; padding: 10px; background: #0b0918; }
.arcade-canvas { width: min(320px, 82vw); height: min(240px, 61.5vw); border: 3px solid #9b7be0; outline: none; touch-action: none; }
.arcade-canvas:focus-visible { border-color: #ffd166; }

.memory { display: flex; flex-direction: column; flex: 1; }
.memory-grid { flex: 1; display: grid; grid-template-columns: repeat(4, 72px); grid-auto-rows: 72px; gap: 8px; justify-content: center; align-content: center; padding: 12px; background: #2b1f4a; }
.card { padding: 0; border: 0; background: #7a4fc4 0 0 / 100% 100% no-repeat; image-rendering: pixelated; }
.card:hover:not(.up) { filter: brightness(1.12); }
.card canvas { width: 45px; height: 60px; visibility: hidden; }
.card.up canvas { visibility: visible; }

.sticky { display: flex; flex-direction: column; flex: 1; }
.sticky.yellow { background: #ffe79a; } .sticky.pink { background: #ffc9dc; } .sticky.mint { background: #c9f7e8; } .sticky.sky { background: #cfe8ff; }
.sticky-text { flex: 1; resize: none; border: 0; outline: none; padding: 12px 14px; background: transparent; color: var(--ink); font: 22px/1.15 var(--mono); }
.sticky-bar { display: flex; gap: 6px; align-items: center; padding: 6px 10px; border-top: 2px dashed rgba(26, 16, 48, 0.3); }
.sticky-bar .dim { margin-left: auto; }
.sticky-dot { width: 22px; height: 22px; padding: 0; border: 3px solid var(--ink); }
.sticky-dot.yellow { background: #ffd166; } .sticky-dot.pink { background: #ff8fab; } .sticky-dot.mint { background: #7ee0c3; } .sticky-dot.sky { background: #79bbeb; }
.sticky-dot[aria-pressed='true'] { outline: 3px solid #fff; outline-offset: -7px; }

.trophies, .visitors { padding: 10px 14px; overflow: auto; }
.trophy-count { margin: 0 0 8px; font: 400 12px var(--pixel); color: var(--accent-2); }
.trophy-list, .visitor-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.trophy-list li { display: flex; gap: 10px; align-items: center; padding: 4px 8px; background: #fff; border: 3px solid var(--ink); }
.trophy-list li canvas { width: 32px; height: 32px; flex: none; }
.trophy-list li div { display: grid; }
.trophy-list li small { color: #6e6884; font-size: 17px; }
.trophy-list li.locked canvas { filter: grayscale(1) brightness(0.6); opacity: 0.6; }
.trophy-list li.locked b { color: #6e6884; }
.visitor-list li { display: flex; gap: 10px; align-items: center; padding: 4px 8px; background: #fff; border: 3px solid var(--ink); }
.visitor-list li canvas { width: 27px; height: 36px; }
.visitor-list li.you { border-color: var(--accent); background: #f3edff; }
.small-note { font-size: 17px; margin: 10px 0 0; }

@media (max-width: 720px), (max-height: 480px) {
  .widget { display: none; }
  .g2048 { grid-template-columns: repeat(4, 48px); grid-template-rows: repeat(4, 48px); }
  .memory-grid { grid-template-columns: repeat(4, 54px); grid-auto-rows: 54px; }
}

/* ---------- nanoweb: pixel-art sites, one colour theme each ---------- */
.web { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.web-bar { display: flex; gap: 4px; align-items: center; padding: 6px; background: var(--paper-2); border-bottom: 3px solid var(--ink); }
.web-addr { flex: 1; min-width: 0; height: 30px; padding: 0 8px; font: 20px var(--mono); color: var(--ink); background: #fff; border: 3px solid var(--ink); }
.web-marks { display: flex; gap: 6px; padding: 5px 6px; overflow-x: auto; background: #d4cbe6; border-bottom: 3px solid var(--ink); scrollbar-width: none; }
.web-mark { flex: none; padding: 1px 8px; font-size: 18px; color: var(--ink); background: #efe9f7; border: 2px solid var(--ink); }
.web-mark:hover { background: var(--accent); color: #fff; }

.web-page {
  --bg: #efe6cf; --pat: rgba(26, 16, 48, 0.06); --card: #fffbe8; --ink: #1a1030; --soft: #6e6884; --accent: #7a4fc4; --shade: #c9b48a;
  flex: 1; overflow: auto; outline: none; color: var(--ink);
  background-color: var(--bg);
  background-image: linear-gradient(var(--pat) 2px, transparent 2px), linear-gradient(90deg, var(--pat) 2px, transparent 2px);
  background-size: 16px 16px;
  font: 21px/1.25 var(--mono);
}
.theme-portal { --bg: #1a1040; --pat: rgba(155, 123, 224, 0.12); --card: #efe9f7; --ink: #1a1030; --soft: #5b5478; --accent: #7a4fc4; --shade: #ff8fab; --head: #ece6ff; }
.theme-news { --bg: #e9e1d0; --pat: rgba(26, 16, 48, 0.05); --card: #fffbe8; --accent: #e05a47; --shade: #1a1030; }
.theme-sky { --bg: #cfe8ff; --pat: rgba(255, 255, 255, 0.6); --card: #ffffff; --accent: #2d6fd1; --shade: #79bbeb; }
.theme-stars { --bg: #0b0620; --pat: rgba(255, 255, 255, 0.05); --card: #1d1838; --ink: #ece6ff; --soft: #a59fd0; --accent: #ffd166; --shade: #9b5de5; --head: #ece6ff; }
.theme-neon { --bg: #120d24; --pat: rgba(255, 79, 216, 0.08); --card: #1d1838; --ink: #ffe6f8; --soft: #c9a8d8; --accent: #5ef2d6; --shade: #ff4fd8; --head: #ffe6f8; }
.theme-arcade { --bg: #0b0620; --pat: rgba(125, 255, 138, 0.07); --card: #16122e; --ink: #e9e9f2; --soft: #9b93b0; --accent: #7dff8a; --shade: #ff8fab; --head: #e9e9f2; }
.theme-retro { --bg: #2b1f4a; --pat: rgba(255, 255, 255, 0.05); --card: #efe9f7; --ink: #1a1030; --soft: #5b5478; --accent: #e05a47; --shade: #ffd166; --head: #ece6ff; }
.theme-manga { --bg: #ffffff; --pat: rgba(26, 16, 48, 0.07); --card: #ffffff; --accent: #d9487f; --shade: #1a1030; }
.theme-paper { --bg: #efe6cf; --card: #fffbe8; --accent: #7a4fc4; --shade: #c9b48a; }
.theme-tools { --bg: #123a22; --pat: rgba(125, 255, 138, 0.07); --card: #e9f5e6; --ink: #13261a; --soft: #4a6a52; --accent: #2c7a39; --shade: #ffd166; --head: #e9f5e6; }
.theme-kitchen { --bg: #fff1f1; --pat: rgba(224, 90, 71, 0.08); --card: #ffffff; --accent: #e05a47; --shade: #ffd166; }

.web-hero { position: relative; max-width: 800px; margin: 0 auto; border-bottom: 3px solid var(--ink); }
.web-hero-art { display: block; width: 100%; height: auto; aspect-ratio: 200 / 56; image-rendering: pixelated; }
.web-page h1.web-title { position: absolute; left: 14px; bottom: 10px; margin: 0; padding: 4px 10px 3px; font: 400 18px/1.2 var(--pixel); letter-spacing: 1px; color: #fff; background: rgba(26, 16, 48, 0.82); border: 3px solid #fff; box-shadow: 4px 4px 0 var(--accent); text-transform: lowercase; }
.web-body { max-width: 800px; margin: 0 auto; padding: 16px 18px 6px; color: var(--head, var(--ink)); }
.web-body p { margin: 8px 0; }
.web-page h2, .web-page h3 { font: 400 12px/1.3 var(--pixel); letter-spacing: 1px; color: var(--accent); margin: 14px 0 6px; }
.web-dim { color: var(--soft); }
.web-page a.web-link { color: var(--accent); text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat; }
.web-page a.web-link:hover { color: var(--card); background: var(--accent); }

.web-card, .web-recipe, .web-fix, .web-exhibit, .web-manga-card, .web-lesson, .web-strip, .web-tile, .web-site, .web-results li, .web-facts {
  background: var(--card); color: var(--ink); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--shade);
}
.web-card, .web-recipe, .web-manga-card { padding: 10px 14px; margin: 12px 0; }
.web-card p, .web-recipe p { color: var(--ink); }

/* home: a big search and tiles for every site */
.web-search { display: flex; gap: 8px; margin: 4px 0 14px; }
.web-search input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; font: 22px var(--mono); color: var(--ink); background: var(--card); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--shade); }
.web-group h2 { color: var(--head, var(--accent)); }
.web-sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 6px 0 10px; }
.web-site { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; gap: 0 10px; align-items: center; padding: 8px 10px; text-align: left; cursor: pointer; }
.web-site canvas { grid-row: span 2; }
.web-site b { font: 400 11px var(--pixel); letter-spacing: 1px; }
.web-site small { font-size: 17px; line-height: 1.1; color: #6e6884; }
.web-site:hover, .web-tile:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shade); }
.web-site:active, .web-tile:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shade); }

.web-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin: 10px 0; }
.web-tile { display: grid; gap: 4px; justify-items: start; padding: 10px; text-align: left; font-size: 21px; cursor: pointer; }
.web-tile canvas, .web-site canvas { width: 36px; height: 36px; padding: 2px; background: #efe9f7; border: 2px solid var(--ink); box-sizing: border-box; }
.web-tile small { font-size: 17px; color: var(--soft); }
.web-trophy { cursor: default; }
.web-news { padding-left: 22px; margin: 10px 0; display: grid; gap: 8px; list-style: square; }
.web-news li::marker { color: var(--accent); }
.web-results { list-style: none; padding: 0; display: grid; gap: 12px; }
.web-results li { padding: 8px 12px; }
.web-results small { display: block; color: #2c7a39; }
.web-real { margin-top: 14px; }
.web-url { font-size: 19px; word-break: break-all; color: var(--soft); }
.web-art { width: 192px; height: 128px; border: 3px solid var(--ink); display: block; margin: 4px 0 8px; image-rendering: pixelated; }
.web-live { font-weight: bold; margin: 6px 0; color: var(--accent); }
.web-sprite { width: 54px; height: 72px; display: block; margin: 6px 0; image-rendering: pixelated; }
.web-facts { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; padding: 10px 14px; margin: 10px 0 0; }
.web-facts dt { font: 400 10px/2 var(--pixel); color: var(--accent); }
.web-facts dd { margin: 0; }
.web-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 10px; }
.web-gallery figure { margin: 0; padding: 6px 0; text-align: center; font-size: 17px; background: var(--card); color: var(--ink); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--shade); }
.web-gallery .web-sprite { margin: 0 auto 2px; width: 36px; height: 48px; }
.web-museum { display: grid; gap: 12px; }
.web-exhibit { display: flex; gap: 14px; align-items: center; padding: 8px 12px; }
.web-exhibit h3 { margin: 0; }
.web-exhibit p { margin: 2px 0; }
.web-console { width: 96px; height: 64px; flex: none; image-rendering: pixelated; border: 3px solid var(--ink); }
.web-strip { padding: 8px 12px 12px; margin: 14px 0; }
.web-strip h3 { margin-top: 2px; }
.web-panels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.web-panel { width: 100%; aspect-ratio: 4 / 3; image-rendering: pixelated; background: #fff; border: 2px solid var(--ink); }
.web-manga-card small { font: 400 10px var(--pixel); color: var(--accent); }
.web-manga-card h3 { margin: 4px 0 0; color: var(--ink); font-size: 14px; }
.web-lesson { display: flex; gap: 14px; align-items: center; margin: 12px 0; padding: 10px 12px; }
.web-lesson-art { width: 96px; height: 96px; flex: none; image-rendering: pixelated; border: 3px solid var(--ink); }
.web-fix { margin: 10px 0; padding: 8px 12px; }
.web-fix summary { cursor: pointer; font: 400 11px/1.8 var(--pixel); color: var(--accent); }
.web-fix ol { margin: 6px 0 2px; }
.web-index { columns: 2; padding-left: 22px; list-style: square; }
.web-index li::marker { color: var(--accent); }
.web-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; max-width: 800px; margin: 8px auto 0; padding: 12px 18px 18px; font: 400 10px var(--pixel); color: var(--head, var(--soft)); }
.web-chip { padding: 2px 10px; font: 19px var(--mono); color: var(--ink); background: var(--card); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--shade); cursor: pointer; }
.web-chip:hover { background: var(--accent); color: var(--card); }
@media (max-width: 520px) { .web-page h1.web-title { font-size: 12px; left: 8px; bottom: 6px; } .web-index { columns: 1; } .web-panels { grid-template-columns: repeat(2, 1fr); } }

/* ---------- v4: radio fun buttons ---------- */
.fx-row .fx { font-size: 17px; }
.fx[aria-pressed='true'] { background: #b8ff7a; }

/* ---------- v4: desktop icon dragging ---------- */
.desk-icon.dragging { opacity: 0.35; }
.desk-icon.ghost { position: fixed; z-index: 60; pointer-events: none; opacity: 0.85; }
.desk-icon.drop-target { border: 2px dashed #ffd166; }

/* ---------- v4: new apps and games ---------- */
.arcade-canvas.wide { height: min(160px, 40vw); }
.sketch { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sketch-main { flex: 1; display: flex; gap: 10px; padding: 10px; overflow: auto; background: #cfc8dd; align-items: flex-start; }
.sketch-frame { flex: 1; border: 3px solid var(--ink); line-height: 0; }
.sketch-canvas { width: 100%; height: auto; touch-action: none; cursor: crosshair; image-rendering: auto; }
.sketch-size { display: flex; gap: 6px; align-items: center; font-size: 18px; }
.calc { display: flex; flex-direction: column; gap: 6px; padding: 10px; background: #d4cbe6; flex: 1; }
.calc-past { min-height: 20px; text-align: right; color: #6e6884; font-size: 18px; }
.calc-screen { padding: 6px 10px; text-align: right; font: 32px var(--mono); color: #7dff8a; background: #0f1f14; border: 3px solid var(--ink); overflow: hidden; }
.calc-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.calc-keys .wide { grid-column: span 3; }
.calc-keys .eq { background: #ffd166; }
.timer { display: flex; flex-direction: column; flex: 1; gap: 8px; padding-bottom: 6px; }
.timer-face { display: grid; place-items: center; padding: 10px; background: #1a1030; }
.timer-canvas { width: 360px; max-width: 100%; height: auto; image-rendering: pixelated; }
.timer .radio-row { padding: 0 10px; }
.pet { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 10px; background: #fff3f8; }
.pet-face { display: grid; place-items: center; border: 3px solid var(--ink); background: #ffe9f3; }
.pet-canvas { width: 240px; height: 180px; image-rendering: pixelated; }
.pet-stat { display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: center; }
.pet-bar { height: 14px; background: #e9e1d0; border: 2px solid var(--ink); }
.pet-bar i { display: block; height: 100%; background: #5bba6f; }
.pet-bar i.low { background: #e05a47; }
.beat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.beat-grid { flex: 1; display: grid; grid-template-columns: 52px repeat(16, 1fr); gap: 3px; padding: 10px; background: #1a1030; overflow: auto; align-content: start; }
.beat-label { font: 400 10px var(--pixel); color: #c3a6ff; align-self: center; }
.beat-label.k, .beat-label.s, .beat-label.h { color: #ffd166; }
.beat-cell { height: 22px; padding: 0; background: #2b1f4a; border: 2px solid #3a2d6b; }
.beat-cell.bar { border-left-color: #6a5aa0; }
.beat-cell.on { background: #ff4fd8; border-color: #ffd6f5; }
.beat-cell.bass.on { background: #5ef2d6; }
.beat-cell.k.on, .beat-cell.s.on, .beat-cell.h.on { background: #ffd166; }
.beat-cell.now { outline: 2px solid #ffffff; outline-offset: -2px; }
.simon { display: flex; flex-direction: column; flex: 1; }
.simon-board { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px; background: #1a1030; }
.simon-pad { min-height: 110px; border: 0; padding: 0; background: #2b1f4a 0 0 / 100% 100% no-repeat; image-rendering: pixelated; }
.c4 { display: flex; flex-direction: column; flex: 1; }
.c4-grid { flex: 1; display: grid; grid-template-columns: repeat(7, 42px); justify-content: center; align-content: center; padding: 10px; background: #1d4fa0; }
.c4-col { display: grid; grid-auto-rows: 42px; padding: 0; background: none; border: 0; }
.c4-col:hover:not(:disabled) { filter: brightness(1.18); }
.c4-cell { display: block; width: 42px; height: 42px; background: #2d6fd1 0 0 / 100% 100% no-repeat; image-rendering: pixelated; }
.whack { display: flex; flex-direction: column; flex: 1; }
.whack-grid { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px; background: #5bba6f; }
.hole { min-height: 80px; background: transparent center 85% / 96px 64px no-repeat; image-rendering: pixelated; border: 0; display: grid; place-items: center; }
.hole canvas { width: 56px; height: 56px; image-rendering: pixelated; }

/* ---------- v5: things in the room you can step into ---------- */
.play { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(8, 6, 16, 0.78); outline: none; animation: play-in 0.18s steps(3); }
@keyframes play-in { from { opacity: 0; transform: scale(0.96); } }
.play-win { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: calc(100vw - 16px); padding: 0 0 10px; background: var(--paper); border: 3px solid var(--ink); box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.55); color: var(--ink); }
.play-bar { display: flex; align-items: center; gap: 12px; align-self: stretch; padding: 4px 4px 4px 12px; background: var(--accent); color: #fff; }
.play-bar b { font: 400 13px var(--pixel); letter-spacing: 1px; white-space: nowrap; }
.play-score { flex: 1; font-size: 19px; color: #ece6ff; text-align: right; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.play-x { width: 30px; height: 26px; background: var(--paper); border: 3px solid var(--ink); color: var(--ink); font: 400 16px/1 var(--pixel); }
.play-x:hover { background: #ff8fab; }
.play-screen { padding: 0 12px; }
.play-canvas { display: block; border: 3px solid var(--ink); background: #05040c; touch-action: none; cursor: crosshair; }
.play-help { margin: 0; padding: 0 12px; font-size: 19px; color: #5b5478; text-align: center; }
.play-pad { display: none; gap: 8px; }
.play-btn { min-width: 52px; height: 46px; background: var(--paper-2); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font: 400 16px var(--pixel); color: var(--ink); touch-action: none; user-select: none; }
.play-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); background: var(--accent-hi); color: #fff; }
.play-a { min-width: 76px; background: #ffd166; }
@media (pointer: coarse) { .play-pad { display: flex; } }

/* the drone's flight pad */
.drone-pad { position: fixed; z-index: 5; right: 20px; bottom: 60px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.drone-help { margin: 0; padding: 4px 10px; background: rgba(13, 11, 24, 0.88); border: 3px solid #4a3a78; font-size: 18px; color: #c9c2ee; }
.drone-keys { display: grid; grid-template-columns: repeat(4, 44px); grid-template-rows: 40px 40px; gap: 4px; }
.drone-btn, .drone-land { background: rgba(13, 11, 24, 0.88); border: 3px solid #4a3a78; color: #ece6ff; font: 400 14px var(--pixel); touch-action: none; user-select: none; }
.drone-btn:active, .drone-btn:hover, .drone-land:hover { border-color: #5ef2d6; color: #5ef2d6; }
.drone-btn[data-key='up'] { grid-column: 2; grid-row: 1; }
.drone-btn[data-key='left'] { grid-column: 1; grid-row: 2; }
.drone-btn[data-key='down'] { grid-column: 2; grid-row: 2; }
.drone-btn[data-key='right'] { grid-column: 3; grid-row: 2; }
.drone-btn[data-key='rise'] { grid-column: 4; grid-row: 1; }
.drone-btn[data-key='sink'] { grid-column: 4; grid-row: 2; }
.drone-land { grid-column: 1; grid-row: 1; font-size: 10px; }
@media (max-width: 720px) { .drone-pad { right: 10px; bottom: 70px; } .drone-help { display: none; } }

/* card games */
.cards { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.cards .toolbar { flex-wrap: wrap; }
.cards-box { position: relative; flex: 1; min-height: 0; background: #1f5547; overflow: hidden; }
.cards-canvas { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: block; touch-action: none; cursor: pointer; outline: none; }
.cards-canvas:focus-visible { box-shadow: 0 0 0 3px var(--accent-hi); }

/* right-click file actions */
.menu button:disabled { opacity: 0.4; cursor: default; background: none; color: var(--ink); }
.rename-box { width: 100%; max-width: 110px; padding: 1px 3px; border: 2px solid var(--ink); background: #fffbe8; color: var(--ink); font: 18px/1 var(--mono); text-align: center; }
.file.drop-target { outline: 3px dashed var(--accent-hi); outline-offset: -3px; }
.props { display: flex; flex-direction: column; gap: 10px; padding: 14px; flex: 1; }
.props-head { display: flex; align-items: center; gap: 12px; padding-bottom: 8px; border-bottom: 3px dotted var(--mute); }
.props-head b { font: 400 13px var(--pixel); word-break: break-all; }
.props-icon { width: 48px; height: 48px; }
.props dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 19px; }
.props dt { color: #6e6884; }
.props dd { margin: 0; word-break: break-word; }
.props-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: auto; }
.notes-editable { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.notes-edit { flex: 1; min-height: 0; resize: none; margin: 0; padding: 12px 14px; border: 0; outline: none; background: #fffbe8; color: var(--ink); font: 20px/1.25 var(--mono); }
.notes.notes-editable { padding: 0; overflow: hidden; background: #fffbe8; }

/* ---------- v6: customise the room ---------- */
.room-custom { position: fixed; left: 150px; top: 20px; z-index: 3; background: none; border: 3px solid #3a3460; padding: 4px 10px; font: 400 11px var(--pixel); color: #a59fd0; transition: opacity 0.3s; }
.room-custom:hover, .room-custom[aria-expanded='true'] { border-color: #5ef2d6; color: var(--text); }
.room.zooming .room-custom, .room.zooming .custom-panel { opacity: 0; }
.custom-panel { position: fixed; z-index: 8; left: 28px; top: 62px; width: min(360px, calc(100vw - 32px)); max-height: calc(100vh - 140px); overflow: auto; padding: 0 0 12px; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.55); }
.custom-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 6px 12px; background: var(--accent); color: #fff; }
.custom-head b { font: 400 12px var(--pixel); letter-spacing: 1px; }
.custom-x { width: 28px; height: 24px; background: var(--paper); border: 3px solid var(--ink); color: var(--ink); font: 400 14px/1 var(--pixel); }
.custom-row { padding: 8px 12px 0; }
.custom-label { display: block; margin-bottom: 4px; font: 400 10px var(--pixel); letter-spacing: 1px; color: var(--accent-2); }
.custom-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.custom-panel .chip[aria-pressed='true'] { background: var(--accent); color: #fff; }
.custom-reset { margin: 12px 12px 0; }
@media (max-width: 720px) { .room-custom { left: 120px; top: 14px; } .custom-panel { left: 16px; top: 52px; } }
.custom-tip { margin: 10px 12px 0; font-size: 18px; color: #5b5478; }
.custom-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 12px 0; }
#room-canvas { touch-action: none; }
/* "say something" sits under the clock, clear of the boot hint over the screen */
.say { left: auto; right: 28px; top: 74px; transform: none; justify-items: end; width: min(420px, calc(100vw - 32px)); }
.say-panel { justify-content: flex-end; }
@media (max-width: 720px) { .say { right: 16px; top: 62px; } }

/* about the developer: a button in the room + the same card in the dev app */
.room-dev { position: fixed; left: 290px; top: 20px; z-index: 3; background: none; border: 3px solid #3a3460; padding: 4px 10px; font: 400 11px var(--pixel); color: #a59fd0; transition: opacity 0.3s; }
.room-dev:hover, .room-dev[aria-expanded='true'] { border-color: #ffd166; color: var(--text); }
.room.zooming .room-dev, .room.zooming .dev-panel { opacity: 0; }
.dev-panel { width: min(400px, calc(100vw - 32px)); }
.dev-card { padding: 10px 14px 0; font: 19px/1.25 var(--mono); }
.dev-card p { margin: 0 0 8px; }
.dev-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.dev-avatar { width: 54px; height: 72px; image-rendering: pixelated; background: #1b1830; border: 3px solid var(--ink); }
.dev-name { display: block; font: 400 14px/1.3 var(--pixel); letter-spacing: 1px; }
.dev-role { color: var(--accent-2); }
.dev-label { font: 400 10px var(--pixel); letter-spacing: 1px; color: var(--accent-2); }
.dev-skills { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.dev-skills li { padding: 0 6px; border: 2px solid var(--ink); background: #fffbe8; font-size: 17px; }
.dev-links { display: flex; flex-wrap: wrap; gap: 8px; }
.dev-app { overflow: auto; }
.dev-app .dev-card { padding: 14px 16px; }
@media (max-width: 720px) { .room-dev { left: 16px; top: 50px; } .dev-panel { left: 16px; top: 88px; } }

/* v7: the world around the room, behind it at the same pixel scale */
#world-canvas { position: fixed; z-index: 0; image-rendering: pixelated; transition: opacity 0.6s; }
#room-canvas { position: relative; z-index: 1; }
.room.zooming #world-canvas { opacity: 0; }

/* v9: everything in 2.5d. Windows, menus, panels and buttons are little slabs:
   a lit top-left edge, a solid side going down-right, and a shadow on the desk. */
:root { --slab: #1a1230; }
.win { box-shadow: inset 3px 3px 0 rgba(255, 255, 255, 0.55), 1px 1px 0 var(--slab), 2px 2px 0 var(--slab), 3px 3px 0 var(--slab), 4px 4px 0 var(--slab), 5px 5px 0 var(--slab), 6px 6px 0 var(--slab), 13px 13px 0 rgba(10, 6, 24, 0.42); }
.win.maxed { box-shadow: none; }
.win-bar { box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.35), inset 0 -3px 0 rgba(0, 0, 0, 0.2); }
.menu, .play-win, .custom-panel { box-shadow: inset 3px 3px 0 rgba(255, 255, 255, 0.5), 1px 1px 0 var(--slab), 2px 2px 0 var(--slab), 3px 3px 0 var(--slab), 4px 4px 0 var(--slab), 5px 5px 0 var(--slab), 11px 11px 0 rgba(10, 6, 24, 0.42); }
.play-bar { box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.3), inset 0 -3px 0 rgba(0, 0, 0, 0.2); }
.btn { box-shadow: inset -3px -3px 0 #b9b3c9, inset 3px 3px 0 #fff, 1px 1px 0 var(--ink), 2px 2px 0 var(--ink), 3px 3px 0 var(--ink); }
.btn:active, .btn[aria-pressed='true'], .btn[aria-checked='true'] { transform: translate(2px, 2px); box-shadow: inset 3px 3px 0 #b9b3c9, 1px 1px 0 var(--ink); }
.win-btn, .play-x, .custom-x { box-shadow: inset 2px 2px 0 #fff, 1px 1px 0 var(--ink), 2px 2px 0 var(--ink); }
.win-btn:active, .play-x:active, .custom-x:active { transform: translate(2px, 2px); box-shadow: none; }
.start { box-shadow: inset -3px -3px 0 #d9a43a, 1px 1px 0 #7a5a1a, 2px 2px 0 #7a5a1a, 3px 3px 0 #7a5a1a; }
.start[aria-expanded='true'] { transform: translate(2px, 2px); box-shadow: inset 3px 3px 0 #d9a43a; }
.taskbar { box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.12), 0 -6px 0 rgba(10, 6, 24, 0.35); }
.desk-icon canvas, .menu canvas { filter: drop-shadow(3px 3px 0 rgba(10, 6, 24, 0.75)); }
.room-sound, .room-custom, .room-dev, .say-btn { box-shadow: 1px 1px 0 #0a0818, 2px 2px 0 #0a0818, 3px 3px 0 #0a0818; }
.room-sound:active, .room-custom:active, .room-dev:active, .say-btn:active { transform: translate(2px, 2px); box-shadow: none; }

/* v11: the turn button that shows up after you move something */
.turn-btn { position: fixed; z-index: 7; padding: 4px 10px; font: 400 11px var(--pixel); color: var(--ink); background: #ffd166; border: 3px solid var(--ink); box-shadow: 1px 1px 0 var(--ink), 2px 2px 0 var(--ink), 3px 3px 0 var(--ink); }
.turn-btn:active { transform: translate(2px, 2px); box-shadow: none; }

/* v11: the site's own pixel cursors (drawn in js/cursor.js) */
html, body { cursor: var(--cur-default, auto); }
button, a, summary, .toggle, [role='button'], .desk-icon, .web-tile, .chip, .win-btn, .web-fix summary, .gb-pick { cursor: var(--cur-pointer, pointer); }
.win-bar { cursor: var(--cur-grab, grab); }
.win-bar:active { cursor: var(--cur-grab, grabbing); }
.btn:disabled, .menu button:disabled, .web-trophy { cursor: var(--cur-default, default); }
.room-help { max-width: min(560px, 34vw); text-align: right; pointer-events: none; }
/* the music player sits bottom centre: when it's showing, the help text moves up out of its way */
.room-player:not([hidden]) ~ .room-help { bottom: 70px; }

/* v12: the bar that shows which gadget you're holding */
.tool-bar { position: fixed; z-index: 8; left: 50%; top: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); padding: 6px 8px 6px 12px; background: rgba(13, 11, 24, 0.92); border: 3px solid #ffb45c; color: #ffe0b8; font: 19px/1.15 var(--mono); box-shadow: 1px 1px 0 #0a0818, 2px 2px 0 #0a0818, 3px 3px 0 #0a0818; }
.tool-bar .btn { flex: none; }
@media (max-width: 720px) { .tool-bar { top: 92px; font-size: 16px; } }

/* v13: first-visitor fixes */
.custom-panel { max-height: calc(100vh - 180px); scrollbar-width: thin; scrollbar-color: #7a4fc4 #e2dbee; }
@media (max-width: 720px), (max-height: 480px) {
  .room-help { display: block; left: 16px; right: 16px; top: 88px; bottom: auto; max-width: none; text-align: center; font-size: 15px; color: #a59fd0; }
  .room-player:not([hidden]) ~ .room-help { bottom: auto; }
  .toasts { top: 10px; bottom: auto; }
}

/* v14: the inventory on the right */
.inv-btn { position: fixed; right: 28px; top: 112px; z-index: 6; background: rgba(13, 11, 24, 0.85); border: 3px solid #3a3460; padding: 4px 10px; font: 400 11px var(--pixel); color: #a59fd0; box-shadow: 1px 1px 0 #0a0818, 2px 2px 0 #0a0818, 3px 3px 0 #0a0818; }
.inv-btn:hover, .inv-btn[aria-expanded='true'] { border-color: #5ef2d6; color: var(--text); }
.inv-btn.bump { animation: pop 0.3s steps(3); border-color: #ffd166; color: #ffd166; }
.inv-panel { position: fixed; right: 28px; top: 146px; z-index: 6; width: min(250px, calc(100vw - 32px)); max-height: calc(100vh - 330px); overflow: auto; padding: 0 0 8px; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); box-shadow: inset 3px 3px 0 rgba(255, 255, 255, 0.5), 1px 1px 0 var(--slab), 2px 2px 0 var(--slab), 3px 3px 0 var(--slab), 4px 4px 0 var(--slab), 9px 9px 0 rgba(10, 6, 24, 0.42); }
.inv-head { margin: 0 0 6px; padding: 6px 10px; background: var(--accent); color: #fff; font: 400 12px var(--pixel); letter-spacing: 1px; }
.inv-list { margin: 0; padding: 0 8px; list-style: none; display: grid; gap: 4px; }
.inv-list li { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 18px; line-height: 1.05; }
.inv-empty { color: #6e6884; }
.inv-tip { margin: 8px 10px 0; font-size: 15px; color: #6e6884; }
.store-btn { background: #c3a6ff; }
@media (max-width: 720px) { .inv-btn { right: 16px; top: 50px; } .inv-panel { right: 16px; top: 84px; max-height: calc(100vh - 260px); } }

/* v15: build mode, sims-style: a drawer of pictures at the bottom */
.build-drawer { position: fixed; z-index: 9; left: 50%; bottom: 12px; transform: translateX(-50%); width: min(980px, calc(100vw - 32px)); background: var(--paper); color: var(--ink); border: 3px solid var(--ink); box-shadow: inset 3px 3px 0 rgba(255, 255, 255, 0.5), 1px 1px 0 var(--slab), 2px 2px 0 var(--slab), 3px 3px 0 var(--slab), 4px 4px 0 var(--slab), 9px 9px 0 rgba(10, 6, 24, 0.42); }
.build-head { display: flex; align-items: center; gap: 12px; padding: 6px 8px 6px 12px; background: var(--accent); color: #fff; }
.build-head b { font: 400 12px var(--pixel); letter-spacing: 1px; white-space: nowrap; }
.build-tip { flex: 1; font-size: 16px; line-height: 1.1; color: #ece6ff; }
.build-shelf { display: flex; gap: 8px; padding: 10px; overflow-x: auto; min-height: 104px; align-items: stretch; scrollbar-width: thin; scrollbar-color: #7a4fc4 #e2dbee; }
.build-card { flex: none; display: grid; grid-template-rows: 64px auto; justify-items: center; align-items: end; gap: 4px; width: 96px; padding: 6px 4px; background: #fffbe8; border: 3px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); touch-action: none; }
.build-card:hover, .build-card.picked { background: #ffe9a8; border-color: #7a4fc4; }
.build-pic { display: block; max-width: 88px; max-height: 64px; image-rendering: pixelated; }
.build-name { font-size: 15px; line-height: 1; text-align: center; }
.build-empty { margin: auto; font-size: 18px; color: #6e6884; }
.build-ghost { position: fixed; z-index: 50; pointer-events: none; image-rendering: pixelated; opacity: 0.85; filter: drop-shadow(3px 3px 0 rgba(10, 6, 24, 0.6)); }
.room.building .room-help, .room.building .room-player, .room.building .room-brand { visibility: hidden; }

.copy-btn { background: #7dff8a; }

/* v16: the right-click menu for things in the room */
.item-menu { position: fixed; z-index: 30; min-width: 170px; padding: 0 0 4px; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); box-shadow: inset 3px 3px 0 rgba(255, 255, 255, 0.5), 1px 1px 0 var(--slab), 2px 2px 0 var(--slab), 3px 3px 0 var(--slab), 7px 7px 0 rgba(10, 6, 24, 0.42); }
.item-menu-name { margin: 0 0 4px; padding: 5px 10px; background: var(--accent); color: #fff; font: 400 11px var(--pixel); letter-spacing: 1px; }
.item-menu button { display: block; width: 100%; padding: 3px 12px; text-align: left; font: 19px/1.15 var(--mono); color: var(--ink); background: none; border: 0; }
.item-menu button:hover, .item-menu button:focus-visible { background: #ffe9a8; outline: none; }

/* phones: the say button sat on top of the build mode button */
@media (max-width: 720px) { .say { top: 88px; } .room-help { top: 124px; } }
