@import url('https://unpkg.com/98.css');

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

body {
  overflow: hidden;
  background: #000000; /* nero per le barre laterali */
}

legend {
  font-weight: 700;
}

#boot-screen {
  position: fixed;
  inset: 0;
  background: #000000;
  color: #c0c0c0;
  font-family: "MS Sans Serif", Arial, sans-serif;
  font-size: 14px;
  padding: 24px;
  box-sizing: border-box;
  z-index: 5000;
  border-left: 15vw solid #000000;
  border-right: 15vw solid #000000;
}

#boot-screen.is-hidden {
  display: none;
}

.boot-epa {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 400px;
  height: auto;
  image-rendering: pixelated;
}

#boot-text {
  white-space: pre-wrap;
  margin: 0;
  background: #000000;
  color: #c0c0c0;
  border: 1px solid #000000;
  padding: 8px;
  box-shadow: none;
  outline: none;
}

.boot-logo {
  position: absolute;
  inset: 0;
  display: none;
}

.boot-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Desktop wrapper: centra l'area 4:3 con barre nere laterali */
.desktop-wrap {
  height: 100vh;
  width: 100vw;
  background: #000000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.desktop-area {
  flex: none;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* width e height vengono impostati dinamicamente da JS */
}

/* Superficie desktop: contiene icone e finestre */
.desktop-surface {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.desktop-wrap .window {
  width: 720px;
  max-width: 95%;
  min-width: 280px;
  min-height: 180px;
  resize: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: fixed;   /* sempre fuori dal flusso normale */
  left: -9999px;     /* nascosto finché JS non lo posiziona */
  top: 0;
}

.window-body p {
  margin: 0 0 1rem 0;
}

.window-body p:first-child {
  font-weight: 700;
  margin-bottom: .5rem;
}

.window-body fieldset {
  margin-top: 8px;
}

.window-body {
  overflow: auto;
  flex: 1;
  box-sizing: border-box;
  font: 13px "MS Sans Serif", Arial, sans-serif;
}

.window-body .actions {
  display: flex;
  gap: 8px;
}

.home-banner {
  width: 560px;
  height: 140px;
  display: block;
  margin-bottom: 8px;
  object-fit: cover;
}

.about-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.about-header img {
  max-width: 140px;
  border: 2px solid #000000;
}

.about-text p {
  margin: 0 0 8px 0;
}

.pcto-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}

.pcto-images img {
  width: 240px;
  height: auto;
  border: none;
}

/* Drag cursor and small touch niceties */
.title-bar { cursor: move; user-select: none; }
.title-bar-text { font-size: 16px; }
.window { touch-action: none; }

.window.is-minimized .window-body {
  display: none;
}

.window.is-hidden {
  display: none;
}

.window.is-maximized {
  position: fixed !important;
  resize: none;
  overflow: hidden;
}

.resizer {
  position: absolute;
  z-index: 6;
}

.resizer-n {
  top: -4px;
  left: 8px;
  right: 8px;
  height: 8px;
  cursor: n-resize;
}

.resizer-s {
  bottom: -4px;
  left: 8px;
  right: 8px;
  height: 8px;
  cursor: s-resize;
}

.resizer-e {
  right: -4px;
  top: 8px;
  bottom: 8px;
  width: 8px;
  cursor: e-resize;
}

.resizer-w {
  left: -4px;
  top: 8px;
  bottom: 8px;
  width: 8px;
  cursor: w-resize;
}

.resizer-ne {
  right: -4px;
  top: -4px;
  width: 10px;
  height: 10px;
  cursor: ne-resize;
}

.resizer-nw {
  left: -4px;
  top: -4px;
  width: 10px;
  height: 10px;
  cursor: nw-resize;
}

.resizer-se {
  right: -4px;
  bottom: -4px;
  width: 10px;
  height: 10px;
  cursor: se-resize;
}

.resizer-sw {
  left: -4px;
  bottom: -4px;
  width: 10px;
  height: 10px;
  cursor: sw-resize;
}


.desktop-icons {
  position: absolute;
  top: 8px;
  left: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  pointer-events: none;
}

.desktop-icon {
  width: 112px;
  text-align: center;
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
  box-shadow: none;
  position: absolute;
  pointer-events: auto;
}

.desktop-icon .icon-label {
  display: block;
  margin-top: 4px;
  text-shadow: 1px 1px #00000055;
  color: #ffffff;
  background: #008080;
  padding: 2px 4px;
  border-radius: 2px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.title-bar-controls button[aria-label="Close"] {
  background: #cc0000;
  color: #ffffff;
  font-weight: 700;
  background-image: none;
}

.title-bar-controls button[aria-label="Close"]::before {
  content: "×";
  display: inline-block;
  color: #ffffff;
  font-size: 12px;
  line-height: 10px;
}

.taskbar {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #c0c0c0;
  border-top: 2px solid #ffffff;
  box-sizing: border-box;
  font-size: 14px;
}

.start-button {
  min-width: 72px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 14px;
  padding: 4px 8px;
}

.start-button img {
  width: 20px;
  height: 20px;
}

.taskbar-windows {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.taskbar-windows .button {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
  font-size: 14px;
  padding: 4px 8px;
}

.taskbar-spacer {
  flex: 1;
}

.tray {
  padding: 2px 8px;
  border: 2px inset #ffffff;
  background: #c0c0c0;
  font-size: 13px;
}

.start-menu {
  position: absolute;
  left: 12px;
  bottom: 56px;
  width: 260px;
  background: #c0c0c0;
  border: 2px outset #ffffff;
  display: none;
  z-index: 2000;
  font-size: 14px;
  padding: 0;
}

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

.start-menu-content {
  display: grid;
  grid-template-columns: 36px 1fr;
}

.start-menu-side {
  background: #000080;
  color: #ffffff;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-size: 20px;
  padding: 6px 4px;
}

.start-menu-side span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  letter-spacing: 1px;
}

.start-menu-side strong {
  font-weight: 700;
}

.start-menu ul {
  list-style: none;
  margin: 6px;
  padding: 0;
}

.start-menu li {
  margin: 4px 0;
}

.start-menu a {
  display: block;
  padding: 6px 8px;
  text-decoration: none;
  color: #000000;
  font-size: 14px;
}

.start-menu a:hover {
  background: #000080;
  color: #ffffff;
}

.info-grid {
  display: grid;
  gap: 6px;
}