.army-card {
  position: fixed;
  z-index: 9000;
  pointer-events: none;
  min-width: 280px;
  max-width: 340px;
  background: linear-gradient(180deg, #1a1410 0%, #0f0a06 100%);
  border: 1px solid #6b5a3a;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.85), 0 0 0 1px #2a1f12 inset;
  color: #d8c896;
  font-family: 'Raleway', Arial, sans-serif;
  font-size: 12px;
  letter-spacing: 0.2px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease-out, transform 0.12s ease-out;
}

.army-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.army-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--nation-color, #8b7d3c), transparent);
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.army-card-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid #3a2f1c;
  background: linear-gradient(180deg, rgba(70, 50, 22, 0.35) 0%, transparent 100%);
  border-radius: 5px 5px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.army-card-header.is-rebel {
  background: linear-gradient(180deg, rgba(124, 29, 29, 0.34) 0%, transparent 100%);
}
.army-card-headtext { min-width: 0; flex: 1; }

.army-card-crest {
  width: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8));
}
.army-card-crest svg { width: 38px; height: auto; display: block; }
.army-card-crest-plain {
  height: 44px;
  border-radius: 3px;
  border: 1px solid #2a1f12;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12) inset;
}

.army-card-name {
  font-size: 15px;
  font-weight: 700;
  color: #f4e3a8;
  text-shadow: 0 1px 2px #000;
  letter-spacing: 0.4px;
  line-height: 1.15;
}

.army-card-nation {
  font-size: 11px;
  color: #b2a274;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.army-card-nation-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--nation-color, #8b7d3c);
  border: 1px solid #2a1f12;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12) inset;
}

