/* Campo Minato Vintage - Windows 95/98 Stile & Look and Feel */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

body {
  background-color: #008080; /* Classico verde petrolio Windows 95 */
  font-family: "Segoe UI", "Tahoma", "MS Sans Serif", Geneva, sans-serif;
  font-size: 12px;
  color: #000;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Desktop container */
.desktop {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: auto;
  position: relative;
}

/* Icone Desktop Vintage */
.desktop-icons {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  max-height: calc(100vh - 55px);
  gap: 14px;
  z-index: 1;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 72px;
  cursor: pointer;
  text-align: center;
}

.desktop-icon svg {
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,0.5));
}

.desktop-icon span {
  color: #ffffff;
  margin-top: 4px;
  padding: 1px 3px;
  font-size: 11px;
  text-shadow: 1px 1px 1px #000;
  line-height: 1.2;
}

.desktop-icon:focus span,
.desktop-icon.selected span {
  background-color: #000080;
}

/* Finestra Principale Windows 95 */
.win95-window {
  background-color: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #000000;
  border-bottom: 2px solid #000000;
  box-shadow: 1px 1px 0 #808080 inset, -1px -1px 0 #808080 inset;
  padding: 3px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
  max-width: 98vw;
  max-height: calc(100vh - 45px);
}

/* Barra del titolo */
.win95-titlebar {
  background: #808080;
  color: #d8d8d8;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 3px 2px 4px;
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 0.3px;
  cursor: move;
}

.win95-window.active .win95-titlebar {
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #ffffff;
}

.title-left {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  white-space: nowrap;
}

.app-icon {
  width: 16px;
  height: 16px;
}

.title-controls {
  display: flex;
  gap: 2px;
}

.title-btn {
  width: 16px;
  height: 14px;
  background-color: #c0c0c0;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 1px solid #000000;
  border-bottom: 1px solid #000000;
  box-shadow: 1px 1px 0 #808080 inset;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-family: sans-serif;
  font-size: 10px;
  font-weight: bold;
  color: #000;
  line-height: 1;
}

.title-btn:active {
  border-top: 1px solid #000000;
  border-left: 1px solid #000000;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
  box-shadow: -1px -1px 0 #808080 inset;
  padding: 1px 0 0 1px;
}

.title-btn.disabled {
  color: #808080;
  cursor: default;
  box-shadow: none;
}

/* Barra dei Menu */
.win95-menubar {
  display: flex;
  align-items: center;
  background-color: #c0c0c0;
  border-bottom: 1px solid #808080;
  padding: 2px 2px 1px 2px;
  font-size: 12px;
  gap: 2px;
}

.menu-item {
  position: relative;
}

.menu-header {
  padding: 2px 6px;
  cursor: pointer;
  border: 1px solid transparent;
}

.menu-header:hover,
.menu-header.active {
  background-color: #000080;
  color: #ffffff;
}

/* Sottomenu */
.menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #c0c0c0;
  border-top: 1px solid #ffffff;
  border-left: 1px solid #ffffff;
  border-right: 2px solid #000000;
  border-bottom: 2px solid #000000;
  box-shadow: 1px 1px 0 #808080 inset, -1px -1px 0 #808080 inset;
  min-width: 170px;
  padding: 2px;
  z-index: 100;
}

.menu-dropdown.show {
  display: block;
}

.menu-dropdown-item {
  display: flex;
  align-items: center;
  padding: 3px 12px 3px 20px;
  cursor: pointer;
  color: #000;
  font-size: 11.5px;
  position: relative;
}

.menu-dropdown-item:hover {
  background-color: #000080;
  color: #ffffff;
}

.menu-dropdown-item.checked::before {
  content: "✓";
  position: absolute;
  left: 6px;
  font-size: 11px;
  font-weight: bold;
}

.menu-dropdown-item.disabled {
  color: #808080;
  pointer-events: none;
}

.menu-separator {
  height: 1px;
  background-color: #808080;
  border-bottom: 1px solid #ffffff;
  margin: 3px 2px;
}

