  :root { --bg:#0d0d0d; --fg:#e8e8e8; --dim:#8a8a8a; --line:#2e2e2e; --on:#262626; --acc:#0071E3; }
  html,body { margin:0; height:100%; background:var(--bg); color:var(--fg); font:15px/1.4 system-ui,sans-serif; overflow:hidden; }
  canvas { position:fixed; inset:0; width:100%; height:100%; display:block; }
  #hdr { position:fixed; top:0; left:0; right:0; z-index:5; padding:14px 20px 12px; display:flex; flex-direction:column; gap:12px;
         background:linear-gradient(var(--bg) 78%, transparent); }
  #tabs, #aud { display:flex; flex-wrap:nowrap; overflow-x:auto; gap:32px; scrollbar-width:none; }
  #hdr button { font:500 14px -apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",sans-serif; color:#8a8a8a; background:none; border:0; padding:0;
                cursor:pointer; white-space:nowrap; flex:none; }
  #tabs button:first-child { margin-left:auto; }
  #tabs button:last-child { margin-right:auto; }
  #aud { justify-content:center; }
  #aud { gap:24px; }
  #aud button { font:15px ui-monospace,Menlo,Consolas,monospace; color:var(--fg); padding:2px 4px;
                border-bottom:1px solid currentColor; }
  #aud button:hover { background:var(--fg); color:var(--bg); }
  #hdr #aud button[aria-selected="true"] { background:var(--fg); color:var(--bg); }
  body.term #aud button { color:#5dff8a; }
  body.term #aud button:hover, body.term #hdr #aud button[aria-selected="true"] { background:#5dff8a; color:#001a05; }
  #hdr button:hover, #hdr button[aria-selected="true"] { color:#0071E3; }
  body.light #hdr { background:#fff; }
  body.light #hdr button { color:#666; }
  body.light #hdr button[aria-selected="true"], body.light #hdr button:hover { color:#0071E3; }
  body.light #aud { display:none; }
  #scroller { position:fixed; inset:0; overflow-y:auto; z-index:1; }
  #spacer { width:1px; }
  #form { position:absolute; left:50%; transform:translateX(-50%); width:min(420px,calc(100% - 32px)); text-align:center; }
  .sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
  input.em { width:100%; box-sizing:border-box; font:15px ui-monospace,Menlo,Consolas,monospace; color:var(--fg); background:rgba(13,13,13,.85);
             border:1px solid var(--fg); border-radius:0; padding:10px 12px; }
  input.em::placeholder { color:var(--dim); }
  input.em:focus { outline:none; box-shadow:0 0 0 1px var(--fg); }
  .join { margin-top:12px; font:15px ui-monospace,Menlo,Consolas,monospace; color:var(--fg); background:rgba(13,13,13,.85);
          border:1px solid var(--fg); border-radius:6px; padding:8px 14px; cursor:pointer; }
  .join:hover { background:var(--fg); color:var(--bg); }
  .msg { margin-top:10px; font:15px ui-monospace,Menlo,Consolas,monospace; min-height:20px; }
  #term { position:fixed; inset:0; z-index:1; display:none; overflow:auto; padding:96px 16px 80px; background:rgba(0,12,2,.9);
          font:15px/1.5 ui-monospace,Menlo,Consolas,monospace; color:#5dff8a; }
  #term .wrap { max-width:760px; margin:0 auto; }
  #term pre { margin:0; white-space:pre-wrap; font:inherit; }
  #gameBox { display:flex; flex-wrap:wrap; gap:18px; margin-top:16px; }
  #gameBox .col { white-space:pre; }
  #gameBox span { cursor:pointer; }
  #gameBox span.hl { background:#5dff8a; color:#001a05; }
  #gameBox .log { min-width:180px; display:flex; flex-direction:column; justify-content:flex-end; }
  #gameBox .head { width:100%; }
  #term button { font:inherit; color:#5dff8a; background:none; border:1px solid #5dff8a; border-radius:4px; padding:4px 10px; cursor:pointer; margin-top:10px; }
  #term input { font:inherit; color:#5dff8a; background:#001a05; border:1px solid #5dff8a; padding:6px 8px; width:min(320px,100%); box-sizing:border-box; }
  #main { position:fixed; left:0; right:0; bottom:0; top:0; z-index:1; display:none; border:0; width:100%; background:#fff; padding-top:0; }
  body.prod #tabs { display:none; }
