html, body { margin: 0; height: 100%; background: #000; color: #ddd; font: 14px system-ui, sans-serif; overflow: hidden; }
  #canvas { display: block; width: 100vw; height: 100vh; outline: none; }
  #status { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
            text-align: center; padding: 0 16px; white-space: pre-line; pointer-events: none; }
  #status a { pointer-events: auto; color: #8cf; }
  #stream { position: fixed; left: 8px; bottom: 8px; padding: 3px 8px; border-radius: 4px;
            background: rgba(0, 0, 0, .55); color: #bbb; font-size: 12px; pointer-events: none; }
  [hidden] { display: none !important; }
  #guest-dialog-layer { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center;
    justify-content: center; background: rgba(0,0,0,.15); color: #000; }
  .guest-dialog { padding: 3px; background: #c0c0c0; font: 11px "MS Sans Serif", Arial, sans-serif;
    box-shadow: inset -1px -1px #000, inset 1px 1px #dfdfdf, inset -2px -2px #808080, inset 2px 2px #fff;
    transform-origin: center; flex: none; }
  .guest-titlebar { height: 18px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 2px 0 3px; color: #fff; font-weight: bold; background: #000080; }
  .guest-titlebar button { padding: 0; width: 16px; height: 14px; font: bold 14px Arial; line-height: 10px; }
  .guest-dialog-client { position: relative; margin: 2px 1px; }
  .guest-control { position: absolute; box-sizing: border-box; padding: 0; margin: 0; font: inherit; color: #000; }
  .guest-dialog button { border: 0; border-radius: 0; background: #c0c0c0; color: #000;
    box-shadow: inset -1px -1px #000, inset 1px 1px #fff, inset -2px -2px #808080, inset 2px 2px #dfdfdf; }
  .guest-dialog button:active { box-shadow: inset 1px 1px #000, inset -1px -1px #fff, inset 2px 2px #808080; }
  .guest-dialog button:focus { outline: 1px dotted #000; outline-offset: -5px; }
  .guest-dialog button.guest-default { border: 1px solid #000; }
  .guest-dialog input:not([type=checkbox]):not([type=radio]), .guest-dialog textarea, .guest-dialog select {
    border: 0; border-radius: 0; background: #fff; padding: 2px 3px;
    box-shadow: inset 1px 1px #808080, inset -1px -1px #fff, inset 2px 2px #000; }
  .guest-dialog textarea { resize: none; }
  .guest-dialog input[readonly], .guest-dialog textarea[readonly] { background: #c0c0c0; }
  .guest-choice { display: flex; align-items: center; gap: 4px; white-space: pre-wrap; }
  .guest-choice input { margin: 0; padding: 0; accent-color: #000080; width: 13px; height: 13px; }
  .guest-static { white-space: pre-wrap; overflow: hidden; }
  .guest-dialog fieldset { border: 2px groove #fff; padding: 0 6px; }
  .guest-dialog legend { padding: 0 2px; }
  .guest-dialog canvas { image-rendering: pixelated; }
  .guest-dialog :disabled { color: #808080; }
  #game-touch-controls { display: none; position: fixed; z-index: 20; bottom: max(18px,env(safe-area-inset-bottom));
    left: 18px; right: 18px; height: 164px; pointer-events: none; user-select: none; }
  #game-touch-controls button { position: absolute; width: 52px; height: 52px; pointer-events: auto;
    touch-action: none; border: 1px solid #798894; border-radius: 8px; color: #fff;
    background: rgba(23,34,44,.88); font: 14px Arial,sans-serif; }
  #game-touch-controls button.pressed { background: #48657c; }
  #game-touch-controls .touch-up { left: 56px; top: 0; font-size: 25px; }
  #game-touch-controls .touch-left { left: 0; top: 56px; font-size: 25px; }
  #game-touch-controls .touch-right { left: 112px; top: 56px; font-size: 25px; }
  #game-touch-controls .touch-down { left: 56px; top: 112px; font-size: 25px; }
  #game-touch-controls .touch-enter { right: 0; top: 0; width: 80px; }
  #game-touch-controls .touch-pause { right: 84px; top: 0; width: 64px; }
  #game-touch-controls .touch-escape { right: 0; top: 56px; }
  #game-touch-controls .touch-yes { right: 56px; top: 112px; width: 40px; height: 40px; }
  #game-touch-controls .touch-no { right: 0; top: 112px; width: 40px; height: 40px; }
  @media (max-width:768px), (pointer:coarse) { #game-touch-controls { display: block; } }
  @media (max-height:500px) and (max-width:1000px) { #game-touch-controls { display: block; } }
  .guest-modal-open #game-touch-controls { display: none; }
