* {
  box-sizing: border-box;
}
:root {
  --bg1: #0b0b12;
  --bg2: #141428;
  --card: #17172c;
  --text: #e6e6f0;
  --muted: #a8a8c7;
  --accent: #7c3aed;
  --ring: rgba(124, 58, 237, 0.5);
}

html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: "Outfit", system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  color: var(--text);
  background: radial-gradient(
      1200px 800px at 10% 10%,
      #1b1b35 0%,
      transparent 60%
    ),
    radial-gradient(1200px 800px at 90% 20%, #1a1735 0%, transparent 60%),
    linear-gradient(120deg, var(--bg1), var(--bg2));
}

.app-header {
  text-align: center;
  padding: 24px 16px 8px 16px;
}
.app-header h1 {
  margin: 0 0 8px 0;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: 0.5px;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.05), 0 0 40px var(--ring);
}
.app-header p {
  margin: 0;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  width: min(1200px, 96%);
  margin: 0 auto 32px auto;
}

.card {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.controls .card,
.note {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0)
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25), 0 0 60px rgba(124, 58, 237, 0.15);
}

.card h2 {
  margin: 0 0 8px 0;
  font-size: 18px;
}
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 6px 0;
}
input,
select {
  width: 100%;
  background: #0f0f1e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  outline: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.2);
}
.grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}
button {
  cursor: pointer;
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  background: #1d1d35;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s ease, box-shadow 0.2s ease, background 0.2s ease;
}
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
button.primary {
  background: radial-gradient(120% 140% at 0% 0%, #8b5cf6, #4f46e5);
}
.note {
  margin-top: 16px;
  color: var(--muted);
}

.preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.canvas-wrap {
  width: min(600px, 90%);
  aspect-ratio: 1;
  background: radial-gradient(
    140% 120% at 100% 0%,
    rgba(124, 58, 237, 0.15),
    transparent 40%
  );
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  display: grid;
  place-items: center;
  box-shadow: 0 20px 80px rgba(124, 58, 237, 0.25),
    inset 0 0 60px rgba(255, 255, 255, 0.04);
  padding: 20px;
}
#previewCanvas {
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(124, 58, 237, 0.35));
}

.legend {
  display: flex;
  gap: 10px;
}
.legend .swatch {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer {
  opacity: 0.75;
  text-align: center;
  padding: 16px;
  font-size: 12px;
}
@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.small {
  font-size: 11px;
  color: var(--muted);
}
.muted {
  color: var(--muted);
}
