/* XP-desktop pastiche. One fixed theme on purpose: it's the meme. */
:root {
  --xp-blue: #0a54e0;
  --xp-face: #ece9d8;
  --xp-border: #0831d9;
  --ink: #1b1b1b;
  --muted: #5a5a5a;
  --good: #1a8a2e;
  --bad: #d0261d;
  --taskbar-h: 40px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: #3a7bd5;
  font-family: Tahoma, "Segoe UI", Verdana, sans-serif;
  font-size: 13px;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.desktop {
  position: fixed;
  inset: 0 0 var(--taskbar-h) 0;
  overflow: hidden;
}

/* Bliss-ish background */
.sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 40% 18% at 22% 18%, rgb(255 255 255 / .85), transparent 70%),
    radial-gradient(ellipse 30% 12% at 72% 26%, rgb(255 255 255 / .7), transparent 70%),
    radial-gradient(ellipse 25% 10% at 50% 8%, rgb(255 255 255 / .55), transparent 70%),
    linear-gradient(#1f63d8 0%, #4a92ee 45%, #9cc8f7 75%, #d6ecff 100%);
}
.hill {
  position: absolute; left: -10%; right: -10%; bottom: -38%;
  height: 70%;
  border-radius: 50% 50% 0 0 / 60% 60% 0 0;
  background:
    radial-gradient(ellipse 60% 40% at 35% 10%, #8fd14f, transparent 70%),
    linear-gradient(#5fb02f, #2f7d14 60%, #235f0f);
  box-shadow: inset 0 18px 40px rgb(255 255 255 / .18);
}

.big-title {
  position: absolute;
  left: 50%; top: 9%;
  transform: translateX(-50%);
  margin: 0;
  font-family: "Archivo Black", Impact, sans-serif;
  font-size: clamp(80px, 17vw, 300px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 6px 30px rgb(10 60 160 / .35);
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

#stage {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: pan-y;
  cursor: grab;
}
#stage:active { cursor: grabbing; }

/* Desktop icons */
.icons {
  position: absolute; top: 18px; left: 14px;
  display: grid; gap: 14px;
  z-index: 5;
}
.icon {
  width: 78px;
  display: grid; justify-items: center; gap: 4px;
  padding: 4px 2px;
  background: none; border: 1px solid transparent; border-radius: 3px;
  color: #fff; text-decoration: none; font: inherit; font-size: 12px;
  text-shadow: 1px 1px 2px rgb(0 0 0 / .8);
  cursor: pointer;
}
.icon i { font-size: 38px; filter: drop-shadow(1px 2px 2px rgb(0 0 0 / .45)); }
.icon:hover, .icon:focus-visible { background: rgb(49 106 197 / .45); border-color: rgb(255 255 255 / .35); outline: none; }
.icon:active { transform: translateY(1px); }

/* XP windows */
.win {
  position: absolute;
  z-index: 10;
  background: var(--xp-face);
  border: 3px solid var(--xp-border);
  border-top-width: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 2px 4px 14px rgb(0 20 80 / .45);
  min-width: 200px;
}
.win.hidden { display: none; }
.win.min .win-body { display: none; }
.win-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 28px;
  padding: 0 4px 0 8px;
  margin: 0 -3px;
  border-radius: 8px 8px 0 0;
  color: #fff; font-weight: bold; font-size: 13px;
  text-shadow: 1px 1px 0 #0f1f6b;
  background: linear-gradient(#0997ff 0%, #0053ee 8%, #0050ee 40%, #06f 88%, #06f 93%, #005bff 95%, #003dd7 96%, #003dd7);
  cursor: move;
  user-select: none;
  touch-action: none;
}
.win-bar span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.win-btns { display: flex; gap: 2px; }
.wb {
  width: 21px; height: 21px;
  display: grid; place-items: center;
  border: 1px solid #fff; border-radius: 3px;
  background: linear-gradient(#3c8cff, #1a5fe0);
  color: #fff; font: bold 14px/1 Tahoma, sans-serif;
  cursor: pointer; padding: 0;
}
.wb-x { background: linear-gradient(#e8836a, #d0402a 60%, #c03018); }
.wb:active { filter: brightness(.88); }
.win-body { padding: 10px 12px 12px; }
.win-body p { margin: 0 0 6px; }
.center { text-align: center; }
.muted { color: var(--muted); font-size: 12px; }

.win-welcome { left: 50%; top: 40%; transform: translate(-50%, -50%); width: min(360px, calc(100vw - 32px)); z-index: 20; }
.win-welcome.moved { transform: none; }
.welcome-h { font-size: 18px; color: #a0522d; font-weight: bold; margin-bottom: 10px !important; }
.groove {
  text-align: left;
  border: 1px solid #b5b19e; box-shadow: inset 1px 1px 0 #fff;
  padding: 8px 10px; margin: 10px 0 12px;
}
.groove p { display: flex; align-items: center; gap: 6px; }

.win-token { right: 16px; top: 16px; width: 230px; }
.win-weight { right: 16px; top: 220px; width: 230px; }
.win-feed { left: 110px; bottom: 24px; width: 300px; z-index: 15; }

.tk-name { font-weight: bold; font-size: 14px; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 2px 6px; margin: 0 0 6px; }
.stats dt { color: var(--ink); }
.stats dd { margin: 0; }
.up { color: var(--good); }
.down { color: var(--bad); }

.weight-big { font-size: 26px; font-weight: bold; margin: 0 !important; font-variant-numeric: tabular-nums; }
.tier { margin-top: 6px !important; }
.meter {
  height: 16px; margin: 6px 0 8px;
  border: 1px solid #7a7a7a; border-radius: 3px;
  background: #fff; padding: 1px;
}
.meter-fill {
  height: 100%; width: 0%;
  background: repeating-linear-gradient(90deg, #2fbf3b 0 8px, transparent 8px 10px);
  transition: width .6s cubic-bezier(.16, 1, .3, 1);
}
.chk { display: flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; }

.lbl { display: block; margin-bottom: 6px; }
input[type="range"] { width: 100%; accent-color: var(--xp-blue); }
.row { display: flex; justify-content: flex-end; margin-top: 8px; }

.xp-btn {
  font: inherit; font-size: 12px;
  min-width: 90px; padding: 4px 14px;
  color: var(--ink);
  background: linear-gradient(#fff, #ecebe6 85%, #d6d0c5);
  border: 1px solid #003c74; border-radius: 3px;
  cursor: pointer; white-space: nowrap;
}
.xp-btn:hover { box-shadow: inset 0 0 0 2px #f8b636; }
.xp-btn:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }
.xp-btn:active { background: linear-gradient(#e3e2da, #f1f0ea); transform: translateY(1px); }

/* Notification balloon, like XP tray balloons */
.balloon {
  position: absolute; right: 16px; bottom: 16px;
  z-index: 30;
  max-width: 280px;
  padding: 10px 12px;
  background: #ffffe1;
  border: 1px solid #000; border-radius: 8px;
  box-shadow: 2px 3px 8px rgb(0 0 0 / .35);
  font-size: 12px;
}
.balloon b { display: block; margin-bottom: 2px; font-size: 13px; }
.balloon.hidden { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .balloon:not(.hidden) { animation: pop .35s cubic-bezier(.16, 1, .3, 1); }
  @keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

.disclaimer {
  position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%);
  margin: 0; padding: 2px 8px;
  font-size: 11px; color: #fff;
  text-shadow: 1px 1px 2px rgb(0 0 0 / .8);
  white-space: nowrap;
  pointer-events: none;
}

/* Taskbar */
.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: var(--taskbar-h);
  display: flex; align-items: stretch;
  background: linear-gradient(#1f2f86 0, #3165c4 3%, #3682e5 6%, #4490e6 10%, #3883e5 12%, #2b71e0 15%, #2663da 18%, #235bd6 20%, #2258d5 23%, #2157d6 38%, #245ddb 54%, #2562df 86%, #245fdc 89%, #2158d4 92%, #1d4ec0 95%, #1941a5 98%);
  z-index: 50;
}
.start {
  display: flex; align-items: center; gap: 6px;
  padding: 0 22px 0 12px;
  border: 0; border-radius: 0 12px 12px 0;
  color: #fff; font: italic bold 20px/1 "Trebuchet MS", Tahoma, sans-serif;
  text-shadow: 1px 1px 2px rgb(0 0 0 / .5);
  background: linear-gradient(#3c9a3c 0, #46b246 10%, #3fa53f 50%, #2e8b2e 90%, #2a7d2a);
  box-shadow: inset -2px 0 4px rgb(0 0 0 / .25);
  cursor: pointer;
}
.start:hover { filter: brightness(1.08); }
.tasks { flex: 1; display: flex; gap: 4px; padding: 5px 8px; min-width: 0; justify-content: center; }
.task {
  display: flex; align-items: center; gap: 6px;
  min-width: 0; max-width: 200px;
  padding: 0 12px;
  color: #fff; font: inherit; font-size: 12px;
  background: linear-gradient(#3c81f3, #2e6be0);
  border: 1px solid #1b4fb8; border-radius: 3px;
  box-shadow: inset 1px 1px 0 rgb(255 255 255 / .25);
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task span { overflow: hidden; text-overflow: ellipsis; }
.task:hover { background: linear-gradient(#5291f6, #3a78e6); }
.task:active { background: #1e52bd; }
.tray {
  display: flex; align-items: center;
  padding: 0 14px;
  color: #fff; font-size: 12px;
  background: linear-gradient(#0c59b9, #139ee9 6%, #18b5f2 12%, #139beb 18%, #1290e8 40%, #0d8dea 90%, #0a75d3);
  border-left: 1px solid #092e8a;
  box-shadow: inset 1px 0 1px #18bbff;
}

/* Phones: windows become a compact stack, nothing is draggable */
@media (max-width: 760px) {
  .icons { top: auto; bottom: 34px; left: 8px; grid-auto-flow: column; gap: 2px; }
  .icon { width: 62px; font-size: 10px; }
  .icon i { font-size: 28px; }
  .big-title { top: 22%; }
  .win-bar { cursor: default; }
  .win-token, .win-weight {
    top: 8px; width: calc(50% - 12px); min-width: 0;
  }
  .win-token { left: 8px; right: auto; }
  .win-weight { right: 8px; }
  .win-body { padding: 6px 8px 8px; font-size: 11px; }
  .weight-big { font-size: 18px; }
  .win-weight .chk, #t-next, .tk-name { display: none; }
  .win-feed { left: 8px; right: 8px; bottom: 110px; width: auto; }
  .balloon { top: 150px; bottom: auto; right: 8px; }
  .win-welcome { top: 50%; }
  .tasks { justify-content: flex-start; }
  #tb-ca { display: none; }
  .start { padding: 0 14px 0 10px; font-size: 17px; }
  .disclaimer { white-space: normal; width: calc(100% - 32px); text-align: center; bottom: 4px; }
}