.menu-shortcut {
  margin-left: auto;
  padding-left: 14px;
  font-size: 11px;
  color: #444;
}

.menu-dropdown-item:hover .menu-shortcut {
  color: #ddd;
}

/* Barra degli Strumenti Veloce con Tasto Aiuto */
.win95-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 5px;
  background-color: #c0c0c0;
  border-bottom: 2px solid #808080;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.win95-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #000000;
  border-bottom: 2px solid #000000;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
  font-weight: 500;
  color: #000;
}

.win95-tool-btn:active,
.win95-tool-btn.active {
  border-top: 2px solid #000000;
  border-left: 2px solid #000000;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding: 3px 7px 1px 9px;
  background-color: #b0b0b0;
}

.win95-tool-btn.highlight {
  font-weight: bold;
}

/* Area Interna di Gioco */
.game-inner-frame {
  background-color: #c0c0c0;
  border: 3px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 3px;
}

/* Header punteggi e faccina */
.game-header {
  background-color: #c0c0c0;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  padding: 4px 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Display 7 Segmenti a LED */
.seven-seg-display {
  background-color: #000000;
  border: 1px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  padding: 2px 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 47px;
  height: 29px;
  box-sizing: border-box;
}

.digit-svg {
  width: 15px;
  height: 25px;
}

.seg-lit {
  fill: #ff0000;
}

.seg-dim {
  fill: #290000;
}

/* Faccina Gialla */
.face-button {
  width: 28px;
  height: 28px;
  background-color: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #808080;
  border-bottom: 2px solid #808080;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.face-button:active,
.face-button.pressed {
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding-top: 1px;
  padding-left: 1px;
}

/* Cornice Griglia di Gioco */
.board-container {
  border: 3px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  background-color: #c0c0c0;
  overflow: auto;
  max-width: 100%;
  max-height: calc(100vh - 190px);
}

.board-grid {
  display: grid;
  background-color: #808080;
  gap: 0;
  margin: 0 auto;
  width: fit-content;
}

/* Caselle Griglia */
.cell {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Lucida Console", "Courier New", monospace, sans-serif;
  font-weight: 900;
  font-size: 15px;
  box-sizing: border-box;
  background-color: #c0c0c0;
  cursor: default;
}

/* Casella non scoperta (3D sporgente) */
.cell.unrevealed {
  border-top: 2.5px solid #ffffff;
  border-left: 2.5px solid #ffffff;
  border-right: 2.5px solid #808080;
  border-bottom: 2.5px solid #808080;
}

/* Casella premuta/depressa col mouse */
.cell.depressed,
.cell.unrevealed:active {
  border-top: 1.5px solid #808080;
  border-left: 1.5px solid #808080;
  border-right: 1.5px solid #c0c0c0;
  border-bottom: 1.5px solid #c0c0c0;
}

/* Casella scoperta (piatta) */
.cell.revealed {
  border: 1px solid #7b7b7b;
  background-color: #c0c0c0;
}

.cell.revealed.mine {
  background-color: #c0c0c0;
}

.cell.revealed.exploded {
  background-color: #ff0000; /* Mina esplosa che ha causato la sconfitta */
}

/* Colori numeri originali Windows 95 */
.cell.num-1 { color: #0000ff; } /* Blu */
.cell.num-2 { color: #008000; } /* Verde */
.cell.num-3 { color: #ff0000; } /* Rosso */
.cell.num-4 { color: #000080; } /* Blu scuro */
.cell.num-5 { color: #800000; } /* Bordeaux/Marrone */
.cell.num-6 { color: #008080; } /* Turchese/Ciano scuro */
.cell.num-7 { color: #000000; } /* Nero */
.cell.num-8 { color: #808080; } /* Grigio */

.cell.question {
  color: #000000;
  font-weight: bold;
}

/* Barra di stato inferiore della finestra */
.win95-statusbar {
  display: flex;
  align-items: center;
  background-color: #c0c0c0;
  padding: 2px;
  gap: 3px;
  margin-top: 3px;
}

.status-panel {
  border: 1px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  padding: 2px 6px;
  font-size: 11px;
  color: #222;
}

.status-panel.flex-1 {
  flex: 1;
}

/* Barra delle Applicazioni in Basso (Taskbar) */
.taskbar {
  height: 30px;
  background-color: #c0c0c0;
  border-top: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 3px;
  z-index: 1000;
  position: relative;
}

.start-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 2px 6px;
  background-color: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #000000;
  border-bottom: 2px solid #000000;
  font-weight: bold;
  font-size: 12px;
  cursor: pointer;
}

.start-btn:active,
.start-btn.active {
  border-top: 2px solid #000000;
  border-left: 2px solid #000000;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding: 3px 5px 1px 7px;
}

.taskbar-tasks {
  flex: 1;
  display: flex;
  gap: 4px;
  padding: 0 6px;
}

.task-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  max-width: 170px;
  flex: 1;
  background-color: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #000000;
  border-bottom: 2px solid #000000;
  padding: 2px 6px;
  font-size: 11.5px;
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.task-tab.active {
  background-color: #dfdfdf;
  border-top: 2px solid #000000;
  border-left: 2px solid #000000;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  font-weight: bold;
}

.taskbar-tray {
  border: 1px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  height: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  font-size: 11px;
}

/* Menu Avvio (Start Menu) */
.start-menu {
  display: none;
  position: absolute;
  bottom: 30px;
  left: 2px;
  width: 210px;
  background-color: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #000000;
  border-bottom: 2px solid #000000;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.4);
  z-index: 1001;
}

.start-menu.show {
  display: flex;
}

.start-sidebar {
  background: linear-gradient(180deg, #000080, #1084d0);
  width: 26px;
  display: flex;
  align-items: flex-end;
  padding-bottom: 10px;
  padding-left: 4px;
}

.start-sidebar span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  color: #ffffff;
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 2px;
}

.start-items {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 2px;
}

.start-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
}

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

/* Finestre di Dialogo Vintage (Modali <dialog>) */
dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: none;
  background-color: #c0c0c0;
  padding: 3px;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #000000;
  border-bottom: 2px solid #000000;
  box-shadow: 2px 2px 10px rgba(0,0,0,0.5);
  font-family: inherit;
  color: #000;
  max-width: 90vw;
  max-height: 85vh;
  overflow: hidden;
  z-index: 2000;
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.2);
}

.modal-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 80vh;
}

.modal-titlebar {
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #ffffff;
  padding: 2px 4px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 20px;
  font-size: 12px;
}

.modal-body {
  padding: 12px 14px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.4;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 12px;
}

/* Pulsanti Standard Windows 95 */
.win95-btn {
  background-color: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #000000;
  border-bottom: 2px solid #000000;
  padding: 4px 16px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  min-width: 72px;
  text-align: center;
}

.win95-btn:active {
  border-top: 2px solid #000000;
  border-left: 2px solid #000000;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding: 5px 15px 3px 17px;
}

.win95-btn:focus {
  outline: 1px dotted #000;
  outline-offset: -4px;
}

/* Stili specifici per la Guida di Gioco (Help Modal) */
.help-window {
  width: 520px;
}

.help-topic-card {
  background-color: #ffffff;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  padding: 12px;
  margin-bottom: 12px;
}

.help-topic-card h3 {
  font-size: 13px;
  margin-bottom: 8px;
  color: #000080;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid #d0d0d0;
  padding-bottom: 4px;
}

.help-mouse-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: 11.5px;
}

.help-mouse-table th,
.help-mouse-table td {
  border: 1px solid #c0c0c0;
  padding: 6px 8px;
  text-align: left;
}

.help-mouse-table th {
  background-color: #e8e8e8;
  font-weight: bold;
}

.help-mouse-icon {
  display: inline-block;
  background-color: #c0c0c0;
  padding: 1px 4px;
  border-radius: 2px;
  font-weight: bold;
  border: 1px solid #808080;
}

.number-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.number-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f0f0f0;
  padding: 2px 6px;
  border: 1px solid #ddd;
  font-size: 11px;
}

.number-badge strong {
  font-size: 13px;
  font-family: monospace;
}

/* Modale Personalizzato */
.custom-input-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.win95-input {
  background-color: #ffffff;
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding: 2px 5px;
  width: 65px;
  font-family: inherit;
  font-size: 12px;
}

/* Modale Record */
.records-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}

.records-table th,
.records-table td {
  padding: 5px 8px;
  text-align: left;
}

.records-table tr:nth-child(even) {
  background-color: #e0e0e0;
}

/* Responsive per schermi piccoli / touch */
@media (max-width: 600px) {
  .win95-toolbar {
    flex-wrap: wrap;
  }
  .desktop-icons {
    display: none;
  }
  .help-window {
    width: 95vw;
  }
  .desktop {
    padding: 4px;
  }
}

/* ================= STILI SPECIFICI PER SERPENTE '95 ================= */
#snake-window {
  width: 380px;
}

.snake-header {
  background-color: #c0c0c0;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.snake-label-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.snake-label {
  font-size: 10px;
  font-weight: bold;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.snake-canvas-box {
  border: 3px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  background-color: #0a1a0a;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2px;
}

#snake-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: pointer;
  display: block;
}

/* Pad Direzionale Vintage per il Mouse */
.snake-dpad-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background-color: #c0c0c0;
  border: 1px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  margin-top: 4px;
}

