:root { color-scheme: dark; --navy:#000080; --gray:#c0c0c0; --red:#800000; }
* { box-sizing: border-box; }
html, body { margin:0; height:100%; background:#000; color:#fff; font-family: system-ui, "Segoe UI", Roboto, sans-serif; overscroll-behavior: none; }
body { height:100dvh; }
.screen { height:100dvh; display:flex; flex-direction:column; }
[hidden] { display:none !important; }
#login { align-items:center; justify-content:center; background:var(--navy); }
#loginform { background:#10107a; border:2px solid var(--gray); padding:24px; width:min(92vw,340px); display:flex; flex-direction:column; gap:14px; }
#loginform h1 { margin:0 0 4px; font-size:20px; font-weight:600; }
label { display:flex; flex-direction:column; gap:4px; font-size:14px; }
input, textarea, select { background:#fff; color:#000; border:1px solid var(--gray); padding:9px; font-size:16px; border-radius:0; }
button { background:var(--gray); color:#000; border:1px solid #fff; border-right-color:#555; border-bottom-color:#555; padding:7px 11px; font-size:14px; cursor:pointer; border-radius:0; touch-action:manipulation; }
button:active, button.on { background:#808080; color:#fff; }
button.go { background:#2a7d2a; color:#fff; }
#loginbtn { padding:11px; font-size:16px; }
.err { color:#ffb0b0; min-height:1.2em; margin:0; font-size:14px; }
#top { display:flex; align-items:center; gap:6px; padding:4px 6px; background:#222; font-size:13px; flex-wrap:wrap; }
#top button { padding:5px 9px; font-size:13px; }
#top .sp, .sp { flex:1; }
#ttl { font-weight:600; }
#pos { font-family: ui-monospace, Consolas, monospace; color:#aaa; }
#stage { flex:1; position:relative; min-height:0; background:var(--navy); overflow:hidden; }
#cv { position:absolute; inset:0; width:100%; height:100%; display:block; touch-action:none; cursor:default; }
#imgs { position:absolute; inset:0; pointer-events:none; }
#imgs img { position:absolute; border:2px solid var(--gray); background:var(--navy); object-fit:contain; }
#note { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); max-width:80%; background:var(--red); border:1px solid #fff; padding:14px 22px; text-align:center; font-size:16px; white-space:pre-wrap; }
#stopbar { position:absolute; right:10px; bottom:10px; background:#222; border:1px solid #888; padding:6px 10px; display:flex; gap:10px; align-items:center; font-size:14px; }
#keys { display:flex; flex-wrap:wrap; gap:4px; padding:4px; background:#222; justify-content:center; }
#keys button { min-width:46px; padding:9px 8px; }
#kbd { position:fixed; left:-1000px; top:0; width:10px; height:10px; opacity:0; }
dialog { background:#1a1a1a; color:#fff; border:1px solid var(--gray); padding:16px; width:min(94vw,640px); }
dialog::backdrop { background:rgba(0,0,0,.6); }
dialog h2 { margin:0 0 10px; font-size:18px; }
.mrow { display:flex; gap:10px; flex-wrap:wrap; }
#mlist { flex:1 1 150px; min-width:140px; }
.mcol { flex:3 1 280px; display:flex; flex-direction:column; gap:8px; }
.mcol textarea { font-family: ui-monospace, Consolas, monospace; font-size:14px; }
.help { font-size:12px; color:#bbb; line-height:1.4; }
.mbtns { display:flex; gap:8px; margin-top:8px; }
@media (pointer: fine) { #bKbd, #bSel { display:none; } }
