/* ============================================================
   Empyria IV — Battle Plans editor styles (live map)
   The editor lives inside the right command sheet (#dz-command);
   markers render in the high 'battlePlans' Leaflet pane (z 920),
   above every map layer. Pairs with js/addons/battle-plans.js.
   ============================================================ */

/* the worlds/players roster is replaced by the editor */
#sidebar { display: none !important; }

/* ---------- editor panel (inside the parchment command sheet) ---------- */
#bp-panel {
  font-family: "Special Elite", "Courier New", monospace;
  color: #2c1308;
  margin-top: 10px;
  border-top: 1px solid rgba(90, 58, 22, .4);
  padding-top: 8px;
}
.bp-title {
  font: 700 12px "Cinzel", "IM Fell English", Georgia, serif;
  letter-spacing: .14em;
  color: #2c1308;
  border-bottom: 1.5px solid rgba(90, 58, 22, .5);
  padding-bottom: 3px;
  margin: 0 0 8px;
}

/* style selector */
.bp-styles { display: flex; gap: 5px; margin-bottom: 7px; }
.bp-style {
  flex: 1; cursor: pointer; padding: 4px 0; border-radius: 2px;
  background: rgba(44, 19, 8, .05); border: 1px solid rgba(90, 58, 22, .4);
  color: #2c1308; font: 700 9px "Special Elite", monospace; letter-spacing: .08em; text-transform: uppercase;
}
.bp-style:hover { background: rgba(44, 19, 8, .1); }
.bp-style.is-on { background: rgba(124, 31, 22, .16); border-color: #7c1f16; color: #7c1f16; box-shadow: inset 0 0 0 1px #7c1f16; }

/* colour row */
.bp-colors { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-bottom: 9px; }
.bp-color { width: 19px; height: 19px; padding: 0; border-radius: 50%; cursor: pointer; border: 1px solid rgba(90, 58, 22, .5); box-shadow: inset 0 1px 2px rgba(255, 255, 255, .25); }
.bp-color.is-on { box-shadow: 0 0 0 2px #efe4c8, 0 0 0 3.5px #2c1308; }
.bp-color-custom { width: 26px; height: 21px; padding: 0; border: 1px solid rgba(90, 58, 22, .5); border-radius: 3px; background: none; cursor: pointer; }
.bp-color-custom::-webkit-color-swatch-wrapper { padding: 0; }
.bp-color-custom::-webkit-color-swatch { border: 0; border-radius: 2px; }

/* unit palette */
.bp-palette { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; margin-bottom: 9px; }
.bp-unit {
  display: flex; align-items: center; gap: 7px; cursor: pointer; padding: 4px 6px; border-radius: 3px;
  background: #f1e7cf; border: 1px solid rgba(90, 58, 22, .4); color: #2c1308;
  font: 700 10px "Special Elite", monospace; letter-spacing: .02em; text-align: left;
}
.bp-unit:hover { background: #f6eed7; }
.bp-unit.is-armed { background: rgba(124, 31, 22, .15); border-color: #7c1f16; box-shadow: inset 0 0 0 1px #7c1f16; }
.bp-unit .bp-svg { flex: none; }
.bp-unit span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* line tool + line config */
.bp-linebtn {
  width: 100%; cursor: pointer; padding: 6px 0; border-radius: 3px; margin-bottom: 7px;
  background: #f1e7cf; border: 1px solid rgba(90, 58, 22, .45); color: #2c1308;
  font: 700 10px "Special Elite", monospace; letter-spacing: .06em;
}
.bp-linebtn:hover { background: #f6eed7; }
.bp-linebtn.is-armed { background: rgba(124, 31, 22, .15); border-color: #7c1f16; color: #7c1f16; box-shadow: inset 0 0 0 1px #7c1f16; }
.bp-linecfg { margin-bottom: 9px; display: flex; flex-direction: column; gap: 6px; }
.bp-seg { display: flex; gap: 4px; }
.bp-segbtn {
  flex: 1; cursor: pointer; padding: 4px 0; border-radius: 2px;
  background: rgba(44, 19, 8, .05); border: 1px solid rgba(90, 58, 22, .4); color: #2c1308;
  font: 700 9px "Special Elite", monospace; letter-spacing: .06em; text-transform: uppercase;
}
.bp-segbtn:hover { background: rgba(44, 19, 8, .1); }
.bp-segbtn.is-on { background: rgba(124, 31, 22, .16); border-color: #7c1f16; color: #7c1f16; box-shadow: inset 0 0 0 1px #7c1f16; }
.bp-slider { display: flex; align-items: center; gap: 8px; font: 700 10px "Special Elite", monospace; color: #3a2a12; }
.bp-slider > span { flex: none; width: 64px; }
.bp-slider > b { flex: none; width: 18px; text-align: right; color: #7c1f16; }
.bp-slider input[type="range"] { flex: 1; accent-color: #7c1f16; height: 3px; }
.bp-toggle { display: flex; align-items: center; gap: 7px; cursor: pointer; font: 700 10px "Special Elite", monospace; color: #3a2a12; }
.bp-toggle input { accent-color: #7c1f16; }

/* drawn lines (SVG renderer, high pane) */
.bp-line { pointer-events: auto; cursor: pointer; }
.bp-line--sel { filter: drop-shadow(0 0 3px rgba(255, 255, 255, .9)); }
.bp-line-outline { pointer-events: none; cursor: default; }   /* the halo never eats clicks */

/* ---------- collapsible "Arrows & outline" submenu ---------- */
.bp-arrowtoggle {
  width: 100%; text-align: left; cursor: pointer; margin-top: 2px; padding: 5px 7px; border-radius: 3px;
  background: rgba(44, 19, 8, .05); border: 1px solid rgba(90, 58, 22, .4); color: #2c1308;
  font: 700 10px "Special Elite", monospace; letter-spacing: .06em; text-transform: uppercase;
}
.bp-arrowtoggle:hover { background: rgba(44, 19, 8, .1); }
.bp-arrowtoggle.is-open { background: rgba(124, 31, 22, .12); border-color: rgba(124, 31, 22, .5); color: #7c1f16; }
.bp-arrowtoggle .bp-caret { display: inline-block; width: 11px; color: #7c1f16; }
.bp-arrowcfg {
  display: flex; flex-direction: column; gap: 6px;
  margin: 5px 0 2px; padding: 7px; border-radius: 3px;
  background: rgba(44, 19, 8, .045); border: 1px dashed rgba(90, 58, 22, .4);
}
.bp-arrowrow { display: flex; align-items: center; gap: 8px; }
.bp-arrowlbl { flex: none; width: 38px; font: 700 10px "Special Elite", monospace; color: #3a2a12; }
.bp-arrowrow .bp-seg { flex: 1; }
.bp-outrow { justify-content: space-between; }
.bp-outcolor { width: 30px; height: 20px; }

/* when the arrows submenu is open, shrink the placed-items list to make room */
#bp-panel.bp-arrows-open .bp-list { max-height: 66px; }

/* placed-items list — max 4 rows, then scroll */
.bp-list {
  max-height: 126px; overflow-y: auto; margin-bottom: 9px;
  scrollbar-width: thin; scrollbar-color: rgba(90, 58, 22, .55) transparent;
}
.bp-list::-webkit-scrollbar { width: 7px; }
.bp-list::-webkit-scrollbar-track { background: transparent; }
.bp-list::-webkit-scrollbar-thumb { background: rgba(90, 58, 22, .5); border-radius: 4px; border: 1px solid transparent; background-clip: content-box; }
.bp-list::-webkit-scrollbar-thumb:hover { background: rgba(90, 58, 22, .75); background-clip: content-box; }
.bp-empty { font: 11px/1.4 "IM Fell English", Georgia, serif; color: #5a4423; padding: 4px 2px; }
.bp-item {
  display: flex; align-items: center; gap: 7px; padding: 3px 4px; border-radius: 2px; cursor: pointer;
  border-bottom: 1px dotted rgba(90, 58, 22, .3);
}
.bp-item:hover { background: rgba(44, 19, 8, .06); }
.bp-item.is-sel { background: rgba(124, 31, 22, .14); box-shadow: inset 0 0 0 1px rgba(124, 31, 22, .5); }
.bp-item-ico { flex: none; display: grid; place-items: center; width: 20px; }
.bp-item-name { flex: 1; font: 700 10px "Special Elite", monospace; }
.bp-item-xz { font: 10px "Special Elite", monospace; color: #5a4423; }
.bp-item-del { flex: none; width: 18px; height: 18px; padding: 0; border: none; background: transparent; color: rgba(124, 31, 22, .6); cursor: pointer; font: 700 11px system-ui; border-radius: 50%; }
.bp-item-del:hover { background: rgba(124, 31, 22, .14); color: #7c1f16; }

/* export / import / clear */
.bp-actions { display: flex; gap: 6px; }
.bp-btn {
  flex: 1; cursor: pointer; padding: 5px 0; border-radius: 2px;
  background: rgba(44, 19, 8, .06); border: 1px solid rgba(90, 58, 22, .45); color: #2c1308;
  font: 700 9px "Special Elite", monospace; letter-spacing: .12em; text-transform: uppercase;
}
.bp-btn:hover { background: rgba(44, 19, 8, .12); }
.bp-btn--danger { color: #7c1f16; border-color: rgba(124, 31, 22, .5); }
.bp-btn--danger:hover { background: rgba(124, 31, 22, .12); }

/* ---------- map markers (in the high battlePlans pane) ---------- */
.bp-marker {
  pointer-events: auto;            /* the pane is pointer-events:none */
  cursor: grab;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45));
}
.bp-marker:active { cursor: grabbing; }
.bp-marker .bp-svg { display: block; }
.bp-marker--sel { filter: drop-shadow(0 0 0 2px #fff) drop-shadow(0 0 4px rgba(124, 31, 22, .9)); }

/* ---------- placement capture overlay (only while a unit is armed) ---------- */
#bp-capture {
  position: fixed; z-index: 1400; display: none; cursor: crosshair;
  background: rgba(124, 31, 22, .04);
}
#bp-capture.show { display: block; }
