:root { --ground: #c4c3be; --dim: #7a7975; color-scheme: light; }
html, body { height: 100%; margin: 0; }
body { background: var(--ground); overflow: hidden; }
.stage { position: fixed; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#reset { position: absolute; right: 20px; top: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: transparent; color: var(--dim); font-size: 24px; line-height: 1; cursor: pointer; }
#reset:hover { background: rgba(0, 0, 0, 0.05); }
#reset:focus-visible { outline: 2px solid #aaa; }
[hidden] { display: none !important; }

/* ---- control panel (left, floating, collapsible) ---- */
.panel { position: absolute; left: 16px; top: 16px; max-height: calc(100% - 32px); display: flex; flex-direction: column; align-items: flex-start;
  font: 11px/1.3 ui-monospace, "SF Mono", Menlo, monospace; color: #2b2b2a; z-index: 2; }
.panel-toggle { border: 0; border-radius: 999px; padding: 7px 12px; background: rgba(246, 246, 243, 0.92); color: #2b2b2a;
  font: inherit; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); }
.panel-toggle::after { content: ' ▸'; }
.panel.open .panel-toggle::after { content: ' ◂'; }
.panel-toggle:focus-visible, .panel button:focus-visible, .panel select:focus-visible, .panel input:focus-visible { outline: 2px solid #7a7975; outline-offset: 2px; }
.panel-body { margin-top: 8px; width: 240px; min-height: 0; overflow-y: auto; padding: 14px; border-radius: 14px; background: rgba(246, 246, 243, 0.94);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15); }
.panel h2 { margin: 0 0 10px; font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #7a7975; }
.panel .row { display: grid; gap: 4px; margin-bottom: 12px; }
.panel .row:has(input[type=color]), .panel .row:has(select) { grid-template-columns: 1fr auto; align-items: center; }
.panel .row-head { display: flex; justify-content: space-between; gap: 8px; }
.panel output { font-variant-numeric: tabular-nums; }
.panel .range { color: #7a7975; font-size: 10px; }
.panel input[type=range] { width: 100%; margin: 0; accent-color: #2b2b2a; }
.panel input[type=color] { width: 44px; height: 26px; padding: 0; border: 1px solid #c4c3be; border-radius: 6px; background: none; cursor: pointer; }
.panel select { font: inherit; padding: 4px 6px; border: 1px solid #c4c3be; border-radius: 6px; background: #fff; color: #2b2b2a; }
.panel .actions { display: flex; gap: 6px; margin-top: 4px; }
.panel .actions button { flex: 1; padding: 7px 6px; border: 1px solid #c4c3be; border-radius: 8px; background: #fff; color: #2b2b2a; font: inherit; cursor: pointer; }
.panel .actions button:hover { background: #ecebe7; }
.panel .status { min-height: 1.3em; margin: 8px 0 0; color: #7a7975; }
