.canvas-header {
  margin-bottom: 20px;
}

.canvas-header h2 {
  margin: 0 0 10px 0;
}

.subtitle {
  margin: 0;
  color: #666;
  font-size: 14px;
}

.canvas-info {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding: 15px;
  background: #f5f5f5;
  border-radius: 4px;
  flex-wrap: wrap;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-item .label {
  font-weight: bold;
}

.info-item .value {
  color: #0066cc;
}

#connection-status {
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
}

#connection-status.connected {
  background: #4caf50;
  color: white;
}

#connection-status.disconnected {
  background: #f44336;
  color: white;
}

.color-picker {
  width: 40px;
  height: 30px;
  border: 2px solid #333;
  border-radius: 4px;
  cursor: pointer;
}

#color-value {
  font-family: monospace;
  font-weight: bold;
}

.canvas-container {
  position: relative;
  display: inline-block;
  margin: 20px 0;
  border: 2px solid #333;
  background: #fff;
  overflow: auto;
  max-width: 100%;
  max-height: 600px;
}

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

.canvas-overlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.cursor-indicator {
  position: absolute;
  border: 2px solid rgba(255, 0, 0, 0.8);
  pointer-events: none;
  display: none;
}

.color-palette {
  margin: 20px 0;
}

.color-palette h3 {
  margin: 0 0 10px 0;
  font-size: 16px;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 8px;
  max-width: 400px;
}

.palette-color {
  width: 40px;
  height: 40px;
  border: 2px solid #333;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.1s;
}

.palette-color:hover {
  transform: scale(1.1);
  border-color: #0066cc;
}

.palette-color.selected {
  border-color: #0066cc;
  border-width: 3px;
  box-shadow: 0 0 5px rgba(0, 102, 204, 0.5);
}

.controls {
  display: flex;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.btn {
  padding: 8px 16px;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.btn:hover {
  background: #0052a3;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.message-box {
  min-height: 30px;
  padding: 10px;
  margin: 20px 0;
  border-radius: 4px;
  font-size: 14px;
}

.message-box.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message-box.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.message-box.info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.message-box:empty {
  display: none;
}

.back-link {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
}

.back-link a {
  color: #0066cc;
  text-decoration: none;
}

.back-link a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .canvas-info {
    flex-direction: column;
    gap: 10px;
  }

  .controls {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .canvas-container {
    max-height: 400px;
  }
}
