body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
#startMenu {
  display: none; position: fixed; bottom: 28px; left: 0; width: 220px;
  background-color: #c0c0c0; border-top: 1px solid #dfdfdf; border-left: 1px solid #dfdfdf;
  border-right: 1px solid #000; border-bottom: 1px solid #000;
  box-shadow: inset 1px 1px #fff, inset -1px -1px #808080; z-index: 1002;
  padding: 2px; font-family: 'Pixelated MS Sans Serif', Arial; font-size: 12px;
}
.menu-item { padding: 6px 10px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.menu-item:hover { background-color: #000080; color: #fff; }

#overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.3); z-index: 999;
}
.popup-window {
  display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 380px; z-index: 1000;
}
.desktop-icon-text {
  color: white; font-family: 'Pixelated MS Sans Serif', Arial; font-size: 11px;
  text-align: center; margin-top: 4px; padding: 2px; line-height: 1.2; border: 1px solid transparent;
}
.desktop-icon-text.selected {
  background-color: #000080; border: 1px dotted #fff;
}

/* Schermata Blu della Morte */
#bsodScreen {
  display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; 
  background-color: #0000AA; color: #FFFFFF; font-family: 'Courier New', Courier, monospace; 
  z-index: 9999; flex-direction: column; justify-content: center; align-items: center; 
  padding: 20px; box-sizing: border-box; cursor: pointer; user-select: none;
}

@media (max-width: 600px) {
  /* Adatta lo sfondo e il logo centrale allo schermo mobile */
  body > div:first-of-type {
    background-size: 85vw auto !important;
    padding-top: 15px !important;
  }

  /* Dispone le 3 icone del desktop in orizzontale in alto su mobile */
  #desktopIcon { top: 12px !important; left: 15px !important; }
  #ieIcon { top: 12px !important; left: 105px !important; }
  #mineIcon { top: 12px !important; left: 195px !important; }

  /* Adatta la finestra principale della lotteria e Internet Explorer */
  #mainWindow, #ieWindow {
    width: 94vw !important;
    max-width: 94vw !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    transform: translate(-50%, -52%) !important;
    max-height: 82vh !important;
    overflow-y: auto !important;
  }

  /* Adatta tutte le finestre popup (Rules, About, History, Contact, Success) */
  .popup-window {
    width: 94vw !important;
    max-width: 94vw !important;
    max-height: 82vh !important;
    overflow-y: auto !important;
  }

  /* Evita sovrapposizioni nel box Current Round su schermi molto stretti */
  #mainWindow fieldset > div {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  /* Compatta i tab sulla Taskbar per non schiacciare l'orologio */
  #ieTaskbarTab, #lotteryTaskbarTab {
    width: 85px !important;
  }
}