.dpad-label {
  font-size: 11px;
  font-weight: bold;
  color: #222;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.snake-dpad {
  display: grid;
  grid-template-columns: repeat(3, 30px);
  grid-template-rows: repeat(2, 26px);
  gap: 3px;
  justify-content: center;
}

.dpad-btn {
  background-color: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #000000;
  border-bottom: 2px solid #000000;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.dpad-btn:active {
  border-top: 2px solid #000000;
  border-left: 2px solid #000000;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding-top: 1px;
  padding-left: 1px;
}

.dpad-up { grid-column: 2; grid-row: 1; }
.dpad-left { grid-column: 1; grid-row: 2; }
.dpad-down { grid-column: 2; grid-row: 2; }
.dpad-right { grid-column: 3; grid-row: 2; }

/* ================= STILI SPECIFICI PER OTHELLO ================= */
#othello-window {
  width: 420px;
}

.othello-header {
  background-color: #c0c0c0;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.othello-turn-box {
  background-color: #e0e0e0;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: bold;
  color: #000080;
  min-width: 130px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.othello-board-box {
  border: 3px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  background-color: #1a4d2c;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px;
}

#othello-canvas {
  background-color: #1a4d2c;
  display: block;
  image-rendering: pixelated;
  cursor: pointer;
}

