/* Monster Sheet (/sheets/monster/). Loaded after games-dnd-sheet.css: the sheet itself is the player sheet's; this adds the encounter list and the monster import. */

/* encounter list on the left of the sheet; on phones the bar's dropdown picks the monster instead */
.mon-wrap { display: grid; grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 16px; align-items: start; }
.mon-side { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; }
.mon-list { display: grid; gap: 6px; }
.mon-item { display: grid; gap: 2px; min-width: 0; padding: 8px 10px; background: var(--card2); border: 1px solid transparent; border-radius: var(--radius); color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; transition: border-color var(--fast), background var(--fast); }
.mon-item b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon-item small { color: var(--muted); font-size: 13px; }
.mon-item:hover { border-color: var(--accent); }
.mon-item.on { background: var(--accent-soft); border-color: var(--accent); }
.mon-item.down b { color: var(--muted); text-decoration: line-through; }
/* named encounters (ROADMAP 3.1): the picker tops the sidebar, and on phones sits in the bar above the monster picker */
.mon-encside { width: 100%; margin-bottom: 12px; }
.mon-encnote { margin: 0 0 10px; font-size: 14px; }
.mon-encrows { display: grid; gap: 8px; margin: 12px 0; }
.mon-encrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mon-encrow .field { flex: 1 1 160px; min-width: 0; }
.mon-encrow span { flex: 1 1 160px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mon-encarch .mon-item { width: 100%; }
/* the encounter builder (ROADMAP 3.2): a card under the picker, on phones one line in the bar that opens it in a dialog */
.mon-diff { display: grid; gap: 6px; margin-bottom: 12px; padding: 10px; background: var(--card2); border-radius: var(--radius); font-size: 14px; }
.mon-diff small { color: var(--muted); font-size: 13px; }
.mon-diff small b { color: var(--text); }
.mon-diff .kv { margin: 0; }
.mon-diffmsg, .mon-difftier { margin: 0; }
.mon-diffhow, .mon-diffparty, .mon-diffnote { display: block; overflow-wrap: anywhere; }
.mon-diffacts { display: flex; flex-wrap: wrap; gap: 6px; }
.mon-diffbar { display: none; align-items: center; gap: 8px; min-height: 44px; padding: 8px 10px; background: var(--card2); border: 1px solid var(--line-strong); border-radius: var(--radius); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.mon-partyf { display: grid; gap: 4px; margin: 10px 0; }
.mon-partylist { display: grid; gap: 6px; margin: 10px 0; }
.mon-partylist label { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.mon-partyread { min-height: 1em; margin: 0; font-size: 13px; }
/* the monster search: CR and rules filters, how many to add, and the running difficulty */
.mon-findf { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mon-findf label { display: grid; flex: 1 1 90px; gap: 4px; font-size: 13px; }
.mon-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; }
@media (min-width: 700px) { .mon .hb-pick, .mon .mon-encbar { display: none; } }
@media (max-width: 699.98px) { .mon .mon-encbar, .mon .mon-diffbar { flex: 1 1 100%; } .mon .mon-diffbar { display: flex; } }
@media (max-width: 699.98px) {
    .mon-wrap { grid-template-columns: minmax(0, 1fr); }
    .mon-side { display: none; }
}
/* hit dice are set in the Death saves and hit dice panel */
.hb-hdset { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hb-hdset label { display: flex; align-items: center; gap: 6px; }
.mon .hb-hdset .field { width: 64px; }

/* import dialog */
.mon-dlg { width: min(560px, calc(100vw - 32px)); }
.mon-dlg .field { width: 100%; }
#mon-status { margin: 8px 0; font-size: 13px; }
.mon-results { display: grid; gap: 6px; max-height: min(60vh, 520px); overflow-y: auto; }
.mon-hit { display: grid; gap: 2px; padding: 8px 10px; background: var(--card2); border: 1px solid transparent; border-radius: var(--radius); color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.mon-hit:hover { border-color: var(--accent); }
.mon-hit small { color: var(--muted); font-size: 13px; }

/* credits for the open-licence books */
.mon-credit { margin-top: 20px; color: var(--muted); font-size: 13px; }
.mon-credit summary { cursor: pointer; }
.mon-credit li { margin: 4px 0; }
/* archived monsters (ROADMAP 0.5) */
.mon-arch { margin-top: 12px; }
.mon-arch summary { color: var(--muted); font-size: 14px; cursor: pointer; }
.mon-arch .mon-list { margin-top: 8px; }
.mon-arcrow { display: grid; gap: 4px; }
.mon-arcrow .btn { justify-self: start; }

/* phone mode (ROADMAP 2.1): the encounter list and the fight panel live in a bottom sheet */
.ph-on .mon-wrap { display: block; }
.ph-on #ph-enc .mon-side { display: block; position: static; max-height: none; overflow: visible; padding: 0; background: none; border: 0; }
.ph-on .mon-fight { margin: 0; }
.ph-on .mon-item { min-height: 44px; width: 100%; }
.ph-on .mon-list { grid-template-columns: minmax(0, 1fr); }
.ph-on .mon-hit { min-height: 44px; }

/* a monster's type line ("Small humanoid (goblinoid)") is longer than the player sheet's race, so its field gets room to show it (2.2) */
.hb.mon .hb-bar .hb-race { flex: 0 1 280px; }
