/* Scenes (scenes.js): a conversation screen over the map, phone first. */
#scene { position: fixed; z-index: 3; left: 0; right: 0; bottom: 0; top: calc(max(10px, env(safe-area-inset-top)) + 54px);
  max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; overflow: hidden; padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; backdrop-filter: blur(8px); }
body.in-scene #order, body.in-scene #dock, body.in-scene #cam, body.in-scene #hint { visibility: hidden; }
.sc-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.sc-title { display: grid; min-width: 0; } .sc-title small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.sc-title strong { font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sc-picture { flex: 0 1 auto; min-height: 48px; max-height: 24vh; overflow: hidden; border-radius: var(--radius); background: var(--panel-2); }
#sc-picture img { display: block; width: 100%; height: 100%; max-height: 24vh; object-fit: cover; }
#scene.tools #sc-picture { display: none; }
.sc-people { flex: none; list-style: none; margin: 0; padding: 2px 0; display: flex; gap: 10px; overflow-x: auto; scrollbar-width: thin; }
.sc-people li { flex: none; width: 64px; display: grid; justify-items: center; gap: 2px; font-size: 12px; text-align: center; }
.sc-people li span:not(.sc-face) { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-people li small { color: var(--accent); font-size: 10px; }
.sc-face { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--panel-2); border: 2px solid var(--line); font-weight: 800; }
.sc-people li.party .sc-face { border-color: var(--who, var(--good)); }
.sc-people li.npc .sc-face { border-color: var(--accent); }
.sc-people li[data-npc] { cursor: pointer; } .sc-people li.open .sc-face { box-shadow: 0 0 0 3px var(--accent); }
.sc-people li.add .sc-face { border-style: dashed; color: var(--muted); }
.sc-dm { flex: 0 1 auto; min-height: 120px; display: grid; gap: 8px; max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.sc-form { display: grid; gap: 6px; } .sc-form + .sc-form { border-top: 1px solid var(--line); padding-top: 8px; }
.sc-form input:not([type=file]), .sc-form textarea, .sc-form select, .sc-say select, .sc-say input, .sc-chron input, .sc-chron textarea, .sc-asks input {
  min-height: 40px; box-sizing: border-box; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: inherit; font: inherit; min-width: 0; }
.sc-form textarea, .sc-chron textarea { resize: vertical; }
.sc-form .row select { flex: 1 1 7em; } #sc-call-dc, .sc-asks input { width: 5em; flex: none; }
.sc-asks { flex: none; list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sc-asks li { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; border: 1px solid var(--accent); border-radius: var(--radius); padding: 6px 8px; }
.sc-asks li span { flex: 1 1 10em; }
.sc-lines { flex: 1 1 120px; min-height: 96px; overflow-y: auto; list-style: none; margin: 0; padding: 0 2px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.sc-lines li[data-line] { display: grid; gap: 1px; padding: 6px 10px; border-radius: 12px; background: var(--panel-2); max-width: 88%; align-self: flex-start; border: 2px solid transparent; }
.sc-lines li.mine { align-self: flex-end; }
.sc-lines li.ooc { opacity: .75; font-style: italic; }
.sc-lines li b { font-size: 12px; color: var(--accent); } .sc-lines li small { font-size: 11px; color: var(--muted); }
.sc-lines li span { white-space: pre-wrap; overflow-wrap: anywhere; }
.sc-lines li.picked { border-color: var(--accent); }
.sc-lines li.sc-sys { align-self: center; font-size: 13px; color: var(--muted); text-align: center; }
body:not(.dm) .sc-lines li[data-line] { cursor: default; }
.sc-chron { flex: none; display: grid; gap: 6px; border: 1px solid var(--accent); border-radius: var(--radius); padding: 8px; }
.sc-chron span { font-size: 13px; color: var(--muted); }
.sc-say { flex: none; display: flex; gap: 6px; align-items: center; }
.sc-say select { flex: 0 1 9em; max-width: 40%; } .sc-say input { flex: 1 1 auto; }
.sc-skills { flex: none; list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; max-height: 30vh; overflow-y: auto; }
.sc-skills li.sc-sys { width: 100%; font-size: 13px; color: var(--muted); }
.sc-skills button.prof { border-color: var(--accent); }
.sc-skills small { color: var(--muted); }
#log-list li.say { border-left-color: var(--accent); } #log-list li.ooc { font-style: italic; opacity: .8; }
@media (max-width: 480px) {
  #scene { padding: 8px 8px max(8px, env(safe-area-inset-bottom)); border-radius: 0; }
  .sc-say { flex-wrap: wrap; } .sc-say select { flex: 1 1 100%; max-width: none; }
  .sc-say input { flex: 1 1 0; }
}
/* A scene being prepared (the DM's alone): no transcript, no box to speak in, the tools always open. */
.sc-prep { flex: none; display: grid; gap: 6px; border: 1px solid var(--accent); border-radius: var(--radius); padding: 8px; }
.sc-prep p { margin: 0; }
#scene.prep .sc-lines, #scene.prep .sc-say, #scene.prep .sc-skills, #scene.prep .sc-chron, #scene.prep .sc-asks, #scene.prep #sc-call { display: none; }
#scene.prep .sc-dm { max-height: none; flex: 1 1 auto; }
#scene.prep #sc-picture { display: block; }
.sc-say button { min-height: 40px; }
