* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: #fff; overflow: hidden;
  font-family: system-ui, -apple-system, "Noto Sans KR", sans-serif; -webkit-user-select: none; user-select: none; }

#cam, #overlay { position: fixed; inset: 0; width: 100%; height: 100%; }
#cam { object-fit: cover; }
#overlay { touch-action: none; }

#start { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 24px; text-align: center;
  background: radial-gradient(circle at 50% 70%, #3a1f0a 0%, #000 70%); }
#start h1 { margin: 0; font-size: 28px; color: #ffb347; }
#start p { margin: 0; line-height: 1.6; color: #ddd; }
#start .small { font-size: 13px; color: #999; }
#go { margin: 12px 0; padding: 14px 48px; font-size: 18px; border: 0; border-radius: 999px;
  background: #ff9f1c; color: #000; font-weight: 700; }
.err { color: #ff6b6b !important; font-size: 14px; }

#hud { position: fixed; top: 0; left: 0; right: 0; display: flex; gap: 8px; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 8px) 10px 8px; background: linear-gradient(#000a, #0000);
  font-size: 15px; font-weight: 600; text-shadow: 0 1px 2px #000; }
#hud div { line-height: 1.35; }
#hud small { display: block; font-weight: 400; font-size: 12px; color: #ddd; }
#set { text-align: right; }

#bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 8px 10px calc(env(safe-area-inset-bottom) + 10px);
  background: linear-gradient(#0000, #000b); text-align: center; text-shadow: 0 1px 2px #000; }
#guide { font-size: 16px; font-weight: 700; min-height: 22px; }
#heading { font-size: 13px; color: #ddd; margin: 2px 0 8px; }
.btns { display: flex; gap: 6px; justify-content: center; }
.btns button { padding: 10px 12px; border: 1px solid #fff6; border-radius: 10px; background: #0008;
  color: #fff; font-size: 14px; }
#calib.on { background: #ff9f1c; color: #000; border-color: #ff9f1c; }

#toast { position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%); max-width: 86%;
  padding: 12px 16px; border-radius: 12px; background: #000c; font-size: 15px; text-align: center; }

[hidden] { display: none !important; }
