:root { --bg: #000; --fg: #c0c0c0; --hi: #55ffff; --line: #555; --field: #111; --btn: #222; color-scheme: dark; }
/* Light page (web extras, 2026-11-22): the browser's prefers-color-scheme picks it, and the Light page / Dark page
   button (extras.js) overrides that for the visit only; nothing is stored (S5). With no preference the page is
   dark (Tony, 2026-11-22 16:30: "follow the browser's prefers-color-scheme, falling back to dark"). Only the page around the terminal changes: the terminal itself
   stays black, because the ANSI art and the doors are drawn for a black screen. Text is at least 7:1 on --bg. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --bg: #f4f1e8; --fg: #1a1a1a; --hi: #004a6e; --line: #707070; --field: #fff; --btn: #e4e0d4; color-scheme: light; }
}
:root[data-theme="light"] { --bg: #f4f1e8; --fg: #1a1a1a; --hi: #004a6e; --line: #707070; --field: #fff; --btn: #e4e0d4; color-scheme: light; }
.theme { margin: 0; text-align: right; }
#board { border: 1px solid var(--line); padding: 0.25rem 0.75rem; margin: 0 0 1rem; }
#board h2 { color: var(--hi); font-size: 1rem; margin: 0.5rem 0; }
#board h3 { font-size: 0.9rem; margin: 0.5rem 0 0.25rem; }
#board p { margin: 0.4rem 0; }
#board ul { margin: 0 0 0.5rem; padding-left: 1.25rem; }
/* The IBM VGA 8x16 face, exactly as its author publishes it (R1; static/vendor/vga-font). */
@font-face { font-family: "Web437 IBM VGA 8x16"; src: url("/static/vendor/vga-font/Web437_IBM_VGA_8x16.woff") format("woff"); font-display: block; }
[hidden] { display: none !important; }
#term { border: 1px solid var(--line); background: #000; padding: 0.25rem; overflow-x: auto; max-width: 100%; }
.mode { margin-left: 1rem; font-size: 0.9rem; }
.credits { margin-top: 1rem; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; }
main { max-width: 52rem; margin: 0 auto; padding: 1rem; }
h1 { color: var(--hi); font-size: 1.3rem; }
.note { font-size: 0.9rem; }
#log { border: 1px solid var(--line); height: 60vh; overflow-y: auto; padding: 0.5rem; white-space: pre-wrap; word-break: break-word; }
#line { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; align-items: center; }
#line label[for=input] { flex-basis: 100%; }
#input { flex: 1 1 12rem; font: inherit; background: var(--field); color: var(--fg); border: 1px solid var(--line); padding: 0.4rem; }
#keys { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }
button { font: inherit; background: var(--btn); color: var(--fg); border: 1px solid var(--line); padding: 0.3rem 0.6rem; }
button:disabled { opacity: 0.5; }
/* F1 (2026-11-20): on a narrow screen an 80-column BBS screen wrapped at about 40 columns. Below 700 px the log's
   font scales towards 80 columns (a monospace cell is about 0.6 em, so 48 em is about 80 cells), never below 9 px,
   and its lines no longer wrap: what does not fit scrolls sideways inside the log, never the page. */
.phone-hint { display: none; }
@media (max-width: 700px) {
  main { padding: 0.5rem; }
  #log { font-size: max(9px, calc((100vw - 2.5rem) / 48)); white-space: pre; word-break: normal; overflow-x: auto; }
}
@media (max-width: 700px) and (orientation: portrait) {
  .phone-hint { display: block; }
}
