:root {
  --bg: #111;
  --panel: #1e1e1e;
  --text: #eee;
  --muted: #999;
  --accent: #ffb000;
  --danger: #ff5a4f;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 system-ui, "Segoe UI", sans-serif;
  overflow: hidden;
}
#stage { position: relative; flex: 1; min-width: 0; }
#stage canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
}
#overlay { pointer-events: none; }
#hud, #help, #noperson, #status {
  position: absolute;
  background: rgba(0, 0, 0, .55);
  border-radius: 6px;
  padding: 6px 10px;
}
#hud { top: 10px; left: 10px; font-variant-numeric: tabular-nums; }
#help { top: 48px; left: 10px; margin: 0; list-style: none; color: #ddd; font-size: 13px; }
#help b { color: var(--accent); }
#noperson { bottom: 16px; left: 50%; transform: translateX(-50%); color: var(--accent); font-size: 16px; }
#status { top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 16px; max-width: 80%; text-align: center; }
#status.error { color: var(--danger); }
[hidden] { display: none !important; }

#panel {
  width: 170px; flex: none;
  overflow-y: auto;
  background: var(--panel);
  padding: 8px;
  display: flex; flex-direction: column; gap: 8px;
}
.item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px;
  background: #2a2a2a; color: var(--text);
  border: 2px solid #444; border-radius: 8px;
  cursor: pointer; font: inherit; font-size: 12px;
}
.item:hover { border-color: #777; }
.item.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.item img { width: 100%; height: 100px; object-fit: contain; }
.item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); font-size: 13px; }

@media (max-width: 700px) {
  body { flex-direction: column; }
  #panel { width: 100%; height: 120px; flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 6px 16px; }
  .item { width: 90px; flex: none; }
  .item img { height: 60px; }
  #help { display: none; }
}
