*{box-sizing:border-box}body{margin:0;overflow:hidden;background:#142d3b;color:#e8f1ed;font:14px system-ui,sans-serif}canvas{display:block;width:100vw;height:100vh}#panel{position:absolute;left:18px;top:18px;width:290px;padding:18px 20px;border:1px solid #638b8e66;border-radius:12px;background:#122a35e8;box-shadow:0 12px 40px #0005}h1{font-size:23px;letter-spacing:.03em;margin:0}small{font-size:12px;color:#9bc4b7}label{display:flex;align-items:center;gap:8px;margin:12px 0}select{margin-left:auto;max-width:160px}select,button{color:#e8f1ed;background:#2b4953;border:1px solid #76928d;border-radius:5px;padding:5px}input{width:110px;margin-left:auto}p{line-height:1.6;color:#b9d1cd}#status{font:12px ui-monospace,monospace;margin-bottom:0}kbd{font-size:11px}#crosshair{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);pointer-events:none;color:#fff9;display:none}@media(max-width:600px){#panel{left:8px;top:8px;width:250px;padding:12px}p{font-size:12px}}

#presence {position:fixed;right:16px;top:16px;padding:12px;background:#12222de6;border-radius:8px;font:14px sans-serif;pointer-events:none;}

/* Shared account/live chrome stays clear of the world tools and presence HUD. */
[hidden]{display:none!important}
#topbar{position:fixed;inset:0 0 auto;height:56px;display:flex;align-items:center;gap:20px;padding:0 20px;background:#f5f7f4;color:#20352d;border-bottom:1px solid #d9e0d8;z-index:10;font-size:14px}
.brand{font-size:19px;font-weight:650;text-decoration:none;color:inherit;letter-spacing:-.02em}
#topbar #name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#607365}
#topbar nav{margin-left:auto;display:flex;align-items:center;gap:10px}
#topbar button,.login-button{background:transparent;color:inherit;border:1px solid #c6d2c7;border-radius:8px;padding:8px 12px;font:inherit;cursor:pointer;text-decoration:none;white-space:nowrap}
#topbar #profile-toggle{border-radius:50%;width:36px;height:36px;padding:0;background:#dce9df;font-weight:650}
#live-dot{color:#82958a}#live-toggle.live-active #live-dot{color:#1b8754}#live-toggle.live-active{background:#e3efe5}
#panel{top:74px}#panel h1{font-size:16px;font-weight:600}#presence{top:74px;max-width:220px;z-index:1}
.popover{position:fixed;right:16px;top:64px;z-index:20;width:min(340px,calc(100vw - 24px));padding:18px;background:#f5f7f4;color:#20352d;border:1px solid #ccd8cd;border-radius:12px;box-shadow:0 12px 40px #10251b33}
.popover h2{margin:0;font-size:18px}.popover p{color:#425f4c;font-size:14px}.popover .muted{color:#718074;font-size:12px}.popover button{background:#e4ece5;color:#20352d;border-color:#b8cabb;cursor:pointer;padding:8px 12px;font:inherit}.live-actions{display:flex;gap:8px;flex-wrap:wrap}
#profile-menu{width:230px;display:flex;flex-direction:column;gap:14px}#profile-menu a{color:#315d44}#profile-menu button{text-align:left}
#account-message{position:fixed;top:64px;left:50%;transform:translateX(-50%);max-width:calc(100vw - 24px);z-index:9;background:#f5f7f4;color:#354e3d;border:1px solid #cad6cb;padding:12px 16px;border-radius:8px;margin:0}
#live-people{padding-left:20px}#live-people:empty{display:none}
:focus-visible{outline:2px solid #43876a;outline-offset:3px}
@media(max-width:600px){#topbar{padding:0 12px;gap:10px}#topbar #name{max-width:28vw}#topbar nav{gap:6px}#topbar button{padding:7px}#panel{top:68px;width:220px}#presence{top:auto;bottom:12px;right:12px;font-size:12px}.popover{right:12px}#account-message{top:64px;width:calc(100vw - 24px)}}

#touch-controls,#tools-toggle{display:none}
#scene{touch-action:none}
@media(any-pointer:coarse){
  #tools-toggle{display:block;position:fixed;left:10px;top:66px;z-index:3;padding:10px}
  #panel{display:none;top:110px;max-height:calc(100dvh - 270px);overflow:auto;z-index:3}
  .tools-open #panel{display:block}
  #touch-controls{display:flex;position:fixed;bottom:max(16px,env(safe-area-inset-bottom));left:12px;right:12px;justify-content:space-between;align-items:end;gap:8px;pointer-events:none;z-index:2;user-select:none;-webkit-user-select:none}
  #touch-controls [data-stick],#touch-controls button{pointer-events:auto;touch-action:none;background:#122a35bb;border:1px solid #b9d1cd99;color:#e8f1ed}
  #touch-controls [data-stick]{width:112px;height:112px;border-radius:50%;display:grid;place-items:center}
  .touch-height{display:flex;flex-direction:column;gap:8px}
  .touch-height button{width:50px;height:48px;font-size:22px}
  #presence{top:68px;bottom:auto;right:10px;max-width:180px;padding:8px}
  #capture{display:none}
}

#telemetry{position:fixed;bottom:12px;right:12px;margin:0;padding:12px;background:#10212cde;color:#e5f1f5;border-radius:8px;font:12px/1.35 monospace;pointer-events:none;max-width:calc(100vw - 48px);overflow:hidden;white-space:pre;z-index:3}
#devices-panel{margin:12px 0}#devices-panel summary{cursor:pointer}#devices{font:11px/1.4 monospace;white-space:pre-wrap;overflow-wrap:anywhere;max-height:240px;overflow:auto}
@media(max-width:600px){#telemetry{font-size:9px;bottom:8px;right:8px;padding:8px}}
