/* viewport */
#viewport { position: relative; overflow: hidden; border: 1px solid var(--ink); }
#viewport canvas { width: 100%; height: 100%; cursor: grab; touch-action: none; }
#viewport canvas:active { cursor: grabbing; }
.vp-hint { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.vp-info { position: absolute; left: 4px; bottom: 4px; background: var(--paper); border: 1px solid var(--ink); padding: 0 4px; }

/* character */
.who { display: flex; gap: var(--gap); align-items: center; margin-bottom: var(--gap); }
.portrait { border: 1px solid var(--ink); padding: 2px; }
.bar { display: grid; grid-template-columns: 24px 1fr auto; gap: var(--gap); align-items: center; margin-bottom: 3px; }
.track { height: 10px; border: 1px solid var(--ink); padding: 1px; }
.fill { height: 100%; background: var(--ink); }
.equip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: var(--gap); }
.slot { aspect-ratio: 1; border: 1px solid var(--ink); display: grid; place-items: center; font-size: 10px; }
/* Drawn icons are PNGs; keep them crisp when the UI scales them. */
.icon-art { image-rendering: pixelated; object-fit: contain; }
.slot.empty { border-style: dashed; }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 1px var(--gap); margin-bottom: var(--gap); }
.stats dd { text-align: right; }
.bonus { font-size: 11px; }

/* grids: bag */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.grid.five { grid-template-columns: repeat(5, 1fr); }
.cell { aspect-ratio: 1; border: 1px solid var(--ink); display: grid; place-items: center; position: relative; padding: 0; }
.cell.empty { border-style: dashed; }
.qty { position: absolute; right: 2px; bottom: 0; font-size: 10px; }
.info { margin-top: auto; border-top: 1px solid var(--ink); padding-top: 4px; min-height: 4.5em; }
.coins { display: flex; justify-content: space-between; border-top: 1px solid var(--ink); margin-top: 4px; padding-top: 4px; }

/* dialogue */
.panel[data-panel="dialogue"] .panel-body { display: flex; flex-direction: column; gap: 4px; }
.panel[data-panel="hotbar"] .panel-body { display: flex; flex-direction: column; gap: 4px; }
.panel[data-panel="hotbar"] .hotbar, .panel[data-panel="hotbar"] .hint { align-self: center; }
.panel-body h2 { margin-bottom: 2px; }
.dlg-empty { opacity: .55; font-size: 11px; white-space: pre-wrap; }
.dlg-progress { font-size: 11px; opacity: .6; font-weight: 400; }
.dlg-speaker { border-bottom: 1px dotted var(--ink); padding-bottom: 1px; font-weight: 700; }
.dlg-line { flex: 1; overflow: auto; white-space: pre-wrap; }
.dlg-hint { font-size: 11px; opacity: .6; text-align: right; }
.panel.active { outline: 1px solid var(--ink); outline-offset: -3px; }

/* hotbar */
.hotbar-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.hotbar { display: grid; grid-template-columns: repeat(8, 40px); gap: 4px; }
.hk { height: 40px; position: relative; display: grid; place-items: center; padding: 0; }
.hk em { position: absolute; left: 2px; top: 0; font-size: 10px; font-style: normal; }
.hint { font-size: 11px; }

/* Dialogue choices */
.dlg-choices { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.dlg-choice { display: flex; gap: 6px; align-items: baseline; text-align: left; width: 100%; }
.dlg-key { border: 1px solid currentColor; padding: 0 4px; font-size: 10px; }

/* Answers under a world bubble: a DOM list pinned to the drawn bubble (see ui/bubble-choices.js). */
.bubble-choices { position: absolute; display: flex; flex-direction: column; gap: 3px; z-index: 3; }
.bubble-choices[hidden] { display: none; }
.bubble-choice { display: flex; gap: 6px; align-items: baseline; text-align: left; width: 100%; background: var(--paper); border: 1px solid var(--ink); padding: 1px 5px; }
.bubble-choice:hover { background: var(--ink); color: var(--paper); }

/* Log at the bottom of the dialogue box: what the old chat showed (quest started, loot, travel). */
.dlg-log { border-top: 1px dotted var(--ink); margin-top: 4px; padding-top: 2px; max-height: 7.5em; overflow: auto; font-size: 11px; }
.dlg-log .sys { opacity: .7; }

/* Map info: where you are, what is left to do here. */
.map-head { display: flex; align-items: baseline; gap: 4px; border-bottom: 1px solid var(--ink); padding-bottom: 2px; margin-bottom: 4px; }
.map-counts { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; margin-bottom: var(--gap); }
.map-lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.map-lists h3 { font-size: 12px; display: flex; justify-content: flex-start; gap: 6px; align-items: center; }
.map-counts span { border: 1px solid var(--ink); padding: 0 4px; }
.quest-list { display: flex; flex-direction: column; gap: 1px; margin-bottom: var(--gap); }
.quest-list li { list-style: none; }
.quest-list b { font-weight: 700; }
.count { border: 1px solid var(--ink); padding: 0 4px; font-size: 10px; }

/* Panels are not tied to a side any more: size them by their slot. */
.pane-top .panel, .pane-bottom .panel { min-height: 0; }