/* ================= STILI SPECIFICI PER LIFE '95 ================= */
#life-window {
  width: 480px;
}

.life-header {
  background-color: #c0c0c0;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.life-canvas-box {
  border: 3px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  background-color: #051205;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2px;
  overflow: hidden;
}

#life-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: crosshair;
  display: block;
}

.win95-select {
  background-color: #ffffff;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
  padding: 1px 3px;
  font-family: inherit;
  font-size: 11px;
  color: #000;
  outline: none;
  cursor: pointer;
}

/* ================= STILI SPECIFICI PER CORE WAR '95 ================= */
#corewar-window {
  width: 530px;
}

.corewar-header {
  background-color: #c0c0c0;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.corewar-canvas-box {
  border: 3px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  background-color: #080c08;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2px;
  overflow: hidden;
}

#corewar-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

.corewar-editors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 4px;
}

.corewar-editor-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background-color: #c0c0c0;
  border: 1px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  padding: 4px;
}

.corewar-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: bold;
}

.corewar-textarea {
  width: 100%;
  height: 85px;
  background-color: #000000;
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  font-family: "Lucida Console", "Courier New", monospace;
  font-size: 11px;
  padding: 4px;
  resize: vertical;
  outline: none;
  white-space: pre;
}

.corewar-textarea.warrior1 {
  color: #00ffff;
}

