/* v2.36 siege hold, general outcomes, and faction-colored castle outlines */

/* Castle ownership outline: the city art itself is the ownership marker. */
.node.force-wei { --castle-force-color: #e45145; --castle-force-glow: rgba(228, 81, 69, .58); }
.node.force-shu { --castle-force-color: #54b96e; --castle-force-glow: rgba(84, 185, 110, .52); }
.node.force-wu { --castle-force-color: #5799d4; --castle-force-glow: rgba(87, 153, 212, .52); }
.node.force-lvbu { --castle-force-color: #ad6fd0; --castle-force-glow: rgba(173, 111, 208, .52); }
.node.force-yuanshao { --castle-force-color: #d2af54; --castle-force-glow: rgba(210, 175, 84, .5); }
.node.force-yuanshu { --castle-force-color: #c873c4; --castle-force-glow: rgba(200, 115, 196, .48); }
.node.force-gongsun { --castle-force-color: #64bdcf; --castle-force-glow: rgba(100, 189, 207, .48); }
.node.force-liubiao { --castle-force-color: #7fb477; --castle-force-glow: rgba(127, 180, 119, .48); }
.node.force-liuzhang { --castle-force-color: #73a7c8; --castle-force-glow: rgba(115, 167, 200, .48); }
.node.force-mateng { --castle-force-color: #d08d54; --castle-force-glow: rgba(208, 141, 84, .5); }
.node.force-zhanglu { --castle-force-color: #b4a369; --castle-force-glow: rgba(180, 163, 105, .48); }
.node.force-kongrong { --castle-force-color: #83b29f; --castle-force-glow: rgba(131, 178, 159, .48); }
.node.force-neutral { --castle-force-color: #8e9092; --castle-force-glow: rgba(142, 144, 146, .42); }

.node .city-castle-shell {
  border: 3px solid var(--castle-force-color, #8e9092);
  outline: 1px solid rgba(8, 8, 9, .92);
  outline-offset: 1px;
  border-radius: 12px;
  background: rgba(8, 9, 10, .58);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, .08),
    0 0 13px var(--castle-force-glow, rgba(142, 144, 146, .42)),
    0 5px 12px rgba(0, 0, 0, .52);
}

.node.selected .city-castle-shell,
.node:hover .city-castle-shell {
  border-width: 4px;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, .16),
    0 0 19px var(--castle-force-glow, rgba(142, 144, 146, .52)),
    0 6px 14px rgba(0, 0, 0, .6);
}

.node .city-node-icon {
  filter:
    drop-shadow(1px 0 0 var(--castle-force-color, #8e9092))
    drop-shadow(-1px 0 0 var(--castle-force-color, #8e9092))
    drop-shadow(0 1px 0 var(--castle-force-color, #8e9092))
    drop-shadow(0 -1px 0 var(--castle-force-color, #8e9092));
}

.legend-castle-owner {
  display: inline-block;
  width: 14px;
  height: 9px;
  border: 2px solid #e45145;
  border-radius: 3px;
  background: rgba(20, 20, 21, .75);
  box-shadow: 0 0 5px rgba(228, 81, 69, .5);
}

/* Live siege condition: this is the strategic objective, not another combat stat. */
.siege-hold-rule {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 7px 10px;
  margin: 8px 0 10px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  background: rgba(10, 11, 12, .84);
}

.siege-hold-rule span {
  color: rgba(255, 255, 255, .62);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
}

.siege-hold-rule b {
  color: #e9d7ad;
  font-size: 17px;
}

.siege-hold-rule small {
  color: rgba(255, 255, 255, .7);
  font-size: 9px;
  line-height: 1.45;
}

.siege-hold-rule.holding {
  border-left: 4px solid #6fac81;
}

.siege-hold-rule.breached {
  border-left: 4px solid #dc5948;
  background: linear-gradient(90deg, rgba(115, 27, 21, .34), rgba(10, 11, 12, .86));
}

.siege-hold-rule.breached b {
  color: #ff8978;
  text-shadow: 0 0 9px rgba(255, 78, 59, .42);
}

/* Battle personnel consequences stay attached to the battle result. */
.battle-personnel-results {
  display: grid;
  gap: 6px;
  margin: 10px 0 4px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.battle-personnel-results > small {
  color: #d7bf92;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .06em;
}

.battle-personnel-results article {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: rgba(0, 0, 0, .22);
}

.battle-personnel-results article.player {
  border-color: rgba(226, 92, 73, .48);
  background: rgba(91, 26, 20, .24);
}

.battle-personnel-results img {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border-radius: 7px;
}

.battle-personnel-results span {
  display: grid;
  gap: 2px;
}

.battle-personnel-results b {
  color: #f1dfbb;
  font-size: 11px;
}

.battle-personnel-results em {
  color: rgba(255, 255, 255, .66);
  font-size: 9px;
  font-style: normal;
  line-height: 1.4;
}

.battle-personnel-results .captured b,
.battle-personnel-results .executed b {
  color: #ff8d79;
}

.battle-record-personnel {
  display: grid;
  gap: 4px;
  margin: 8px 0;
  padding: 8px 10px;
  border-left: 3px solid rgba(214, 93, 74, .64);
  background: rgba(98, 31, 24, .14);
}

.battle-record-personnel b {
  color: #d7bf92;
  font-size: 10px;
}

.battle-record-personnel span {
  color: rgba(255, 255, 255, .7);
  font-size: 9px;
}

/* Executions happen outside battle playback, so they get an unmistakable global report. */
.general-outcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(20, 0, 0, .44);
  animation: generalOutcomeFlash .35s ease both;
}

.general-outcome-card {
  width: min(330px, calc(100vw - 34px));
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 18px 20px;
  border: 1px solid rgba(236, 104, 82, .62);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(46, 20, 18, .98), rgba(13, 11, 12, .98));
  box-shadow: 0 18px 60px rgba(0, 0, 0, .64), 0 0 34px rgba(196, 52, 38, .24);
  text-align: center;
}

.general-outcome-card > small {
  color: #db957f;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
}

.general-outcome-card img {
  width: 82px;
  height: 82px;
  object-fit: cover;
  border: 2px solid #b94e3d;
  border-radius: 50%;
}

.general-outcome-card b {
  color: #ffe1d4;
  font-size: 19px;
}

.general-outcome-card p {
  margin: 0;
  color: rgba(255, 255, 255, .76);
  font-size: 11px;
  line-height: 1.55;
}

@keyframes generalOutcomeFlash {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 760px) {
  .node .city-castle-shell {
    border-width: 2px;
    outline-offset: 0;
  }

  .node.selected .city-castle-shell,
  .node:hover .city-castle-shell {
    border-width: 3px;
  }

  .siege-hold-rule {
    grid-template-columns: auto auto;
    gap: 4px 8px;
    padding: 7px 8px;
  }

  .siege-hold-rule small {
    grid-column: 1 / -1;
    font-size: 8px;
  }
}
