@import url('data:font/woff2;base64,d09GMgABAAAAAAWYAAoAAAAABNwAAAVNAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgkIKgySCWwsIAAE2AiQDCgQgBQYHOBuzA8iOw7jhO7LFUv7jgf/X/X+f2fOe/+4HkCk3U6aE6hLVZJdcgtZZdprEU+HqGneSTFNJCyQtsLJAE7fAAk5xAtYvR02WQjvK5YXgCZCEP2GdNOKuuA2b5qHhre42EKUpAAhNATB8ysRx7lVCJYRtxfcI24xBgDACmAJSEPSLOEIwREG/iAYmsSIiVUKx+A80EQCI0uxGEEtRgfXYBYhAVJYkA3v2bVyW1JdNzjI1c7oew7s5u4a3tXaJr41j2s6xdjjLlkVrZFtrc9vYFJ293kUbrXw8Y5y99vZ5tN8Re/vd4+Py3j6O9L1n6q5ed3W9k5v7OD7g3oYt/dYOej7gy+AXw3LDXrKi+41xz/u+GPSyC1sGfxu8a8DJ3icP9K3tXc3Omlva/k9LppNpSy0lPjEOSN7K9rZM6S0kPwQQ+LdiQn1Ok+8+HVreLvn84fhgz6t5rfe8Puz1kNsXQnFKKwrfD/nt/5Ir92b+OuzpE9e/fK0HQGCkHTmvTHnW9HfE6CIoD3/37+sM/hcPxr1gTsAVDgTaUsyEGqI2yKdZi6hQy1FFEBUNW6Tk0EKjJSInIpOKdxHH+ZNnFdJiQwAA') format('woff2')), monospace;

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

body {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 12px;
  overflow: hidden;
  background: #C0C0C0;
  cursor: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAASCAYAAACE1oM7AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAFYSURBVDiNpZM9SwNBEIafgxBsbGwtLQQrwcJCG1sLG1vBQrBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLCwULCwsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQsLGwsLBQ'), auto;
  line-height: 1.2;
}

.app {
  width: 100vw;
  height: 100vh;
  position: relative;
}

