/* Sidebar module — faction overview, faction/banner/territory detail. */
.sb-panel { display: flex; flex-direction: column; gap: 10px; }

.sb-title {
  font-size: 17px; margin: 4px 0 6px; color: var(--accent);
  display: flex; align-items: center; gap: 8px; line-height: 1.2;
}
.sb-section { border-top: 1px solid var(--border); padding-top: 8px; }
.sb-section h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim); margin: 0 0 6px;
}

.sb-field { margin: 2px 0; }
.sb-label { font-weight: bold; color: var(--text); }
.sb-story { margin: 4px 0; font-size: 13px; color: var(--text-dim); font-style: italic; line-height: 1.45; }
.sb-empty { margin: 2px 0; font-size: 13px; color: var(--text-dim); }
.sb-text-dim { color: var(--text-dim); }

.sb-chip {
  display: inline-block; width: 12px; height: 12px; border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.4); flex: 0 0 auto;
}
.sb-faction-icon { width: 18px; height: 18px; object-fit: contain; }
.sb-portrait {
  width: 72px; height: 72px; object-fit: cover; border-radius: 4px;
  border: 1px solid var(--border); flex: 0 0 auto;
}

/* ----- faction list ----- */
.sb-faction-list { display: flex; flex-direction: column; gap: 8px; }
.sb-faction-row {
  display: flex; flex-direction: column; gap: 6px; align-items: stretch;
  width: 100%; text-align: left; padding: 10px;
  background: var(--panel-light); border: 1px solid var(--border); border-radius: 6px;
}
.sb-faction-row:hover { border-color: var(--accent); background: var(--border); }
.sb-faction-head { display: flex; align-items: center; gap: 8px; }
.sb-faction-name { font-weight: bold; font-size: 15px; color: var(--text); }

.sb-stats {
  display: flex; flex-wrap: wrap; gap: 4px 10px;
  font-size: 12px; color: var(--text-dim);
}
.sb-stats span { white-space: nowrap; }
.sb-stats-detail {
  background: var(--panel-light); border: 1px solid var(--border);
  border-radius: 4px; padding: 6px 8px; font-size: 13px; color: var(--text);
}

/* ----- back button ----- */
.sb-back {
  align-self: flex-start; padding: 4px 10px; font-size: 12px;
  background: transparent; border: 1px solid var(--border); color: var(--text-dim);
}
.sb-back:hover { color: var(--accent); border-color: var(--accent); background: var(--panel-light); }

/* ----- general ----- */
.sb-general { display: flex; gap: 10px; align-items: flex-start; }
.sb-general-body { flex: 1; min-width: 0; }

/* ----- landmarks ----- */
.sb-landmarks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sb-lm {
  font-size: 13px; padding: 6px 8px; border-radius: 4px;
  background: var(--panel-light); border-left: 3px solid var(--border);
}
.sb-lm-capital { border-left-color: var(--accent); }
.sb-lm-fortress { border-left-color: #b0863c; }
.sb-lm-supply { border-left-color: #6f9a52; }
.sb-lm-watchtower { border-left-color: #8a7ab0; }
.sb-lm-type { font-weight: bold; }
.sb-lm-name { color: var(--text-dim); }
.sb-lm-garrison { font-size: 12px; color: var(--text-dim); margin-top: 3px; }

/* ----- banners ----- */
.sb-banner-list { display: flex; flex-direction: column; gap: 6px; }
.sb-banner-row {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  width: 100%; text-align: left; padding: 8px 10px;
  background: var(--panel-light); border: 1px solid var(--border); border-radius: 4px;
}
.sb-banner-row:hover { border-color: var(--accent); background: var(--border); }
.sb-banner-name { font-weight: bold; display: flex; align-items: center; gap: 6px; }
.sb-banner-meta { font-size: 12px; color: var(--text-dim); white-space: nowrap; }

/* ----- tag lists (upgrades / items / curses) ----- */
.sb-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sb-tags li {
  font-size: 13px; padding: 5px 8px; border-radius: 4px;
  background: var(--panel-light); border-left: 3px solid var(--border);
}
.sb-tags-up li { border-left-color: var(--accent); }
.sb-tags-item li { border-left-color: #6f9a52; }
.sb-tags-curse li { border-left-color: #b03a2e; color: #e7b8b2; }
.sb-tag-description {
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.4;
  font-weight: normal;
}

/* ----- links / flyto ----- */
.sb-link { color: var(--accent); cursor: pointer; text-decoration: underline dotted; }
.sb-link:hover { color: var(--text); }

/* ----- territory flags ----- */
.sb-flag-razed {
  display: inline-block; font-size: 11px; font-weight: bold; text-transform: uppercase;
  letter-spacing: 0.04em; color: #e7b8b2; background: rgba(176,58,46,0.2);
  border: 1px solid #b03a2e; border-radius: 3px; padding: 1px 6px;
}
.sb-flag-fort {
  display: inline-block; font-size: 11px; font-weight: bold; text-transform: uppercase;
  letter-spacing: 0.04em; color: #1a1612; background: var(--accent);
  border-radius: 3px; padding: 1px 6px;
}

/* ----- terrain ----- */
.sb-terrain { display: flex; flex-wrap: wrap; gap: 6px; }
.sb-terr-chip {
  font-size: 12px; padding: 2px 8px; border-radius: 10px;
  background: var(--panel-light); border: 1px solid var(--border); color: var(--text);
}

/* ----- battles ----- */
.sb-casualty-summary {
  margin-bottom: 8px;
  padding: 9px;
  background: rgba(176, 58, 46, 0.14);
  border: 1px solid rgba(176, 58, 46, 0.65);
  border-radius: 4px;
}
.sb-casualty-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
  font-size: 12px;
}
.sb-casualty-total strong { color: #e7b8b2; font-size: 18px; white-space: nowrap; }
.sb-casualty-breakdown { margin-top: 4px; color: var(--text-dim); font-size: 11px; line-height: 1.35; }
.sb-battles { display: flex; flex-direction: column; gap: 8px; }
.sb-battle {
  padding: 8px;
  background: var(--panel-light);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.4;
}
.sb-battle-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--text);
  margin-bottom: 4px;
}
.sb-battle-head span { color: var(--text-dim); font-size: 11px; text-align: right; }
.sb-battle-scenario {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--accent);
  font-style: italic;
}
.sb-battle-side { color: var(--text-dim); }
.sb-battle-side b { color: var(--text); }
.sb-battle-result { margin-top: 5px; color: var(--accent); font-weight: bold; }
.sb-battle-meta { margin-top: 3px; color: var(--text-dim); }
.sb-battle-notes {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-style: italic;
}

/* ----- neighbors ----- */
.sb-neighbors { display: flex; flex-wrap: wrap; gap: 6px; }
.sb-neighbor {
  min-width: 34px; padding: 5px 8px; font-size: 13px; font-weight: bold;
  background: var(--panel-light); border: 1px solid var(--border); border-radius: 4px;
}
.sb-neighbor:hover { border-color: var(--accent); background: var(--border); color: var(--accent); }
