/* DEAD BYTE — Windows XP "Luna" desktop chrome */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Tahoma, "Segoe UI", Verdana, sans-serif;
  /* Absolute, not rem: this establishes the root basis that every other
     rem font-size in the app is scaled from. Settings overrides this via
     an inline style on <html> to change the whole app's text size. */
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

/* ============ DESKTOP ============ */

#desktop {
  position: fixed;
  inset: 0;
  bottom: 38px;
  background:
    radial-gradient(ellipse at 50% 35%, #26343f 0%, #182229 55%, #0d1418 100%);
  overflow: hidden;
  user-select: none;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  padding: 16px;
  gap: 12px;
}

/* In-fiction corporate wallpaper: wordmark + asset tag, low-opacity watermark. */
#desktop::before {
  content: "NEXORA LABS";
  position: absolute;
  z-index: 0;
  right: 48px;
  bottom: 36px;
  font-family: Tahoma, "Segoe UI", Verdana, sans-serif;
  font-size: 46px;
  font-weight: bold;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

/* Vignette + subtle grain, layered above the gradient, below icons. */
#desktop::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.55) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch' result='t'/><feColorMatrix in='t' type='matrix' values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.05 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: cover, 120px 120px;
}

.icon {
  position: relative;
  z-index: 1;
  width: 72px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 2px;
}

.icon:hover .icon-badge,
.icon.selected .icon-badge {
  filter: brightness(1.15);
}

.icon.selected {
  background: rgba(49, 106, 197, 0.35);
  border: 1px dotted rgba(255, 255, 255, 0.6);
}

