:root {
  --bg: #0b0f14;
  --fg: #eaf0ff;
  --muted: rgba(234, 240, 255, 0.7);
  --panel: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--fg); font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif; }

.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 14px;
  background: rgba(11,15,20,0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.brand{ font-weight: 700; letter-spacing: .02em; }
.actions{ display:flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.btn{
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--fg);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
}
.btn:hover{ filter: brightness(1.08); }
.btn.primary{
  background: rgba(234,240,255,0.14);
  border-color: rgba(234,240,255,0.24);
}

.stage{
  position: relative;
  width: 100%;
  height: calc(100vh - 58px);
  overflow: hidden;
}

#video{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* 鏡 */
  opacity: 0; /* デフォルト非表示 */
  pointer-events: none;
}

#canvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hud{
  position: absolute;
  left: 12px;
  bottom: 12px;
  max-width: min(420px, calc(100% - 24px));
  padding: 12px 12px 10px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}
.hud-title{ font-weight: 700; margin-bottom: 6px; }
.hud-list{ margin: 0 0 8px 18px; padding: 0; color: var(--muted); font-size: 13px; }
.status{ font-size: 13px; color: var(--muted); }

@media (max-width: 720px){
  .topbar{ gap: 10px; align-items: flex-start; }
  .actions{ justify-content: flex-start; }
  .btn{ width: 100%; }
}
