:root {
  --xp-blue: #0759db;
  --xp-blue-dark: #00369b;
  --xp-green: #37b735;
  --xp-cyan: #42d7ff;
  --window-border: #0c4fc4;
  --taskbar-height: 44px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: Tahoma, Verdana, Arial, sans-serif;
  background: #000;
}

/* DESKTOP */

.desktop {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.wallpaper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: calc(100% - var(--taskbar-height));
  object-fit: cover;
  object-position: center center;
  z-index: 0;
  user-select: none;
  pointer-events: none;
}

.desktop-icons {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.desktop-icon {
  width: 90px;
  min-height: 82px;
  border: 0;
  background: transparent;
  color: white;
  text-shadow: 1px 1px 2px black;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
}

.desktop-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
  margin: 0 auto 4px;
}

.desktop-icon:hover span {
  background: rgba(0, 80, 255, 0.65);
}

/* WINDOWS */

.xp-window {
  display: none;
  position: absolute;
  top: 90px;
  left: 160px;
  width: min(620px, calc(100vw - 40px));
  max-height: calc(100vh - var(--taskbar-height) - 40px);
  background: #ece9d8;
  border: 3px solid var(--window-border);
  border-radius: 8px 8px 2px 2px;
  box-shadow: 6px 8px 18px rgba(0, 0, 0, 0.45);
  z-index: 20;
  overflow: hidden;
}

.xp-window.active {
  display: block;
}

.xp-titlebar {
  height: 34px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  font-weight: bold;
  background: linear-gradient(#2d8cff, #0759db 45%, #00369b);
  cursor: move;
}

.close-btn {
  width: 24px;
  height: 24px;
  border: 1px solid white;
  border-radius: 3px;
  color: white;
  background: linear-gradient(#ff9b7a, #e43b16);
  font-weight: bold;
  cursor: pointer;
}

.xp-content {
  padding: 18px;
  color: #111;
  overflow: auto;
}

.xp-content h1,
.xp-content h2 {
  margin-top: 0;
}

.xp-content a {
  color: #0046cc;
  font-weight: bold;
}

/* EXPLORER */

.explorer-window {
  width: min(820px, calc(100vw - 40px));
}

.explorer-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px;
  background: #edead9;
  border-bottom: 1px solid #aaa;
}

.explorer-toolbar button {
  padding: 4px 9px;
}

.explorer-toolbar input {
  flex: 1;
  padding: 4px;
}

.explorer-body {
  display: flex;
  min-height: 390px;
  background: white;
}

.explorer-sidebar {
  width: 190px;
  padding: 12px;
  background: linear-gradient(#dce9ff, #f5f8ff);
  border-right: 1px solid #b8c7e8;
}

.explorer-sidebar h3 {
  margin-top: 0;
  color: #00369b;
}

.explorer-main {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
}

.file-card {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #c8c8c8;
  background: #f8f8f8;
}

.file-card strong,
.file-card span {
  display: block;
}

/* SERVER TABLE */

.server-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: white;
}

.server-table th,
.server-table td {
  padding: 7px;
  border: 1px solid #b8c8d8;
  text-align: left;
}

.server-table th {
  background: #d6e8ff;
}

.game-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.online {
  color: #078a19;
  font-weight: bold;
}

.offline {
  color: #c01818;
  font-weight: bold;
}

/* LIMEFORGE */

.lime-window {
  width: 980px;
  height: 610px;
}

.lime-window.active {
  display: flex;
  flex-direction: column;
}

.lime-menubar {
  display: flex;
  gap: 18px;
  padding: 4px 8px;
  background: #ece9d8;
  border-bottom: 1px solid #999;
  font-size: 12px;
}

.lime-searchbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: #f4f1de;
  border-bottom: 1px solid #aaa;
}

.lime-searchbar input {
  flex: 1;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 12px;
}

.lime-body {
  display: grid;
  grid-template-columns: 130px 1fr 130px;
  flex: 1;
  min-height: 0;
  background: #fff;
}

.lime-sidebar {
  padding: 6px;
  background: #dfe8f6;
  border-right: 1px solid #8aa0c0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.lime-sidebar button {
  text-align: left;
  font-size: 12px;
}

.lime-main {
  padding: 6px;
  overflow: auto;
}

.lime-results {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.lime-results th {
  padding: 4px;
  background: #ece9d8;
  border: 1px solid #aaa;
  text-align: left;
}

.lime-results td {
  padding: 4px;
  border: 1px solid #ddd;
}

.lime-results tr {
  cursor: pointer;
}

.lime-results tr:hover {
  background: #cfe5ff;
}

.lime-download-box {
  margin-top: 10px;
  padding: 8px;
  background: #f7f7f7;
  border: 1px solid #aaa;
  font-size: 12px;
}

.lime-progress {
  height: 16px;
  margin: 6px 0;
  background: #fff;
  border: 1px solid #666;
}

#limeProgressFill {
  height: 100%;
  width: 28%;
  background: #39d353;
  transition: width 0.6s ease;
}

.lime-adbar {
  padding: 6px;
  background: #f3f3f3;
  border-left: 1px solid #aaa;
}

.lime-ad {
  margin-bottom: 8px;
  padding: 6px;
  background: #fff7cc;
  border: 1px solid #999;
  font-size: 11px;
  text-align: center;
}

.lime-statusbar {
  padding: 4px 8px;
  background: #ece9d8;
  border-top: 1px solid #999;
  font-size: 11px;
}

.fake-file {
  cursor: pointer;
}

.fake-file:hover {
  background: #cfe5ff;
}

/* FAKE POPUPS */

#popupLayer {
  position: absolute;
  inset: 0;
  z-index: 100;
}