.icon-badge {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

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

.icon-badge-cmd {
  background: linear-gradient(155deg, #3a3a3a 0%, #0a0a0a 100%);
  color: #4ade80;
}

.icon-badge-schema {
  background: linear-gradient(155deg, #ffd166 0%, #c9860f 100%);
  color: #fff;
}

.icon-badge-notes {
  background: linear-gradient(155deg, #7fb3e8 0%, #3a6ea8 100%);
  color: #fff;
}

.icon-badge-cluefolder {
  background: linear-gradient(155deg, #ffb84d 0%, #cc7a08 100%);
  color: #fff;
}

.icon-badge-accuse {
  background: linear-gradient(155deg, #ef6a61 0%, #a11f1f 100%);
  color: #fff;
}

.icon-badge-settings {
  background: linear-gradient(155deg, #9fb2bc 0%, #536876 100%);
  color: #fff;
}

.icon-badge-casefile {
  background: linear-gradient(155deg, #9c7a58 0%, #5c3d24 100%);
  color: #fff;
}

.icon-label {
  color: #fff;
  font-size: 0.8462rem;
  text-align: center;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.95), 0 0 6px rgba(0, 0, 0, 0.6);
  line-height: 1.2;
  max-width: 72px;
  word-wrap: break-word;
}

/* ============ WINDOW LAYER ============ */

#window-layer {
  position: fixed;
  inset: 0;
  bottom: 38px;
  pointer-events: none;
}

.xp-window {
  position: absolute;
  min-width: 320px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  background: #ece9d8;
  border: 1px solid #0831d9;
  border-radius: 8px 8px 0 0;
  box-shadow: 6px 10px 24px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  overflow: hidden;
}

.xp-window.minimized {
  display: none;
}

.xp-titlebar {
  height: 28px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 3px 3px 3px 8px;
  background: linear-gradient(180deg, #2f7fe6 0%, #1958d6 8%, #1550d0 40%, #1550d0 60%, #0d3fc7 88%, #123fce 100%);
  cursor: default;
}

.xp-window.focused .xp-titlebar {
  background: linear-gradient(180deg, #3f96ff 0%, #2a6fef 8%, #1f5fe0 40%, #1f5fe0 60%, #144fd6 88%, #1a4fd6 100%);
}

.xp-window:not(.focused) .xp-titlebar {
  background: linear-gradient(180deg, #9db3d6 0%, #8ba0c9 50%, #7e93bd 100%);
}

.xp-titlebar-icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  border-radius: 3px;
  background: #000;
  border: 1px solid #2ecc71;
  flex: 0 0 auto;
}

.xp-titlebar-text {
  flex: 1 1 auto;
  color: #fff;
  font-weight: bold;
  font-size: 0.9231rem;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xp-titlebar-buttons {
  display: flex;
  gap: 2px;
  flex: 0 0 auto;
}

.xp-btn {
  width: 21px;
  height: 20px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  background: linear-gradient(180deg, #6fa8f5 0%, #2c62d6 100%);
  color: #fff;
  font-size: 0.8462rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}

.xp-btn:hover {
  filter: brightness(1.2);
}

.xp-btn-close {
  background: linear-gradient(180deg, #f79f9f 0%, #d33a2c 100%);
}

.xp-window-body {
  flex: 1 1 auto;
  overflow: auto;
  background: #ece9d8;
  border-top: 1px solid #fff;
  min-height: 0;
}

.xp-window-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
}

/* ============ TASKBAR ============ */

#taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 38px;
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, #245edb 0%, #1941a5 4%, #1941a5 92%, #0e2a7a 100%);
  border-top: 1px solid #4a86e8;
  z-index: 10000;
  padding: 0 4px;
  gap: 6px;
}

#start-button {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px 0 8px;
  background: linear-gradient(180deg, #6fce54 0%, #3ea022 45%, #2e8b1a 55%, #4bbf2c 100%);
  border: 1px solid #1c5e0e;
  border-radius: 4px;
  color: #fff;
  font-weight: bold;
  font-style: italic;
  font-size: 1.0769rem;
  cursor: pointer;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
}

.start-flag {
  width: 18px;
  height: 18px;
  border-radius: 2px;
  background:
    linear-gradient(135deg, #f25022 0 50%, transparent 50%) top left / 9px 9px no-repeat,
    linear-gradient(135deg, transparent 50%, #7fba00 50%) top right / 9px 9px no-repeat,
    linear-gradient(135deg, #00a4ef 0 50%, transparent 50%) bottom left / 9px 9px no-repeat,
    linear-gradient(135deg, transparent 50%, #ffb900 50%) bottom right / 9px 9px no-repeat;
}

#taskbar-items {
  flex: 1 1 auto;
  display: flex;
  gap: 4px;
  height: 30px;
  overflow: hidden;
}

.taskbar-item {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  min-width: 120px;
  max-width: 200px;
  padding: 0 10px;
  background: linear-gradient(180deg, #3d78e0 0%, #2a5fc4 100%);
  border: 1px solid #163e8f;
  border-radius: 3px;
  color: #fff;
  font-size: 0.9231rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.taskbar-item.active {
  background: linear-gradient(180deg, #123a8c 0%, #1c4fb0 100%);
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.6);
}

#taskbar-clock {
  color: #fff;
  font-size: 0.9231rem;
  padding: 0 12px;
  border-left: 1px solid #4a86e8;
  height: 30px;
  display: flex;
  align-items: center;
}

/* ============ INTRO / CUTSCENE OVERLAY ============ */

.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-card {
  width: 440px;
  max-width: 90vw;
  background: #ece9d8;
  border: 1px solid #0831d9;
  border-radius: 8px 8px 3px 3px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.intro-card-titlebar {
  height: 26px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: linear-gradient(180deg, #3f96ff 0%, #2a6fef 8%, #1f5fe0 40%, #1f5fe0 60%, #144fd6 88%, #1a4fd6 100%);
}

.intro-card-from {
  color: #fff;
  font-weight: bold;
  font-size: 0.8462rem;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
}

.intro-card-body {
  padding: 18px 20px 8px;
  color: #222;
  font-size: 0.9231rem;
  line-height: 1.55;
}

.intro-card-body p {
  margin: 0 0 12px;
}

.intro-card-continue {
  display: block;
  margin: 4px 20px 18px;
  padding: 7px 0;
  width: calc(100% - 40px);
  background: linear-gradient(180deg, #6fa8f5 0%, #2c62d6 100%);
  color: #fff;
  border: 1px solid #163e8f;
  border-radius: 3px;
  font-weight: bold;
  font-size: 0.9231rem;
  cursor: pointer;
}

.intro-card-continue:hover {
  filter: brightness(1.1);
}
