:root {
  --runner-background: transparent;
  --runner-text: #20201e;
  --runner-error-border: #f2b8b5;
  --runner-error-background: rgba(255, 245, 245, 0.96);
  --runner-error-text: #9f1d1d;
  color-scheme: light;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  --runner-text: #f0efeb;
  --runner-error-border: #7f3232;
  --runner-error-background: rgba(55, 25, 25, 0.96);
  --runner-error-text: #ffc9c7;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: auto;
  background: var(--runner-background);
  color: var(--runner-text);
}

#sketchStage {
  display: grid;
  width: 100%;
  min-height: 100vh;
  place-items: center;
}

#sketchStage canvas {
  display: block;
  max-width: 100%;
  height: auto !important;
  max-height: 100vh;
  object-fit: contain;
}

#sketchError {
  position: fixed;
  z-index: 10;
  right: 1rem;
  bottom: 1rem;
  left: 1rem;
  max-height: min(45vh, 18rem);
  margin: 0;
  padding: 0.75rem 0.875rem;
  overflow: auto;
  border: 1px solid var(--runner-error-border);
  border-radius: calc(0.65rem*var(--ls-r,1));
  background: var(--runner-error-background);
  color: var(--runner-error-text);
  font: 0.75rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
}

#sketchError[hidden] { display: none; }