.corewar-textarea.warrior2 {
  color: #ff6666;
}

#corewar-status-badge {
  display: inline-block;
  padding: 2px 8px;
  background-color: #e0e0e0;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
  font-weight: bold;
  font-size: 11px;
}

#corewar-status-badge.running {
  background-color: #008000;
  color: #ffffff;
  border-color: #004d00 #99ff99 #99ff99 #004d00;
}

#corewar-status-badge.paused {
  background-color: #808000;
  color: #ffffff;
}

#corewar-status-badge.win-p1 {
  background-color: #000080;
  color: #ffff00;
  border: 2px solid #ffcc00;
  box-shadow: 0 0 6px #0055ff;
  animation: win-pulse 0.8s infinite alternate;
}

#corewar-status-badge.win-p2 {
  background-color: #800000;
  color: #ffff00;
  border: 2px solid #ffcc00;
  box-shadow: 0 0 6px #ff2222;
  animation: win-pulse 0.8s infinite alternate;
}

#corewar-status-badge.tie {
  background-color: #444444;
  color: #ffffff;
}

@keyframes win-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.corewar-editor-col {
  transition: border-color 0.3s, box-shadow 0.3s;
}

.corewar-editor-col.winner {
  border: 2px solid #ffaa00 !important;
  box-shadow: 0 0 10px rgba(255, 170, 0, 0.7);
}

/* ================= STILI SPECIFICI PER TETRIS '95 ================= */
#tetris-window {
  width: 440px;
}

.tetris-game-frame {
  background-color: #c0c0c0;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tetris-main-area {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: center;
}

.tetris-well-container {
  border: 3px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  background-color: #0a0a14;
  padding: 2px;
  box-shadow: inset 1px 1px 0 #000000;
}

#tetris-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
  background-color: #0a0a14;
  cursor: pointer;
}

.tetris-sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 170px;
}

.tetris-panel-box {
  background-color: #c0c0c0;
  border: 1px solid;
  border-color: #ffffff #808080 #808080 #ffffff;
  padding: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tetris-panel-title {
  font-size: 10px;
  font-weight: bold;
  color: #000080;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.tetris-preview-box {
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  background-color: #0a0a14;
  width: 68px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#tetris-preview-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
}

.tetris-stat-group {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 1px 4px;
  font-size: 11px;
}

.tetris-stat-num {
  font-weight: bold;
  color: #000080;
}

.tetris-touch-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  margin-top: 2px;
}

.tetris-touch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3px;
}

.tetris-key-btn {
  background-color: #c0c0c0;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #000000;
  border-bottom: 2px solid #000000;
  font-size: 11px;
  font-weight: bold;
  padding: 4px 2px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.tetris-key-btn:active {
  border-top: 2px solid #000000;
  border-left: 2px solid #000000;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding-top: 5px;
  padding-left: 3px;
  background-color: #b0b0b0;
}

.tetris-key-btn.rotate-btn {
  background-color: #d0d4e0;
  color: #000080;
}

.tetris-key-btn.drop-btn {
  background-color: #e0d4d0;
  color: #800000;
}

/* ================= STILI SPECIFICI PER HONKEY KONG '95 ================= */
#donkey-window {
  width: 486px;
  max-width: 98vw;
}

.donkey-header {
  background-color: #c0c0c0;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.donkey-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.donkey-stat-title {
  font-size: 10px;
  font-weight: bold;
  color: #000080;
  letter-spacing: 0.5px;
}

.donkey-lives-display {
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: #000000;
  border-top: 1px solid #808080;
  border-left: 1px solid #808080;
  border-right: 1px solid #ffffff;
  border-bottom: 1px solid #ffffff;
  padding: 2px 6px;
  min-height: 24px;
}

