html, body { margin: 0; height: 100%; background: #14101c; overflow: hidden; overscroll-behavior: none; }
body { display: flex; align-items: center; justify-content: center; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#stage { position: relative; }
#room { display: block; touch-action: none; -webkit-tap-highlight-color: transparent; }
/* 導線：UI帯の小さなリンク。普段は薄く、触ると「ひらく」が出る。置き方は3案（links.layout） */
#links { position: absolute; left: 0; right: 0; bottom: calc(1.6em + env(safe-area-inset-bottom, 0px)); display: flex; gap: 1.8em; padding: 0 1.8em;
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif; letter-spacing: 0.06em; }
#links[hidden] { display: none; }
#links.l0 { justify-content: flex-end; }
#links.l1 { justify-content: center; }
#links.l2 { justify-content: space-between; }
#links a { display: inline-flex; align-items: center; gap: 0.45em; padding: 0.9em 0.5em; color: rgba(236, 222, 214, 0.5); text-decoration: none;
  -webkit-tap-highlight-color: transparent; transition: color 0.3s; }
#links svg { width: 1.35em; height: 1.35em; fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
#links i { font-style: normal; max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; transition: max-width 0.35s, opacity 0.35s; }
#links a.armed { color: rgba(255, 240, 214, 0.95); }
#links a.armed i { max-width: 4em; opacity: 1; }
#links a.armed i::after { content: " ↗"; }
#panel { position: fixed; right: 0; top: 0; bottom: 0; width: min(340px, 88vw); background: rgba(24, 22, 34, 0.94); color: #e9ecf4;
  font: 12px/1.5 "Hiragino Sans", "Yu Gothic", sans-serif; display: flex; flex-direction: column; z-index: 10; }
#panel[hidden] { display: none; }
.p-head { padding: 8px 10px; border-bottom: 1px solid #3a3850; display: flex; align-items: center; gap: 6px; }
.p-head span { flex: 1; color: #9aa1b5; font-size: 11px; }
.p-body { overflow-y: auto; padding: 4px 10px 20px; -webkit-overflow-scrolling: touch; }
#panel summary { padding: 8px 0 4px; font-weight: bold; cursor: pointer; }
#panel label { display: grid; grid-template-columns: 1fr 96px 44px; gap: 6px; align-items: center; padding: 3px 0; border-bottom: 1px solid #2b2a3c; }
.p-name i { display: block; color: #7f86a0; font-style: normal; font-size: 10px; }
#panel output { text-align: right; font-variant-numeric: tabular-nums; }
#panel input[type=range] { width: 100%; }
#panel button { background: #3a3a5c; color: #fff; border: 0; border-radius: 4px; padding: 6px 8px; font-size: 12px; }
.p-btns { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0; }
#panel textarea { width: 100%; box-sizing: border-box; background: #14131e; color: #cfd6ea; border: 1px solid #3a3850; font: 11px monospace; }
