@font-face {
  font-family: "MS Sans Serif";
  src: url("fonts/MSW98UI-Regular.ttf") format("truetype");
  font-weight: normal;
}

@font-face {
  font-family: "MS Sans Serif";
  src: url("fonts/MSW98UI-Bold.ttf") format("truetype");
  font-weight: bold;
}

/* ---------------- MOBILE FIX ---------------- */
@media (max-width: 600px) {
  .window {
    width: 95vw;
    height: auto;
    max-height: 80vh;
  }

  .window-content,
  .rich-content {
    max-height: 65vh;
    overflow: auto;
  }

  #desktop {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
  }

  .icon {
    transform: scale(1.3);
  }
}
/* -------------- END MOBILE FIX -------------- */

body {
  cursor: url("icons/windows-cursor.cur"), auto;
  background: #008080;
  font-family: "MS Sans Serif", sans-serif;
  margin: 0;
  overflow: hidden;
}

/* Desktop Icons */
.icon {
  display: inline-block;
  text-align: center;
  margin: 20px;
  cursor: pointer;
  vertical-align: top;
  width: 80px;
  touch-action: manipulation;
}

.icon span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  text-align: center;
}

.icon img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
}

.icon:active img {
  transform: translate(2px, 2px);
  filter: brightness(0.9);
}

.icon:hover {
  filter: brightness(1.2);
}

/* ---------------- WINDOWS ---------------- */
.window {
  width: 400px;
  height: 300px;
  background: #c0c0c0;
  border: 2px solid #000;
  box-shadow: 2px 2px #808080;
  position: absolute;
  display: none;

  resize: vertical;       /* only vertical resizing */
  overflow: hidden;       /* hides outer scrollbar completely */
  min-width: 400px;       /* fixed horizontal size */
  min-height: 150px;
  box-sizing: border-box;
}

.title-bar {
  background: linear-gradient(to right, #000080, #0000a0);
  color: white;
  padding: 4px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  cursor: move;
}

.title-bar span {
  display: flex;
  align-items: center;
}

.title-bar .title-icon {
  width: 20px;
  height: 20px;
  margin-right: 6px;
}

.title-bar button {
  background: #c0c0c0;
  border: 1px solid #808080;
  cursor: pointer;
  font-weight: bold;
  width: 20px;
  height: 20px;
  line-height: 16px;
  text-align: center;
  padding: 0;
}

/* Scrollable window content */
.window-content {
  overflow-y: auto;
  overflow-x: hidden;
  height: calc(100% - 28px); /* ✅ accounts for title/menu bar height */
  box-sizing: border-box;
  background: #ffffff;
  padding: 10px;
}

.rich-content {
  overflow: visible;      /* ✅ disables nested scrollbars */
  max-height: none;       /* ✅ prevents inner overflow */
  padding: 10px;
}

/* ---------------- NOTEPAD ---------------- */
.notepad .menu-bar {
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
  padding: 2px 6px;
  font-size: 13px;
}

/* ---------------- FOLDER WINDOWS ---------------- */
.folder-content {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 10px;
}

.folder-content .file img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
}

.folder-content .file span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  text-align: center;
}

.file {
  width: 80px;
  text-align: center;
  cursor: pointer;
}

.file img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
}

.file span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

/* ---------------- DESKTOP ---------------- */
#desktop {
  position: relative;
  height: calc(100vh - 40px);
  padding: 10px;
}

/* ---------------- TASKBAR ---------------- */
#taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #c0c0c0;
  border-top: 2px solid #808080;
  box-shadow: inset 1px 1px #fff, inset -1px -1px #000;
  padding: 4px;
  display: flex;
  align-items: center;
}

#start-button {
  background: #c0c0c0;
  border: 2px outset #fff;
  padding: 4px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: bold;
}

.start-icon {
  width: 16px;
  height: 16px;
}

/* ---------------- START MENU ---------------- */
#start-menu {
  position: fixed;
  bottom: 40px;
  left: 4px;
  width: 200px;
  background: #c0c0c0;
  border: 2px solid #000;
  box-shadow: 2px 2px #808080;
  display: none;
  font-family: "MS Sans Serif", sans-serif;
}

#start-menu::before {
  content: "";
  display: block;
  height: 100%;
  width: 30px;
  background: #000080;
  position: absolute;
  left: 0;
  top: 0;
}

#start-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
  left: 30px;
}

#start-menu li {
  padding: 6px 8px;
  cursor: pointer;
}

#start-menu li:hover {
  background: #000080;
  color: white;
}

/* ---------------- CLOCK ---------------- */
#clock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #c0c0c0;
  border: 2px inset #808080;
  padding: 2px 8px;
  margin-left: auto;
  margin-right: 6px;
  font-size: 13px;
  box-shadow: inset 1px 1px #fff, inset -1px -1px #000;
}

.clock-icon {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}
