* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #111; color: #eee; font-family: system-ui, sans-serif; overflow: hidden; }
.hidden { display: none !important; }
.screen { height: 100%; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; padding: 24px; text-align: center; }
button { font: inherit; padding: 14px 20px; border: 0; border-radius: 12px; background: #3b82f6; color: #fff; width: 100%; max-width: 340px; }
button.ghost { background: rgba(0,0,0,.55); width: auto; padding: 10px 14px; }
input[type=text], input:not([type]), #codeInput { font-size: 28px; text-align: center; padding: 12px; width: 220px; border-radius: 12px; border: 0; letter-spacing: 8px; }

#app { position: fixed; inset: 0; }
#stage { position: absolute; inset: 0; overflow: hidden; background: #222; }
#video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#overlay { position: absolute; left: 50%; top: 50%; transform-origin: center; pointer-events: none; display: none; max-width: none; user-select: none; }
#overlay.tracked { left: 0; top: 0; transform-origin: 0 0; }
#gesture { position: absolute; inset: 0; touch-action: none; }
.link { color: #8ab4ff; }  
#trackOpts { display: flex; flex-direction: column; gap: 6px; }
#trackOpts small { opacity: .7; }
.dims input { width: 70px; padding: 6px; border-radius: 8px; border: 0; text-align: center; }
#panel { max-height: 60vh; overflow-y: auto; }

#topbar { position: absolute; top: env(safe-area-inset-top); left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 8px; pointer-events: none; }
#topbar > * { pointer-events: auto; }
#status { background: rgba(0,0,0,.55); padding: 6px 12px; border-radius: 10px; font-size: 14px; }

#panel { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); background: rgba(0,0,0,.8); display: flex; flex-direction: column; gap: 12px; }
#panel label { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
#panel input[type=range] { flex: 1; }
.filebtn { background: #3b82f6; padding: 14px; border-radius: 12px; justify-content: center !important; }
