/* MdOS — the chrome. Everything pixel is drawn in js/pixel.js; this is the furniture. */
:root {
  --ui: Tahoma, Verdana, 'Segoe UI', 'DejaVu Sans', sans-serif;
  --mono: 'Lucida Console', Monaco, 'Courier New', monospace;
  --face: #ece9d8;
  --face-dark: #d4d0c8;
  --face-light: #fff;
  --shadow: #808080;
  --shadow-dark: #404040;
  --ink: #000;
  --title-a: #0a2a8a;
  --title-b: #3d7bd9;
  --title-inactive-a: #6b7a99;
  --title-inactive-b: #9aa8c4;
  --hi: #316ac5;
  --link: #0000ee;
  --taskbar-a: #245edb;
  --taskbar-b: #1941a5;
  --start-a: #3c9d3c;
  --start-b: #2a7f2a;
  --desk: #0b1a3a;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: var(--desk);
  color: var(--ink);
  font: 11px/1.35 var(--ui);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
a { color: var(--link); }
button { font: inherit; color: inherit; }
svg.px { display: block; image-rendering: pixelated; }
canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
[hidden] { display: none !important; }

.noscript { padding: 2rem; color: #fff; font-size: 14px; }
.noscript a { color: #8ed6ff; }

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0; z-index: 900;
  background: #000; color: #c8c8c8;
  font: 13px/1.5 var(--mono);
  cursor: pointer;
}
.bios { margin: 0; padding: 18px 22px; white-space: pre-wrap; }
.bios .ok { color: #7cff7c; }
.bios .warn { color: #ffd23f; }
.bios .cur { display: inline-block; width: 8px; height: 13px; background: #c8c8c8; vertical-align: -2px; animation: blink 1s steps(1) infinite; }
.splash {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  background: #000;
}
.splash-bar { width: 154px; height: 14px; border: 1px solid #5a6a8a; border-radius: 3px; padding: 2px; overflow: hidden; }
.splash-bar i { display: block; width: 36px; height: 100%; background: linear-gradient(90deg, #2f63d6, #79a6ff 45%, #2f63d6); border-radius: 2px; animation: slide 1.1s linear infinite; }
.splash-note { color: #6f7f9f; font: 11px var(--ui); letter-spacing: .08em; }
@keyframes slide { from { transform: translateX(-40px); } to { transform: translateX(160px); } }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- desktop ---------- */
.desktop { position: fixed; inset: 0 0 30px 0; overflow: hidden; }
.room { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.icons {
  position: absolute; top: 8px; left: 6px; bottom: 8px;
  display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-start; gap: 4px 2px;
  pointer-events: none;
}
.icon {
  pointer-events: auto;
  width: 74px; padding: 4px 2px 3px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: transparent; border: 1px solid transparent; cursor: pointer;
}
.icon .lbl {
  color: #fff; text-align: center; line-height: 1.2; padding: 0 2px;
  text-shadow: 1px 1px 0 #000, 0 0 3px rgba(0,0,0,.9);
}
.icon.sel .lbl { background: var(--hi); text-shadow: none; }
.icon:focus-visible { border-color: rgba(255,255,255,.6); outline: none; }
.icon .ico { filter: drop-shadow(1px 1px 0 rgba(0,0,0,.55)); }
.icon.sel .ico { opacity: .75; }

/* ---------- windows ---------- */
.windows { position: absolute; inset: 0; pointer-events: none; }
.win {
  position: absolute;
  pointer-events: auto;
  display: flex; flex-direction: column;
  min-width: 160px;
  background: var(--face);
  border: 1px solid #0a2a8a;
  border-radius: 6px 6px 0 0;
  box-shadow: 2px 2px 0 rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.35);
  overflow: hidden;
}
.win.minimized { display: none; }
.win.opening { animation: pop .16s ease-out; }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
.tb {
  display: flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 4px 0 6px;
  background: linear-gradient(180deg, var(--title-b), var(--title-a));
  color: #fff; font-weight: 700; font-size: 12px;
  text-shadow: 1px 1px 0 rgba(0,0,0,.5);
  cursor: default; touch-action: none;
}
.win.inactive .tb { background: linear-gradient(180deg, var(--title-inactive-b), var(--title-inactive-a)); }
.tb-title { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tb-btns { display: flex; gap: 2px; }
.tb-btns button {
  width: 21px; height: 21px; padding: 0;
  display: grid; place-items: center;
  border: 1px solid #fff; border-radius: 3px;
  background: linear-gradient(180deg, #4a8be8, #2456c2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
  cursor: pointer;
}
.tb-btns button:hover { filter: brightness(1.15); }
.tb-btns .tb-x { background: linear-gradient(180deg, #e8785a, #c8391f); }
.menubar { display: flex; gap: 2px; padding: 1px 2px; background: var(--face); border-bottom: 1px solid var(--face-dark); }
.menubar button { border: 0; background: transparent; padding: 2px 6px; cursor: pointer; }
.menubar button:hover { background: var(--hi); color: #fff; }
.body { flex: 1; overflow: auto; position: relative; }
.body.pad { padding: 10px; }
.body.white { background: #fff; }
.statusbar { display: flex; gap: 8px; padding: 2px 6px; border-top: 1px solid var(--shadow); background: var(--face); color: #333; }
.statusbar span { border: 1px inset #d4d0c8; padding: 0 5px; }

/* buttons & controls (the bevel) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 72px; height: 23px; padding: 0 12px;
  background: var(--face);
  border: 1px solid #003c74; border-radius: 3px;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #c1c1b5;
  cursor: pointer; font-size: 11px; color: #000; text-decoration: none;
}
.btn:hover { box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #c1c1b5, inset 0 0 0 2px #f8d97a; }
.btn:active { box-shadow: inset 1px 1px 2px rgba(0,0,0,.35); }
.btn.primary { box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #c1c1b5, inset 0 0 0 2px #7aa2e8; }
.btn.big { height: 34px; font-size: 14px; font-weight: 700; padding: 0 22px; }
.btn.play { background: linear-gradient(180deg, #ffe680, #f5a623); border-color: #b06a00; }
.btn:disabled { color: #8a8a8a; cursor: default; }
.input, .textarea, .select {
  width: 100%; padding: 3px 4px; font: inherit; color: #000;
  background: #fff; border: 1px solid #7f9db9; border-radius: 0;
}
.textarea { resize: none; min-height: 120px; font: 12px/1.4 var(--ui); }
.input:focus, .textarea:focus { outline: none; border-color: #316ac5; }
.field { display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: 6px 4px; margin-bottom: 6px; }
.field label { text-align: right; }
.row { display: flex; gap: 6px; align-items: center; }
.row.end { justify-content: flex-end; }
.groupbox { border: 1px solid #d0d0bf; border-radius: 4px; padding: 10px; margin: 8px 0; position: relative; }
.groupbox > legend { padding: 0 3px; color: #0046d5; }
.hr { height: 1px; background: #a0a0a0; box-shadow: 0 1px 0 #fff; margin: 8px 0; }
.dialog-body { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px 10px; font-size: 11px; line-height: 1.45; }
.dialog-body p { margin: 0 0 6px; }
.dialog-btns { display: flex; justify-content: center; gap: 8px; padding: 4px 16px 14px; }
.tabs { display: flex; gap: 0; margin: 0 0 -1px; padding: 0 2px; }
.tab { padding: 3px 9px; border: 1px solid #919b9c; border-bottom: 0; background: #f1efe2; border-radius: 3px 3px 0 0; cursor: pointer; }
.tab.on { background: #fcfcfe; position: relative; top: 1px; padding-top: 4px; box-shadow: inset 0 2px 0 #ffc73c; }
.tabpanel { border: 1px solid #919b9c; background: #fcfcfe; padding: 10px; }
.lst { border: 1px solid #7f9db9; background: #fff; }
.lst-row { display: grid; align-items: center; padding: 2px 4px; gap: 6px; cursor: default; }
.lst-row:hover { background: #e8f0fb; }
.lst-row.sel { background: var(--hi); color: #fff; }
.lst-head { background: var(--face); border-bottom: 1px solid #a0a0a0; font-weight: 400; color: #333; }
.progress { height: 12px; border: 1px solid #686868; background: #fff; padding: 1px; }
.progress i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, #4ea3ff 0 8px, #2f80e8 8px 10px); transition: width .4s linear; }
.tiny { font-size: 10px; color: #555; }
.center { text-align: center; }
.marquee { overflow: hidden; white-space: nowrap; }
.marquee > span { display: inline-block; padding-left: 100%; animation: marquee 14s linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }
kbd { font: 10px var(--mono); background: #f4f4f4; border: 1px solid #aaa; border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; }

/* ---------- welcome (the space) ---------- */
.space { display: grid; grid-template-columns: 172px 1fr; gap: 10px; padding: 10px; background: #fff; min-height: 100%; }
.space .col-l { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.space .col-r { min-width: 0; overflow: hidden; display: flex; flex-direction: column; gap: 8px; }
.space .wa { width: 100%; height: 84px; }
.space .avatar { border: 1px solid #999; padding: 4px; background: #f4f4f4; display: grid; place-items: center; }
.space .who { font-size: 12px; font-weight: 700; }
.space .stat { font-size: 10px; color: #333; line-height: 1.6; }
.space .stat b { color: #000; }
.space .box { border: 1px solid #6699cc; }
.space .box-h { background: #6699cc; color: #fff; font-weight: 700; padding: 2px 5px; }
.space .box-b { padding: 6px; background: #fff; }
.space .contact { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 6px; font-size: 10px; }
.space .contact a { display: flex; align-items: center; gap: 4px; color: #003399; text-decoration: none; }
.space .contact a:hover { text-decoration: underline; }
.wordart { display: block; width: 100%; height: 100%; cursor: pointer; overflow: visible; }
.wordart text { font-family: Impact, 'Arial Black', 'Helvetica Neue', sans-serif; font-weight: 900; }
.top4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.top4 a { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none; color: #003399; font-size: 10px; text-align: center; }
.top4 a:hover .fr { box-shadow: 0 0 0 2px #ffcc00; }
.top4 .fr { width: 100%; aspect-ratio: 1; display: grid; place-items: center; background: #eef3fa; border: 1px solid #99b; }
.top4 .nm { font-weight: 700; }
.blink { animation: blink 1s steps(1) infinite; }
.counter { display: inline-flex; gap: 1px; padding: 2px; background: #000; border: 1px solid #555; vertical-align: middle; }
.space .banner { border: 1px dashed #c33; padding: 3px 6px; background: #fff8e1; font-size: 10px; text-align: center; }
.space .interests td { vertical-align: top; padding: 2px 4px; font-size: 10px; }
.space .interests td:first-child { background: #b1c9e6; color: #003399; font-weight: 700; width: 70px; }
.space .interests td:last-child { background: #d5e2f2; }

/* ---------- game page (as it was in 2005) ---------- */
.gp { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding: 10px; background: #fff; }
.gp .thumb { border: 2px solid #f60; padding: 2px; background: #000; display: grid; place-items: center; }
.gp h2 { margin: 0 0 4px; font-size: 16px; color: #f60; }
.gp .cat { font-size: 10px; color: #666; }
.gp .stars { display: inline-flex; gap: 1px; cursor: pointer; }
.gp .stars span { font-size: 14px; color: #ccc; }
.gp .stars span.on, .gp .stars:hover span { color: #f6b200; }
.gp .stars span:hover ~ span { color: #ccc; }
.gp .meta { font-size: 10px; color: #333; margin: 4px 0 8px; }
.gp .desc { font-size: 11px; line-height: 1.5; margin: 6px 0; }
.gp .tags a { font-size: 10px; margin-right: 6px; }
.gp .ad { grid-column: 1 / -1; border: 1px solid #ccc; background: #f6f6f6; padding: 4px 6px; font-size: 10px; text-align: center; color: #666; }

/* ---------- pictures ---------- */
.pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; padding: 12px; }
.polaroid { background: #fff; padding: 6px 6px 18px; box-shadow: 1px 2px 4px rgba(0,0,0,.35); transform: rotate(var(--r, 0)); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.polaroid .cap { font: 11px 'Comic Sans MS', 'Chalkboard SE', cursive; color: #333; }
.polaroid:hover { transform: rotate(0) scale(1.03); }

/* ---------- notepad ---------- */
.notepad { width: 100%; height: 100%; min-height: 200px; border: 0; padding: 4px; resize: none; font: 12px/1.45 var(--mono); background: #fff; color: #000; white-space: pre-wrap; outline: none; }

/* ---------- player ---------- */
.player { background: #24262f; color: #9ad06f; padding: 6px; display: grid; gap: 6px; }
.player .lcd { background: #000; border: 1px inset #555; padding: 4px 6px; font: 11px var(--mono); display: grid; grid-template-columns: 1fr auto; gap: 4px; }
.player .lcd .ttl { overflow: hidden; white-space: nowrap; }
.player .lcd .ttl span { display: inline-block; padding-left: 100%; animation: marquee 9s linear infinite; }
.player .lcd .tm { color: #9ad06f; font-weight: 700; }
.player canvas { width: 100%; height: 48px; background: #000; border: 1px inset #555; display: block; }
.player .ctl { display: flex; gap: 4px; align-items: center; }
.player .ctl .btn { min-width: 30px; padding: 0 8px; background: linear-gradient(#5d6170, #3a3d49); color: #fff; border-color: #111; box-shadow: inset 1px 1px 0 #8a8fa2; }
.player .ctl .vol { flex: 1; accent-color: #9ad06f; }
.player .pl { background: #000; border: 1px inset #555; font: 11px var(--mono); padding: 2px; }
.player .pl div { padding: 1px 4px; cursor: pointer; color: #9ad06f; }
.player .pl div.on { background: #1a3; color: #fff; }
.player .pl div:hover { background: #142; }

/* ---------- pedro responde ---------- */
.pedro { padding: 10px; display: grid; gap: 8px; background: linear-gradient(180deg, #fff7d6, #ffe9a8); }
.pedro-top { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; }
.pedro-face { display: grid; place-items: center; background: #fff; border: 2px solid #5c3a1e; border-radius: 6px; padding: 4px; }
.pedro-say { position: relative; background: #fff; border: 1px solid #5c3a1e; border-radius: 8px; padding: 8px 10px; min-height: 52px; font-size: 13px; line-height: 1.4; }
.pedro-say::before { content: ''; position: absolute; left: -7px; top: 22px; width: 10px; height: 10px; background: #fff; border-left: 1px solid #5c3a1e; border-bottom: 1px solid #5c3a1e; transform: rotate(45deg); }
.pedro-say b { font-size: 15px; color: #5c3a1e; }
.pedro .btn { min-width: 0; }
.pedro .field { margin: 0; }
.pedro .row .tiny { margin-left: auto; }

/* ---------- tv ---------- */
.tvbox { background: #3b2a1f; padding: 10px; display: grid; grid-template-columns: 1fr 44px; gap: 8px; }
.tvbox canvas { width: 100%; aspect-ratio: 4 / 3; background: #000; border: 6px solid #1c130d; border-radius: 12px; display: block; }
.tvbox .knobs { display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; }
.knob { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #c9b8a8, #5b4638); border: 2px solid #1c130d; cursor: pointer; display: grid; place-items: center; color: #1c130d; font-size: 12px; font-weight: 700; }
.knob:active { transform: rotate(20deg); }
.tv-ch { color: #f7d9a8; font: 10px var(--mono); }

/* ---------- storybook ---------- */
.book { background: #6b3f2a; padding: 12px; display: grid; gap: 8px; }
.pages { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: #fdf6e3; border: 3px solid #3d2216; box-shadow: inset 0 0 40px rgba(0,0,0,.15); min-height: 220px; }
.pages .pg { padding: 12px; }
.pages .pg.l { border-right: 1px solid #d8c9a8; display: grid; place-items: center; background: #fbf1da; }
.pages .pg.r { font: 14px/1.55 Georgia, 'Times New Roman', serif; color: #3b2a1f; }
.pages .pg.r .w.on { background: #ffd54a; border-radius: 2px; }
.pages .pg.r .pn { font-size: 10px; color: #8b7355; text-align: right; margin-top: 8px; }
.book .ctl { display: flex; justify-content: space-between; align-items: center; }
.book .ctl .btn { background: linear-gradient(#f4e6c2, #d7c391); border-color: #5c3d2a; }
.pages.flip { animation: flip .35s ease; }
@keyframes flip { 0% { transform: perspective(600px) rotateY(0); } 50% { transform: perspective(600px) rotateY(-14deg); filter: brightness(.9); } 100% { transform: none; } }

/* ---------- downloads (ares) ---------- */
.dl .lst-row { grid-template-columns: 1fr 60px 70px 64px 60px; font-size: 10px; }
.dl .lst-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl .lst-row .st { color: #060; }
.dl .lst-row .st.wait { color: #a60; }

/* ---------- world time ---------- */
.wt { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 10px; background: #fff; }
.wt .clk { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border: 1px solid #c8c8c8; background: #fafafa; }
.wt .clk.home { border-color: #f6b200; background: #fffbea; }
.wt .clk .city { font-weight: 700; font-size: 12px; }
.wt .clk .dig { font: 14px var(--mono); }
.wt .clk .df { font-size: 10px; color: #555; }
.wt canvas { width: 96px; height: 96px; }

/* ---------- bubble trouble ---------- */
.bt { background: #000; padding: 6px; display: grid; gap: 6px; }
.bt canvas { width: 100%; aspect-ratio: 8 / 5; display: block; background: #000; border: 1px solid #333; }
.bt .pad { display: none; justify-content: space-between; gap: 6px; }
.bt .pad button { flex: 1; height: 42px; background: #333; color: #fff; border: 2px outset #777; font-size: 18px; }
@media (pointer: coarse) { .bt .pad { display: flex; } }
.bt .hud { color: #fff; font: 11px var(--mono); display: flex; justify-content: space-between; }

/* ---------- taskbar ---------- */
.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 30px; z-index: 500;
  display: flex; align-items: stretch;
  background: linear-gradient(180deg, #3f7de8 0, var(--taskbar-a) 12%, var(--taskbar-b) 100%);
  border-top: 1px solid #0b2a7a;
  box-shadow: inset 0 1px 0 #6fa0f0;
}
.start {
  display: flex; align-items: center; gap: 6px;
  padding: 0 14px 0 8px; margin: 0;
  border: 0; border-radius: 0 10px 10px 0;
  background: linear-gradient(180deg, #5bbf5b, var(--start-a) 40%, var(--start-b));
  color: #fff; font: italic 700 15px var(--ui); text-shadow: 1px 1px 0 rgba(0,0,0,.5);
  box-shadow: inset -2px 0 4px rgba(0,0,0,.3);
  cursor: pointer;
}
.start:hover { filter: brightness(1.1); }
.start[aria-expanded="true"] { filter: brightness(.9); }
.tasks { flex: 1; display: flex; gap: 3px; padding: 3px 6px; overflow: hidden; }
.task {
  display: flex; align-items: center; gap: 5px;
  max-width: 160px; min-width: 40px; padding: 0 8px; margin: 0;
  border: 1px solid #1b3f9e; border-radius: 3px;
  background: linear-gradient(180deg, #3d84f0, #2a66d8);
  color: #fff; font-size: 11px; cursor: pointer; overflow: hidden;
}
.task span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.task.on { background: linear-gradient(180deg, #1c4bb3, #1741a0); box-shadow: inset 1px 1px 3px rgba(0,0,0,.5); }
.tray {
  display: flex; align-items: center; gap: 6px; padding: 0 10px 0 12px;
  background: linear-gradient(180deg, #1f9ae8 0, #0f7fd6 12%, #0c62b7 100%);
  border-left: 1px solid #083a80; box-shadow: inset 1px 0 0 #4fb4f6;
  color: #fff;
}
.tray-btn { border: 0; background: transparent; padding: 2px; cursor: pointer; display: grid; place-items: center; }
.tray-clock { border: 0; background: transparent; color: #fff; font: 11px var(--ui); cursor: pointer; padding: 2px 4px; white-space: nowrap; }
.tray-clock:hover { background: rgba(255,255,255,.15); }

/* ---------- start menu ---------- */
.startmenu {
  position: fixed; left: 0; bottom: 30px; z-index: 600;
  width: 380px; max-width: 100vw;
  background: var(--face);
  border: 1px solid #0b2a7a; border-radius: 6px 6px 0 0;
  box-shadow: 3px 3px 8px rgba(0,0,0,.4);
  overflow: hidden;
}
.sm-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: linear-gradient(180deg, #3d7bd9, #1a4fbf); color: #fff; font-size: 14px; font-weight: 700; text-shadow: 1px 1px 0 rgba(0,0,0,.4); }
.sm-head .av { border: 2px solid #fff; border-radius: 3px; background: #bcd; }
.sm-cols { display: grid; grid-template-columns: 1fr 1fr; }
.sm-col { padding: 6px 4px; display: flex; flex-direction: column; gap: 1px; }
.sm-col.r { background: #d3e5fa; border-left: 1px solid #a9c4e8; }
.sm-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border: 0; background: transparent; text-align: left; cursor: pointer; border-radius: 2px; font-size: 11px; }
.sm-item:hover { background: var(--hi); color: #fff; }
.sm-item .sub { display: block; font-size: 9px; color: #777; }
.sm-item:hover .sub { color: #dfe8f8; }
.sm-col .sep { height: 1px; background: #ccd; margin: 4px 6px; }
.sm-col.r .sm-item { font-weight: 700; }
.sm-foot { display: flex; justify-content: flex-end; gap: 4px; padding: 6px 8px; background: linear-gradient(180deg, #3d7bd9, #1a4fbf); }
.sm-foot button { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; color: #fff; padding: 3px 6px; cursor: pointer; border-radius: 3px; }
.sm-foot button:hover { background: rgba(255,255,255,.2); }

.ctxmenu { position: fixed; z-index: 650; min-width: 150px; background: #fff; border: 1px solid #888; box-shadow: 2px 2px 4px rgba(0,0,0,.35); padding: 2px; }
.ctxmenu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 4px 22px; cursor: pointer; }
.ctxmenu button:hover { background: var(--hi); color: #fff; }
.ctxmenu .sep { height: 1px; background: #ccc; margin: 2px 4px; }

/* ---------- stumble bar (a toolbar from 2006) ---------- */
.stumblebar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px; height: 28px; padding: 0 8px;
  background: linear-gradient(180deg, #f4f4f0, #d9d9d1); border-bottom: 1px solid #888;
  font-size: 11px; color: #333;
}
.stumblebar + .icons { top: 36px; }
.stumble-btn { height: 20px; padding: 0 10px; border: 1px solid #8a6a00; border-radius: 3px; background: linear-gradient(#ffe066, #f5b800); font-weight: 700; color: #000; cursor: pointer; }
.stumble-votes button { border: 1px solid #aaa; border-radius: 3px; background: #fff; cursor: pointer; padding: 0 5px; height: 20px; }
.stumble-x { margin-left: auto; border: 0; background: transparent; cursor: pointer; font-size: 14px; }

/* ---------- moth (the assistant) & bubbles ---------- */
.moth { position: absolute; right: 18px; bottom: 14px; z-index: 40; cursor: pointer; filter: drop-shadow(1px 2px 0 rgba(0,0,0,.4)); animation: hover 3.4s ease-in-out infinite alternate; }
@keyframes hover { from { transform: translate(0, 0); } to { transform: translate(-4px, -6px); } }
.bubble {
  position: absolute; z-index: 45; max-width: 230px;
  background: #fffbe6; border: 1px solid #333; border-radius: 6px; padding: 7px 9px;
  font-size: 11px; line-height: 1.45; color: #111;
  box-shadow: 2px 2px 0 rgba(0,0,0,.3);
}
.bubble::after { content: ''; position: absolute; right: 18px; bottom: -7px; width: 12px; height: 12px; background: #fffbe6; border-right: 1px solid #333; border-bottom: 1px solid #333; transform: rotate(45deg); }
.bubble b { color: #7a3f00; }

/* ---------- overlays ---------- */
.sparkles { position: fixed; inset: 0; z-index: 800; pointer-events: none; }
.overlay { position: fixed; inset: 0; z-index: 850; }
.overlay.bsod { background: #0000aa; color: #fff; font: 16px/1.5 var(--mono); padding: 40px 60px; cursor: pointer; }
.overlay.bsod a { color: #fff; }
.overlay.bsod h1 { display: inline-block; background: #aaa; color: #0000aa; font-size: 16px; padding: 0 6px; margin: 0 0 20px; font-weight: 400; }
.overlay.off { background: #000; color: #f5a623; font: 700 22px var(--mono); display: grid; place-items: center; text-align: center; cursor: pointer; }
.overlay.off small { display: block; font-size: 12px; color: #666; margin-top: 30px; font-weight: 400; }
.overlay.dim { background: rgba(0,0,0,.45); display: grid; place-items: center; }
.overlay.levelup { background: transparent; pointer-events: none; }
.saver { position: fixed; inset: 0; z-index: 870; width: 100%; height: 100%; background: #000; cursor: none; }
.shutdown-box { background: linear-gradient(180deg, #3d7bd9, #1a4fbf); color: #fff; padding: 14px 18px; border: 1px solid #0b2a7a; border-radius: 6px; box-shadow: 0 8px 30px rgba(0,0,0,.6); text-align: center; }
.shutdown-box h2 { margin: 0 0 14px; font-size: 16px; }
.shutdown-box .opts { display: flex; gap: 14px; justify-content: center; margin-bottom: 12px; }
.shutdown-box .opt { display: flex; flex-direction: column; align-items: center; gap: 4px; background: transparent; border: 0; color: #fff; cursor: pointer; padding: 4px; border-radius: 4px; }
.shutdown-box .opt:hover { background: rgba(255,255,255,.2); }
.shutdown-box .opt .ico { width: 34px; height: 34px; border-radius: 6px; display: grid; place-items: center; }
.levelup-box { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); background: #4a3a2c; border: 3px solid #1e150f; color: #ffcf40; padding: 16px 22px; font: 700 15px/1.5 var(--ui); text-align: center; box-shadow: 0 0 0 2px #8a6a4a, 6px 6px 0 rgba(0,0,0,.5); pointer-events: auto; cursor: pointer; }
.levelup-box small { display: block; color: #fff; font-weight: 400; font-size: 11px; margin-top: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 700px) {
  .space { grid-template-columns: 1fr; }
  .top4 { grid-template-columns: repeat(2, 1fr); }
  .gp { grid-template-columns: 1fr; }
  .gp .thumb { justify-self: center; }
  .startmenu { width: 100vw; }
  .icon { width: 64px; }
  .moth { right: 10px; bottom: 8px; }
  .tray-clock #tray-city { display: none; }
  .wt { grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px; }
  .wt canvas { width: 80px; height: 80px; }
}
@media (prefers-reduced-motion: reduce) {
  .moth, .marquee > span, .player .lcd .ttl span, .splash-bar i { animation: none; }
  .win.opening { animation: none; }
}
