:root {
  color-scheme: dark;
  --bg: #10120f;
  --panel: #181a17;
  --panel-2: #22241f;
  --text: #f3f1e8;
  --muted: #a8aa9f;
  --line: #34382f;
  --accent: #f45d48;
  --accent-2: #f8c05a;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  height: 100vh;
  min-height: 100vh;
}

.stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: #0b0d0c;
}

#field {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.readout {
  position: absolute;
  left: 18px;
  bottom: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: calc(100% - 36px);
  padding: 8px;
  border: 1px solid rgba(243, 241, 232, 0.14);
  background: rgba(15, 17, 14, 0.72);
  backdrop-filter: blur(12px);
}

.readout div {
  min-width: 86px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.035);
}

.label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
  text-transform: uppercase;
}

.readout span:last-child {
  display: block;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  font-size: 18px;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 0;
  height: 100%;
  padding: 24px;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
}

.identity {
  padding-bottom: 6px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 12ch;
  font-size: 40px;
  line-height: 0.98;
  letter-spacing: 0;
}

.control-grid {
  display: grid;
  gap: 18px;
}

label span {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #11130f;
  color: var(--text);
  cursor: pointer;
}

button:hover {
  border-color: color-mix(in srgb, var(--accent) 64%, white 4%);
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 28%, #11130f);
  border-color: var(--accent);
}

.swatches {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  gap: 10px;
  margin-top: auto;
}

.swatch {
  width: 44px;
  height: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--swatch-a), var(--swatch-b));
}

.swatch.active {
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--accent-2);
}

@media (max-width: 820px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  .shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .stage {
    height: 68vh;
    min-height: 68vh;
  }

  .panel {
    height: auto;
    min-height: auto;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  h1 {
    max-width: 18ch;
    font-size: 32px;
  }

  .swatches {
    margin-top: 0;
  }
}
