:root {
  --bg: #000;
  --fg: #c0c0c0;
  --hi: #fff;
  --accent: #55ffff;
  --warn: #ffff55;
  --muted: #7a7a7a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); }
body { display: flex; flex-direction: column; align-items: center; padding: 16px; }
#crt { position: relative; width: 100%; max-width: 720px; flex: 1; min-height: 0; }
#term {
  margin: 0; height: 100%; overflow-y: auto; white-space: pre-wrap; word-break: break-all;
  font: 16px/1.3 "IBM VGA 8x16", "Perfect DOS VGA 437", ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;
  color: var(--fg); cursor: text;
}
#term .hi { color: var(--hi); }
#term .acc { color: var(--accent); }
#term .warn { color: var(--warn); }
#term .dim { color: var(--muted); }
#term .cur { display: inline-block; width: .6em; background: var(--fg); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { background: transparent; } }
#kbd { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; border: 0; padding: 0; }
canvas { display: block; width: 100%; max-width: 640px; height: auto; aspect-ratio: 4 / 3; margin: 0 auto; image-rendering: pixelated; background: #000; }
#foot { width: 100%; max-width: 720px; display: flex; gap: 12px; justify-content: space-between; align-items: center;
  font: 14px ui-monospace, "DejaVu Sans Mono", monospace; color: var(--muted); padding-top: 8px; }
#foot button { font: inherit; color: var(--fg); background: transparent; border: 1px solid var(--muted); padding: 2px 10px; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { #term .cur { animation: none; } }
