:root {
  --blue: #0a5bd8; --blue-dark: #0831d9; --blue-light: #3d95ff; --face: #ece9d8; --ink: #111;
  --taskbar: 30px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  font: 12px Tahoma, Verdana, 'Segoe UI', sans-serif; color: var(--ink);
  background: #3a6ea5 url('../images/bliss_background.jpg') center / cover no-repeat; user-select: none;
}
button { font: inherit; cursor: pointer; }
.muted { color: #6b6b6b; } .small { font-size: 11px; }
.mini svg { width: 16px; height: 16px; display: block; }

#desktop { position: absolute; inset: 0 0 var(--taskbar) 0; overflow: hidden; }
#windows { position: absolute; inset: 0; }

/* Desktop icons */
#icons { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 1; }
.d-icon { width: 78px; background: none; border: 1px dotted transparent; color: #fff; text-align: center; padding: 4px 2px; text-shadow: 1px 1px 2px #000, 0 0 3px #000; }
.d-icon svg { width: 36px; height: 36px; display: block; margin: 0 auto 3px; filter: drop-shadow(1px 2px 1px rgba(0,0,0,.4)); }
.d-icon span { display: block; line-height: 1.2; }
.d-icon.sel, .d-icon:focus-visible { background: rgba(49, 106, 197, .55); border-color: #fff; outline: none; }
/* Icons sit at the left edge; windows open above them */

/* Taskbar */
#taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: var(--taskbar); z-index: 99999;
  display: flex; align-items: stretch; background: url('../images/desktop_taskbar_background.png') 0 0 / 100% 100% no-repeat, #245edb;
}
#start-btn {
  width: 92px; flex: none; border: 0; padding: 0; background: url('../images/start_idle.png') center / 100% 100% no-repeat; margin-right: 6px;
}
#start-btn:hover { background-image: url('../images/start_hovered.png'); }
#start-btn:active, #start-btn.open { background-image: url('../images/start_clicked.png'); }
#start-btn:focus-visible { outline: 2px dotted #fff; outline-offset: -4px; }
#tasks { flex: 1; display: flex; gap: 3px; padding: 3px 0; min-width: 0; overflow: hidden; }
.task-btn {
  display: flex; align-items: center; gap: 5px; width: 160px; min-width: 40px; max-width: 160px; padding: 0 8px; color: #fff;
  background: linear-gradient(#3c81f3, #2a62d6); border: 1px solid #1a3fa8; border-radius: 3px; text-align: left; flex: 0 1 160px;
}
.task-btn .t-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-btn:hover { background: linear-gradient(#5a98f8, #3a73e6); }
.task-btn.active { background: linear-gradient(#1b49b3, #2557c9); box-shadow: inset 1px 1px 3px rgba(0,0,0,.5); }
.task-btn .mini svg { width: 16px; height: 16px; }
#tray {
  flex: none; display: flex; align-items: center; gap: 6px; padding: 0 12px 0 14px; color: #fff; min-width: 110px; justify-content: flex-end;
  background: url('../images/desktop_taskbar_clock_hotbar_area.png') 0 0 / 100% 100% no-repeat, #1290e8; border-left: 1px solid #0c3a8a;
}
#tray-clock { background: none; border: 0; color: #fff; padding: 2px 4px; font: inherit; cursor: pointer; border-radius: 3px; white-space: nowrap; }
#tray-clock:hover { background: rgba(255,255,255,.18); } #tray-clock.tt { background: #c76a00; }
#tray-sound { background: none; border: 0; color: #fff; padding: 0; font-size: 13px; }

/* Start menu */
#start-menu { position: fixed; left: 0; bottom: var(--taskbar); width: 400px; z-index: 99998; border: 2px solid #0a45c8; border-bottom: 0; border-radius: 8px 8px 0 0; overflow: hidden; background: #fff; box-shadow: 3px -3px 8px rgba(0,0,0,.4); }
#start-menu[hidden] { display: none; }
.sm-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; color: #fff; font-size: 15px; font-weight: bold; text-shadow: 1px 1px 1px #000; background: linear-gradient(#1c63da, #0c47b8); }
.sm-avatar { width: 38px; height: 38px; border-radius: 4px; border: 2px solid #fff; background: #e8b64a; display: grid; place-items: center; font-size: 22px; color: #6a3d00; }
.sm-body { display: grid; grid-template-columns: 1fr 1fr; }
.sm-body ul { list-style: none; margin: 0; padding: 6px 4px; }
.sm-left { background: #fff; } .sm-right { background: #d3e5fa; border-left: 1px solid #95bdee; }
.sm-body button { width: 100%; display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 7px 8px; text-align: left; font-size: 12.5px; color: #222; }
.sm-body button:hover, .sm-body button:focus-visible { background: #2f71cd; color: #fff; outline: none; }
.sm-body .mini svg { width: 24px; height: 24px; }
.sm-foot { display: flex; justify-content: flex-end; padding: 6px 10px; background: linear-gradient(#4a8ae8, #1f5ec6); }
#sm-reset { background: #d9534f; color: #fff; border: 1px solid #8f1d1a; border-radius: 3px; padding: 3px 10px; }
#sm-reset:hover { background: #e86460; }

/* Loading / error panel shown before the app boots */
.boot { position: fixed; inset: 0; z-index: 9999; display: grid; place-content: center; padding: 24px; text-align: center; background: #3a6ea5; color: #fff; font: 14px Tahoma, sans-serif; }
.boot[hidden] { display: none; }
.boot p { max-width: 560px; margin: 8px auto; line-height: 1.5; } .boot code { background: rgba(0,0,0,.25); padding: 0 4px; }

/* Calendar popup (opens from the taskbar clock) */
#cal { position: fixed; right: 0; bottom: var(--taskbar); width: 290px; z-index: 99998; border: 2px solid #0a45c8; border-bottom: 0; border-radius: 8px 8px 0 0; overflow: hidden; background: #ece9d8; box-shadow: -3px -3px 8px rgba(0,0,0,.4); font: 12px Tahoma, sans-serif; color: #000; }
#cal[hidden] { display: none; }
.cal-title { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 4px 10px; color: #fff; font-weight: bold; text-shadow: 1px 1px 1px #000; background: linear-gradient(#1c63da, #0c47b8); }
.cal-close { width: 20px; height: 20px; line-height: 16px; padding: 0; color: #fff; font-weight: bold; background: #d8433a; border: 1px solid #fff; border-radius: 3px; }
.cal-tab { padding: 6px 8px 0; } .cal-tab span { display: inline-block; padding: 3px 12px; background: #fcfcfe; border: 1px solid #919b9c; border-bottom: 0; border-radius: 3px 3px 0 0; }
.cal-body { margin: 0 8px; padding: 8px; background: #fcfcfe; border: 1px solid #919b9c; display: grid; gap: 8px; }
.cal-field { margin: 0; padding: 4px 8px 8px; border: 1px solid #d0d0bf; } .cal-field legend { padding: 0 4px; color: #0a45c8; }
.cal-nav { display: flex; gap: 4px; align-items: center; margin-bottom: 6px; } .cal-nav select { flex: 1; min-width: 0; } .cal-y { width: 62px; }
.cal-arrow { padding: 1px 6px; border: 1px solid #7f9db9; background: linear-gradient(#fff, #e3dfcf); border-radius: 2px; font-size: 10px; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.cal-week span { padding: 2px 0; font-weight: bold; color: #0a45c8; border-bottom: 1px solid #7f9db9; margin-bottom: 2px; }
.cal-d { position: relative; padding: 3px 0; margin: 1px; background: none; border: 1px solid transparent; border-radius: 2px; color: #000; }
.cal-d:hover { background: #e2ecff; border-color: #9db8ea; }
.cal-d.today { border-color: #cc0000; }
.cal-d.sel { background: #316ac5; color: #fff; }
.cal-d.has::after { content: ''; position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #35a64a; }
.cal-d.sel.has::after { background: #fff; }
.cal-time { font: bold 20px 'Lucida Console', monospace; text-align: center; padding: 6px 0 2px; color: #0c47b8; }
.cal-btns { display: flex; justify-content: flex-end; gap: 6px; padding: 8px; } .cal-btns .xp-btn { min-width: 64px; }