.desktop {
  width: 100%;
  height: 100%;
  position: relative;
  background: #C0C0C0;
  background-image: 
    radial-gradient(circle at 25% 25%, #000 1px, transparent 1px),
    radial-gradient(circle at 75% 75%, #000 1px, transparent 1px),
    radial-gradient(circle at 25% 75%, #000 1px, transparent 1px),
    radial-gradient(circle at 75% 25%, #000 1px, transparent 1px);
  background-size: 4px 4px;
  background-position: 0 0, 2px 2px, 0 2px, 2px 0;
}

.window {
  position: absolute;
  background: #C0C0C0;
  border: 3px solid #000;
  box-shadow: 3px 3px 0px #808080;
  min-width: 250px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
}

.window-titlebar {
  background: #C0C0C0;
  border-bottom: 2px solid #000;
  padding: 4px 8px;
  font-weight: bold;
  cursor: move;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 24px;
  user-select: none;
}

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

.window-button {
  width: 16px;
  height: 16px;
  background: #C0C0C0;
  border: 1px solid #000;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  font-weight: bold;
}

.window-button:hover {
  background: #A0A0A0;
}

.close-button:hover {
  background: #FF6666 !important;
  color: white;
}

.window-content {
  flex: 1;
  background: #C0C0C0;
  overflow: auto;
}

.window-resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  cursor: se-resize;
  background: linear-gradient(-45deg, transparent 4px, #000 4px, #000 6px, transparent 6px);
}

.terminal {
  background: #C0C0C0;
  color: #000;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 11px;
  padding: 8px;
  height: 100%;
  overflow-y: auto;
  line-height: 1.3;
}

.terminal-line {
  margin-bottom: 2px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.terminal-input-line {
  display: flex;
  align-items: center;
}

.terminal-input {
  background: transparent;
  border: none;
  outline: none;
  color: #000;
  font-family: inherit;
  font-size: inherit;
  flex: 1;
}

.terminal-cursor {
  background: #000;
  color: #C0C0C0;
  animation: blink 1.06s infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.app-generator {
  padding: 12px;
  height: 100%;
  overflow-y: auto;
}

.generator-header {
  font-weight: bold;
  text-align: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #000;
}

.generation-status {
  background: #A0A0A0;
  border: 1px solid #000;
  padding: 4px 8px;
  margin-bottom: 8px;
  font-size: 10px;
  text-align: center;
}

.generator-form {
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: bold;
}

.retro-select, .retro-textarea, .retro-input {
  width: 100%;
  background: #C0C0C0;
  border: 2px inset #C0C0C0;
  font-family: inherit;
  font-size: 11px;
  padding: 4px;
}

.retro-button {
  background: #C0C0C0;
  border: 2px outset #C0C0C0;
  font-family: inherit;
  font-size: 11px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: bold;
}

.retro-button:hover:not(:disabled) {
  background: #A0A0A0;
}

.retro-button:active:not(:disabled) {
  border: 2px inset #C0C0C0;
}

.retro-button:disabled {
  color: #808080;
  cursor: not-allowed;
}

.generate-button {
  width: 100%;
  margin-top: 8px;
}

.templates-section, .history-section {
  margin-bottom: 16px;
}

.templates-section h4, .history-section h4 {
  margin-bottom: 8px;
  font-size: 12px;
  border-bottom: 1px solid #808080;
  padding-bottom: 2px;
}

.templates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.template-button {
  background: #C0C0C0;
  border: 1px solid #808080;
  padding: 4px;
  font-size: 10px;
  cursor: pointer;
  text-align: left;
}

.template-button:hover:not(:disabled) {
  background: #A0A0A0;
}

.history-list {
  max-height: 120px;
  overflow-y: auto;
}

.history-item {
  padding: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  margin-bottom: 2px;
}

.history-item:hover {
  background: #A0A0A0;
  border: 1px solid #808080;
}

.app-library {
  padding: 12px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.library-header {
  margin-bottom: 12px;
}

.library-header h3 {
  margin-bottom: 8px;
  font-size: 14px;
  border-bottom: 2px solid #000;
  padding-bottom: 4px;
}

.library-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.library-controls .retro-input {
  flex: 1;
  max-width: 200px;
}

.library-controls .retro-select {
  width: auto;
  min-width: 120px;
}

.library-stats {
  font-size: 10px;
  color: #666;
  margin-bottom: 8px;
}

.app-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.empty-library {
  grid-column: 1 / -1;
  text-align: center;
  color: #666;
  padding: 20px;
}

.app-card {
  border: 1px solid #808080;
  background: #C0C0C0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.app-card:hover {
  background: #A0A0A0;
}

.app-info {
  flex: 1;
}

.app-info strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
}

.app-prompt {
  font-size: 10px;
  color: #333;
  margin-bottom: 4px;
  line-height: 1.2;
}

.app-meta {
  font-size: 9px;
  color: #666;
  display: flex;
  justify-content: space-between;
}

.app-actions {
  display: flex;
  gap: 4px;
}

.app-actions .retro-button {
  flex: 1;
  padding: 4px 8px;
  font-size: 10px;
}

.delete-button {
  background: #E0E0E0 !important;
}

.delete-button:hover:not(:disabled) {
  background: #FF9999 !important;
}

.library-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.library-actions .retro-button {
  font-size: 10px;
  padding: 4px 8px;
}

.dynamic-app {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dynamic-app.error {
  padding: 12px;
}

.error-info h3 {
  color: #800000;
  margin-bottom: 8px;
}

.error-info p {
  margin-bottom: 12px;
}

.error-info details {
  background: #E0E0E0;
  border: 1px solid #808080;
  padding: 4px;
}

.error-info pre {
  font-size: 9px;
  overflow: auto;
  max-height: 200px;
  background: #F0F0F0;
  padding: 4px;
  border: 1px solid #808080;
  margin-top: 4px;
}

.app-info {
  background: #A0A0A0;
  padding: 4px 8px;
  font-size: 10px;
  border-bottom: 1px solid #000;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-model {
  color: #666;
  font-size: 9px;
}

.app-iframe {
  flex: 1;
  border: none;
  width: 100%;
  background: white;
}

.file-manager {
  padding: 8px;
  height: 100%;
}

.file-header {
  display: grid;
  grid-template-columns: 1fr 80px 120px;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #000;
  margin-bottom: 4px;
  font-weight: bold;
}

.file-list {
  height: calc(100% - 30px);
  overflow-y: auto;
}

.file-item {
  display: grid;
  grid-template-columns: 1fr 80px 120px;
  gap: 8px;
  padding: 2px 0;
  cursor: pointer;
}

.file-item:hover {
  background: #A0A0A0;
}

.clock-widget {
  padding: 12px;
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.clock-date {
  font-size: 11px;
  margin-bottom: 4px;
}

.clock-time {
  font-size: 14px;
  font-weight: bold;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.graphics-demo {
  padding: 8px;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.retro-canvas {
  border: 1px solid #000;
  background: #C0C0C0;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.tools-panel {
  padding: 8px;
  height: 100%;
}

.tools-title {
  text-align: center;
  font-weight: bold;
  margin-bottom: 8px;
}

.tools-done {
  text-align: center;
  padding: 2px 8px;
  border: 1px solid #000;
  margin-bottom: 8px;
  cursor: pointer;
  background: #C0C0C0;
}

.tools-done:hover {
  background: #A0A0A0;
}

.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  font-size: 10px;
}

.tool-item {
  padding: 4px;
  border: 1px solid transparent;
  text-align: center;
}

.tool-clickable {
  cursor: pointer;
}

.tool-clickable:hover {
  border: 1px solid #000;
  background: #A0A0A0;
}

.tool-disabled {
  color: #808080;
}

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: #C0C0C0;
  border: 1px solid #000;
}

::-webkit-scrollbar-thumb {
  background: #808080;
  border: 1px solid #000;
}

::-webkit-scrollbar-thumb:hover {
  background: #606060;
}

::selection {
  background: #000;
  color: #C0C0C0;
}

.window:hover {
  cursor: default;
}

.window-titlebar:hover {
  cursor: move;
}

.window-resize-handle:hover {
  cursor: se-resize;
}