:root {
  color-scheme: light dark;
  --bg: #0f1220;
  --card: #151a2e;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #7c3aed;
  --border: rgba(148, 163, 184, 0.2);
}

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

body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: radial-gradient(circle at top left, #1f2440, #0b0d18 65%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app {
  max-width: 960px;
  margin: 40px auto 24px;
  padding: 24px;
  background: rgba(21, 26, 46, 0.7);
  border: 1px solid var(--border);
  border-radius: 20px;
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.header h1 {
  font-size: 2rem;
  margin-bottom: 6px;
}

.header p {
  color: var(--muted);
}

.preview {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
}

.preview-swatch {
  height: 220px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.preview-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.control {
  background: rgba(15, 18, 32, 0.7);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.control label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
}

.color-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  align-items: center;
}

.color-row input[type="range"] {
  width: 100%;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--muted);
}

.output {
  background: rgba(15, 18, 32, 0.7);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.output pre {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas;
  font-size: 0.9rem;
  color: #e2e8f0;
}

.btn {
  border: 1px solid var(--border);
  background: rgba(124, 58, 237, 0.15);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn.primary {
  background: linear-gradient(135deg, #7c3aed, #22d3ee);
  border: none;
  color: #0f172a;
  font-weight: 600;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.footer {
  margin-top: auto;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 700px) {
  .preview {
    grid-template-columns: 1fr;
  }
  .preview-actions {
    flex-direction: row;
    justify-content: flex-start;
  }
}