.army-card-relation {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 5px;
  border-radius: 2px;
  margin-left: auto;
}
.army-card-relation.own    { color: #c8e6c8; background: rgba(80, 130, 60, 0.18); }
.army-card-relation.ally   { color: #cee0ff; background: rgba(60, 90, 140, 0.20); }
.army-card-relation.enemy  { color: #f4b8b8; background: rgba(140, 50, 50, 0.22); }
.army-card-relation.neutral{ color: #d8c896; background: rgba(120, 100, 60, 0.18); }

.army-card-commander {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-bottom: 1px solid #2a1f12;
  background: rgba(30, 22, 12, 0.6);
}

.army-card-commander-portrait {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #6b4a28, #3a1e0a);
  border: 1px solid #8b7d3c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #f4e3a8;
  flex-shrink: 0;
}

.army-card-commander-name {
  font-size: 13px;
  color: #f4e3a8;
  font-weight: 600;
  line-height: 1.2;
}

.army-card-commander-role {
  font-size: 10px;
  color: #a89668;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 2px;
}

.army-card-stats {
  padding: 8px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}

.army-card-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.army-card-stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #8a7a50;
  font-weight: 600;
}

.army-card-stat-value {
  font-size: 12px;
  color: #e8d5a0;
  font-weight: 500;
}

.army-card-bars {
  padding: 6px 12px 10px;
}

.army-card-bar {
  margin-top: 6px;
}

.army-card-bar:first-child { margin-top: 0; }

.army-card-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #a89668;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 2px;
}

.army-card-bar-track {
  height: 4px;
  background: rgba(0,0,0,0.55);
  border-radius: 2px;
  border: 1px solid #2a1f12;
  overflow: hidden;
}

.army-card-bar-fill {
  height: 100%;
  transition: width 0.18s ease-out;
}

.army-card-bar-fill.health  { background: linear-gradient(90deg, #6b3030 0%, #c95050 100%); }
.army-card-bar-fill.roster  { background: linear-gradient(90deg, #2f5d6b 0%, #50b0c9 100%); }
.army-card-bar-fill.morale  { background: linear-gradient(90deg, #6e6234 0%, #d4c060 100%); }
.army-card-bar-fill.fatigue { background: linear-gradient(90deg, #4a4a4a 0%, #8a7e5e 100%); }

.army-card-balance {
  margin: 8px 12px;
  padding: 8px 10px;
  background: rgba(30, 22, 12, 0.6);
  border: 1px solid rgba(120, 100, 60, 0.35);
  border-radius: 6px;
}
.acb-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a89668;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}
.acb-tier { color: #f4e3a8; font-weight: 700; }
.acb-bar {
  display: flex;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.5);
  background: #0a0a0a;
}
.acb-mine  { background: linear-gradient(90deg, #e0a93b, #f4cf8b); }
.acb-enemy { background: linear-gradient(90deg, #cc4444, #a5341f); }
.acb-legend {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  margin-top: 4px;
}
.acb-l-mine  { color: #e0c070; }
.acb-l-enemy { color: #d98a78; }

.army-card-stance {
  padding: 5px 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #b2a274;
  background: rgba(20, 14, 8, 0.6);
  border-top: 1px solid #2a1f12;
  border-radius: 0 0 6px 6px;
  display: flex;
  justify-content: space-between;
}

.army-card-stance-value {
  color: #f4e3a8;
  font-weight: 600;
}

.army-card-fog {
  padding: 9px 12px;
  font-size: 11px;
  color: #b8a878;
  font-style: italic;
  background: rgba(20, 14, 8, 0.4);
  text-align: center;
  border-top: 1px solid #2a1f12;
  border-bottom: 1px solid #2a1f12;
}

.army-card-fog-strength {
  display: block;
  font-style: normal;
  font-size: 13px;
  color: #f4e3a8;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-top: 4px;
}

.army-card-loading {
  padding: 12px;
  text-align: center;
  font-size: 11px;
  color: #8a7a50;
  font-style: italic;
}

.army-card-civil {
  margin: 8px 12px 0;
  padding: 7px 9px;
  background: rgba(40, 16, 16, 0.55);
  border: 1px solid rgba(140, 50, 50, 0.4);
  border-radius: 6px;
}
.acw-row { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.acw-tag {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: #f4b8b8;
  background: rgba(140, 50, 50, 0.3);
  padding: 2px 5px;
  border-radius: 2px;
}
.acw-goal { font-size: 11px; color: #e8d5a0; font-weight: 600; }
.acw-bar {
  display: flex;
  height: 9px;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.5);
  background: #0a0a0a;
}
.acw-crown { background: linear-gradient(90deg, #c79a3c, #f0d488); }
.acw-rebel { background: linear-gradient(90deg, #8c2b2b, #c14a3a); }
.acw-lead {
  font-size: 10px;
  color: #cbb78a;
  margin-top: 4px;
  text-align: center;
  font-style: italic;
}

.acb-verdict {
  font-weight: 700;
  letter-spacing: 0.3px;
}
.verdict-great  { color: #8fe08f; }
.verdict-good   { color: #c4e08a; }
.verdict-edge   { color: #e8d5a0; }
.verdict-even   { color: #d8c896; }
.verdict-edgebad{ color: #e6b97a; }
.verdict-bad    { color: #e89a78; }
.verdict-dire   { color: #f07a7a; }

.army-card-stack {
  margin: 8px 12px 0;
  padding: 6px 9px;
  background: rgba(20, 14, 8, 0.5);
  border: 1px solid #2a1f12;
  border-radius: 5px;
}
.acs-title {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #8a7a50;
  margin-bottom: 4px;
}
.acs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.acs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  padding: 2px 6px;
  border-left: 2px solid #4a3f28;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.2);
}
.acs-row.acs-own    { border-left-color: #6fae6f; }
.acs-row.acs-ally   { border-left-color: #6f9fae; }
.acs-row.acs-enemy  { border-left-color: #b8524f; }
.acs-row.acs-neutral{ border-left-color: #8a7a50; }
.acs-nm { color: #cbb78a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acs-st { color: #e8d9a8; font-variant-numeric: tabular-nums; flex: 0 0 auto; }

.army-card-holding {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 12px 0;
  padding: 5px 9px;
  font-size: 11px;
  color: #cbb78a;
  background: rgba(20, 14, 8, 0.5);
  border: 1px solid #2a1f12;
  border-radius: 5px;
}
.ach-ctrl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 2px;
}
.ach-ctrl.own   { color: #c8e6c8; background: rgba(80, 130, 60, 0.18); }
.ach-ctrl.enemy { color: #f4b8b8; background: rgba(140, 50, 50, 0.22); }

/* ---- Redesigned, glanceable layout ---- */
.army-card-relation { flex-shrink: 0; }

.ac-balance {
  margin: 9px 12px;
  padding: 9px 11px;
  background: rgba(30, 22, 12, 0.6);
  border: 1px solid rgba(120, 100, 60, 0.35);
  border-radius: 6px;
}
.ac-balance-flat {
  background: rgba(20, 14, 8, 0.5);
  border-color: #2a1f12;
}
.acb-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
}
.acb-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a89668;
  font-weight: 600;
}
.acb-verdict {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-align: right;
}
.ac-balance .acb-bar { height: 14px; }
.acb-ends {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.acb-side { display: flex; flex-direction: column; min-width: 0; }
.acb-side b {
  font-size: 11px; font-weight: 700; color: #e8d5a0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}
.acb-side > span { font-size: 12px; color: #e0c070; font-weight: 600; }
.acb-side-r { text-align: right; align-items: flex-end; }
.acb-side-r b { color: #e8c0b0; }
.acb-side-r > span { color: #d98a78; }
.acb-hint {
  margin-top: 7px;
  font-size: 10px;
  font-style: italic;
  color: #8a7a50;
  text-align: center;
}

.ac-est {
  display: flex;
  gap: 6px;
  padding: 9px 12px;
}
.ac-est-cell {
  flex: 1;
  text-align: center;
  font-size: 11px;
  color: #d8c896;
  background: rgba(20, 14, 8, 0.5);
  border: 1px solid #2a1f12;
  border-radius: 4px;
  padding: 6px 4px;
}

.acs-sub { color: #7a6a40; }

.army-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #f4e3a8;
  font-weight: 600;
  background: rgba(20, 14, 8, 0.6);
  border-top: 1px solid #2a1f12;
  border-radius: 0 0 6px 6px;
}
.acf-k { color: #8a7a50; font-weight: 600; margin-right: 3px; }
.acf-cmd {
  color: #cbb78a;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

