/* ---------- Base ---------- */
* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: Tahoma, "Segoe UI", Verdana, sans-serif;
  font-size: 13px;
  user-select: none;
}

button { font-family: inherit; }

#wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #3f7de0 url(../img/bliss.jpg) center / cover no-repeat;
}

/* ---------- Desktop icons ---------- */
#desktop {
  position: fixed;
  inset: 0 0 34px 0;
  z-index: 1;
}

.icon {
  position: absolute;
  width: 92px;
  height: 88px;
  padding: 6px 4px;
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  touch-action: none;
}

.icon.dragging { opacity: 0.7; }

#marquee {
  position: absolute;
  z-index: 4;
  display: none;
  border: 1px solid #4c8bd4;
  background: rgba(100, 160, 225, 0.28);
  pointer-events: none;
}

.icon svg { flex: none; width: 40px; height: 40px; filter: drop-shadow(1px 2px 2px rgba(0,0,0,0.4)); }

.icon span {
  color: #fff;
  font-size: 12px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.85);
  padding: 1px 3px;
  line-height: 1.25;
  text-align: center;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.icon.selected { z-index: 5; }
.icon.selected span {
  background: #316ac5;
  text-shadow: none;
  -webkit-line-clamp: initial;
  overflow: visible;
}
.icon:focus-visible { outline: 1px dotted #fff; }

/* ---------- Windows ---------- */
.window {
  position: fixed;
  z-index: 10;
  min-width: 260px;
  max-width: calc(100vw - 16px);
  background: #ece9d8;
  border: 3px solid #0855dd;
  border-top: none;
  border-radius: 8px 8px 3px 3px;
  box-shadow: 2px 4px 14px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
}

.window[hidden] { display: none; }

.window.inactive { border-color: #7ba2e7; }

.titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 4px 0 8px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #0997ff 0%, #0053ee 12%, #0050ee 45%, #0863f2 88%, #0a3fc4 100%);
  color: #fff;
  font-weight: bold;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
  cursor: default;
  touch-action: none;
}

.window.inactive .titlebar {
  background: linear-gradient(180deg, #9db9eb 0%, #7ba2e7 45%, #89ade8 100%);
}

.titlebar .title {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.titlebar button {
  width: 22px;
  height: 22px;
  border-radius: 3px;
  border: 1px solid #fff;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  background: linear-gradient(180deg, #7ba7f0 0%, #2a63d8 50%, #1d51c0 100%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.5);
}

.titlebar button.close {
  background: linear-gradient(180deg, #f3a08a 0%, #e15a2d 45%, #c13d13 100%);
}

.titlebar button:hover { filter: brightness(1.15); }
.titlebar button:active { filter: brightness(0.9); }

.window-body {
  flex: 1;
  overflow: auto;
  margin: 0 3px 3px;
  background: #fff;
  border: 1px solid #919b9c;
}

/* Blog windows: proportional, comfortable reading */
.window.notepad .window-body {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  color: #1a1a1a;
}
.window.notepad .content { padding: 20px 26px; max-width: 62ch; }
.window.notepad .content h1 { font-size: 22px; line-height: 1.25; margin: 0 0 14px; }
.window.notepad .content h2 { font-size: 16px; margin: 22px 0 6px; }
.window.notepad .content p { line-height: 1.65; margin: 0 0 14px; }
.window.notepad .post-date { font-size: 12px; letter-spacing: 0.03em; text-transform: uppercase; }

.content { padding: 14px 16px; user-select: text; }
.content h1 { font-size: 17px; margin: 0 0 10px; color: #003399; }
.content h2 { font-size: 14px; margin: 16px 0 6px; color: #0b4aa2; }
.content p { line-height: 1.5; margin: 0 0 10px; }
.content .fineprint { color: #888; font-size: 11px; }
.post-date { color: #888; font-size: 11px; margin: 0 0 4px; }

/* Explorer-ish chrome */
.explorer-bar {
  padding: 5px 8px;
  background: #ece9d8;
  border-bottom: 1px solid #c8c4b2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-list { list-style: none; margin: 0; padding: 6px; }
.file-list .file {
  display: block;
  width: 100%;
  text-align: left;
  padding: 4px 6px;
  border: 1px solid transparent;
  background: none;
  cursor: pointer;
  font-size: 13px;
}
.file-list .file:hover { background: #e8f0fb; border-color: #b8d0ef; }

.statusbar {
  padding: 3px 8px;
  background: #ece9d8;
  border-top: 1px solid #c8c4b2;
  color: #555;
  font-size: 11px;
}

.link-list { list-style: none; padding: 0; margin: 0 0 10px; }
.link-list li { padding: 5px 0; font-size: 14px; }
.link-list a { color: #0645ad; }
.address { color: #0645ad; }

/* ---------- Minesweeper ---------- */
.mine-frame { padding: 8px; background: #c0c0c0; }

.mine-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px;
  margin-bottom: 8px;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
}

.lcd {
  font-family: Consolas, monospace;
  font-size: 20px;
  font-weight: bold;
  color: #f00;
  background: #000;
  padding: 1px 4px;
  border: 1px solid;
  border-color: #808080 #fff #fff #808080;
}

.smiley {
  width: 34px;
  height: 34px;
  font-size: 18px;
  cursor: pointer;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
}
.smiley:active { border-color: #808080 #fff #fff #808080; }

.mine-grid {
  display: grid;
  grid-template-columns: repeat(9, 26px);
  border: 3px solid;
  border-color: #808080 #fff #fff #808080;
  width: max-content;
  margin: 0 auto;
}

.cell {
  width: 26px;
  height: 26px;
  padding: 0;
  font-size: 14px;
  font-weight: bold;
  font-family: Consolas, monospace;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  cursor: pointer;
}

.cell.open {
  border: 1px solid #9a9a9a;
  border-width: 0 0 1px 1px;
  background: #c6c6c6;
  cursor: default;
}

.cell.boom { background: #f00; }
.cell[data-n="1"] { color: #0000f5; }
.cell[data-n="2"] { color: #087f08; }
.cell[data-n="3"] { color: #f50000; }
.cell[data-n="4"] { color: #00007f; }
.cell[data-n="5"] { color: #7f0000; }
.cell[data-n="6"] { color: #087f7f; }
.cell[data-n="7"] { color: #000; }
.cell[data-n="8"] { color: #7f7f7f; }

/* ---------- Taskbar ---------- */
#taskbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 34px;
  z-index: 100;
  display: flex;
  align-items: stretch;
  background: linear-gradient(180deg, #3980f4 0%, #245edb 6%, #245edb 60%, #1941a5 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3);
}

#start-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 22px 0 12px;
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 17px;
  font-weight: bold;
  font-style: italic;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  background: linear-gradient(180deg, #7ede57 0%, #3c9a2c 40%, #2f8322 85%, #24671a 100%);
  border-radius: 0 12px 12px 0;
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.6), 2px 0 4px rgba(0,0,0,0.3);
}

#start-button:hover { filter: brightness(1.1); }
.start-flag { font-style: normal; font-size: 15px; }

#task-buttons {
  flex: 1;
  display: flex;
  gap: 3px;
  padding: 4px 6px;
  overflow: hidden;
}

.task-btn {
  flex: 0 1 160px;
  min-width: 0;
  padding: 0 8px;
  border: 1px solid rgba(0,0,0,0.25);
  border-radius: 3px;
  color: #fff;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  background: linear-gradient(180deg, #4a8af4 0%, #3a75e0 50%, #2d61c8 100%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.35);
}

.task-btn.active {
  background: linear-gradient(180deg, #1b46a8 0%, #1e51c0 100%);
  box-shadow: inset 1px 1px 3px rgba(0,0,0,0.45);
}

#tray {
  display: flex;
  align-items: center;
  padding: 0 14px 0 16px;
  color: #fff;
  background: linear-gradient(180deg, #1db0f4 0%, #0f8ee4 50%, #0b6fc4 100%);
  box-shadow: inset 2px 0 3px rgba(0,0,0,0.25);
  text-shadow: 1px 1px 1px rgba(0,0,0,0.4);
}

/* ---------- Start menu ---------- */
#start-menu {
  position: fixed;
  left: 2px;
  bottom: 36px;
  z-index: 200;
  width: 260px;
  background: #fff;
  border: 2px solid #0855dd;
  border-radius: 6px 6px 0 0;
  box-shadow: 3px 5px 14px rgba(0,0,0,0.5);
  overflow: hidden;
}

.start-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  color: #fff;
  font-size: 15px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  background: linear-gradient(180deg, #1c63e0 0%, #0f4bc0 100%);
}

.start-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  font-size: 24px;
  background: #fff;
  border: 2px solid #9db9eb;
  border-radius: 5px;
}

#start-menu ul { list-style: none; margin: 0; padding: 6px; }

#start-menu li button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: none;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}

#start-menu li button:hover { background: #316ac5; color: #fff; }

.start-footer {
  padding: 6px 12px;
  font-size: 11px;
  color: #fff;
  text-align: right;
  background: linear-gradient(180deg, #1c63e0 0%, #0f4bc0 100%);
}

/* ---------- Small screens ---------- */
@media (max-width: 600px) {
  .window {
    left: 4px !important;
    top: 4px !important;
    right: 4px;
    width: auto !important;
    max-height: calc(100dvh - 46px);
  }
  #desktop { gap: 2px; }
}
