:root {
  color-scheme: dark;
  color: #f0e5d7;
  background: #22201d;
  font: 16px/1.45 system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 38% 0, #40372e, #22201d 760px); }
main { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
header, .heading, .actions, .toolbar { display: flex; align-items: center; gap: 10px; }
header, .heading { justify-content: space-between; }
header { min-height: 60px; }
a { color: #e4cbaa; text-underline-offset: .23em; font-size: .9rem; }
button {
  background: #312a24;
  border: 1px solid #6d5948;
  color: inherit;
  border-radius: 7px;
  padding: 8px 11px;
  font: inherit;
  cursor: pointer;
}
button[aria-pressed="true"] { color: #241a13; background: #e5bf90; border-color: #e5bf90; }
button:disabled { opacity: .48; cursor: default; }
.heading { align-items: end; margin: 3px 0 14px; }
h1 { margin: 0; font: 500 clamp(2.35rem, 6vw, 4.25rem)/1 Georgia, serif; letter-spacing: -.05em; }
p { margin: 7px 0 0; color: #d3c3b2; }
.metrics { display: grid; grid-template-columns: repeat(3, 92px); gap: 12px; }
.metrics label { display: grid; grid-template-columns: 1fr auto; gap: 4px; font-size: .75rem; }
progress { grid-column: span 2; width: 100%; height: 7px; accent-color: #d5aa7d; }
output { font-variant-numeric: tabular-nums; }
.viewport {
  position: relative; overflow: hidden; border: 1px solid #6b594a;
  border-radius: 11px; background: #37312b; box-shadow: 0 12px 35px #0e0a0780;
}
canvas {
  display: block; width: 100%; height: clamp(340px, calc(100dvh - 218px), 650px);
  touch-action: none; cursor: crosshair;
}
canvas:focus-visible { outline: 2px solid #efcb9e; outline-offset: -3px; }
.status {
  position: absolute; top: 10px; left: 10px; max-width: calc(100% - 20px);
  margin: 0; padding: 8px 12px; border-radius: 6px; background: #251e17ec;
  color: #ffecd2; pointer-events: none;
}
.status:empty { display: none; }
.toolbar { padding: 10px 0 20px; }
.toolbar button { min-width: 100px; }
kbd { font: inherit; opacity: .7; margin-right: 4px; }
@media (max-width: 660px) {
  main { width: calc(100% - 20px); }
  .heading { flex-wrap: wrap; }
  .metrics { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .toolbar button { flex: 1; min-width: 0; }
  canvas { height: clamp(300px, 54dvh, 515px); }
}
@media (pointer: coarse) { kbd { display: none; } }
