:root {
  --bg: #111318;
  --panel: #181c24;
  --ink: #f4f0e8;
  --muted: #aeb7c4;
  --line: #2d3440;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(135deg, rgb(238 180 90 / 13%), transparent 30rem), var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app {
  display: grid;
  width: min(920px, calc(100% - 32px));
  gap: 18px;
  margin: 0 auto;
  padding: 28px 0;
}

header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4rem);
  line-height: 1;
}

a {
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.workspace {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
}

.toolbar,
canvas {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.toolbar {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.swatch {
  background: var(--color);
}

.swatch.active {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

canvas {
  width: 100%;
  aspect-ratio: 1;
  image-rendering: pixelated;
}

@media (max-width: 720px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .toolbar {
    grid-template-columns: repeat(5, 1fr);
  }

  .toolbar button:not(.swatch) {
    grid-column: span 5;
  }
}