.chaos-popup {
  position: absolute;
  width: 260px;
  background: #ece9d8;
  border: 3px solid #0c4fc4;
  border-radius: 7px 7px 2px 2px;
  box-shadow: 5px 7px 15px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  overflow: hidden;
}

.chaos-popup-title {
  padding: 5px 8px;
  color: white;
  font-weight: bold;
  background: linear-gradient(#2d8cff, #0759db 45%, #00369b);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chaos-popup-content {
  padding: 14px;
  font-size: 13px;
}

.chaos-popup-content button {
  margin-top: 10px;
}
.image-popup {
    position: absolute;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    width: auto;
    height: auto;
    overflow: visible;
}

.image-popup img {
    display: block;
    max-width: 420px;
    height: auto;
    image-rendering: auto;
    pointer-events: none;
}

/* INTERNET EXPLORER */

.ie-window {
  width: 720px;
  height: 520px;
}

.ie-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ece9d8;
  padding: 5px;
  border-bottom: 1px solid #999;
  font-size: 12px;
}

.ie-toolbar button {
  font-size: 12px;
}

.ie-toolbar input {
  flex: 1;
  height: 22px;
  border: 1px solid #777;
  padding: 2px 6px;
  font-family: Tahoma, Arial, sans-serif;
}

.ie-page {
  background: white;
  height: calc(100% - 72px);
  overflow: auto;
}

/* TASKBAR */

.taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--taskbar-height);
  z-index: 200;
  background: linear-gradient(#2d8cff, #0759db 45%, #00369b);
  display: flex;
  align-items: center;
  color: white;
  box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.35);
}

.start-button {
  height: 36px;
  margin-left: 6px;
  padding: 0 14px 0 9px;
  border: 1px solid #1f6e17;
  border-radius: 18px;
  color: white;
  font-style: italic;
  font-weight: bold;
  font-size: 17px;
  background: linear-gradient(#74d86a, #2ba723 50%, #147a18);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.start-button img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.taskbar-tabs {
  flex: 1;
  display: flex;
  align-items: center;
  padding-left: 12px;
}

.taskbar-tabs span {
  min-width: 140px;
  max-width: 220px;
  padding: 7px 12px;
  border-radius: 3px;
  background: rgba(0, 50, 180, 0.65);
  box-shadow: inset 1px 1px 2px rgba(255, 255, 255, 0.25);
}

.tray {
  align-self: stretch;
  min-width: 88px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(#18b9f0, #0b87d1);
  border-left: 1px solid rgba(255, 255, 255, 0.35);
}

/* START MENU */

.start-menu {
  display: none;
  position: absolute;
  left: 6px;
  bottom: var(--taskbar-height);
  width: 260px;
  background: #ece9d8;
  border: 3px solid #0759db;
  border-radius: 8px 8px 0 0;
  z-index: 199;
  box-shadow: 5px -5px 18px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.start-menu.active {
  display: block;
}

.start-menu-header {
  height: 62px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-weight: bold;
  background: linear-gradient(#2d8cff, #0759db 45%, #00369b);
}

.start-menu-header img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.start-menu button {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid #c8c4b3;
  background: #fffef2;
  text-align: left;
  font-family: Tahoma, Verdana, Arial, sans-serif;
  cursor: pointer;
}

.start-menu button:hover {
  background: #dbeaff;
}

/* BOOT SCREEN */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at center, #061c4d, #01030c 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--xp-cyan);
  font-family: Consolas, monospace;
}

.boot-screen.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.boot-terminal {
  width: min(720px, 90vw);
  padding: 22px;
  border: 1px solid var(--xp-cyan);
  background: rgba(0, 0, 0, 0.78);
  box-shadow: 0 0 30px rgba(66, 215, 255, 0.35);
}

.boot-header,
.boot-footer {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
}

.boot-log {
  height: 180px;
  margin: 18px 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.45;
}

.boot-progress {
  height: 18px;
  border: 1px solid var(--xp-cyan);
  background: #020b17;
}

#bootProgressFill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #0759db, #42d7ff);
}

/* RESPONSIVE */

@media (max-width: 700px) {
  .desktop-icons {
    top: 18px;
    left: 12px;
    gap: 12px;
  }

  .desktop-icon {
    width: 82px;
    font-size: 11px;
  }

  .desktop-icon img {
    width: 42px;
    height: 42px;
  }

  .xp-window,
  .lime-window {
    top: 70px;
    left: 10px;
    width: calc(100vw - 20px);
  }

  .lime-body {
    grid-template-columns: 1fr;
  }

  .lime-sidebar,
  .lime-adbar {
    display: none;
  }

  .start-button span {
    display: none;
  }

  .taskbar-tabs span {
    min-width: 110px;
  }
}
#popupLayer {
  position: absolute;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.image-popup {
  position: absolute;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  width: auto;
  height: auto;
  overflow: visible;
  pointer-events: auto;
  cursor: pointer;
}
#popupLayer {
  position: absolute;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.image-popup {
  position: absolute;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  width: auto;
  height: auto;
  overflow: visible;
  pointer-events: auto;
  cursor: pointer;
}
.prank-message {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #c0c0c0;
  color: #000;
  border: 3px outset #fff;
  padding: 18px 28px;
  z-index: 9999999;
  font-family: "MS Sans Serif", Arial, sans-serif;
  font-size: 22px;
}

.screen-flicker {
  animation: screenFlicker 0.12s infinite;
}

@keyframes screenFlicker {
  0% { filter: brightness(1); }
  50% { filter: brightness(2) contrast(2); }
  100% { filter: brightness(0.4); }
}

#bsodPrank {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 99999999;
}