:root {
  --acc: #6c8cff;
  --ok: #3ddc84;
  --warn: #ffb020;
  --err: #ff5c5c;
  --panel: rgba(16, 16, 24, .9);
  --line: rgba(255, 255, 255, .14);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
  font: 14px/1.5 -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  overscroll-behavior: none;
  touch-action: manipulation;
}

.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.tiny { font-size: 11px; }

/* ---------- 摄像头画面 ---------- */
/* 尺寸与位置完全由 layout() 设置：必须与 #gl 严格重合，差一点虚拟物体
   就会和真实画面错位。所以这里不写 object-fit，也不写 100% 宽高。 */
#cam {
  position: fixed;
  top: 0; left: 0;
  background: #000;
}

/* ---------- 虚拟系统层 ---------- */
#gl {
  position: fixed;
  pointer-events: none;   /* 交互全靠手指，屏幕不接收触摸 */
  z-index: 2;
}

/* ---------- 启动遮罩 ---------- */
.boot {
  position: fixed; inset: 0;
  z-index: 20;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, #171728 0%, #08080d 75%);
  padding: 24px;
}
.boot.hide { display: none; }
.boot-inner { max-width: 380px; text-align: center; }
.boot h1 { font-size: 24px; margin: 0 0 12px; letter-spacing: 1px; }
.boot p { color: #9a9ab0; font-size: 13.5px; margin: 0 0 18px; line-height: 1.6; }
.boot .tiny { color: #5a5a70; margin: 16px 0 0; font-size: 11px; line-height: 1.7; }

.hint {
  text-align: left;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px !important;
  line-height: 1.9 !important;
}
.hint b { color: #e8e8f0; }

.btn-big {
  width: 100%;
  background: var(--acc); color: #fff;
  border: 0; border-radius: 13px;
  font: inherit; font-size: 17px; font-weight: 600;
  padding: 17px;
  cursor: pointer;
}
.btn-big:disabled { opacity: .45; cursor: default; }

.bar {
  height: 5px; border-radius: 3px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
  margin: 0 0 18px;
}
.bar i { display: block; height: 100%; width: 0%; background: var(--acc); transition: width .2s; }

/* 启动日志：每一步都留在屏幕上，而不是一闪而过 */
.boot-log {
  text-align: left;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 16px;
  max-height: 34vh;
  overflow-y: auto;
}
.boot-log .line {
  font: 11.5px/1.75 ui-monospace, "SFMono-Regular", Consolas, monospace;
  color: #9a9ab0;
  word-break: break-word;
}
.boot-log .line.ok { color: #3ddc84; }
.boot-log .line.warn { color: #ffb020; }
.boot-log .line.err { color: #ff5c5c; }
.boot-log .line.run { color: #6c8cff; }

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  left: 12px; top: calc(12px + env(safe-area-inset-top));
  z-index: 10;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 196px;
  backdrop-filter: blur(8px);
  pointer-events: none;
}
.hud-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.tag {
  font-size: 11.5px; font-weight: 600;
  padding: 3px 8px; border-radius: 6px;
  background: rgba(61, 220, 132, .18); color: var(--ok);
}
.tag.lost { background: rgba(255, 92, 92, .18); color: var(--err); }
.tag.warn { background: rgba(255, 176, 32, .18); color: var(--warn); }

.hud-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 5px 12px; margin-bottom: 7px;
}
.hud-grid div { display: flex; align-items: baseline; gap: 5px; }
.hud-grid b { font-size: 14px; font-weight: 600; font-family: ui-monospace, Consolas, monospace; }
.hud-grid span { font-size: 10.5px; color: #8a8aa0; }
.hud .tiny { color: #8a8aa0; line-height: 1.6; }
