/* ── the plan ─────────────────────────────────────────────────────────
   Sanilles' hall in 3D, inside the admin's shell: the view takes all of
   the content area, edge to edge, and planol.js sizes it to what is left
   between the top bar and the tab bar on a phone. You are inside the
   hall at eye height, like in a game: WASD and the mouse, or two thumbs.
   The model was built from the inside; the outside is not worth seeing. */
body[data-page="planol"] .wrap{ max-width:none; padding:0 }
body[data-page="planol"] .content{ min-height:0 }

.pl-stage{ position:relative; height:100dvh; overflow:hidden; background:#1b1d23; user-select:none; -webkit-user-select:none }
.pl-stage canvas{ display:block; width:100%; height:100%; touch-action:none; outline:none }

/* the sight, in the middle: what a click measures to */
.pl-cross{ position:absolute; left:50%; top:50%; width:22px; height:22px; margin:-11px 0 0 -11px; pointer-events:none }
.pl-cross::before, .pl-cross::after{ content:""; position:absolute; background:#fff; box-shadow:0 0 0 1px rgba(0,0,0,.45) }
.pl-cross::before{ left:10px; top:0; width:2px; height:22px }
.pl-cross::after{ top:10px; left:0; height:2px; width:22px }
.pl-cross.snap::before, .pl-cross.snap::after{ background:#ffd23f }
.pl-read{
  position:absolute; left:50%; top:calc(50% + 20px); transform:translateX(-50%);
  pointer-events:none; white-space:nowrap; text-align:center;
  color:#fff; font-size:.78rem; line-height:1.35; text-shadow:0 1px 3px rgba(0,0,0,.8);
}
.pl-read b{ font-size:1.05rem; font-variant-numeric:tabular-nums }
.pl-read i{ font-style:normal; opacity:.75 }

/* the panel: the measures, and what the keys do */
.pl-panel{
  position:absolute; top:.8rem; right:.8rem; width:17.5rem; max-height:calc(100% - 1.6rem);
  display:flex; flex-direction:column; gap:.6rem; overflow:auto;
  background:rgba(255,255,255,.94); border-radius:var(--r-lg);
  box-shadow:var(--shadow-pop); padding:.8rem;
}
.pl-panel h2{ font-size:.7rem; font-weight:650; text-transform:uppercase; letter-spacing:.05em; color:var(--faint); margin:0 }
.pl-list{ display:grid; gap:.35rem }
.pl-empty{ font-size:.82rem; color:var(--muted) }
.pl-m{
  display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:.5rem;
  padding:.45rem .55rem; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--well);
}
.pl-n{ width:1.35rem; height:1.35rem; border-radius:50%; background:var(--accent); color:#fff;
       font-size:.72rem; font-weight:700; display:grid; place-items:center }
.pl-m b{ font-size:.95rem; font-variant-numeric:tabular-nums }
.pl-m small{ display:block; color:var(--faint); font-size:.74rem; font-variant-numeric:tabular-nums }
.pl-x{ border:0; background:none; color:var(--faint); font-size:1.1rem; cursor:pointer; padding:.2rem .35rem; border-radius:6px }
.pl-x:hover{ color:var(--bad); background:var(--bad-bg) }
.pl-keys{ display:grid; grid-template-columns:auto 1fr; gap:.25rem .6rem; font-size:.78rem; color:var(--muted); align-items:center }
.pl-keys kbd{ font:inherit; font-size:.72rem; font-weight:600; color:var(--ink); border:1px solid var(--line-strong);
              border-bottom-width:2px; border-radius:5px; padding:.05rem .35rem; background:#fff; white-space:nowrap; justify-self:start }
.pl-layers{ display:flex; flex-wrap:wrap; gap:.35rem }
.pl-layers button{
  height:1.9rem; padding:0 .7rem; border-radius:99px; cursor:pointer;
  border:1px solid var(--line-strong); background:#fff; color:var(--faint);
  font:inherit; font-size:.8rem; font-weight:600;
}
.pl-layers button.on{ background:var(--ink); border-color:var(--ink); color:#fff }
.pl-panel[hidden], .pl-veil[hidden], .pl-start[hidden], .pl-touch[hidden]{ display:none }

/* labels painted over the canvas, moved every frame */
.pl-tag{
  position:absolute; left:0; top:0; pointer-events:none; white-space:nowrap;
  transform:translate(-50%, -50%); padding:.15rem .45rem; border-radius:99px;
  background:var(--accent); color:#fff; font-size:.8rem; font-weight:700;
  font-variant-numeric:tabular-nums; box-shadow:0 2px 6px rgba(0,0,0,.35);
}
.pl-tag.live{ background:#ffd23f; color:#14161b }

.pl-veil, .pl-start{ position:absolute; inset:0; display:grid; place-items:center; text-align:center; padding:2rem; color:#d6d9e0 }
.pl-veil h1, .pl-start h1{ font-size:1.25rem; color:#fff; margin-bottom:.4rem }
.pl-start{ background:rgba(20,22,27,.55); cursor:pointer }
.pl-start p{ max-width:28rem; margin:0 auto; line-height:1.45 }
.pl-start .btn{ margin-top:1rem }

/* a phone: a stick on the left to walk, the right half to look, a button to mark */
.pl-touch{ position:absolute; inset:0; pointer-events:none }
.pl-stick{ position:absolute; left:1.2rem; bottom:calc(1.2rem + env(safe-area-inset-bottom)); width:7.5rem; height:7.5rem;
           border-radius:50%; background:rgba(20,22,27,.28); border:2px solid rgba(255,255,255,.7); box-shadow:0 2px 10px rgba(0,0,0,.25); pointer-events:auto; touch-action:none }
.pl-knob{ position:absolute; left:50%; top:50%; width:3rem; height:3rem; margin:-1.5rem 0 0 -1.5rem; border-radius:50%; background:#fff; box-shadow:0 2px 6px rgba(0,0,0,.35) }
.pl-mark{ position:absolute; right:1.2rem; bottom:calc(1.6rem + env(safe-area-inset-bottom)); width:4.6rem; height:4.6rem; border-radius:50%;
          border:0; background:var(--accent); color:#fff; font:inherit; font-weight:700; font-size:.85rem; pointer-events:auto; box-shadow:0 4px 14px rgba(0,0,0,.4) }
.pl-mark.second{ background:#ffd23f; color:#14161b }
.pl-ud{ position:absolute; right:1.5rem; bottom:calc(7.4rem + env(safe-area-inset-bottom)); display:grid; gap:.4rem; pointer-events:auto }
.pl-ud button{ width:2.6rem; height:2.6rem; border-radius:50%; border:0; background:rgba(20,22,27,.55); color:#fff; font-size:1rem; box-shadow:0 2px 6px rgba(0,0,0,.3) }
/* a phone: the panel folds into a pill in the corner, and opens over the
   top of the hall only when asked; the keys are for a keyboard */
.pl-toggle{ display:none }
@media (pointer:coarse) and (not (any-pointer:fine)){
  .pl-panel{ top:.6rem; left:.6rem; right:auto; width:auto; max-width:calc(100% - 1.2rem); max-height:55%; padding:0; border-radius:99px; gap:0 }
  .pl-panel:not(.open) > :not(.pl-toggle){ display:none }
  .pl-panel.open{ right:.6rem; padding:.3rem .8rem .8rem; border-radius:var(--r-lg); gap:.6rem }
  .pl-panel .pl-keys, .pl-panel .pl-keyshead{ display:none }
  .pl-toggle{
    display:block; border:0; background:none; cursor:pointer; text-align:left;
    font:inherit; font-size:.82rem; font-weight:650; color:var(--ink);
    min-height:2.5rem; padding:0 1rem; white-space:nowrap;
  }
  .pl-panel.open .pl-toggle{ align-self:flex-end; color:var(--faint); padding:0 .2rem; min-height:2.2rem }
}

/* the props, for an admin: add one, see where they are */
.pl-objs{ display:grid; gap:.45rem }
.pl-objs[hidden]{ display:none }
.pl-add{ display:flex; flex-wrap:wrap; gap:.35rem }
.pl-add button{
  height:1.9rem; padding:0 .65rem; border-radius:99px; cursor:pointer;
  border:1px dashed var(--line-strong); background:#fff; color:var(--muted);
  font:inherit; font-size:.78rem; font-weight:600;
}
.pl-add button:hover{ border-style:solid; color:var(--ink) }
.pl-m.carrying{ border-color:#ffd23f; box-shadow:0 0 0 3px rgba(255,210,63,.35) }
.pl-ico{ width:1.35rem; height:1.35rem; border-radius:6px; background:var(--ink); color:#fff; font-size:.7rem; font-weight:700; display:grid; place-items:center }
.pl-move{ border:0; background:none; color:var(--accent); font:inherit; font-size:.78rem; font-weight:600; cursor:pointer; padding:.2rem .3rem }
.pl-saved{ font-size:.74rem; color:var(--faint); min-height:1em }
