:root {
  color-scheme: dark;
  --paper: #eae4d4;
  --muted: #a7a293;
  --brass: #e5bc66;
  --line: #3a382e;
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  background: #11120f;
  color: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 1560px; margin: auto; padding: 0 28px; }
header { display: flex; align-items: baseline; justify-content: space-between; gap: 1em; padding: 18px 0; }
h1 { font: 400 clamp(1.5rem, 3vw, 2.6rem)/1 Georgia, serif; margin: 0; }
a { color: var(--brass); text-underline-offset: .25em; }
button, a, summary { touch-action: manipulation; }
button {
  background: #1a1b16; color: var(--paper); border: 1px solid var(--line);
  border-radius: 2px; padding: .45em .7em; cursor: pointer; font: inherit;
}
button:hover { border-color: var(--brass); }
button[aria-pressed="true"] { color: #16130c; background: var(--brass); border-color: var(--brass); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
#stage { position: relative; background: #080907; border: 1px solid var(--line); }
canvas { display: block; width: 100%; aspect-ratio: 16 / 9; touch-action: none; cursor: grab; }
canvas:active { cursor: grabbing; }
#status { margin: 0; position: absolute; inset: 0; display: grid; place-content: center; padding: 24px; text-align: center; pointer-events: none; }
#status[hidden], #exit-fullscreen { display: none; }
#stage:fullscreen { display: grid; place-items: center; border: 0; }
#stage:fullscreen canvas { width: 100%; height: 100%; }
#stage:fullscreen #exit-fullscreen { display: block; position: absolute; top: .75em; right: .75em; }
#controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); padding-top: 15px; }
fieldset { margin: 0; padding: 0 16px 16px; border: 0; min-width: 0; }
fieldset + fieldset { border-left: 1px solid var(--line); }
fieldset:first-child { padding-left: 0; }
legend { width: 100%; margin: 0 0 .65rem; padding: 0; color: var(--muted); font-size: .82rem; }
legend output { color: var(--brass); float: right; font-variant-numeric: tabular-nums; }
.buttons { display: flex; flex-wrap: wrap; gap: .35rem; font-size: .82rem; }
details, label { margin-top: .65rem; font-size: .8rem; color: var(--muted); }
summary { cursor: pointer; }
label { display: flex; align-items: center; gap: .55em; }
input[type="range"] { accent-color: var(--brass); min-width: 0; flex: 1; }
footer { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .3rem 1rem; padding: 12px 0 18px; font-size: .8rem; color: var(--muted); }
footer p { margin: 0; }
@media (max-width: 1000px) {
  #controls { grid-template-columns: repeat(2, 1fr); }
  fieldset:nth-child(odd) { border-left: 0; padding-left: 0; }
  fieldset:nth-child(n+3) { margin-top: 6px; }
}
@media (max-width: 580px) {
  main { padding: 0 12px; }
  header { flex-wrap: wrap; font-size: .8rem; }
  h1 { order: 3; width: 100%; }
}
