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

body {
  font-family: Arial, sans-serif;
  background: #f0f0f0;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

.tools, .effects {
  background: white;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.effects {
  flex-wrap: wrap;
}

.effect-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 120px;
}

.effect-group label {
  font-size: 12px;
  color: #666;
}

.tool-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  border-radius: 4px;
}

.tool-btn:hover {
  background: #f0f0f0;
}

.tool-btn.active {
  background: #e0e0e0;
}

.tool-btn svg {
  fill: #666;
}

.tool-btn.active svg {
  fill: #000;
}

#canvas {
  width: 100%;
  height: 400px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  touch-action: none;
}

.actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

button {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  background: #4CAF50;
  color: white;
  cursor: pointer;
  font-size: 14px;
}

button:hover {
  background: #45a049;
}

#clear {
  background: #f44336;
}

#clear:hover {
  background: #da190b;
}

#reset-effects {
  background: #ff9800;
}

#reset-effects:hover {
  background: #f57c00;
}

select, input[type="range"] {
  padding: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.gallery {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.gallery img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@media (max-width: 600px) {
  .tools, .effects {
    flex-wrap: wrap;
  }
  
  #canvas {
    height: 300px;
  }
  
  .effect-group {
    min-width: calc(50% - 10px);
  }
}