:root {
  --xp-blue: #245edb;
  --xp-blue-dark: #1a3e9a;
  --xp-start: #3c8a2e;
  --xp-start-dark: #2b6b20;
  --xp-face: #ece9d8;
  --xp-win: #d4d0c8;
  --xp-text: #000;
  --bar: #245edb;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Tahoma, "Trebuchet MS", "MS Sans Serif", sans-serif;
  color: var(--xp-text);
  overflow: hidden;
  background: #003c74;
}

.desktop {
  height: calc(100% - 30px);
  background:
    linear-gradient(180deg, rgba(0, 80, 180, 0.15), rgba(0, 0, 0, 0.12)),
    url("assets/rover-xp.jpg") center / cover no-repeat;
  position: relative;
  padding: 16px 8px;
}

.icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 86px;
  margin: 0 0 18px;
  background: none;
  border: 0;
  color: #fff;
  text-shadow: 1px 1px 2px #000;
  font: 11px Tahoma, sans-serif;
  cursor: pointer;
  text-decoration: none;
}
.icon img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  image-rendering: pixelated;
  border: 1px solid #fff;
  box-shadow: 1px 1px 0 #0008;
}
.icon:focus-visible { outline: 1px dotted #fff; }

.win {
  position: absolute;
  left: 110px;
  top: 28px;
  width: min(720px, calc(100vw - 24px));
  background: var(--xp-win);
  border: 2px solid #0831d9;
  box-shadow: 2px 2px 0 #0006, inset 1px 1px 0 #fff;
  z-index: 2;
}
.win--narrow { width: min(420px, calc(100vw - 24px)); left: 160px; top: 80px; }
.win--dialog { width: min(360px, calc(100vw - 24px)); left: 200px; top: 140px; }
#win-pics { left: 130px; top: 48px; }
#win-lore { left: 168px; top: 86px; width: min(560px, calc(100vw - 24px)); }
.win.is-max {
  left: 0 !important;
  top: 0 !important;
  width: 100% !important;
  height: calc(100% - 30px);
}
.win.is-min { display: none; }

.win__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 4px 0 6px;
  color: #fff;
  font: 700 12px Tahoma, sans-serif;
  background: linear-gradient(180deg, #0a46ee 0%, #245edb 45%, #1941a5 100%);
  cursor: grab;
}
.win__ico { width: 16px; height: 16px; object-fit: cover; image-rendering: pixelated; }
.win__title { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win__btns { display: flex; gap: 2px; }
.win__btns button {
  width: 21px;
  height: 18px;
  font: 700 12px Tahoma, sans-serif;
  line-height: 14px;
  background: #d4d0c8;
  border: 1px solid #fff;
  border-right-color: #404040;
  border-bottom-color: #404040;
  cursor: pointer;
}
.win__x { background: #e81123 !important; color: #fff; border-color: #f1707a #8b0a12 #8b0a12 #f1707a !important; }

.win__menu {
  display: flex;
  gap: 12px;
  padding: 2px 8px;
  font: 11px Tahoma, sans-serif;
  background: var(--xp-face);
  border-bottom: 1px solid #aaa;
}
.win__body {
  padding: 12px;
  background: #fff;
  border: 1px solid #808080;
  margin: 4px;
  max-height: min(70vh, 560px);
  overflow: auto;
}
.win__body p { margin: 0 0 10px; font-size: 13px; line-height: 1.4; }

h1 {
  margin: 0 0 6px;
  font: 700 32px "Trebuchet MS", Tahoma, sans-serif;
  color: #1a3e9a;
}
.punch { font-weight: 700; font-size: 15px !important; }

.hero { display: grid; grid-template-columns: 140px 1fr; gap: 14px; align-items: center; }
.hero__gif {
  width: 140px;
  image-rendering: pixelated;
  background: #fff;
}
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.xp-btn {
  font: 11px Tahoma, sans-serif;
  padding: 6px 14px;
  background: linear-gradient(180deg, #fff, #ece9d8);
  border: 1px solid #003c74;
  border-radius: 3px;
  box-shadow: inset 1px 1px 0 #fff;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  display: inline-block;
}
.xp-btn--go {
  background: linear-gradient(180deg, #98d46a, #3c8a2e);
  color: #fff;
  font-weight: 700;
  border-color: #2b6b20;
}

.ca {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  padding: 8px;
  background: #ece9d8;
  border: 1px solid #808080;
  font: 12px "Lucida Console", monospace;
}
.ca code { flex: 1; overflow: auto; }

.banner { width: 100%; display: block; border: 1px solid #808080; image-rendering: pixelated; }

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.thumbs img { width: 100%; border: 1px solid #808080; image-rendering: pixelated; }
.thumbs figcaption { font-size: 11px; margin-top: 4px; }

.info { background: #ffffe1; border: 1px solid #ccc; padding: 8px; }
.steps { margin: 0; padding-left: 18px; font-size: 13px; }

.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30px;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, #3f8cf3, #245edb 8%, #245edb 92%, #1941a5);
  z-index: 20;
  padding-right: 6px;
}
.start {
  height: 100%;
  padding: 0 16px 0 10px;
  border: 0;
  border-radius: 0 12px 12px 0;
  color: #fff;
  font: 700 14px "Trebuchet MS", Tahoma, sans-serif;
  font-style: italic;
  background: linear-gradient(180deg, #6fba54, #3c8a2e 40%, #2b6b20);
  cursor: pointer;
  text-shadow: 1px 1px 0 #0006;
}
.bar__tasks { display: flex; gap: 4px; flex: 1; padding: 3px 8px; }
.task {
  min-width: 120px;
  height: 22px;
  font: 11px Tahoma, sans-serif;
  color: #fff;
  background: linear-gradient(180deg, #3d7def, #215cd6);
  border: 1px solid #0831d9;
  cursor: pointer;
}
.tray {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  color: #fff;
  font: 11px Tahoma, sans-serif;
  background: #0d59cf;
  border-left: 1px solid #0831d9;
}
.tray img { width: 16px; height: 16px; object-fit: cover; }
.tray a { display: flex; line-height: 0; }

.start-menu {
  position: fixed;
  left: 0;
  bottom: 30px;
  width: 240px;
  background: #d3e5fa;
  border: 2px solid #0831d9;
  z-index: 30;
  display: flex;
  flex-direction: column;
}
.start-menu[hidden] { display: none; }
.start-menu__user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(180deg, #245edb, #1941a5);
}
.start-menu__user img { width: 40px; image-rendering: pixelated; }
.start-menu button {
  text-align: left;
  padding: 8px 12px;
  border: 0;
  background: #fff;
  font: 12px Tahoma, sans-serif;
  cursor: pointer;
}
.start-menu button:hover,
.start-menu a:hover { background: #316ac5; color: #fff; }
.start-menu a {
  display: block;
  text-align: left;
  padding: 8px 12px;
  background: #fff;
  font: 12px Tahoma, sans-serif;
  color: inherit;
  text-decoration: none;
}
.win__body a { color: #003399; }

.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffe1;
  border: 1px solid #000;
  padding: 6px 10px;
  font: 12px Tahoma, sans-serif;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
}
.toast.show { opacity: 1; }

@media (max-width: 700px) {
  .hero { grid-template-columns: 1fr; }
  .win { left: 8px; top: 8px; }
  body { overflow: auto; }
  .desktop { min-height: 100vh; height: auto; padding-bottom: 40px; }
}
