/* Perspective: full-window viewport, a thin menu bar, an optional minimalist parameter panel on the right.
   Type is 1-bit pixel: VT323 (16 px, its native size) for text, Press Start 2P (8 px grid) for titles; both served from here, SIL OFL. */
@font-face { font-family: "VT323"; src: url("./fonts/vt323.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Press Start 2P"; src: url("./fonts/press-start-2p.woff2") format("woff2"); font-display: swap; }
:root { --bg: #0b0b0d; --bar: #101013; --ink: #ececea; --dim: #8e8e93; --line: #26262b; --accent: #e04a3a; --mono: "VT323", ui-monospace, Menlo, monospace; --title: "Press Start 2P", "VT323", monospace; --paper: #F2F2EE; --pink: #101014; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 16px/1.1 var(--mono); overflow: hidden; -webkit-font-smoothing: none; -moz-osx-font-smoothing: unset; font-smooth: never; text-rendering: optimizeSpeed; }
#app { position: fixed; inset: 0; }
#menu { position: absolute; left: 0; right: 0; bottom: 0; height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--bar); border-top: 1px solid var(--line); z-index: 3; white-space: nowrap; padding-bottom: env(safe-area-inset-bottom); overflow-x: auto; scrollbar-width: none; }
#menu::-webkit-scrollbar { display: none; }
#menu .brand { color: var(--ink); text-decoration: none; font: 8px/1 var(--title); margin-right: 6px; }
#menu .brand:hover { color: var(--accent); }
#menu label, #menu button, #menu .t, #menu .brand, #m-speed { flex: none; }
#menu label select { padding-left: 6px; }
#menu #m-place { max-width: 150px; text-overflow: ellipsis; }
#menu label { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); font-size: 16px; }
#menu select, #menu button { height: 26px; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 0; padding: 0 8px; font: 16px var(--mono); cursor: pointer; }
#menu select { appearance: none; -webkit-appearance: none; padding-right: 20px; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 11px) 11px, calc(100% - 7px) 11px; background-size: 4px 4px; background-repeat: no-repeat; }
#menu select:hover, #menu button:hover { border-color: var(--dim); }
#menu select:disabled { opacity: .4; cursor: default; }
#menu button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
#menu input[type=range] { flex: 1 1 60px; min-width: 40px; accent-color: var(--accent); height: 26px; margin: 0; }
#menu .stepper { display: inline-flex; align-items: center; gap: 4px; color: var(--dim); font-size: 16px; white-space: nowrap; flex: none; }
#menu .stepper button { width: 24px; padding: 0; }
#menu .stepper button:disabled { opacity: .35; cursor: default; }
#menu .stepper b { min-width: 20px; text-align: center; color: var(--ink); font-weight: normal; }
#menu .t { color: var(--dim); min-width: 96px; text-align: right; font-size: 16px; }
#view { position: absolute; left: 0; right: 0; top: 0; bottom: 40px; background: #000; overflow: hidden; }
body.params #view { right: 300px; }
#frame { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: hidden; cursor: grab; }
#frame.drag { cursor: grabbing; }
canvas#gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: auto; }
#side { position: absolute; top: 0; right: 0; bottom: 40px; width: 300px; display: none; overflow-y: auto; background: var(--bar); border-left: 1px solid var(--line); z-index: 2; }
body.params #side { display: block; }
#info { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); }
#info b { display: block; font: 8px/1.4 var(--title); text-transform: uppercase; margin-bottom: 6px; }
#info pre { margin: 0; font: 16px/1.05 var(--mono); color: var(--dim); white-space: pre-wrap; }
/* lil-gui, kept to the minimum: no rounding, thin lines, small type */
.lil-gui { --background-color: var(--bar); --widget-color: #17171b; --hover-color: #1f1f24; --focus-color: #26262c; --text-color: var(--ink); --title-background-color: #141418; --title-text-color: var(--ink); --number-color: #9fc6ff; --string-color: #f0c36a; --font-size: 16px; --input-font-size: 16px; --font-family: var(--mono); --padding: 4px; --spacing: 3px; --widget-height: 20px; --title-height: 22px; --name-width: 52%; --slider-knob-width: 1px; --slider-input-width: 30%; --color-input-width: 30%; --widget-border-radius: 0; --folder-indent: 6px; --widget-padding: 0 0 0 3px; --checkbox-size: 11px; --scrollbar-width: 4px; }
.lil-gui.root { width: 100% !important; }
.lil-gui.root > .title { display: none; }
.lil-gui .title { font-weight: 400; text-transform: uppercase; font-size: 16px; }
.lil-gui.root > .children > .lil-gui > .title { border-top: 1px solid var(--line); }
body.render #menu, body.render #side { display: none; } body.render #view { bottom: 0; right: 0; background: #000; }
body.render #frame { width: 1920px; height: 1080px; }
/* lil-gui's folder arrows come from a data: font the site's CSP refuses; the system font draws them instead */
.lil-gui .title::before { font-family: var(--mono) !important; }
/* The welcome card, as a 1-bit HyperCard dialog: paper, a 2 px ink frame, a hard shadow, a striped title bar, no fades. */
#intro { position: absolute; left: 50%; top: calc(50% - 20px); transform: translate(-50%, -50%); width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 72px); overflow: auto; background: var(--paper); color: var(--pink); border: 2px solid var(--pink); box-shadow: 4px 4px 0 var(--pink); z-index: 4; cursor: pointer; }
#intro[hidden] { display: none; }
#intro .bar { display: flex; justify-content: center; padding: 6px 0; border-bottom: 2px solid var(--pink); background: repeating-linear-gradient(to bottom, var(--pink) 0 2px, var(--paper) 2px 4px); }
#intro .bar span { background: var(--paper); padding: 3px 10px; font: 16px/1.25 var(--mono); }
#intro .body { padding: 12px 16px 14px; font: 16px/1.15 var(--mono); }
#intro p { margin: 0 0 10px; }
#intro dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 16px; margin: 0 0 12px; }
#intro dt { font-weight: 400; background: var(--pink); color: var(--paper); padding: 0 6px; justify-self: start; }
#intro dd { margin: 0; }
#intro .go { margin: 0; text-align: center; border-top: 2px solid var(--pink); padding-top: 10px; }
/* on a narrower screen the menus name themselves: their labels go first, then the time readout, so the whole bar stays in view */
@media (max-width: 1600px) { #menu label { font-size: 0; gap: 0; } #menu label select { font-size: 16px; } }
@media (max-width: 1400px) { #menu .t { display: none; } }