.donkey-life-icon {
  font-size: 14px;
  line-height: 1;
}

.donkey-canvas-container {
  border: 3px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  background-color: #000000;
  padding: 2px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 1px 1px 0 #000000;
}

#donkey-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  display: block;
  background-color: #000000;
  width: 448px;
  height: 512px;
  max-width: 100%;
  aspect-ratio: 7 / 8;
  cursor: pointer;
}

.donkey-arcade-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #c0c0c0;
  border-top: 1px solid #808080;
  padding: 6px 12px;
  margin-top: 4px;
}

.donkey-dpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.donkey-dpad-horiz {
  display: flex;
  gap: 3px;
}

.donkey-btn {
  background-color: #d4d0c8;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  border-right: 2px solid #000000;
  border-bottom: 2px solid #000000;
  font-size: 13px;
  font-weight: bold;
  color: #000080;
  width: 38px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.donkey-btn:active {
  border-top: 2px solid #000000;
  border-left: 2px solid #000000;
  border-right: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  padding-top: 2px;
  padding-left: 2px;
  background-color: #b0b0b0;
}

.donkey-action-pad {
  display: flex;
  align-items: center;
  justify-content: center;
}

.donkey-jump-btn {
  background: radial-gradient(circle at 30% 30%, #ff4d4d, #cc0000, #800000);
  border: 3px solid;
  border-color: #ff9999 #400000 #400000 #ff9999;
  border-radius: 50%;
  width: 66px;
  height: 66px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.4);
  user-select: none;
  touch-action: manipulation;
  color: #ffffff;
  text-shadow: 1px 1px 2px #000000;
}

.donkey-jump-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  background: radial-gradient(circle at 40% 40%, #ee2222, #aa0000, #660000);
}

.jump-btn-inner {
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.jump-subtext {
  font-size: 9px;
  opacity: 0.85;
}

/* ==========================================================================
   Nexus Auth Fullscreen Overlay & Desktop Protection
   ========================================================================== */
.desktop {
  display: none;
}

.desktop.authenticated {
  display: flex !important;
}

.taskbar {
  display: none;
}

.taskbar.authenticated {
  display: flex !important;
}


/* Solitario Styles */
.solitaire-area {
  padding: 10px;
  background-color: #008000;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.solitaire-top-row { display: flex; gap: 10px; }
.solitaire-tableau-row { display: flex; gap: 10px; }
.card-slot {
  width: 70px;
  height: 95px;
  border: 1px solid #004000;
  border-radius: 4px;
  background-color: rgba(0,0,0,0.2);
  position: relative;
}
.card {
  width: 70px;
  height: 95px;
  border: 1px solid #000;
  border-radius: 4px;
  background-color: #fff;
  position: absolute;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  padding: 2px;
}
.card-back {
  background-color: #000080;
  background-image: repeating-linear-gradient(45deg, #0000a0, #0000a0 10px, #000080 10px, #000080 20px);
}
.card-rank { font-weight: bold; font-size: 14px; }
.card-suit { font-size: 18px; }
.card-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.3); }
.suit-placeholder { font-size: 30px; color: rgba(0,0,0,0.2); display: flex; align-items: center; justify-content: center; height: 100%; }

/* ==========================================================================
   INVADERS '95 STYLES
   ========================================================================== */
.invaders-header {
  background-color: #c0c0c0;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.invaders-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.invaders-stat-title {
  font-size: 10px;
  font-weight: bold;
  color: #000080;
  letter-spacing: 0.5px;
}

.invaders-lives-display {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 25px;
  padding: 0 4px;
  background-color: #000000;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
  font-size: 14px;
}

.invaders-canvas-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #000010;
  border: 2px solid;
  border-color: #808080 #ffffff #ffffff #808080;
}

#win95-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background-color: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #f8fafc;
}

#win95-auth-overlay.hidden {
  display: none !important;
}
