/* THWS — early-2000s desktop look, hand-built CSS (no third-party themes). Portrait-first. */
@font-face { font-family: 'THWS UI'; src: url(../assets/fonts/ui.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'THWS UI'; src: url(../assets/fonts/ui-bold.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'VT323'; src: url(../assets/fonts/vt323.woff2) format('woff2'), url(../assets/fonts/vt323-ext.woff2) format('woff2'); font-display: block; }
:root {
  --ui: Tahoma, 'THWS UI', Verdana, sans-serif;
  --face: #ece9d8; --face2: #f4f3ee; --edge: #0831d9; --blue: #0a246a;
  --sel: #316ac5; --tb-h: 40px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; overscroll-behavior: none; }
body { font: 13px/1.3 var(--ui); color: #000; -webkit-text-size-adjust: 100%; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; -webkit-user-select: text; user-select: text; }
#screen { position: fixed; inset: 0; padding-top: var(--safe-t); background: #000; overflow: hidden; }
.hidden { display: none !important; }
.muted { color: #555; font-size: 12px; }
.fadeout { animation: fadeout .35s forwards; }
@keyframes fadeout { to { opacity: 0; } }

/* ============ 1. CMD first-run ============ */
.cmd-screen { position: absolute; inset: var(--safe-t) 0 0; background: #f595aa; color: #4a1030; font: 22px/1.15 VT323, 'Courier New', monospace; padding: 14px 14px; overflow-y: auto; background-image: radial-gradient(#ffd0dc 1.2px, transparent 1.3px); background-size: 14px 14px; }
.cmd-line { white-space: pre-wrap; min-height: 1.15em; }
.cmd-cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.cmd-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: rgba(255,255,255,.35); border: 2px solid #4a1030; box-shadow: 3px 3px 0 #4a1030; color: #4a1030; font: inherit; font-size: 24px; padding: 8px 12px; margin: 10px 0; }
.cmd-opt:active, .cmd-opt.chosen { background: #4a1030; color: #fff; box-shadow: 1px 1px 0 #4a1030; transform: translate(2px,2px); }
.cmd-star { width: 22px; height: 22px; image-rendering: pixelated; flex: none; }
.cmd-opt.chosen .cmd-star { animation: twinkle .5s steps(2) infinite; }
@keyframes twinkle { 50% { transform: scale(1.25) rotate(15deg); } }
.cmd-opt.dim { opacity: .45; }
.cmd-bar { height: 18px; margin: 6px 0; border: 2px solid #fff; padding: 2px; }
.cmd-bar-fill { height: 100%; width: 0; background: #fff; }
.cmd-kb { position: absolute; opacity: 0; width: 1px; height: 1px; bottom: 0; left: 0; }

/* ============ 2/3. Alf question + boot (classic grey dialogs on teal) ============ */
.teal-screen { position: absolute; inset: 0; background: #0e8a8a; display: grid; place-items: center; padding: 14px; }
.boot-screen { background: #58a8a8; }
.w98 { width: min(360px, 94vw); background: #c0c0c0; border: 1px solid; border-color: #dfdfdf #000 #000 #dfdfdf; box-shadow: inset 1px 1px #fff, inset -1px -1px #808080, 2px 2px 0 rgba(0,0,0,.25); font: 14px var(--ui); padding: 2px; }
.w98.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.w98-title { height: 22px; background: #000a80; color: #fff; font-size: 13px; font-weight: 700; padding: 0 2px 0 6px; display: flex; justify-content: space-between; align-items: center; }
.w98-x { width: 18px; height: 16px; padding: 0; background: #c0c0c0; border: 1px solid; border-color: #fff #000 #000 #fff; box-shadow: inset -1px -1px #808080; position: relative; }
.w98-x::before, .w98-x::after { content: ''; position: absolute; left: 7px; top: 3px; width: 2px; height: 9px; background: #000; transform: rotate(45deg); }
.w98-x::after { transform: rotate(-45deg); }
.w98-mini { display: flex; gap: 2px; }
.w98-mini i { width: 16px; height: 14px; background: #c0c0c0; border: 1px solid; border-color: #fff #000 #000 #fff; }
.w98-body { padding: 16px 14px 14px; }
.w98-row { display: flex; align-items: center; gap: 14px; }
.w98-row.bottom { gap: 12px; margin-top: 18px; }
.w98-alf .alf-sprite { width: 64px; flex: none; image-rendering: pixelated; }
.alf-sprite.happy { animation: hop .45s 2; }
@keyframes hop { 50% { transform: translateY(-8px) rotate(-5deg); } }
.alf-q { font-size: 16px; }
.w98-btns { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
.w98-btn { min-width: 108px; padding: 7px 10px; background: #c0c0c0; color: #000; border: 1px solid; border-color: #fff #000 #000 #fff; box-shadow: inset -1px -1px #808080, inset 1px 1px #dfdfdf; font: 14px var(--ui); }
.w98-btn:active, .w98-btn.pressed { border-color: #000 #fff #fff #000; box-shadow: inset 1px 1px #808080; }
.w98-btn:disabled { color: #808080; }
.boot-text { font-size: 14px; }
.w98-progress { flex: 1; height: 24px; background: #c0c0c0; border: 1px solid; border-color: #808080 #fff #fff #808080; box-shadow: inset 1px 1px #000; padding: 2px; }
.w98-blocks { display: flex; gap: 2px; height: 100%; }
.w98-blocks i { width: 9px; flex: none; background: #000a9c; }
.w98-boot .w98-btn { min-width: 84px; }

/* ============ Desktop ============ */
.desktop { position: absolute; inset: var(--safe-t) 0 0; display: flex; flex-direction: column; }
.desk { position: relative; flex: 1; overflow: hidden; background: #3a6ea5 center / cover no-repeat; }
.desk.pixel-bg { image-rendering: pixelated; }
.desk-icons { position: absolute; top: 4px; left: 2px; height: min(54%, 432px); width: 164px; display: grid; grid-template-columns: 82px 82px; grid-template-rows: repeat(6, minmax(0, 72px)); grid-auto-flow: column; justify-items: center; z-index: 1; }
.desk-icons.refresh { opacity: .3; }
.desk-icon { width: 80px; height: 100%; min-height: 0; overflow: hidden; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2px; }
.desk-icon img { width: 32px; height: 32px; image-rendering: pixelated; }
.desk-icon span { margin-top: 4px; color: #fff; font-size: 11px; line-height: 1.15; text-align: center; text-shadow: 1px 1px 1px #000, 0 0 2px #000; padding: 0 2px; max-height: 2.4em; overflow: hidden; }
.desk-icon.sel img { filter: brightness(.6) sepia(1) hue-rotate(190deg) saturate(4); }
.desk-icon.sel span { background: var(--sel); text-shadow: none; }
.credit { position: absolute; right: 8px; bottom: 6px; display: flex; align-items: center; gap: 4px; color: rgba(255,255,255,.85); font-size: 10px; text-decoration: none; text-shadow: 1px 1px 1px rgba(0,0,0,.8); z-index: 1; }
.credit .ig { width: 11px; height: 11px; border: 1.5px solid currentColor; border-radius: 3px; position: relative; display: inline-block; }
.credit .ig::before { content: ''; position: absolute; inset: 2px; border: 1.5px solid currentColor; border-radius: 50%; }
.credit .ig::after { content: ''; position: absolute; top: 0; right: 0; width: 2px; height: 2px; background: currentColor; border-radius: 50%; }
.flowers { position: absolute; inset: 0; z-index: 0; }
.flower { position: absolute; border: 0; padding: 0; background: none; }
.flower img { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.flower.bob img { animation: bob .4s; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.flower-tip { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); padding: 2px 7px; background: #ffffe1; color: #000; border: 1px solid #000; font: 12px var(--ui); white-space: nowrap; box-shadow: 1px 1px 0 rgba(0,0,0,.3); animation: tipIn .15s; pointer-events: none; }
.flower-tip.out { opacity: 0; transition: opacity .4s; }
@keyframes tipIn { from { opacity: 0; transform: translate(-50%, 4px); } }
.win-layer { position: absolute; inset: 0; pointer-events: none; }
.win-layer > * { pointer-events: auto; }

/* ============ Taskbar ============ */
.taskbar { height: calc(var(--tb-h) + var(--safe-b)); padding-bottom: var(--safe-b); display: flex; align-items: stretch; background: linear-gradient(#3168d5 0, #4993e6 4%, #2157d7 8%, #2663e0 50%, #1941a5 100%); border-top: 1px solid #0c3a9c; position: relative; z-index: 9000; }
.start-btn { display: flex; align-items: center; gap: 5px; padding: 0 20px 0 14px; border: 0; border-radius: 0 12px 12px 0; color: #fff; font: italic 700 18px var(--ui); text-shadow: 1px 1px 1px #222; background: linear-gradient(#3c9a3c, #59c159 15%, #3f9d3f 50%, #2f8a2f 85%, #1f6e1f); box-shadow: inset -2px 0 3px rgba(0,0,0,.35), 2px 0 3px rgba(0,0,0,.3); }
.start-btn img { width: 24px; height: 24px; filter: drop-shadow(1px 1px 0 rgba(0,0,0,.4)); }
.start-btn.on, .start-btn:active { background: linear-gradient(#2f7e2f, #3e9a3e 50%, #2b7a2b); }
.quicklaunch { display: flex; align-items: center; padding: 0 3px 0 6px; gap: 1px; border-right: 1px solid #1b47b1; box-shadow: 1px 0 #4a85eb; }
.ql-btn { width: 30px; height: 30px; border: 1px solid transparent; background: none; border-radius: 3px; padding: 0; display: grid; place-items: center; }
.ql-btn img { width: 20px; height: 20px; }
.ql-btn:active { background: rgba(0,0,0,.25); border-color: #1a3f9a; }
.tasks { flex: 1; display: flex; align-items: center; gap: 2px; padding: 0 3px; overflow-x: auto; scrollbar-width: none; }
.tasks::-webkit-scrollbar { display: none; }
.task-btn { flex: 0 1 120px; min-width: 38px; height: 30px; display: flex; align-items: center; gap: 4px; padding: 0 6px; color: #fff; border: 1px solid #1e4ab6; border-radius: 3px; background: linear-gradient(#5f93f2, #3c81f3 20%, #3b7bed 80%, #2c62cf); font-size: 11px; white-space: nowrap; overflow: hidden; }
.task-btn img { width: 16px; height: 16px; flex: none; }
.task-btn span { overflow: hidden; text-overflow: ellipsis; }
.task-btn.active { background: linear-gradient(#1c4ec0, #1e52b7 50%, #1a4aa9); box-shadow: inset 1px 1px 2px rgba(0,0,0,.5); }
.tray { display: flex; align-items: center; gap: 5px; padding: 0 9px 0 9px; color: #fff; font-size: 12px; background: linear-gradient(#1290e9, #19a3f1 15%, #1590e5 50%, #0f7ed3); border-left: 1px solid #0b5fbf; box-shadow: inset 1px 0 #2fb3ff; }
.tray-i { width: 16px; height: 16px; }
.clock { padding-left: 2px; white-space: nowrap; }

/* ============ Start menu ============ */
.startmenu { position: absolute; left: 0; bottom: calc(var(--tb-h) + var(--safe-b)); width: min(380px, 100vw); max-height: calc(100% - var(--tb-h) - 8px); display: flex; flex-direction: column; background: #fff; border: 1px solid #0b3cba; border-radius: 7px 7px 0 0; box-shadow: 3px 0 8px rgba(0,0,0,.45); z-index: 9500; overflow: hidden; animation: smUp .14s ease-out; }
@keyframes smUp { from { transform: translateY(18px); opacity: 0; } }
.sm-head { display: flex; align-items: center; gap: 9px; padding: 7px 9px; color: #fff; font: 700 16px var(--ui); text-shadow: 1px 1px 1px #0a2a7a; background: linear-gradient(#1f63d8, #3c84ee 8%, #2867d9 40%, #1d58cc); }
.sm-avatar { width: 46px; height: 46px; object-fit: contain; background: #fff; border: 2px solid #d6dff7; border-radius: 4px; image-rendering: pixelated; }
.sm-cols { display: flex; flex: 1; min-height: 0; border-top: 2px solid #f9a443; }
.sm-left { flex: 1.05; display: flex; flex-direction: column; padding: 5px 0; background: #fff; overflow-y: auto; }
.sm-right { flex: 1; display: flex; flex-direction: column; padding: 5px 0; background: #d3e5fa; border-left: 1px solid #95bdee; overflow-y: auto; }
.sm-item { display: flex; align-items: center; gap: 7px; width: 100%; padding: 6px 8px; border: 0; background: none; text-align: left; font-size: 12px; }
.sm-item img { width: 28px; height: 28px; }
.sm-right .sm-item img { width: 22px; height: 22px; }
.sm-item.bold { font-weight: 700; }
.sm-right .sm-item { color: #0a246a; }
.sm-item:active, .sm-item:hover { background: var(--sel); color: #fff; }
.sm-sep { height: 1px; margin: 4px 8px; background: linear-gradient(90deg, transparent, #c5c5c5, transparent); }
.sm-sep.r { background: linear-gradient(90deg, transparent, #94b4e4, transparent); }
.sm-grow { flex: 1; }
.sm-all { display: flex; justify-content: center; align-items: center; gap: 8px; border: 0; background: none; font-weight: 700; padding: 7px; font-size: 12px; }
.sm-arrow { width: 18px; height: 18px; border-radius: 3px; background: linear-gradient(#5ac45a, #2a8f2a); position: relative; }
.sm-arrow::after { content: ''; position: absolute; left: 7px; top: 4px; border: 5px solid transparent; border-left: 6px solid #fff; }
.sm-foot { display: flex; justify-content: flex-end; gap: 6px; padding: 6px 8px; background: linear-gradient(#3b80ef, #2462d9 50%, #1d50c4); }
.sm-off { display: flex; align-items: center; gap: 5px; border: 0; background: none; color: #fff; font-size: 12px; padding: 4px 6px; }
.sm-off img { width: 24px; height: 24px; }

/* ============ Windows (classic grey, always framed inside the desktop) ============ */
.window { position: absolute; display: flex; flex-direction: column; min-width: 200px; background: #c0c0c0; padding: 3px; border: 1px solid; border-color: #dfdfdf #000 #000 #dfdfdf; box-shadow: inset 1px 1px #fff, inset -1px -1px #808080, 4px 4px 0 rgba(0,0,0,.28); }
.window.dialog { height: auto !important; }
.window.minimized { display: none; }
.window.maximized { left: 6px !important; top: 6px !important; width: calc(100% - 12px) !important; height: calc(100% - 12px) !important; }
.window.opening { animation: winOpen .16s ease-out; }
.window.closing { animation: winClose .14s ease-in forwards; }
@keyframes winOpen { from { transform: scale(.85); opacity: .2; } }
@keyframes winClose { to { transform: scale(.9); opacity: 0; } }
.win-ghost { position: fixed; z-index: 9999; border: 2px dotted #000; pointer-events: none; }
.titlebar { flex: none; height: 30px; display: flex; align-items: center; gap: 6px; padding: 0 2px 0 4px; color: #202020; touch-action: none; background: #c0c0c0; }
.dialog .titlebar { height: 24px; background: #000a80; color: #fff; margin-bottom: 2px; }
.window.dialog:not(.focused) .titlebar { background: #808080; color: #c0c0c0; }
.title-icon { width: 16px; height: 16px; flex: none; }
.title-text { flex: 1; font-weight: 700; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.window:not(.focused) .title-text { color: #808080; }
.dialog .title-text { color: inherit !important; }
.tb-btns { display: flex; gap: 2px; }
.tb-btn { width: 26px; height: 24px; padding: 0; position: relative; background: #c0c0c0; border: 1px solid; border-color: #fff #000 #000 #fff; box-shadow: inset -1px -1px #808080, inset 1px 1px #dfdfdf; }
.dialog .tb-btn { width: 20px; height: 18px; }
.tb-btn:active { border-color: #000 #fff #fff #000; box-shadow: inset 1px 1px #808080; }
.tb-close { margin-left: 2px; }
.tb-min::after { content: ''; position: absolute; left: 7px; bottom: 5px; width: 9px; height: 3px; background: #000; }
.tb-max::after { content: ''; position: absolute; left: 6px; top: 4px; width: 13px; height: 12px; border: 1px solid #000; border-top-width: 3px; box-sizing: border-box; }
.tb-max.is-max::after { left: 8px; top: 3px; width: 10px; height: 9px; }
.tb-max.is-max::before { content: ''; position: absolute; left: 5px; top: 8px; width: 10px; height: 9px; border: 1px solid #000; border-top-width: 3px; box-sizing: border-box; background: #c0c0c0; z-index: 1; }
.tb-close::before, .tb-close::after { content: ''; position: absolute; left: 11px; top: 5px; width: 2px; height: 12px; background: #000; transform: rotate(45deg); }
.tb-close::after { transform: rotate(-45deg); }
.dialog .tb-close::before, .dialog .tb-close::after { left: 8px; top: 3px; height: 10px; }
.menubar { flex: none; display: flex; gap: 0; padding: 1px 0 3px; background: #c0c0c0; }
.menubar .m { padding: 4px 8px; font-size: 13px; }
.menubar .m.open { background: #000a80; color: #fff; }
.win-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border: 2px solid; border-color: #808080 #fff #fff #808080; box-shadow: inset 1px 1px #000; background: #fff; }
.dialog .win-body { border: 0; box-shadow: none; background: #c0c0c0; }
.win-body > * { flex: 1; min-height: 0; }
.win-hscroll { flex: none; height: 18px; margin-top: 3px; display: flex; background: repeating-conic-gradient(#c0c0c0 0 25%, #fff 0 50%) 0 0 / 2px 2px; }
.win-hscroll i { width: 18px; background: #c0c0c0; border: 1px solid; border-color: #fff #000 #000 #fff; position: relative; }
.win-hscroll i:first-child::after, .win-hscroll i:last-child::after { content: ''; position: absolute; top: 4px; left: 5px; border: 4px solid transparent; border-right: 4px solid #000; border-left: 0; }
.win-hscroll i:last-child::after { left: 7px; border-right: 0; border-left: 4px solid #000; }
.win-hscroll b { width: 34%; background: #c0c0c0; border: 1px solid; border-color: #fff #000 #000 #fff; }
.win-hscroll span { flex: 1; }
.resize-grip { position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; touch-action: none; background: linear-gradient(135deg, transparent 50%, #808080 50%, #808080 57%, #fff 57%, #fff 64%, transparent 64%, transparent 72%, #808080 72%, #808080 79%, #fff 79%, #fff 86%, transparent 86%); }
.window.maximized .resize-grip { display: none; }
.statusbar { flex: none !important; padding: 3px 6px; font-size: 11px; color: #000; background: #c0c0c0; border-top: 1px solid #808080; box-shadow: inset 0 1px #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* dropdown menus */
.dropdown { position: fixed; z-index: 10000; min-width: 170px; max-width: 86vw; padding: 2px; background: #c0c0c0; border: 1px solid; border-color: #dfdfdf #000 #000 #dfdfdf; box-shadow: inset 1px 1px #fff, inset -1px -1px #808080, 2px 2px 0 rgba(0,0,0,.3); }
.dd-item { display: flex; align-items: center; padding: 7px 18px 7px 4px; font-size: 13px; }
.dd-item:active, .dd-item:hover { background: #000a80; color: #fff; }
.dd-item.disabled { color: #808080; text-shadow: 1px 1px #fff; background: none !important; }
.dd-check { width: 18px; flex: none; text-align: center; }
.dd-item.checked .dd-check::before { content: '\2713'; font-weight: 700; }
.dd-sep { height: 2px; margin: 3px 2px; border-top: 1px solid #808080; border-bottom: 1px solid #fff; }

/* buttons / controls */
.xp-btn { min-width: 76px; padding: 6px 10px; background: #c0c0c0; color: #000; border: 1px solid; border-color: #fff #000 #000 #fff; box-shadow: inset -1px -1px #808080, inset 1px 1px #dfdfdf; font-size: 13px; }
.xp-btn.default { outline: 1px solid #000; outline-offset: 0; }
.xp-btn:active { border-color: #000 #fff #fff #000; box-shadow: inset 1px 1px #808080; }
.xp-btn:disabled { color: #808080; text-shadow: 1px 1px #fff; }
.xp-btn.small { min-width: 0; padding: 4px 8px; font-size: 12px; }
.xp-input { width: 100%; padding: 6px; border: 2px solid; border-color: #808080 #fff #fff #808080; background: #fff; font-size: 14px; }
.xp-input.num { width: 64px; }
.xp-select { padding: 4px; border: 1px solid #7f9db9; background: #fff; font-size: 13px; max-width: 100%; }
.xp-progress { height: 16px; border: 1px solid #848484; border-radius: 3px; padding: 1px; background: #fff; margin: 8px 0; display: none; }
.xp-progress.on { display: block; }
.xp-progress-fill { height: 100%; width: 0; background: repeating-linear-gradient(90deg, #36c936 0 8px, transparent 8px 10px); transition: width .2s; }
.xp-progress-fill.anim { animation: fillp 1.6s linear forwards; }
@keyframes fillp { to { width: 100%; } }
.row { display: flex; align-items: center; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.lbl { display: block; margin: 8px 0 3px; }

/* dialogs */
.dlg { padding: 12px; background: #c0c0c0; }
.dlg-row { display: flex; gap: 12px; align-items: flex-start; }
.dlg-icon { width: 32px; height: 32px; flex: none; }
.dlg-text { white-space: pre-wrap; padding-top: 4px; font-size: 13px; word-break: break-word; }
.dlg-buttons { display: flex; justify-content: center; gap: 8px; padding-top: 14px; flex-wrap: wrap; flex: none !important; }
.bug-det { font: 11px monospace; background: #fff; border: 1px solid #aaa; padding: 6px; white-space: pre-wrap; }
.balloon { position: absolute; right: 6px; bottom: 8px; width: min(280px, 82vw); background: #ffffe1; border: 1px solid #000; border-radius: 8px; padding: 8px 10px; z-index: 9800; box-shadow: 2px 2px 4px rgba(0,0,0,.35); animation: winOpen .2s; font-size: 12px; }
.balloon::after { content: ''; position: absolute; right: 40px; bottom: -11px; border: 10px solid transparent; border-top-color: #ffffe1; border-bottom: 0; filter: drop-shadow(0 1px 0 #000); }
.bl-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.bl-head img { width: 16px; height: 16px; }
.bl-head b { flex: 1; }
.bl-x { width: 16px; height: 16px; border: 1px solid #888; border-radius: 2px; background: #fff; position: relative; }
.bl-x::before, .bl-x::after { content: ''; position: absolute; left: 6px; top: 2px; width: 1.5px; height: 10px; background: #444; transform: rotate(45deg); }
.bl-x::after { transform: rotate(-45deg); }
.vol-pop { position: fixed; z-index: 9900; width: 84px; padding: 8px; background: var(--face); border: 1px solid #555; box-shadow: 2px 2px 4px rgba(0,0,0,.4); display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 11px; }
.vol-vert { writing-mode: vertical-lr; direction: rtl; height: 110px; width: 28px; }

/* ============ Media Player (classic grey) ============ */
.mp { display: flex; flex-direction: column; background: #c0c0c0; color: #000; }
.mp-np { flex: none; display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; font-size: 12px; color: #fff; background: linear-gradient(90deg, #000a80, #1084d0); }
.mp-np-label { font-weight: 700; }
.mp-viz { flex: none; position: relative; height: 28%; min-height: 130px; margin: 6px 6px 0; border: 2px solid; border-color: #808080 #fff #fff #808080; background: #000; overflow: hidden; }
.mp-canvas { width: 100%; height: 100%; display: block; }
.mp-v-over { position: absolute; left: 0; right: 0; top: 0; padding: 5px 8px 6px; pointer-events: none; background: linear-gradient(rgba(0,0,0,.75), rgba(0,0,0,0)); }
.mp-v-title { font-weight: 700; font-size: 15px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-v-sub { font-size: 11px; color: #9fd0ff; }
.mp-info { flex: none; margin: 5px 6px 0; padding: 3px 6px; font: 12px 'Courier New', monospace; color: #00ff40; background: #000; border: 2px solid; border-color: #808080 #fff #fff #808080; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-seekrow { flex: none; display: flex; align-items: center; gap: 6px; padding: 6px 6px 0; }
.mp-time { font: 12px 'Courier New', monospace; min-width: 46px; }
.mp-time.right { text-align: right; }
.mp-seek { flex: 1; height: 28px; position: relative; touch-action: none; }
.seek-track { position: absolute; left: 0; right: 0; top: 11px; height: 6px; background: #fff; border: 1px solid; border-color: #808080 #fff #fff #808080; box-shadow: inset 1px 1px #000; overflow: hidden; }
.seek-fill { height: 100%; width: 0; background: #000a80; }
.seek-thumb { position: absolute; top: 3px; width: 12px; height: 22px; margin-left: -6px; background: #c0c0c0; border: 1px solid; border-color: #fff #000 #000 #fff; box-shadow: inset -1px -1px #808080; left: 0; }
.mp-controls { flex: none; display: flex; align-items: center; justify-content: center; gap: 3px; padding: 6px; flex-wrap: wrap; }
.mp-b, .mp-play { width: 36px; height: 32px; padding: 0; position: relative; background: #c0c0c0; border: 1px solid; border-color: #fff #000 #000 #fff; box-shadow: inset -1px -1px #808080, inset 1px 1px #dfdfdf; }
.mp-play { width: 52px; }
.mp-b:active, .mp-play:active, .mp-b.on, .mp-b.muted { border-color: #000 #fff #fff #000; box-shadow: inset 1px 1px #808080; background: #d4d0c8; }
.mp-b::before, .mp-b::after { content: ''; position: absolute; }
.mp-b.prev::before { left: 10px; top: 9px; width: 3px; height: 12px; background: #000; }
.mp-b.prev::after { left: 13px; top: 9px; border: 6px solid transparent; border-right: 9px solid #000; border-left: 0; }
.mp-b.next::before { right: 10px; top: 9px; width: 3px; height: 12px; background: #000; }
.mp-b.next::after { right: 13px; top: 9px; border: 6px solid transparent; border-left: 9px solid #000; border-right: 0; }
.mp-b.stop::before { left: 12px; top: 9px; width: 11px; height: 11px; background: #000; }
.mp-b.restart::before { left: 10px; top: 7px; width: 12px; height: 12px; border: 2px solid #000; border-radius: 50%; border-right-color: transparent; }
.mp-b.restart::after { left: 20px; top: 5px; border: 4px solid transparent; border-top: 6px solid #000; transform: rotate(-20deg); }
.mp-b.rep::before { left: 9px; top: 9px; width: 17px; height: 11px; border: 2px solid #000; }
.mp-b.rep::after { left: 16px; top: 5px; border: 4px solid transparent; border-left: 6px solid #000; }
.mp-b.rep.one::after { content: '1'; border: 0; left: 15px; top: 8px; font: 700 10px var(--ui); color: #000; }
.mp-b.mute::before { left: 10px; top: 11px; width: 6px; height: 9px; background: #000; }
.mp-b.mute::after { left: 12px; top: 7px; border: 8px solid transparent; border-right: 9px solid #000; border-left: 0; }
.mp-b.mute.muted::after { border-right-color: #a00; }
.mp-play::after { content: ''; position: absolute; left: 20px; top: 7px; border: 8px solid transparent; border-left: 13px solid #000; border-right: 0; }
.mp-play.is-playing::after { left: 19px; top: 8px; width: 4px; height: 14px; border: 0; background: #000; box-shadow: 8px 0 #000; }
.mp-sep { width: 2px; height: 26px; border-left: 1px solid #808080; border-right: 1px solid #fff; margin: 0 3px; }
.mp-vol { width: 84px; accent-color: #000a80; }
.mp-tabs { flex: none; display: flex; gap: 0; padding: 0 6px; margin-top: 2px; }
.mp-tab { padding: 5px 12px; border: 1px solid; border-color: #fff #000 transparent #fff; border-radius: 3px 3px 0 0; background: #c0c0c0; font-size: 12px; position: relative; top: 2px; }
.mp-tab.on { font-weight: 700; top: 0; padding-bottom: 7px; z-index: 1; }
.mp-list { flex: 1; min-height: 80px; margin: 0 6px 6px; background: #fff; color: #000; overflow-y: auto; -webkit-overflow-scrolling: touch; border: 2px solid; border-color: #808080 #fff #fff #808080; }
.mp-row { display: flex; gap: 6px; padding: 8px 6px; font-size: 13px; border-bottom: 1px dotted #c0c0c0; }
.mp-row.head { position: sticky; top: 0; background: #c0c0c0; font-size: 11px; padding: 3px 6px; border-bottom: 1px solid #808080; box-shadow: inset 0 1px #fff; z-index: 1; }
.mp-row:not(.head):active { background: #e0e0e0; }
.mp-row.cur { background: #000a80; color: #fff; font-weight: 700; }
.c-n { width: 24px; text-align: right; opacity: .7; flex: none; }
.c-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-d { width: 46px; text-align: right; flex: none; font-family: 'Courier New', monospace; font-size: 12px; }
.mp-eq { flex: 1; margin: 0 6px 6px; padding: 8px; background: #c0c0c0; color: #000; border: 2px solid; border-color: #fff #808080 #808080 #fff; overflow: auto; }
.eq-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.eq-top b { width: 100%; }
.eq-sliders { display: flex; justify-content: space-between; height: 150px; padding: 4px 0; background: #fff; border: 2px solid; border-color: #808080 #fff #fff #808080; }
.eq-band { display: flex; flex-direction: column; align-items: center; width: 9%; }
.eq-s { writing-mode: vertical-lr; direction: rtl; flex: 1; width: 26px; accent-color: #000a80; }
.eq-band label { font-size: 9px; margin-top: 3px; }
.eq-note { font-size: 11px; background: #ffffe1; border: 1px solid #000; padding: 5px; margin-top: 8px; }

/* ============ Explorer / Pictures ============ */
.explorer { display: flex; flex-direction: column; background: #fff; }
.ex-toolbar, .ex-address, .ie-bar { flex: none; display: flex; align-items: center; gap: 6px; padding: 4px 6px; background: var(--face); border-bottom: 1px solid #d0cdbf; font-size: 12px; }
.ex-addr { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; background: #fff; border: 1px solid #7f9db9; padding: 3px 5px; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-addr img { width: 16px; height: 16px; }
.ex-tool { width: 30px; height: 28px; border: 1px solid transparent; border-radius: 3px; background: none; position: relative; }
.ex-tool.back::before { content: ''; position: absolute; left: 4px; top: 4px; width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #c8f0c8, #3aa63a 60%, #1f6f1f); }
.ex-tool.back::after { content: ''; position: absolute; left: 9px; top: 9px; border: 5px solid transparent; border-right: 7px solid #fff; border-left: 0; }
.ex-tool.up::before { content: ''; position: absolute; left: 5px; top: 7px; width: 20px; height: 15px; background: #f5cf62; border: 1px solid #a5781a; }
.ex-tool.up::after { content: ''; position: absolute; left: 10px; top: 4px; border: 5px solid transparent; border-bottom: 8px solid #2a8f2a; border-top: 0; }
.ex-side { flex: none !important; display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; background: linear-gradient(90deg, #7ba2e7, #6375d6); color: #fff; font-size: 12px; }
.ex-side a { color: #fff; }
.ex-list { overflow-y: auto; padding: 6px; -webkit-overflow-scrolling: touch; }
.ex-group { font-weight: 700; color: #0a246a; padding: 8px 4px 3px; border-bottom: 1px solid #9eb6e8; margin-bottom: 3px; font-size: 12px; }
.ex-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 4px; border: 0; background: none; text-align: left; flex-wrap: wrap; position: relative; }
.ex-item:active { background: #dbe7fb; }
.ex-item img { width: 32px; height: 32px; flex: none; }
.ex-thumb { object-fit: contain; background: #fff; border: 1px solid #aaa; width: 56px !important; height: 56px !important; }
.ex-name { flex: 1; min-width: 0; font-size: 13px; word-break: break-word; }
.ex-sub { width: 100%; padding-left: 40px; font-size: 11px; color: #666; margin-top: -4px; }
.ex-list.thumbs .ex-sub { padding-left: 64px; }
.ex-del { position: absolute; right: 6px; top: 8px; width: 24px; height: 24px; display: grid; place-items: center; font-size: 18px; color: #a00; }
.ex-empty { padding: 20px; color: #666; text-align: center; }
.pic-tasks { flex: none !important; display: flex; gap: 10px; align-items: center; padding: 6px 10px; background: linear-gradient(90deg, #7ba2e7, #6375d6); color: #fff; font-size: 12px; }
.pic-tasks a { color: #fff; }
.pic-grid { overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; padding: 8px; align-content: start; -webkit-overflow-scrolling: touch; }
.pic-cell { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 3px; }
.pic-frame { width: 96px; height: 96px; display: grid; place-items: center; border: 1px solid #d0d0bf; background: #fff; box-shadow: 1px 1px 0 #e6e6e6; }
.pic-frame img { max-width: 88px; max-height: 88px; }
.pic-cell span { font-size: 11px; word-break: break-all; text-align: center; }
.pic-cell.ghost { opacity: .55; }
.pic-cell:active .pic-frame { border-color: var(--sel); box-shadow: 0 0 0 2px #8fb0ea; }
.pv { display: flex; flex-direction: column; background: #fff; }
.pv-stage { flex: 1; position: relative; overflow: hidden; display: grid; place-items: center; background: #fff; touch-action: none; }
.pv-img { transition: transform .12s; transform-origin: center; image-rendering: auto; }
.pv-img.loading { opacity: .3; }
.pv-fit { max-width: 100%; max-height: 100%; }
.pv-actual { max-width: none; max-height: none; }
.pv-cap { flex: none; text-align: center; font-size: 11px; padding: 3px; color: #444; background: #f7f7f7; }
.pv-bar { flex: none; display: flex; justify-content: center; align-items: center; gap: 3px; padding: 6px 4px calc(6px); background: linear-gradient(#fdfdfd, #ece9d8); border-top: 1px solid #c8c6b8; flex-wrap: wrap; }
.slideshow .pv-stage { background: #000; }
.slideshow .pv-cap { display: none; }
.pv-sep { width: 1px; height: 22px; background: #c8c6b8; margin: 0 3px; }
.pv-b { width: 34px; height: 32px; border: 1px solid transparent; border-radius: 4px; background: none; position: relative; }
.pv-b:active { border-color: #9cb7e0; background: #e1ebfb; }
.pv-b::before, .pv-b::after { content: ''; position: absolute; }
.pv-b.prev::before, .pv-b.next::before { top: 6px; left: 7px; width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #d4f3d4, #44ad44 60%, #1f6f1f); }
.pv-b.prev::after { left: 12px; top: 11px; border: 5px solid transparent; border-right: 7px solid #fff; border-left: 0; }
.pv-b.next::after { left: 15px; top: 11px; border: 5px solid transparent; border-left: 7px solid #fff; border-right: 0; }
.pv-b.fit::before { left: 8px; top: 7px; width: 18px; height: 16px; border: 2px solid #2d5fb5; background: #c7dcfa; }
.pv-b.actual::before { left: 8px; top: 7px; width: 18px; height: 16px; border: 2px solid #2d5fb5; background: #fff; }
.pv-b.actual::after { content: '1:1'; left: 10px; top: 9px; font: 700 9px var(--ui); color: #2d5fb5; }
.pv-b.show::before { left: 7px; top: 7px; width: 20px; height: 16px; border-radius: 2px; background: #2d5fb5; }
.pv-b.show::after { left: 14px; top: 10px; border: 5px solid transparent; border-left: 8px solid #fff; border-right: 0; }
.pv-b.zin::before, .pv-b.zout::before { left: 7px; top: 5px; width: 15px; height: 15px; border: 2.5px solid #2d5fb5; border-radius: 50%; background: #e8f0fe; box-sizing: border-box; }
.pv-b.zin::after { content: '+'; left: 11px; top: 4px; font: 700 13px var(--ui); color: #2d5fb5; }
.pv-b.zout::after { content: '\2212'; left: 11px; top: 4px; font: 700 13px var(--ui); color: #2d5fb5; }
.pv-b.rotl::before, .pv-b.rotr::before { left: 9px; top: 8px; width: 16px; height: 16px; border: 3px solid #2d5fb5; border-radius: 50%; box-sizing: border-box; }
.pv-b.rotl::before { border-left-color: transparent; }
.pv-b.rotr::before { border-right-color: transparent; }
.pv-b.rotl::after { left: 6px; top: 12px; border: 4px solid transparent; border-top: 6px solid #2d5fb5; }
.pv-b.rotr::after { right: 6px; top: 12px; border: 4px solid transparent; border-top: 6px solid #2d5fb5; }

/* ============ Paint ============ */
.paint { display: flex; flex-direction: column; background: var(--face); }
.pt-top { flex: none; display: flex; flex-direction: column; gap: 3px; padding: 4px; border-bottom: 1px solid #c9c6b6; }
.pt-tools, .pt-sizes { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.pt-tool { width: 34px; height: 32px; border: 1px solid; border-color: #fff #808080 #808080 #fff; background: var(--face) center / 20px no-repeat; image-rendering: pixelated; }
.pt-tool.on { border-color: #808080 #fff #fff #808080; background-color: #fff; }
.t-pencil { background-image: url(../assets/icons/pt-pencil.png); } .t-brush { background-image: url(../assets/icons/pt-brush.png); }
.t-eraser { background-image: url(../assets/icons/pt-eraser.png); } .t-line { background-image: url(../assets/icons/pt-line.png); }
.t-rect { background-image: url(../assets/icons/pt-rect.png); } .t-ellipse { background-image: url(../assets/icons/pt-ellipse.png); }
.t-fill { background-image: url(../assets/icons/pt-fill.png); } .t-picker { background-image: url(../assets/icons/pt-picker.png); }
.t-undo { background-image: url(../assets/icons/pt-undo.png); } .t-redo { background-image: url(../assets/icons/pt-redo.png); }
.pt-vsep { width: 1px; height: 26px; background: #a8a595; margin: 0 4px; }
.pt-size { width: 34px; height: 26px; border: 1px solid #a8a595; background: #fff; display: grid; place-items: center; }
.pt-size i { display: block; background: #000; border-radius: 50%; }
.pt-size.on { background: #0a246a; } .pt-size.on i { background: #fff; }
.pt-size.shape::before { content: ''; width: 18px; height: 12px; border: 1.5px solid #000; }
.pt-size.shape.filled::before { background: #888; }
.pt-size.shape.on::before { border-color: #fff; }
.pt-wrap { flex: 1; overflow: auto; background: #808080; padding: 6px; -webkit-overflow-scrolling: touch; }
.pt-paper { position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 100%; margin: 0 auto; box-shadow: 2px 2px 0 #404040; }
.pt-paper canvas { position: absolute; inset: 0; width: 100%; height: 100%; background: transparent; }
.pt-canvas { background: #fff !important; }
.pt-overlay { touch-action: none; cursor: crosshair; }
.pt-bottom { flex: none; display: flex; align-items: center; gap: 6px; padding: 4px; border-top: 1px solid #fff; }
.pt-swatch { position: relative; width: 34px; height: 34px; flex: none; border: 1px solid; border-color: #808080 #fff #fff #808080; background: #fff; }
.pt-fg, .pt-bg { position: absolute; width: 16px; height: 16px; border: 1px solid; border-color: #808080 #fff #fff #808080; box-shadow: 0 0 0 1px #000 inset; }
.pt-fg { left: 4px; top: 4px; z-index: 1; } .pt-bg { right: 4px; bottom: 4px; }
.pt-pal { flex: 1; display: grid; grid-template-columns: repeat(14, 1fr); gap: 1px; }
.pt-color { aspect-ratio: 1; border: 1px solid; border-color: #808080 #fff #fff #808080; padding: 0; min-height: 16px; }
.pt-custom { width: 34px; height: 34px; border: 1px solid #808080; padding: 0; background: none; flex: none; }

/* ============ Notepad / CMD / Help / misc apps ============ */
.notepad { display: flex; }
.np-text { flex: 1; border: 0; resize: none; padding: 6px; font: 15px/1.35 'Lucida Console', 'Courier New', monospace; white-space: pre-wrap; outline: none; }
.cp { overflow-y: auto; padding: 6px; background: #000; color: #c0c0c0; font: 18px/1.15 VT323, 'Courier New', monospace; -webkit-overflow-scrolling: touch; }
.cp-l { white-space: pre-wrap; word-break: break-word; min-height: 1.15em; }
.cp-line { display: flex; flex-wrap: wrap; }
.cp-prompt { white-space: pre; }
.cp-in { flex: 1; min-width: 60px; border: 0; outline: none; background: transparent; color: inherit; font: inherit; padding: 0; caret-color: currentColor; font-size: 18px; }
.help { display: flex; flex-direction: column; background: #fff; }
.help-banner { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: #fff; font: 700 15px var(--ui); background: linear-gradient(90deg, #0a3fa8, #3a7fe0); }
.help-banner img { height: 34px; background: #fff; border-radius: 4px; padding: 2px; }
.help-body { overflow-y: auto; padding: 10px 12px 20px; -webkit-overflow-scrolling: touch; font-size: 13px; }
.help-body h2 { font-size: 16px; color: #0a246a; margin: 4px 0 6px; }
.help-body h3 { font-size: 13px; color: #fff; background: linear-gradient(90deg, #3a6fd5, transparent); padding: 4px 6px; margin: 14px 0 6px; }
.help-body p { margin: 6px 0; -webkit-user-select: text; user-select: text; }
.off-state { font-weight: 700; color: #a05a00; } .off-state.ok { color: #1a7a1a; }
.props { display: flex; flex-direction: column; padding: 8px; background: var(--face); overflow-y: auto; }
.xp-tabs { flex: none !important; display: flex; gap: 2px; }
.xp-tabh { padding: 5px 10px; border: 1px solid #919b9c; border-bottom: 0; border-radius: 3px 3px 0 0; background: linear-gradient(#fff, #ecebe5); font-size: 12px; }
.xp-tabh.on { border-top: 2px solid #f9a443; background: #fcfcfe; position: relative; top: 1px; }
.xp-tabbody { flex: 1; border: 1px solid #919b9c; background: #fcfcfe; padding: 8px; overflow-y: auto; }
.dp-monitor { width: 150px; height: 112px; margin: 4px auto 10px; padding: 9px 9px 18px; background: linear-gradient(#e6e3d4, #c9c5b0); border: 1px solid #77735f; border-radius: 6px; }
.dp-screen { width: 100%; height: 100%; border: 1px solid #222; background: #3a6ea5; image-rendering: pixelated; }
.dp-screen.ss { background: #000 url(../assets/img/alf.png) center / 34% no-repeat; image-rendering: pixelated; }
.xp-list { height: 150px; overflow-y: auto; border: 1px solid #7f9db9; background: #fff; }
.xp-li { display: flex; align-items: center; gap: 6px; padding: 5px; font-size: 12px; }
.xp-li img { width: 16px; height: 16px; }
.xp-li.sel { background: var(--sel); color: #fff; }
.xp-group { border: 1px solid #d0d0bf; border-radius: 4px; padding: 6px 10px 10px; margin: 0 0 10px; }
.xp-group legend { color: #0046d5; padding: 0 4px; }
.rg-opt { display: flex; align-items: center; gap: 6px; padding: 8px 0; font-size: 14px; }
.ie { display: flex; flex-direction: column; background: #fff; }
.ie-page { overflow-y: auto; padding: 14px; font-size: 13px; -webkit-user-select: text; user-select: text; }
.ie-head { display: flex; align-items: center; gap: 8px; } .ie-head h1 { font-size: 17px; margin: 0; }
.ie-page ul { padding-left: 18px; } .ie-page li { margin: 6px 0; }
.mail { display: flex; flex-direction: column; background: #fff; }
.ml-tabs { flex: none !important; margin-top: 4px; }
.compose { display: flex; flex-direction: column; background: #c0c0c0; padding: 6px; gap: 5px; }
.compose > * { flex: none; }
.cm-row { display: flex; align-items: center; gap: 6px; }
.cm-row label { width: 58px; font-size: 12px; }
.cm-to { background: #fff; }
.cm-tools { display: flex; align-items: center; gap: 8px; }
.cm-tools .xp-progress { flex: 1; margin: 0; }
.cm-body { flex: 1 !important; min-height: 120px; border: 2px solid; border-color: #808080 #fff #fff #808080; }
.ml-list { flex: none !important; border-bottom: 2px solid #d0cdbf; max-height: 40%; overflow-y: auto; }
.ml-row { display: grid; grid-template-columns: 20px 1fr; gap: 0 6px; width: 100%; padding: 6px; border: 0; border-bottom: 1px solid #eee; background: none; text-align: left; }
.ml-row img { width: 16px; grid-row: span 2; }
.ml-row.unread { font-weight: 700; }
.ml-row.sel { background: var(--sel); color: #fff; }
.ml-subj { font-size: 12px; opacity: .85; }
.ml-view { overflow-y: auto; padding: 10px; }
.ml-head { background: #f1efe2; border: 1px solid #d0cdbf; padding: 6px 8px; font-size: 12px; margin-bottom: 8px; }
.ml-body { white-space: pre-wrap; font-size: 13px; -webkit-user-select: text; user-select: text; }
.ml-alf { width: 90px; image-rendering: pixelated; margin-top: 10px; }

/* shutdown */
.sd-overlay { position: fixed; inset: 0; z-index: 9990; background: rgba(0,0,0,.35); backdrop-filter: grayscale(1); -webkit-backdrop-filter: grayscale(1); display: grid; place-items: center; }
.sd-box { width: min(330px, 92vw); border: 1px solid #001c6b; box-shadow: 0 4px 12px rgba(0,0,0,.6); }
.sd-top { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; color: #fff; font: 16px var(--ui); background: #0d36a7; }
.sd-top img { width: 30px; }
.sd-mid { display: flex; justify-content: space-around; padding: 22px 6px; background: linear-gradient(90deg, #5a7edc, #8ba5e6 50%, #5a7edc); border-top: 2px solid #8ea5e2; border-bottom: 2px solid #8ea5e2; }
.sd-b { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; color: #fff; font-size: 12px; width: 30%; }
.sd-b img { width: 34px; height: 34px; }
.sd-bot { display: flex; justify-content: flex-end; padding: 10px 12px; background: #0d36a7; }
.sd-screen { position: fixed; inset: 0; z-index: 9995; background: #5a7edc; display: grid; place-items: center; color: #fff; font-size: 16px; }
.sd-screen.black { background: #000; }
.sd-screen.safe { background: #000; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 30px; }
.sd-safe { color: #ff9a2e; font: 700 22px var(--ui); text-align: center; white-space: pre-wrap; }
.sd-tap { color: #666; font-size: 12px; }

/* screensaver */
.screensaver { position: fixed; inset: 0; z-index: 9999; background: #000; }
.screensaver canvas { width: 100%; height: 100%; display: block; }
.ss-hint { position: absolute; bottom: calc(14px + var(--safe-b)); width: 100%; text-align: center; color: #444; font-size: 11px; }

/* Alf buddy */
.alf-buddy { position: absolute; right: 8px; bottom: 6px; z-index: 8000; display: flex; flex-direction: column; align-items: flex-end; animation: alfIn .5s ease-out; }
@keyframes alfIn { from { transform: translateY(120%); } }
.alf-buddy.leaving { animation: alfOut .8s ease-in forwards; }
@keyframes alfOut { to { transform: translateX(140%); } }
.alf-bub { max-width: 230px; background: #ffffe1; border: 1px solid #000; border-radius: 10px; padding: 8px; font-size: 12px; margin-bottom: 8px; position: relative; box-shadow: 2px 2px 3px rgba(0,0,0,.3); }
.alf-bub::after { content: ''; position: absolute; right: 30px; bottom: -10px; border: 9px solid transparent; border-top-color: #ffffe1; border-bottom: 0; }
.alf-bub-btns { display: flex; gap: 6px; justify-content: flex-end; margin-top: 6px; }
.alf-pet { width: 76px; image-rendering: pixelated; filter: drop-shadow(2px 3px 0 rgba(0,0,0,.35)); }
.alf-pet.jump { animation: hop .45s; }
.alf-buddy.dancing .alf-pet { animation: dance .5s infinite alternate ease-in-out; }
@keyframes dance { from { transform: rotate(-8deg) translateY(0); } to { transform: rotate(8deg) translateY(-6px); } }

/* bigger screens: keep the phone proportions centred */
@media (min-width: 700px) and (min-height: 600px) {
  #screen { left: 50%; width: 430px; transform: translateX(-50%); border-left: 1px solid #222; border-right: 1px solid #222; }
}
