/* Windows 98 Desktop Styles */

.win98-desktop {
  height: 100%;
  width: 100%;
  background-color: var(--win98-desktop);
  position: relative;
  overflow: hidden;
  user-select: none;
}

/* Desktop with wallpaper */
.win98-desktop-wallpaper {
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Desktop icons container */
.win98-desktop-icons {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, 75px);
  grid-gap: 20px;
  z-index: 1;
}

/* Desktop icon */
.win98-desktop-icon {
  position: absolute;
  width: 75px;
  height: 75px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 4px;
  border: 1px solid transparent;
  z-index: 1;
}

.win98-desktop-icon:hover {
  border: 1px dotted rgba(255, 255, 255, 0.5);
}

.win98-desktop-icon:focus {
  outline: none;
  border: 1px dotted rgba(255, 255, 255, 0.8);
}

.win98-desktop-icon-image {
  width: 32px;
  height: 32px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.win98-desktop-icon-image img {
  width: 32px;
  height: 32px;
}

.win98-desktop-icon-label {
  color: #ffffff;
  text-align: center;
  text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.7);
  font-size: 11px;
  font-family: 'MS Sans Serif', 'Microsoft Sans Serif', sans-serif;
  max-width: 67px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 1px 2px;
  border-radius: 1px;
}

/* Selected desktop icon */
.win98-desktop-icon.selected {
  border: 1px dotted rgba(255, 255, 255, 0.8);
}

.win98-desktop-icon.selected .win98-desktop-icon-label {
  background-color: var(--win98-title-active);
  color: var(--win98-title-text-active);
}

/* Responsive design for desktop */
@media (max-width: 1024px) {
  .win98-desktop-icons {
    grid-template-columns: repeat(auto-fill, 65px);
    grid-gap: 15px;
  }
  
  .win98-desktop-icon {
    width: 65px;
    height: 65px;
  }
  
  .win98-desktop-icon-text {
    max-width: 65px;
  }
}

@media (max-width: 640px) {
  .win98-desktop-icons {
    grid-template-columns: repeat(auto-fill, 60px);
    grid-gap: 10px;
  }
  
  .win98-desktop-icon {
    width: 60px;
    height: 60px;
  }
  
  .win98-desktop-icon-text {
    max-width: 60px;
    font-size: 10px;
  }
}

/* Touch device optimizations */
@media (pointer: coarse) {
  .win98-desktop-icon {
    padding: 5px;
  }
  
  .win98-desktop-icon-img {
    width: 40px;
    height: 40px;
  }
  
  /* Increase touch target sizes */
  .win98-window-button {
    width: 20px;
    height: 18px;
  }
  
  .win98-window-titlebar {
    height: 22px;
  }
}