/* Shared battle UI: restrained slate, warm commands, readable compact vitals. */
.unit-vitals-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  overflow: hidden;
}
#mode-hud {
  z-index: 6;
}
.unit-vitals {
  position: absolute;
  left: 0;
  top: 0;
  width: 104px;
  color: #edf6f8;
  font:
    600 10px/1.2 "Segoe UI",
    sans-serif;
  filter: drop-shadow(0 2px 3px #000b);
}
.unit-vitals[hidden],
.unit-vitals [hidden],
.unit-vitals-layer[hidden] {
  display: none;
}
.vital-caption {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-bottom: 3px;
  text-shadow:
    0 1px 3px #000,
    0 0 5px #000;
}
.vital-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  font-size: 10px;
}
.vital-number {
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.vital-health {
  height: 7px;
  position: relative;
  overflow: hidden;
  border-radius: 3px;
  background: #121c25e8;
  border: 1px solid #d9eee44d;
  box-shadow: 0 1px 2px #000b;
}
.vital-health i,
.vital-shield i,
.vital-break i {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  display: block;
}
.vital-hp {
  background: linear-gradient(#b0ebc6, #51af90);
}
.enemy .vital-hp {
  background: linear-gradient(#efaea1, #c86769);
}
.vital-loss {
  background: #f7d59a;
}
.danger .vital-health {
  border-color: #ff987e;
}
.focused .vital-health {
  outline: 1px solid #f7d59a;
  outline-offset: 2px;
}
.focused .vital-name {
  color: #ffe1af;
}
.vital-shield,
.vital-break {
  height: 3px;
  position: relative;
  overflow: hidden;
  border-radius: 2px;
  background: #13242bcc;
  margin-top: 3px;
}
.vital-shield i {
  background: #8dd5ef;
}
.vital-break i {
  background: #d9ad6c;
}
.vital-status {
  display: block;
  color: #d5e5e9;
  font-size: 8px;
  letter-spacing: 0.6px;
  text-align: center;
  margin-top: 3px;
  min-height: 0;
}
.boss.unit-vitals {
  width: 132px;
}
#mode-hud .panel {
  background: linear-gradient(145deg, #162631f2, #101c28ed);
  border: 1px solid #b4d2d122;
  box-shadow:
    0 12px 36px #030a1233,
    inset 0 1px #efffff06;
  backdrop-filter: blur(18px);
  border-radius: 16px;
}
#mode-hud .hud-heading {
  padding: 17px 19px;
  max-width: 300px;
  border-top: 2px solid #d4a76a;
}
#mode-hud .hud-heading h2 {
  font-size: 21px;
  line-height: 1.12;
  margin: 9px 0 13px;
  font-weight: 650;
}
#mode-hud .hud-heading p,
#mode-hud .hud-right p {
  line-height: 1.55;
  color: #b6c9d5;
}
#mode-hud .eyebrow {
  color: #d7b98c;
  font-weight: 700;
  letter-spacing: 1.6px;
}
#mode-hud .hud-right {
  width: 235px;
  padding: 16px;
  max-height: calc(100vh - 365px);
  overflow: auto;
}
#mode-hud .scoreboard {
  gap: 8px;
  margin: 12px 0;
  padding: 11px 0;
  border-block: 1px solid #b6d5df19;
}
#mode-hud .scoreboard > div {
  flex: 1;
  min-width: 0;
}
#mode-hud .scoreboard strong {
  font-variant-numeric: tabular-nums;
  color: #f4ddb9;
  font-size: 24px;
}
#mode-hud .scoreboard small {
  font-size: 10px;
  color: #97aebb;
  text-transform: uppercase;
  letter-spacing: 1px;
}
#mode-hud details {
  border: 1px solid #a8c4d024;
  border-radius: 9px;
  padding: 9px 11px;
  background: #ffffff03;
}
#mode-hud details summary {
  font-size: 11px;
  color: #c7d8e0;
  cursor: pointer;
}
#mode-hud button {
  border-radius: 9px;
  border-color: #afcbd529;
  background: linear-gradient(#263a47, #1c2d3a);
  box-shadow: inset 0 1px #ffffff07;
}
#mode-hud button:hover:not(:disabled) {
  background: #344957;
  border-color: #d2b386;
}
#mode-hud button.primary {
  background: linear-gradient(120deg, #f4d2a0, #ce9b61);
  border-color: #f4d3a3;
  color: #18232b;
  font-weight: 750;
}
#mode-hud button:focus-visible,
#mode-hud select:focus-visible {
  outline: 2px solid #f5d5a5;
  outline-offset: 3px;
}
#mode-hud select {
  border-radius: 8px;
  background: #132430;
  color: #dce9ec;
  border: 1px solid #607782;
  padding: 8px 10px;
}
#mode-hud .bottom-panel {
  bottom: 24px;
  padding: 14px 18px;
  max-height: 35vh;
  overflow: auto;
}
#mode-hud .tactics-toolbar {
  gap: 10px;
}
#mode-hud .tactics-toolbar label {
  font-size: 10px;
  color: #9eb4c2;
}
#mode-hud .bench-row {
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 9px;
}
#mode-hud .bench-row button {
  font-size: 11px;
  padding: 8px 10px;
}
#mode-hud .battle-banner {
  width: calc(100% - 690px);
  max-width: 680px;
  top: 25px;
}
#mode-hud .battle-banner .pill {
  background: #132733dc;
  border: 1px solid #c0d3d139;
  border-radius: 20px;
  padding: 6px 13px;
  color: #d5e9e9;
  font-size: 9px;
  letter-spacing: 1px;
}
#mode-hud .timeline {
  gap: 4px;
  margin-top: 12px;
  flex-wrap: wrap;
}
#mode-hud .timeline span {
  max-width: 100px;
  padding: 6px 8px;
  background: #122633ed;
  border-radius: 6px;
  color: #9fb9c6;
  font-size: 9px;
}
#mode-hud .timeline .active {
  color: #ffe0ae;
  background: #3b3429;
  border-color: #c4a36d;
  box-shadow: 0 0 0 2px #e8bb7224;
}
#mode-hud .battle-banner .timeline {
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow-x: auto;
  pointer-events: auto;
  padding: 4px 2px 7px;
  scrollbar-width: thin;
}
#mode-hud .battle-banner .timeline span {
  flex: 0 0 84px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#mode-hud .turn-controls {
  max-height: 35vh;
  overflow: auto;
}
#mode-hud .bar {
  height: 7px;
  border-radius: 5px;
  background: #091521;
  overflow: hidden;
}
#mode-hud .bar i {
  border-radius: 5px;
  background: linear-gradient(90deg, #498d79, #a0ddbc);
}
#mode-hud .bar.energy i {
  background: linear-gradient(90deg, #7c75ba, #c4b9ec);
}
#mode-hud .boss-hud {
  border: 1px solid #d8a56870;
  background: #172630ef;
  padding: 12px 18px;
  border-radius: 12px;
}
@media (max-width: 1100px) {
  #mode-hud .hud-heading {
    max-width: 255px;
  }
  #mode-hud .hud-right {
    width: 205px;
  }
  #mode-hud .battle-banner {
    width: calc(100% - 600px);
  }
  #mode-hud .hud-heading h2 {
    font-size: 18px;
  }
}
@media (min-width: 801px) and (max-width: 1100px) {
  #mode-hud .turn-controls.strategy-panel {
    width: calc(100% - 48px);
    padding: 14px 18px;
  }
  #mode-hud .turn-controls.strategy-panel .tactics-toolbar {
    flex-wrap: nowrap;
    gap: 6px;
  }
  #mode-hud .turn-controls.strategy-panel label {
    flex: 0 0 140px;
    min-width: 0;
  }
  #mode-hud .turn-controls.strategy-panel button[data-unit] {
    flex: 1;
    min-width: 0;
    padding: 8px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #mode-hud .turn-controls.strategy-panel .primary {
    flex: 0 0 auto;
    padding: 10px;
  }
}
@media (max-width: 800px) {
  #mode-hud .battle-banner {
    width: 92%;
    top: 150px;
  }
  #mode-hud .bottom-panel {
    max-height: 33vh;
    bottom: 12px;
  }
  #mode-hud .hud-right {
    max-height: 28vh;
  }
  .unit-vitals {
    width: 88px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .vital-health i {
    transition: none;
  }
}
