:root { --green:#108910; --white:#fff; --font: "Courier New", ui-monospace, Menlo, monospace; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin:0; height:100%; background:#111; color:var(--white); font-family:var(--font); overflow:hidden; touch-action:none; user-select:none; }
#stage { position:fixed; inset:0; background:#111; }
#video, #canvas { position:absolute; inset:0; width:100%; height:100%; }
#video { object-fit:cover; }
#video.mirror { transform:scaleX(-1); }
#video.off { display:none; }

.hidden { display:none !important; }

.overlay { position:fixed; inset:0; z-index:20; display:flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:16px; padding:24px; text-align:center; background:rgba(16,137,16,.97); overflow-y:auto; overflow-x:hidden; touch-action:pan-y; -webkit-overflow-scrolling:touch; }
.overlay > :first-child { margin-top:auto; }
.overlay > :last-child { margin-bottom:auto; }
.overlay > * { flex:0 0 auto; }
.overlay h1 { font-size:clamp(56px,min(16vw,16vh),130px); margin:0; letter-spacing:.12em; text-shadow:6px 6px 0 #000; }
.overlay h2 { font-size:clamp(40px,11vw,96px); margin:0; text-shadow:5px 5px 0 #000; }
.sub { max-width:34em; font-size:clamp(14px,3.6vw,20px); line-height:1.45; margin:0; font-weight:bold; }
.status { min-height:1.4em; font-size:14px; margin:0; font-weight:bold; }
.row { display:flex; gap:10px; align-items:center; justify-content:center; flex-wrap:wrap; font-weight:bold; }

button { font-family:var(--font); font-weight:bold; cursor:pointer; color:var(--white); background:#000; border:3px solid var(--white); border-radius:10px; padding:8px 14px; font-size:16px; }
button:active { transform:translateY(2px); }
button.seg.active { background:var(--white); color:#000; }
button.big { font-size:clamp(22px,6vw,34px); padding:14px 34px; background:var(--white); color:#000; border-color:#000; box-shadow:5px 5px 0 #000; }
button.big.alt { background:#000; color:var(--white); border-color:var(--white); box-shadow:5px 5px 0 rgba(0,0,0,.4); }
label { cursor:pointer; }

#toolbar { position:fixed; z-index:10; top:max(10px,env(safe-area-inset-top)); right:10px; display:flex; gap:8px; }
#toolbar button { padding:6px 10px; font-size:14px; background:rgba(0,0,0,.65); }
#debug-help { position:fixed; z-index:10; left:0; right:0; bottom:max(8px,env(safe-area-inset-bottom)); text-align:center; font-size:12px; font-weight:bold; text-shadow:1px 1px 0 #000, -1px -1px 0 #000; pointer-events:none; }

.desk-grid { display:flex; gap:28px; align-items:center; justify-content:center; flex-wrap:wrap; max-width:1100px; }
#demo { width:min(380px,80vw); max-height:50vh; object-fit:contain; border:4px solid #fff; border-radius:12px; background:#000; box-shadow:6px 6px 0 #000; }
#demo.missing { display:none; }
.steps { text-align:left; max-width:26em; margin:0; padding-left:1.3em; }
.steps li { margin-bottom:.6em; }
body.mobile .opt { display:none; }
