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

body {
  font-family: system-ui, sans-serif;
  background: #0f0f13;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.container {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

header .subtitle {
  color: #888;
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

.preview {
  height: 180px;
  border-radius: 16px;
  background: rgb(128, 128, 128);
  transition: background 0.1s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.sliders {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.slider-group label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  color: #aaa;
}

.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  background: #2a2a2a;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid #fff;
  cursor: pointer;
  transition: transform 0.1s;
}

.slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

.red-slider::-webkit-slider-thumb    { background: #ff4d4d; }
.green-slider::-webkit-slider-thumb  { background: #4dff88; }
.blue-slider::-webkit-slider-thumb   { background: #4d88ff; }

.output {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hex-display {
  flex: 1;
  font-family: monospace;
  font-size: 1.4rem;
  font-weight: 700;
  padding: 0.75rem 1rem;
  background: #1e1e24;
  border-radius: 10px;
  letter-spacing: 0.1em;
}

.copy-btn {
  padding: 0.75rem 1.25rem;
  background: #2a2a35;
  color: #e0e0e0;
  border: 1px solid #3a3a4a;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  white-space: nowrap;
}

.copy-btn:hover   { background: #3a3a50; }
.copy-btn:active  { transform: scale(0.97); }
.copy-btn.copied  { background: #1a4a2a; color: #4dff88; border-color: #4dff88; }

.history h2 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin-bottom: 0.75rem;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 40px;
}

.swatch {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.1s, border-color 0.1s;
  title: attr(data-hex);
}

.swatch:hover {
  transform: scale(1.15);
  border-color: rgba(255,255,255,0.4);
}
