:root {
  --face: #c0c0c0; --hi: #fff; --lite: #dfdfdf; --shadow: #808080; --dark: #0a0a0a; --navy: #000080;
  --raised: inset -1px -1px var(--dark), inset 1px 1px var(--hi), inset -2px -2px var(--shadow), inset 2px 2px var(--lite);
  --sunken: inset -1px -1px var(--hi), inset 1px 1px var(--shadow), inset -2px -2px var(--lite), inset 2px 2px var(--dark);
  --pressed: inset -1px -1px var(--hi), inset 1px 1px var(--dark), inset -2px -2px var(--lite), inset 2px 2px var(--shadow);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { background: #008080; font: 11px "MS Sans Serif", "Microsoft Sans Serif", Tahoma, Geneva, sans-serif; color: #000; -webkit-font-smoothing: none; user-select: none; }
img.px, canvas { image-rendering: pixelated; }
button { font: inherit; color: #000; }

#desktop { position: fixed; inset: 8px 8px 38px 8px; display: grid; grid-template-columns: 1fr 250px; gap: 8px; }
#side { display: grid; grid-template-rows: auto 1fr; gap: 8px; min-height: 0; }

.win { background: var(--face); box-shadow: var(--raised), 2px 2px 0 #0004; padding: 3px; display: flex; flex-direction: column; min-height: 0; }
.title { background: linear-gradient(90deg, var(--navy), #1084d0); color: #fff; font-weight: bold; padding: 3px 4px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; flex: none; }
.tb { width: 18px; height: 16px; padding: 0; background: var(--face); box-shadow: var(--raised); border: 0; font-size: 10px; line-height: 1; cursor: pointer; }
.body { padding: 6px; flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
#view { overflow: auto; }

.field { background: #fff; box-shadow: var(--sunken); padding: 3px; }
.panel { box-shadow: var(--sunken); padding: 2px; }
.group { border: 1px solid var(--shadow); box-shadow: 1px 1px 0 var(--hi), inset 1px 1px 0 var(--hi); padding: 10px 6px 6px; position: relative; margin-top: 8px; }
.group > legend, .group > .lg { position: absolute; top: -7px; left: 6px; background: var(--face); padding: 0 3px; }
.btn { background: var(--face); box-shadow: var(--raised); border: 0; padding: 4px 10px; min-width: 60px; cursor: pointer; }
.btn:active:not(:disabled) { box-shadow: var(--pressed); padding: 5px 9px 3px 11px; }
.btn:disabled { color: var(--shadow); text-shadow: 1px 1px 0 var(--hi); cursor: default; }
.btn.small { padding: 2px 6px; min-width: 0; }
.tabs { display: flex; gap: 0; margin-bottom: -1px; position: relative; z-index: 1; flex: none; }
.tab { background: var(--face); border: 0; box-shadow: inset 1px 1px var(--hi), inset -1px 0 var(--dark), inset -2px 0 var(--shadow); padding: 3px 10px 2px; cursor: pointer; margin-top: 2px; }
.tab.on { margin-top: 0; padding-bottom: 4px; font-weight: normal; position: relative; }
.tabpane { box-shadow: var(--raised); padding: 8px; flex: 1; min-height: 0; overflow: auto; }
.hidden { display: none !important; }
.muted { color: #555; }
.good { color: #006000; } .bad { color: #b00000; }
.money { color: #000080; }
.row { display: flex; gap: 6px; align-items: center; }
.sp { flex: 1; }
h3 { font-size: 11px; margin: 0 0 4px; font-weight: bold; display: flex; align-items: center; gap: 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; }
.kv > :nth-child(even) { text-align: right; }

/* progress bars (segmented, Win98 style) */
.bar { height: 12px; box-shadow: var(--sunken); padding: 2px; background: #fff; }
.bar > i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--navy) 0 7px, transparent 7px 9px); }
.bar.green > i { background: repeating-linear-gradient(90deg, #00a000 0 7px, transparent 7px 9px); }
.bar.amber > i { background: repeating-linear-gradient(90deg, #d08000 0 7px, transparent 7px 9px); }

/* stats */
#statsBody { gap: 2px; }
.stat-h { display: flex; justify-content: space-between; align-items: center; font-weight: bold; border-bottom: 1px solid var(--shadow); box-shadow: 0 1px var(--hi); margin: 4px 0 3px; padding-bottom: 1px; }
.stat-b { padding-left: 8px; }
#log { flex: 1; overflow-y: auto; font-size: 11px; line-height: 1.35; }
#log .l-cafe { color: #6a3a00; } #log .l-good { color: #006000; } #log .l-bad { color: #a00000; }
#log b { color: #000080; font-weight: normal; }

/* dashboard */
.dash { display: grid; grid-template-columns: 1fr 230px; grid-template-rows: 1fr 150px; gap: 6px; height: 100%; min-height: 380px; }
.deskgrid { background: #f4f4ee repeating-linear-gradient(0deg, #e8e8e0 0 14px, #f4f4ee 14px 28px); box-shadow: var(--sunken); padding: 8px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; overflow: auto; }
.dicon { width: 62px; height: 62px; box-shadow: var(--raised); background: var(--face); display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; cursor: pointer; font-size: 10px; gap: 2px; }
.dicon.sel { box-shadow: var(--pressed); background: #d4d4ff; }
.dicon .badge { position: absolute; top: 2px; left: 3px; width: 6px; height: 6px; background: #0c0; box-shadow: 1px 1px #000; }
.dicon .badge.off { background: #888; } .dicon .badge.err { background: #f00; }
.dicon .tier { position: absolute; right: 1px; bottom: 1px; width: 0; height: 0; border-left: 8px solid transparent; }
.dicon .pop { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); background: #ffffe0; border: 1px solid #000; padding: 0 2px; font-size: 9px; white-space: nowrap; animation: pop 1.6s forwards; pointer-events: none; z-index: 2; }
.dicon .pop.burst { background: #ffe040; font-weight: bold; }
.dicon.add { color: #555; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 6px); } 15% { opacity: 1; transform: translate(-50%, 0); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -6px); } }
.deskinfo { display: flex; flex-direction: column; gap: 4px; overflow: auto; }
.titlebox { box-shadow: var(--sunken); background: var(--face); padding: 3px 6px; display: flex; gap: 6px; align-items: center; }
.parts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.pslot { aspect-ratio: 1; box-shadow: var(--raised); display: grid; place-items: center; position: relative; background: var(--face); }
.pslot::after { content: ''; position: absolute; right: 1px; bottom: 1px; border: 4px solid transparent; border-right-color: var(--c); border-bottom-color: var(--c); }
.netrow { grid-column: 1 / -1; display: grid; grid-template-columns: 70px 1fr 160px 120px; gap: 6px; }
.netload { box-shadow: var(--sunken); background: #000; padding: 4px; display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
.netload .leds { flex: 1; display: flex; flex-direction: column-reverse; gap: 1px; }
.netload .leds i { flex: 1; background: #063; } .netload .leds i.on { background: #0f0; } .netload .leds i.hot { background: #f40; }
.netload span { color: #0f0; text-align: center; font-family: monospace; }
canvas.graph { width: 100%; height: 100%; display: block; box-shadow: var(--sunken); background: #000; }
canvas.mini { width: 100%; height: 100%; display: block; box-shadow: var(--sunken); }
.lbl { font-size: 10px; color: #222; margin-bottom: 2px; }

/* store */
.store { display: grid; grid-template-columns: 160px 1fr 210px; gap: 6px; height: 100%; min-height: 380px; }
.tree { overflow: auto; }
.tree .cat { font-weight: bold; margin-top: 4px; display: flex; gap: 3px; align-items: center; }
.tree .leaf { padding: 1px 4px 1px 18px; cursor: pointer; display: flex; gap: 4px; align-items: center; }
.tree .leaf.on { background: var(--navy); color: #fff; }
.cards { overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px; align-content: start; padding: 4px; }
.card { box-shadow: var(--raised); background: var(--face); padding: 4px; display: grid; grid-template-columns: 28px 1fr; gap: 2px 5px; cursor: pointer; position: relative; font-size: 10px; }
.card img { grid-row: span 3; align-self: center; }
.card .nm { font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.sel { box-shadow: var(--pressed); background: #d4d4ff; }
.card.owned { background: #c8e4c8; }
.card.locked { opacity: .55; cursor: default; }
.card.poor .pr { color: #a00; }
.card::after { content: ''; position: absolute; right: 1px; bottom: 1px; border: 4px solid transparent; border-right-color: var(--c); border-bottom-color: var(--c); }
.card .tr { position: absolute; left: 1px; top: 1px; width: 0; height: 0; border: 4px solid transparent; border-left-color: #0a0; border-top-color: #0a0; }
.mini-bar { height: 6px; background: #fff; box-shadow: inset 1px 1px var(--shadow); padding: 1px; }
.mini-bar i { display: block; height: 100%; background: repeating-linear-gradient(90deg, #1060d0 0 4px, transparent 4px 5px); }
.selpanel { display: flex; flex-direction: column; gap: 6px; overflow: auto; }

/* lists */
.list { display: flex; flex-direction: column; gap: 4px; }
.item { box-shadow: var(--raised); background: var(--face); padding: 6px; display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; }
.item.done { background: #c8e4c8; }
.item.lock { opacity: .55; }
.item .d { color: #333; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px; }

/* taskbar */
#taskbar { position: fixed; left: 0; right: 0; bottom: 0; height: 32px; background: var(--face); box-shadow: inset 0 1px var(--lite), inset 0 2px var(--hi); display: flex; gap: 4px; padding: 4px 3px 2px; align-items: stretch; z-index: 5; }
.startbtn { display: flex; align-items: center; gap: 3px; padding: 0 6px; background: var(--face); box-shadow: var(--raised); border: 0; cursor: pointer; }
.startbtn.on { box-shadow: var(--pressed); }
#tasks { display: flex; gap: 3px; flex: 1; overflow: hidden; }
.task { display: flex; align-items: center; gap: 4px; padding: 0 6px; width: 118px; background: var(--face); box-shadow: var(--raised); border: 0; cursor: pointer; text-align: left; white-space: nowrap; overflow: hidden; }
.task.on { box-shadow: var(--pressed); background: repeating-conic-gradient(#fff 0 25%, var(--face) 0 50%) 0 0 / 2px 2px; font-weight: bold; }
.task.locked { color: var(--shadow); cursor: default; }
.tray { display: flex; align-items: center; gap: 6px; padding: 0 8px; background: var(--face); }
#trayIcons { display: flex; gap: 2px; }

#startMenu { position: fixed; left: 2px; bottom: 32px; width: 200px; padding: 2px 2px 2px 26px; z-index: 10; }
#startMenu::before { content: 'NetCafe 98'; position: absolute; left: 3px; top: 3px; bottom: 3px; width: 21px; background: linear-gradient(0deg, var(--navy), #1084d0); color: #c0c0c0; font-weight: bold; font-size: 15px; writing-mode: vertical-rl; transform: rotate(180deg); padding: 6px 0; }
.mi { display: flex; gap: 8px; align-items: center; padding: 5px 6px; cursor: pointer; }
.mi:hover { background: var(--navy); color: #fff; }
.msep { border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--hi); margin: 2px 0; }

#tip { position: fixed; z-index: 20; background: #ffffe1; border: 1px solid #000; padding: 4px 6px; max-width: 260px; pointer-events: none; box-shadow: 2px 2px 0 #0003; }
#tip .th { background: #000; color: #fff; margin: -4px -6px 4px; padding: 2px 6px; font-weight: bold; }
#modal { position: fixed; inset: 0; display: grid; place-items: center; z-index: 30; background: #0003; }
#modal .win { width: min(420px, 92vw); }
#modal textarea { width: 100%; height: 90px; font: 10px monospace; }

/* defrag */
.defrag-grid { display: grid; grid-template-columns: repeat(40, 1fr); gap: 1px; background: #fff; box-shadow: var(--sunken); padding: 4px; }
.defrag-grid i { aspect-ratio: 1; background: #fff; border: 1px solid #ccc; }
.defrag-grid i.a { background: #0000c0; border-color: #000060; }
.defrag-grid i.b { background: #00c0c0; border-color: #006060; }
.defrag-grid i.c { background: #c00000; border-color: #600000; }
.defrag-grid i.d { background: #ffff00; border-color: #808000; }

.bsod { position: fixed; inset: 0; background: #0000aa; color: #fff; font: 16px monospace; z-index: 40; display: grid; place-items: center; text-align: center; }
.bsod span { background: #aaa; color: #00a; padding: 0 6px; }

@media (max-width: 900px) {
  #desktop { grid-template-columns: 1fr; overflow: auto; }
  #side { grid-template-rows: auto 220px; }
  .dash, .store { grid-template-columns: 1fr; grid-template-rows: auto; }
  .netrow { grid-template-columns: 1fr 1fr; }
}

/* ================= v0.2 graphics overhaul ================= */
@font-face { font-family: "Pixelated MS Sans Serif"; src: url(../fonts/ms_sans_serif.woff2) format("woff2"); font-weight: normal; }
@font-face { font-family: "Pixelated MS Sans Serif"; src: url(../fonts/ms_sans_serif_bold.woff2) format("woff2"); font-weight: bold; }
body, button, input, textarea { font-family: "Pixelated MS Sans Serif", "MS Sans Serif", Tahoma, sans-serif; font-size: 11px; }
body { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='19' shape-rendering='crispEdges'%3E%3Cpath d='M.5.5v15l3.5-3.5 2.5 6 2-1-2.5-5.5h5z' fill='%23fff' stroke='%23000'/%3E%3C/svg%3E") 0 0, default; }
img.ic { image-rendering: auto; vertical-align: middle; }
img.px { vertical-align: middle; }

/* title bars */
.title { padding: 2px 2px 2px 3px; height: 18px; font-size: 11px; }
.title .tt { display: flex; align-items: center; gap: 3px; overflow: hidden; white-space: nowrap; }
.tbtns { display: flex; gap: 0; }
.tb { width: 16px; height: 14px; position: relative; color: #000; font-weight: bold; }
.tb:active { box-shadow: var(--pressed); }
.tb-x { margin-left: 2px; }
.tb-min::after { content: ''; position: absolute; left: 4px; bottom: 3px; width: 6px; height: 2px; background: #000; }
.tb-max::after { content: ''; position: absolute; left: 3px; top: 2px; width: 7px; height: 6px; border: 1px solid #000; border-top-width: 2px; }
.tb-x::before, .tb-x::after { content: ''; position: absolute; left: 3px; top: 6px; width: 9px; height: 2px; background: #000; transform: rotate(45deg); }
.tb-x::after { transform: rotate(-45deg); }
#muteBtn { margin-right: 2px; font-size: 9px; }
#side .title { background: linear-gradient(90deg, #808080, #b5b5b5); color: #d4d0c8; }

/* Win98 scrollbars */
::-webkit-scrollbar { width: 16px; height: 16px; }
::-webkit-scrollbar-track { background: repeating-conic-gradient(#c0c0c0 0 25%, #fff 0 50%) 0 0 / 2px 2px; }
::-webkit-scrollbar-thumb { background: var(--face); box-shadow: var(--raised); }
::-webkit-scrollbar-corner { background: var(--face); }
::-webkit-scrollbar-button:single-button { display: block; height: 16px; width: 16px; background-color: var(--face); box-shadow: var(--raised); background-repeat: no-repeat; background-position: center; }
::-webkit-scrollbar-button:single-button:vertical:decrement { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='4' shape-rendering='crispEdges'%3E%3Cpath d='M3 0h1v1h1v1h1v1h1v1H0V3h1V2h1V1h1z'/%3E%3C/svg%3E"); }
::-webkit-scrollbar-button:single-button:vertical:increment { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='4' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h7v1H6v1H5v1H4v1H3V3H2V2H1V1H0z'/%3E%3C/svg%3E"); }
::-webkit-scrollbar-button:single-button:horizontal:decrement { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='7' shape-rendering='crispEdges'%3E%3Cpath d='M3 0h1v7H3V6H2V5H1V4H0V3h1V2h1V1h1z'/%3E%3C/svg%3E"); }
::-webkit-scrollbar-button:single-button:horizontal:increment { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='7' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h1v1h1v1h1v1h1v1H3v1H2v1H1v1H0z'/%3E%3C/svg%3E"); }
::-webkit-scrollbar-button:active { box-shadow: var(--pressed); }

/* desk "desktop icons" in the dashboard list view */
.deskgrid { background: #fff; gap: 2px 4px; padding: 6px; }
.dicon { width: 74px; height: 66px; box-shadow: none; background: transparent; justify-content: flex-start; padding-top: 3px; }
.dicon > span:not(.badge):not(.tier):not(.pop) { padding: 1px 3px; border: 1px dotted transparent; }
.dicon.sel { box-shadow: none; background: transparent; }
.dicon.sel > span:not(.badge):not(.tier):not(.pop) { background: var(--navy); color: #fff; border-color: #ff0; }
.dicon.sel img { filter: sepia(1) hue-rotate(190deg) saturate(3) brightness(.75); }
.dicon .badge { left: 16px; top: 4px; border-radius: 0; }
.dicon .tier { right: 16px; bottom: 22px; }
.dicon .occ { position: absolute; top: 3px; right: 15px; }
.dicon.add { opacity: .75; }
.dicon .pop { top: -2px; z-index: 3; }

/* store cards */
.card { grid-template-columns: 34px 1fr; min-height: 44px; }
.card img { width: 32px; height: 32px; }
.item { grid-template-columns: 40px 1fr auto; }
.cards { background: #fff; }

/* cafe view stage */
#bigCafe { image-rendering: pixelated; box-shadow: 0 0 0 1px #000, 4px 4px 0 #0006; }
.stage { flex: 1; overflow: auto; display: flex; justify-content: center; align-items: flex-start; background: #404050 repeating-linear-gradient(45deg, #3a3a4a 0 6px, #404050 6px 12px); box-shadow: var(--sunken); padding: 6px; }

/* taskbar */
#taskbar { height: 30px; padding: 3px 2px 2px; }
.startbtn { font-weight: bold; padding: 0 5px 0 3px; gap: 4px; }
.task { width: 140px; }
.tray { box-shadow: inset -1px -1px var(--hi), inset 1px 1px var(--shadow); padding: 0 6px; }
#startMenu .mi img { width: 24px; height: 24px; }

/* boot screen */
#boot { position: fixed; inset: 0; z-index: 100; background: linear-gradient(#1a6ad8, #7ab4ff 70%, #c8e0ff); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; overflow: hidden; }
#boot::before, #boot::after { content: ''; position: absolute; inset: -20%; background:
  radial-gradient(ellipse 18% 8% at 20% 30%, #fff9 0 60%, transparent 62%), radial-gradient(ellipse 12% 6% at 75% 22%, #fff8 0 60%, transparent 62%),
  radial-gradient(ellipse 22% 9% at 60% 70%, #fff7 0 60%, transparent 62%), radial-gradient(ellipse 15% 7% at 30% 80%, #fff8 0 60%, transparent 62%);
  animation: clouds 40s linear infinite; }
#boot::after { animation-duration: 70s; opacity: .6; transform: scale(1.4); }
@keyframes clouds { from { translate: -10% 0; } to { translate: 10% 0; } }
.boot-logo { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; color: #fff; text-shadow: 2px 2px 0 #0008; }
.boot-logo canvas { width: 96px; height: 96px; image-rendering: pixelated; filter: drop-shadow(3px 3px 0 #0006); }
.boot-ms { font-size: 18px; font-style: italic; }
.boot-name { font: bold italic 54px/1 Arial, sans-serif; letter-spacing: -1px; }
.boot-name span { font-size: 30px; color: #ffe060; margin-left: 4px; vertical-align: top; }
#bootMsg { position: relative; z-index: 1; margin-top: 30px; color: #fff; font-size: 13px; text-shadow: 1px 1px 0 #000; min-height: 16px; }
.boot-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; z-index: 1; background: linear-gradient(90deg, #000080, #1084d0, #fff, #ffe060, #f04020, #000080) 0 0 / 50% 100%; animation: bootbar 1.2s linear infinite; }
@keyframes bootbar { to { background-position: 100% 0; } }
#boot.out { animation: bootout .35s forwards; }
@keyframes bootout { to { opacity: 0; visibility: hidden; } }

/* v0.3 gameplay UI */
.dicon .ask { position: absolute; top: 0; right: 14px; background: #ffffe1; border: 1px solid #000; font-weight: bold; padding: 0 3px; color: #c00000; animation: askbob .6s steps(2) infinite; z-index: 2; }
@keyframes askbob { 50% { transform: translateY(-2px); } }
.helpbox { display: flex; gap: 6px; align-items: center; background: #ffffe1; border: 1px solid #000; padding: 4px 6px; }
.helpbox span { flex: 1; font-style: italic; }
.sale { color: #fff; background: #c00000; padding: 0 2px; }
#log .l-help { color: #a06000; font-weight: bold; }
#toast { position: fixed; right: 6px; bottom: 36px; z-index: 50; width: 250px; background: #ffffe1; border: 1px solid #000; padding: 5px 7px 7px; box-shadow: 2px 2px 0 #0004; display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
#toast::after { content: ''; position: absolute; right: 40px; bottom: -9px; border: 8px solid transparent; border-top-color: #000; border-bottom: 0; }
#toast .tx { font-weight: bold; }
.evbox { width: min(440px, 92vw) !important; }
#bigCafe { cursor: pointer; }

/* v0.4 */
.task { flex: 0 1 132px; width: auto; min-width: 34px; }
.bgrp { font-weight: bold; margin: 3px 0 1px; }
.buddy { display: flex; gap: 4px; align-items: center; padding: 1px 2px 1px 8px; }
.buddy:hover { background: var(--navy); color: #fff; }
#mineBox { background: var(--face); box-shadow: var(--raised); padding: 6px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.mhead { box-shadow: var(--sunken); padding: 4px 6px; display: flex; justify-content: space-between; align-items: center; align-self: stretch; }
.seg { background: #000; color: #f00; font: bold 20px/1 "Courier New", monospace; padding: 1px 2px; letter-spacing: 1px; }
.mface { width: 30px; height: 30px; padding: 0; background: var(--face); box-shadow: var(--raised); border: 0; display: grid; place-items: center; cursor: pointer; }
.mface:active { box-shadow: var(--pressed); }
.mgrid { display: grid; grid-template-columns: repeat(9, 18px); box-shadow: var(--sunken); padding: 3px; }
.mc { width: 18px; height: 18px; padding: 0; border: 0; background: var(--face); box-shadow: var(--raised); font-weight: bold; font-size: 12px; cursor: pointer; display: grid; place-items: center; }
.mc.o { box-shadow: none; border: 1px solid #808080; border-width: 1px 0 0 1px; cursor: default; }
.cafe-tools { margin-top: 4px; flex: none; }
.stage.zoomed { justify-content: flex-start; }
#hud { display: none; }
html, body { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* ================= phones / small tablets ================= */
@media (max-width: 760px) {
  body { font-size: 13px; }
  body, button, input, textarea { font-size: 13px; }
  #hud { display: flex; position: fixed; top: 0; left: 0; right: 0; height: 40px; z-index: 6; align-items: center; gap: 10px; padding: 0 8px; padding-top: env(safe-area-inset-top);
    background: var(--face); box-shadow: inset 0 -1px var(--shadow), 0 1px 0 #000; }
  #hud #hudCash { color: var(--navy); font-size: 15px; }
  #hud #hudInc { color: #006000; }
  #hud #hudSide { margin-left: auto; }
  #desktop { inset: 42px 0 calc(50px + env(safe-area-inset-bottom)) 0; display: block; }
  #main { height: 100%; box-shadow: none; padding: 0; }
  #main > .title .tb-min, #main > .title .tb-max, #main > .title .tb-x { display: none; }
  #view { padding: 4px; }
  #side { display: none; position: fixed; z-index: 20; inset: 42px 0 calc(50px + env(safe-area-inset-bottom)) 0; grid-template-rows: auto 1fr; gap: 4px; padding: 4px; background: #008080; }
  body.side-open #side { display: grid; }
  .side-close { width: 22px !important; height: 20px !important; }
  .side-close::before, .side-close::after { left: 5px !important; top: 9px !important; }

  /* taskbar: icon strip */
  #taskbar { height: calc(50px + env(safe-area-inset-bottom)); padding: 4px 3px calc(3px + env(safe-area-inset-bottom)); }
  .startbtn b { display: none; }
  .startbtn { padding: 0 8px; }
  .startbtn img { width: 22px; height: 22px; }
  #tasks { overflow-x: auto; scrollbar-width: none; }
  #tasks::-webkit-scrollbar { display: none; }
  .task { flex: 0 0 auto; width: auto; min-width: 46px; padding: 0 8px; font-size: 0; justify-content: center; gap: 0; }
  .task img { width: 22px; height: 22px; }
  .task.on { font-size: 12px; gap: 5px; }
  .tray { padding: 0 4px; font-size: 11px; }
  #trayIcons { display: none; }
  #startMenu { bottom: calc(50px + env(safe-area-inset-bottom)); width: 240px; }
  #startMenu .mi { padding: 10px 8px; }

  /* touch targets */
  .btn { min-height: 34px; padding: 6px 12px; }
  .btn.small { min-height: 30px; padding: 4px 10px; }
  .tab { padding: 6px 12px 5px; }
  .tb { width: 22px; height: 20px; }

  /* dashboard */
  .dash { display: flex; flex-direction: column; gap: 6px; min-height: 0; height: auto; }
  .deskgrid { min-height: 0; max-height: 46vh; }
  .dicon { width: 70px; height: 70px; }
  .netrow { display: grid; grid-template-columns: 64px 1fr; gap: 6px; }
  .netrow > :nth-child(1) .netload { height: 110px !important; }
  .netrow > :nth-child(2) canvas { height: 110px; }
  .netrow > :nth-child(3) { grid-column: 1 / -1; }
  .netrow > :nth-child(4) { grid-column: 1 / -1; height: 160px; }

  /* store: chip strip, cards, then the details panel */
  .tabpane { padding: 5px; }
  .store { display: flex; flex-direction: column; gap: 6px; min-height: 0; height: auto; }
  .tree { display: flex; gap: 4px; overflow-x: auto; padding: 4px; flex: none; }
  .tree .cat { display: none; }
  .tree .leaf { padding: 6px 10px; white-space: nowrap; border: 1px solid var(--shadow); flex: none; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); max-height: 50vh; }
  .selpanel { overflow: visible; }
  .item { grid-template-columns: 36px 1fr; }
  .item > .btn, .item > span:last-child { grid-column: 1 / -1; justify-self: stretch; }
  .grid2 { grid-template-columns: 1fr; }
  .kv { gap: 3px 8px; }

  /* cafe */
  .stage { padding: 2px; }
  .cafe-tools { flex-wrap: wrap; }
  #toast { left: 6px; right: 6px; width: auto; bottom: calc(56px + env(safe-area-inset-bottom)); }
  #toast::after { display: none; }
  #modal .win { width: 94vw !important; }
  .mgrid { grid-template-columns: repeat(9, 32px); }
  .mc { width: 32px; height: 32px; font-size: 16px; }
  .boot-name { font-size: 38px; }
  .boot-logo canvas { width: 64px; height: 64px; }
  .bsod { font-size: 12px; padding: 12px; }
}
@media (max-width: 760px) {
  .dash > * { flex: none; }
  .deskinfo { overflow: visible; }
  .deskgrid { max-height: 34vh; min-height: 90px; }
  .stage { flex: none; }
  .cafe-tools { padding: 4px 2px; }
}
.parts { max-width: 420px; }

/* v0.5 */
.old { color: #fff; background: #208020; padding: 0 2px; }
.dicon .ask.food { color: #006000; }
.tbadge { position: absolute; top: 2px; right: 3px; width: 7px; height: 7px; background: #e00000; border: 1px solid #fff; border-radius: 50%; }
.task { position: relative; }
.item.stock { grid-template-columns: 120px 1fr auto; }
.spark { box-shadow: var(--sunken); width: 120px; height: 34px; }
.trade { gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
table.days { width: 100%; border-collapse: collapse; background: #fff; box-shadow: var(--sunken); }
table.days th { background: var(--face); box-shadow: var(--raised); text-align: left; padding: 2px 6px; font-weight: normal; }
table.days td { padding: 1px 6px; border-bottom: 1px solid #eee; }
#spinamp { position: fixed; left: 12px; bottom: 44px; z-index: 15; width: 275px; background: linear-gradient(#3a3a5a, #22223a); border: 1px solid #000; box-shadow: inset 1px 1px #7070a0, 3px 3px 0 #0006; color: #c0c0e0; font-size: 10px; user-select: none; }
.sa-title { background: linear-gradient(90deg, #c8a040, #f0e0a0, #c8a040); color: #202020; font-weight: bold; letter-spacing: 3px; text-align: center; padding: 1px 4px; display: flex; justify-content: space-between; cursor: move; touch-action: none; }
.sa-x { background: #c0c0c0; border: 1px solid #000; width: 14px; height: 12px; padding: 0; line-height: 9px; font-size: 10px; cursor: pointer; }
.sa-body { padding: 5px; display: flex; flex-direction: column; gap: 5px; }
.sa-lcd { background: #000; border: 1px solid #555; box-shadow: inset 1px 1px #000; display: flex; gap: 6px; padding: 4px; }
.sa-info { flex: 1; min-width: 0; color: #00e000; font-family: "Courier New", monospace; }
.sa-time { font-size: 18px; font-weight: bold; }
.sa-marquee { overflow: hidden; white-space: nowrap; }
.sa-marquee span { display: inline-block; padding-left: 100%; animation: marq 12s linear infinite; }
@keyframes marq { to { transform: translateX(-100%); } }
.sa-ctrl { display: flex; gap: 3px; align-items: center; }
.sa-ctrl button { background: linear-gradient(#d0d0e0, #8080a0); border: 1px solid #000; width: 26px; height: 18px; font-size: 10px; padding: 0; cursor: pointer; color: #000; }
.sa-ctrl button:active { background: linear-gradient(#8080a0, #d0d0e0); }
.sa-ctrl input { flex: 1; accent-color: #e0c040; }
.sa-note { color: #9090c0; font-size: 9px; }
@media (max-width: 760px) {
  #spinamp { left: 6px; right: 6px; width: auto; bottom: calc(56px + env(safe-area-inset-bottom)); }
  .sa-ctrl button { width: 40px; height: 30px; font-size: 14px; }
  .item.stock { grid-template-columns: 1fr; }
  .spark { width: 100%; }
  #trayIcons { display: flex; }
}
.btn.paint { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 96px; line-height: 1.2; }
.btn.paint i { display: block; width: 40px; height: 22px; border: 1px solid #000; }
.btn.paint.on { box-shadow: var(--pressed); background: #d4d4ff; }

/* ---------- v1.0 polish: shell, juice, tips ---------- */
#modal { z-index: 120; }
#boot.menu { cursor: default; }
.title-menu { position: relative; width: 300px; margin: 0 auto; color: #000; text-shadow: none; text-align: left; animation: winopen .18s ease-out; }
.title-menu .body { display: flex; flex-direction: column; gap: 6px; padding: 10px; }
.title-menu .row { gap: 6px; } .title-menu .row .btn { flex: 1; }
.btn.big { display: flex; flex-direction: column; align-items: flex-start; padding: 6px 10px; font-size: 13px; text-align: left; }
.btn.big span { font-size: 10px; color: #404040; font-weight: normal; }
.title-ver { margin-top: 10px; font-size: 11px; opacity: .85; }
.pause-menu { display: flex; flex-direction: column; gap: 6px; } .pause-menu .btn.big { align-items: center; }
body.paused #desktop, body.paused #taskbar { filter: grayscale(.6) brightness(.9); }
@keyframes winopen { from { transform: scale(.92); opacity: .4; } to { transform: none; opacity: 1; } }
#modal:not(.hidden) > .win { animation: winopen .14s ease-out; }
#view.enter { animation: viewin .16s ease-out; }
@keyframes viewin { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: none; } }
#toast:not(.hidden) { animation: toastin .2s ease-out; }
@keyframes toastin { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.cashval { transition: color .3s; } .cashval.spent { animation: spent .5s; }
@keyframes spent { 0% { color: #d00000; } 100% { color: inherit; } }
.shake { animation: shake .35s; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translate(-3px, 1px); } 40% { transform: translate(3px, -1px); } 60% { transform: translate(-2px, 0); } 80% { transform: translate(2px, 1px); } }
.flash { position: fixed; inset: 0; z-index: 90; background: #fff; pointer-events: none; animation: flash .45s forwards; }
@keyframes flash { from { opacity: .45; } to { opacity: 0; } }
/* options */
.opts { display: flex; flex-direction: column; gap: 6px; }
.orow { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 8px; margin: 2px 0; }
.ochk { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; }
kbd { display: inline-block; min-width: 14px; padding: 0 3px; background: var(--face); box-shadow: var(--raised); font: inherit; font-size: 10px; text-align: center; }
/* about + credits */
.about-banner { display: flex; align-items: center; gap: 10px; padding: 10px; background: linear-gradient(90deg, #000080, #1084d0); color: #fff; }
.about-banner canvas { width: 48px; height: 48px; image-rendering: pixelated; }
.about-banner span { display: block; font-size: 11px; font-style: italic; } .about-banner b { font: bold italic 26px/1 Arial, sans-serif; } .about-banner i { font-size: 14px; color: #ffe060; vertical-align: top; }
.about-body { padding: 8px 4px; line-height: 1.45; } .about-body hr { border: 0; border-top: 1px solid var(--shadow); border-bottom: 1px solid var(--lite); margin: 6px 0; }
.credits { display: flex; flex-direction: column; gap: 6px; line-height: 1.4; }
/* tutorial balloon */
.tutor { position: fixed; z-index: 60; width: 260px; background: #ffffe1; border: 1px solid #000; padding: 5px 7px 7px; box-shadow: 2px 2px 0 #0004; display: flex; flex-direction: column; gap: 5px; line-height: 1.4; animation: toastin .2s ease-out; }
.tutor::after { content: ''; position: absolute; left: calc(var(--ax, 50%) - 8px); bottom: -9px; border: 8px solid transparent; border-top-color: #000; border-bottom: 0; }
.tutor.below::after { bottom: auto; top: -9px; border: 8px solid transparent; border-bottom-color: #000; border-top: 0; }
.tutor .tb { width: 16px; height: 14px; line-height: 10px; padding: 0; }
.tut-glow { outline: 2px dashed #c00000; outline-offset: 1px; animation: tutglow 1s steps(2) infinite; }
@keyframes tutglow { 50% { outline-color: #ffe000; } }
/* achievement popup */
.achv { position: fixed; right: 8px; bottom: 40px; z-index: 55; display: flex; gap: 8px; align-items: center; width: 250px; padding: 6px 8px; background: var(--face); box-shadow: var(--raised), 3px 3px 0 #0005; border-left: 4px solid #e0a000; animation: achin .3s ease-out; }
.achv.out { animation: achout .4s forwards; }
.achv-ic { padding: 2px; background: #000080; box-shadow: inset 1px 1px #0008; }
.achv-h { font-size: 10px; color: #806000; text-transform: uppercase; letter-spacing: .5px; }
.achv-r { color: #006000; font-weight: bold; }
@keyframes achin { from { transform: translateX(120%); } to { transform: none; } }
@keyframes achout { to { transform: translateX(120%); opacity: 0; } }
@media (max-width: 760px) { .achv { left: 6px; right: 6px; width: auto; bottom: auto; top: calc(46px + env(safe-area-inset-top)); } .tutor { width: min(260px, 92vw); } }
@media (prefers-reduced-motion: reduce) { #modal:not(.hidden) > .win, #view.enter, .achv, .tutor, #toast:not(.hidden) { animation: none; } }
.keys > span:nth-child(odd) { white-space: nowrap; display: flex; gap: 2px; align-items: center; }
input[type=range] { -webkit-appearance: none; appearance: none; background: transparent; height: 20px; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; background: #fff; box-shadow: var(--sunken); }
input[type=range]::-moz-range-track { height: 4px; background: #fff; box-shadow: var(--sunken); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 20px; margin-top: -8px; background: var(--face); box-shadow: var(--raised); border: 0; }
input[type=range]::-moz-range-thumb { width: 11px; height: 20px; background: var(--face); box-shadow: var(--raised); border: 0; border-radius: 0; }
.stage:not(.zoomed) { align-items: center; }
.tutor.noarrow::after { display: none; }
.keyup { color: #a06000; font-size: 10px; }
.item.rec { box-shadow: inset 0 0 0 2px #e0a000; background: #fff8d8; }
.donegrp { margin-top: 8px; } .donegrp summary { cursor: pointer; padding: 3px 0; font-weight: bold; } .donegrp .list { margin-top: 4px; }
