:root {
  color-scheme: dark;
  font: 14px/1.5 system-ui, sans-serif;
  background: #10141b;
  color: #e2e8f0;
  --muted: #9aa8ba;
  --accent: #8dd9cd;
  --border: #2a3543;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto minmax(240px, 1fr) auto; }
header { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; padding: 14px 24px; border-bottom: 1px solid var(--border); }
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { color: #c3f6ed; }
.brand { color: inherit; font-size: 18px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.brand span { color: var(--muted); font-weight: 400; margin-left: 6px; }
.runtime-info { display: flex; gap: 20px; align-items: center; margin-left: auto; font-size: 13px; }
#fps { color: var(--muted); min-width: 8ch; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
select { font: inherit; color: inherit; background: #1b2430; border: 1px solid var(--border); border-radius: 5px; padding: 6px 30px 6px 10px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#viewport { position: relative; min-width: 0; min-height: 240px; background: #080b11; overflow: hidden; }
/* GLFW writes inline canvas dimensions; the grid container owns the layout. */
canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
canvas:focus-visible { outline-offset: -3px; }
#message { position: absolute; top: 20px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 16px; border: 1px solid var(--border); border-radius: 6px; background: #151d29f2; text-align: center; }
#message[data-error] { border-color: #b97567; }
#restart { display: block; margin-top: 6px; }
footer { border-top: 1px solid var(--border); padding: 16px 24px; }
p { color: var(--muted); margin: 8px 0; }
summary { cursor: pointer; color: var(--muted); width: fit-content; }
summary:hover { color: var(--accent); }
details p { font-size: 13px; }
pre { font: 12px/1.5 ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow: auto; margin-bottom: 0; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 600px) {
  header, footer { padding: 12px 16px; }
  header { gap: 12px; }
  .runtime-info { width: 100%; margin: 0; justify-content: space-between; }
}
