* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d1020; color: #eef; font: 14px/1.35 system-ui, -apple-system, Segoe UI, sans-serif; touch-action: none; }
#arena { position: fixed; inset: 0; display: block; }
#video { display: none; }
kbd { background: #2a3150; border-radius: 4px; padding: 0 5px; font: 12px ui-monospace, monospace; }

#top { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); pointer-events: none; }
#score { font-weight: 700; font-size: 18px; text-shadow: 0 2px 6px #000; }

#hud { position: fixed; top: 10px; left: 10px; max-width: min(360px, 60vw); pointer-events: none; }
#handsHud .g { display: flex; gap: 8px; align-items: baseline; }
#handsHud .g span { opacity: .6; font-size: 12px; min-width: 42px; }
#handsHud .g b { font-size: 26px; letter-spacing: 1px; }
#handsHud .dim { opacity: .55; font-size: 16px; }
#stats { font: 12px ui-monospace, monospace; opacity: .8; margin: 4px 0 8px; }
#check { list-style: none; margin: 0; padding: 8px 10px; background: rgba(0,0,0,.35); border-radius: 8px; }
#check li { opacity: .7; } #check li.ok { opacity: 1; color: #8dffb8; }

#log { position: fixed; right: 12px; bottom: 34px; list-style: none; margin: 0; padding: 0; text-align: right; pointer-events: none; }
#log li { font-weight: 800; font-size: 18px; text-shadow: 0 2px 8px #000; color: #ffe6a6; }
#log li.minor { font-weight: 500; font-size: 13px; color: #ccd; }

#tester { position: fixed; top: 10px; right: 10px; width: min(330px, 46vw); background: #ffd84a; color: #231c00; border-radius: 8px; padding: 6px 10px; box-shadow: 0 4px 16px rgba(0,0,0,.4); font-size: 13px; z-index: 5; }
#tester summary { font-weight: 800; cursor: pointer; }
#tester ol { margin: 6px 0; padding-left: 18px; } #tester li { margin: 3px 0; }
#tester .small { margin: 4px 0 2px; font-size: 12px; } #tester kbd { background: #231c00; color: #ffd84a; }

#camWrap { position: fixed; left: 10px; bottom: 10px; width: min(260px, 38vw); border: 2px solid rgba(255,255,255,.25); border-radius: 8px; overflow: hidden; background: #000; }
#cam { width: 100%; display: block; }
.camNote { position: absolute; bottom: 0; left: 0; right: 0; font-size: 11px; text-align: center; background: rgba(0,0,0,.5); padding: 2px; }
#debug { position: fixed; left: calc(min(260px, 38vw) + 20px); bottom: 10px; margin: 0; padding: 8px; background: rgba(0,0,0,.7); font: 12px ui-monospace, monospace; border-radius: 6px; }
#mouseHelp { position: fixed; left: 10px; bottom: 10px; background: rgba(0,0,0,.6); padding: 6px 10px; border-radius: 6px; }

#start { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(8,10,22,.82); z-index: 10; padding: 16px; }
#start[hidden] { display: none; }
.card { max-width: 440px; text-align: center; background: #171c36; border: 1px solid #2c3563; border-radius: 14px; padding: 22px; }
.card h1 { margin: 0 0 6px; letter-spacing: 4px; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 14px 0 8px; }
button { font: 600 15px system-ui; padding: 10px 16px; border-radius: 8px; border: 0; background: #ffb23f; color: #221500; cursor: pointer; }
button.ghost { background: transparent; color: #dde; border: 1px solid #4a548a; }
button:disabled { opacity: .5; }
#status { min-height: 1.4em; font-size: 13px; opacity: .85; } #status.err { color: #ff9a8a; }

#build { position: fixed; right: 10px; bottom: 8px; font: 11px ui-monospace, monospace; opacity: .55; pointer-events: none; }

@media (max-width: 640px) {
  #tester { top: auto; bottom: 150px; right: 6px; width: 62vw; font-size: 12px; }
  #handsHud .g b { font-size: 20px; }
  #log li { font-size: 15px; }
}
