* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  overflow: hidden;
  background: #1a1a2e;
  font-family: 'Courier New', monospace;
}

canvas {
  display: block;
}

#module-palette {
  position: fixed;
  top: 10px;
  left: 10px;
  background: rgba(20, 20, 40, 0.95);
  border: 1px solid #444;
  border-radius: 6px;
  padding: 8px;
  z-index: 100;
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  width: 160px;
  transition: opacity 0.15s ease;
}

#module-palette h3 {
  color: #aaa;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #333;
}

#module-palette .palette-section {
  margin-bottom: 8px;
}

#module-palette .palette-section-title {
  color: #888;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

#module-palette .palette-section-title:hover {
  color: #aaa;
}

#module-palette .palette-section-title .triangle {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid #888;
  transition: transform 0.15s ease;
}

#module-palette .palette-section-title:hover .triangle {
  border-top-color: #aaa;
}

#module-palette .palette-section.collapsed .palette-section-title .triangle {
  transform: rotate(-90deg);
}

#module-palette .palette-section-content {
  overflow: hidden;
  transition: max-height 0.15s ease;
}

#module-palette .palette-section.collapsed .palette-section-content {
  max-height: 0 !important;
}

#module-palette button {
  display: block;
  width: 100%;
  padding: 4px 8px;
  margin-bottom: 2px;
  background: #2a2a4a;
  color: #ccc;
  border: 1px solid #444;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  cursor: pointer;
  text-align: left;
}

#module-palette button:hover {
  background: #3a3a5a;
  color: #fff;
  border-color: #666;
}

#fullscreen-monitor {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 200;
  cursor: none;
}

#fullscreen-monitor canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
