/* Adventure Workshop - builder styling. Rhymes with the terminal look,
   but utilitarian: this is a tool, not a stage. */

html, body { height: 100%; }
body.builder { display: flex; flex-direction: column; overflow: hidden; font-size: 14px; }

/* ---- top bar ---- */
.b-top {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--dim);
  background: rgba(0,0,0,.25);
}
body[data-theme="paper"] .b-top { background: rgba(0,0,0,.05); }
.b-brand { color: var(--accent); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-right: 8px; }
.b-brand a { color: inherit; text-decoration: none; }
.b-status { color: var(--dim); font-style: italic; margin-left: auto; white-space: nowrap; }

/* ---- main split ---- */
.b-main { flex: 1; display: flex; min-height: 0; }
.b-mapwrap { flex: 1; overflow: auto; position: relative; }
.b-side {
  width: 360px; flex: 0 0 360px; overflow-y: auto;
  border-left: 1px solid var(--dim); padding: 0 14px 40px;
  background: rgba(0,0,0,.18);
}
body[data-theme="paper"] .b-side { background: rgba(0,0,0,.04); }

/* ---- controls ---- */
.b-btn {
  background: transparent; border: 1px solid var(--dim); color: var(--fg);
  font: inherit; padding: 5px 12px; cursor: pointer;
}
.b-btn:hover { border-color: var(--accent); color: var(--accent); }
.b-btn.primary { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.b-btn.danger:hover { border-color: #e05a5a; color: #e05a5a; }
.b-btn.small { padding: 2px 8px; font-size: .85em; }

select.b-in, input.b-in, textarea.b-in {
  background: rgba(0,0,0,.3); border: 1px solid var(--dim); color: var(--fg);
  font: inherit; padding: 5px 8px; box-sizing: border-box; width: 100%;
}
body[data-theme="paper"] select.b-in, body[data-theme="paper"] input.b-in, body[data-theme="paper"] textarea.b-in { background: rgba(255,255,255,.5); }
select.b-in:focus, input.b-in:focus, textarea.b-in:focus { outline: none; border-color: var(--accent); }
textarea.b-in { min-height: 110px; resize: vertical; line-height: 1.5; }
input[type="checkbox"].b-check { accent-color: var(--accent); }

.b-top select.b-in { width: auto; max-width: 220px; }

/* ---- side panel bits ---- */
.b-tabs { display: flex; gap: 6px; margin: 12px 0 4px; position: sticky; top: 0; padding: 8px 0; z-index: 2; background: inherit; }
.b-tab {
  flex: 1; text-align: center; padding: 6px 4px; cursor: pointer;
  border: 1px solid var(--dim); color: var(--dim); background: transparent; font: inherit;
  text-transform: uppercase; letter-spacing: .08em; font-size: .85em;
}
.b-tab.on { color: var(--accent); border-color: var(--accent); font-weight: 700; }

.b-h { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-weight: 700; margin: 18px 0 8px; font-size: .9em; }
.b-field { margin: 0 0 12px; }
.b-field > label { display: block; color: var(--dim); font-size: .85em; margin-bottom: 3px; text-transform: uppercase; letter-spacing: .08em; }
.b-hint { color: var(--dim); font-style: italic; font-size: .85em; margin: 6px 0 14px; }
.b-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.b-row .grow { flex: 1; }

.b-list { border: 1px solid var(--dim); }
.b-list-item {
  display: flex; align-items: baseline; gap: 8px; padding: 7px 10px; cursor: pointer;
  border-bottom: 1px solid rgba(128,128,128,.15); background: transparent; color: var(--fg);
  font: inherit; width: 100%; box-sizing: border-box; text-align: left;
}
.b-list-item:last-child { border-bottom: none; }
.b-list-item:hover { color: var(--accent); }
.b-list-item.on { color: var(--accent); font-weight: 700; }
.b-list-item .where { margin-left: auto; color: var(--dim); font-size: .8em; font-weight: 400; }

.b-exit { border: 1px solid rgba(128,128,128,.25); padding: 8px 10px; margin-bottom: 8px; }
.b-exit .dir { color: var(--accent); text-transform: uppercase; letter-spacing: .1em; font-size: .8em; width: 52px; flex: 0 0 52px; }
.b-exit .lockbox { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(128,128,128,.25); }

.b-thumb { max-width: 100%; border: 1px solid var(--dim); display: block; margin: 6px 0; }
.b-warn { color: #e0b34a; font-size: .85em; }

/* ---- map svg ---- */
.b-map { display: block; }
.b-cell { fill: transparent; stroke: rgba(128,128,128,.13); cursor: pointer; }
.b-cell:hover { fill: rgba(128,128,128,.10); }
.b-room-rect { fill: rgba(0,0,0,.35); stroke: var(--dim); stroke-width: 1.5; cursor: grab; }
body[data-theme="paper"] .b-room-rect { fill: rgba(255,255,255,.55); }
.b-room.on .b-room-rect { stroke: var(--accent); stroke-width: 2.5; }
.b-room text { fill: var(--fg); font-family: inherit; pointer-events: none; }
.b-room.on text { fill: var(--accent); }
.b-room .badges { fill: var(--dim); font-size: 11px; }
.b-edge-hit { fill: transparent; cursor: pointer; }
.b-edge-hit:hover { fill: rgba(128,128,128,.18); }
.b-edge-line { stroke: var(--dim); stroke-width: 3; pointer-events: none; }
.b-edge-line.arrow { marker-end: url(#aw-arrow); }
.b-edge-lock { font-size: 12px; pointer-events: none; }
.b-drag-ghost { fill: rgba(128,128,128,.2); stroke: var(--accent); stroke-dasharray: 4 3; pointer-events: none; }

/* ---- hotspot editor modal ---- */
.hs-modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center;
}
.hs-panel {
  width: min(860px, 94vw); max-height: 92vh; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--accent);
  padding: 14px 18px 18px;
}
.hs-view { position: relative; height: 44vh; min-height: 260px; border: 1px solid var(--dim); }
.hs-cross {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  color: var(--accent); font-size: 26px; font-weight: 700; z-index: 3;
  pointer-events: none; text-shadow: 0 0 6px rgba(0,0,0,.8);
}
.hs-list { margin-top: 12px; }
