/* Battle layout refresh: compact command bar, smaller board, right-side VDU. */
.is-battle-screen #app {
  --battle-viewport-safe-x: 14px;
  --battle-viewport-safe-top: 10px;
  --battle-stage-pad-left: calc(12px + var(--battle-viewport-safe-x));
  --battle-stage-pad-right: calc(16px + var(--battle-viewport-safe-x));
  --battle-board-area-left: calc(var(--battle-stage-pad-left) + var(--rail-w) + var(--stage-gap) + var(--rail-w) + var(--stage-gap));
  --battle-board-area-width: calc(100% - var(--battle-board-area-left) - var(--battle-stage-pad-right));
  --battle-board-frame-right: 36px;
  --battle-board-frame-max: 1243px;
  --battle-board-frame-gutter: 150px;
  --battle-board-frame-window-width: min(var(--battle-board-frame-max), calc(var(--battle-board-area-width) - var(--battle-board-frame-gutter)));
  --battle-ribbon-center-x: calc(var(--battle-board-area-left) + var(--battle-board-area-width) - var(--battle-board-frame-right) - (var(--battle-board-frame-window-width) / 2) - (var(--battle-stage-pad-right) / 2));
  --battle-calling-card-height: 62px;
}

.is-battle-screen #app::before,
.is-battle-screen #app::after {
  content: "";
  position: absolute;
  z-index: 36;
  inset: 6px;
  pointer-events: none;
}

.is-battle-screen #app::before {
  border: 1px solid rgba(117, 213, 205, 0.52);
  background:
    linear-gradient(90deg, rgba(117, 213, 205, 0.68), transparent 13% 87%, rgba(117, 213, 205, 0.68)) top / 100% 1px no-repeat,
    linear-gradient(90deg, rgba(117, 213, 205, 0.52), transparent 16% 84%, rgba(117, 213, 205, 0.52)) bottom / 100% 1px no-repeat,
    linear-gradient(180deg, rgba(117, 213, 205, 0.58), transparent 18% 82%, rgba(117, 213, 205, 0.58)) left / 1px 100% no-repeat,
    linear-gradient(180deg, rgba(117, 213, 205, 0.58), transparent 18% 82%, rgba(117, 213, 205, 0.58)) right / 1px 100% no-repeat;
  box-shadow:
    inset 0 0 0 1px rgba(7, 16, 18, 0.46),
    inset 0 0 52px rgba(20, 138, 154, 0.16),
    0 0 22px rgba(35, 181, 195, 0.14);
}

.is-battle-screen #app::after {
  opacity: 0.94;
  background:
    linear-gradient(90deg, rgba(117, 213, 205, 0.98) 0 96px, transparent 96px calc(100% - 96px), rgba(117, 213, 205, 0.98) calc(100% - 96px)) top / 100% 2px no-repeat,
    linear-gradient(90deg, rgba(117, 213, 205, 0.86) 0 96px, transparent 96px calc(100% - 96px), rgba(117, 213, 205, 0.86) calc(100% - 96px)) bottom / 100% 2px no-repeat,
    linear-gradient(180deg, rgba(117, 213, 205, 0.86) 0 70px, transparent 70px calc(100% - 70px), rgba(117, 213, 205, 0.86) calc(100% - 70px)) left / 2px 100% no-repeat,
    linear-gradient(180deg, rgba(117, 213, 205, 0.86) 0 70px, transparent 70px calc(100% - 70px), rgba(117, 213, 205, 0.86) calc(100% - 70px)) right / 2px 100% no-repeat;
  filter: drop-shadow(0 0 7px rgba(117, 213, 205, 0.34));
}

.is-battle-screen .hud {
  position: absolute;
  inset: 0 auto auto 0;
  grid-template-columns: minmax(160px, auto) minmax(0, 1fr);
  width: 100%;
  min-height: 0;
  padding: calc(14px + var(--battle-viewport-safe-top)) calc(16px + var(--battle-viewport-safe-x)) 0;
  background: transparent;
  pointer-events: none;
}

.is-battle-screen .hud::before {
  display: none;
}

.is-battle-screen .hud-menu {
  pointer-events: auto;
}

.is-battle-screen .hud__cluster--left {
  position: absolute;
  top: var(--battle-ribbon-top-y);
  left: var(--battle-ribbon-center-x);
  justify-content: center;
  transform: translateX(-50%);
}

.is-battle-screen .hud__menu {
  border: 1px solid rgba(232, 196, 116, 0.68);
  background: #030303;
  color: #e0c074;
  opacity: 1;
}

.is-battle-screen .hud__menu.hud-identity-card,
.hud-identity-card {
  --hud-identity-emblem-size: 78%;
  --hud-identity-emblem-right: 3%;
  --hud-identity-title-size: clamp(9px, 26cqh, 20px);
  position: relative;
  container-type: size;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  width: clamp(280px, 24vw, 382px);
  height: var(--battle-calling-card-height);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(232, 196, 116, 0.7);
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(3, 4, 5, 0.02), rgba(3, 4, 5, 0.46) 70%, rgba(3, 4, 5, 0.76)),
    var(--hud-calling-card-image, none) center / cover no-repeat,
    #07090a;
  box-shadow:
    0 7px 18px rgba(0, 0, 0, 0.46),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 -18px 32px rgba(0, 0, 0, 0.42);
}

.is-battle-screen .hud__menu:hover {
  background: #030303;
  color: #f2d488;
}

.is-battle-screen .hud__menu.hud-identity-card:hover,
.hud-identity-card:hover {
  color: #fff0bd;
  border-color: rgba(54, 226, 207, 0.76);
  background:
    linear-gradient(90deg, transparent, rgba(3, 4, 5, 0.38) 70%, rgba(3, 4, 5, 0.7)),
    var(--hud-calling-card-image, none) center / cover no-repeat,
    #07090a;
}

.hud-identity-card__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.06), transparent 52%, rgba(0, 0, 0, 0.58)),
    linear-gradient(0deg, rgba(0, 0, 0, 0.24), transparent 56%);
}

.hud-identity-card__art {
  display: none;
}

.hud-identity-card__copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  justify-items: start;
  min-width: 0;
  padding: 0 20% 0 14%;
  text-align: left;
}

.hud-identity-card__copy span {
  --hud-calling-card-title-min-size: 10px;
  display: block;
  width: 100%;
  overflow: hidden;
  max-width: 100%;
  color: #fff1bc;
  font-family: var(--font-menu);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1;
  text-overflow: clip;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.84);
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
  font-size: var(--hud-identity-title-size);
}

.hud-identity-card__emblems {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: var(--hud-identity-emblem-right);
  display: flex;
  align-items: center;
  gap: 4px;
  transform: translateY(-50%);
}

.hud-identity-card__emblem {
  display: block;
  width: 43px;
  height: 43px;
  border-radius: 50%;
  background: var(--hud-emblem-image, none) center / contain no-repeat;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.72));
}

.hud-identity-card__emblem[hidden] {
  display: none;
}

.is-battle-screen .hud__board {
  display: none;
}

.hud-menu {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.game-menu-dropdown {
  --game-menu-cream: #f2dfb0;
  --game-menu-muted: #b9a982;
  --game-menu-gold: #f0b94d;
  --game-menu-signal: #36e2cf;
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  left: 50%;
  display: grid;
  gap: 7px;
  width: min(336px, calc(100vw - 28px));
  padding: 15px;
  overflow: hidden;
  border: 1px solid rgba(242, 223, 176, 0.42);
  border-radius: 3px;
  color: var(--game-menu-cream);
  background:
    linear-gradient(115deg, rgba(54, 226, 207, 0.055), transparent 42%),
    linear-gradient(180deg, rgba(4, 14, 14, 0.97), rgba(2, 8, 9, 0.985));
  box-shadow:
    0 22px 56px rgba(0, 0, 0, 0.58),
    inset 0 0 0 1px rgba(54, 226, 207, 0.05);
  backdrop-filter: blur(10px) saturate(0.82);
  transform: translateX(-50%);
}

.game-menu-dropdown::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15px;
  width: 72px;
  height: 3px;
  background: var(--game-menu-signal);
  box-shadow: 0 0 12px rgba(54, 226, 207, 0.36);
}

.game-menu-dropdown[hidden] {
  display: none;
}

.game-menu-dropdown__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  min-height: 57px;
  padding: 5px 3px 11px;
  border-bottom: 1px solid rgba(242, 223, 176, 0.26);
}

.game-menu-dropdown__kicker,
.game-menu-dropdown__status {
  color: rgba(54, 226, 207, 0.84);
  font-family: var(--font-ticker);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.11em;
}

.game-menu-dropdown__kicker {
  grid-column: 1 / -1;
}

.game-menu-dropdown__header strong {
  color: var(--game-menu-cream);
  font-family: var(--font-menu);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.045em;
}

.game-menu-dropdown__status {
  align-self: end;
  color: rgba(185, 169, 130, 0.72);
  font-size: 7px;
  text-align: right;
}

.game-menu-dropdown__item {
  position: relative;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 50px;
  padding: 0 14px 0 16px;
  border: 1px solid rgba(242, 223, 176, 0.24);
  border-radius: 2px;
  color: var(--game-menu-cream);
  background: rgba(0, 7, 7, 0.58);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.game-menu-dropdown__item::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 6px;
  width: 3px;
  border-radius: 2px;
  background: var(--game-menu-muted);
}

.game-menu-dropdown__item:hover,
.game-menu-dropdown__item:focus-visible {
  border-color: rgba(240, 185, 77, 0.92);
  color: var(--game-menu-gold);
  background:
    linear-gradient(90deg, rgba(31, 83, 80, 0.72), transparent 78%),
    rgba(4, 18, 18, 0.94);
  outline: 0;
  box-shadow:
    0 0 11px rgba(240, 185, 77, 0.13),
    inset 0 0 16px rgba(54, 226, 207, 0.04);
}

.game-menu-dropdown__item:hover::before,
.game-menu-dropdown__item:focus-visible::before,
.game-menu-dropdown__item[aria-pressed="true"]::before {
  background: var(--game-menu-signal);
  box-shadow: 0 0 7px rgba(54, 226, 207, 0.32);
}

.game-menu-dropdown__item[aria-pressed="true"] {
  border-color: rgba(240, 185, 77, 0.58);
}

.game-menu-dropdown__index {
  color: var(--game-menu-signal);
  font-family: var(--font-ticker);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.game-menu-dropdown__label {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-family: var(--font-menu);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.035em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-menu-dropdown__state {
  color: rgba(185, 169, 130, 0.86);
  font-family: var(--font-ticker);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.game-menu-dropdown__item--toggle[aria-pressed="true"] .game-menu-dropdown__state {
  color: var(--game-menu-signal);
}

.game-menu-dropdown__item--danger {
  border-color: rgba(211, 109, 85, 0.42);
  color: #ffd0c6;
}

.game-menu-dropdown__item--danger::before {
  background: #d36d55;
}

.game-menu-dropdown__item--danger .game-menu-dropdown__state {
  color: rgba(211, 109, 85, 0.88);
}

.is-battle-screen .score-toast {
  position: absolute;
  z-index: 18;
  left: 50%;
  top: calc(100% + var(--battle-ribbon-top-y) + 12px);
  display: grid;
  place-items: center;
  width: 340px;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid rgba(232, 196, 116, 0.68);
  border-radius: 2px;
  background: #030303;
  color: #ffd879;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.06),
    0 10px 28px rgba(0, 0, 0, 0.2),
    0 0 18px rgba(224, 183, 88, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity 0.22s ease, transform 0.22s ease, filter 0.22s ease;
}

.is-battle-screen .score-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.is-battle-screen .score-toast[hidden] {
  display: none;
}

.battle-command-box .hud__section--score {
  position: relative;
  display: grid;
  grid-template-columns: minmax(72px, 1fr) minmax(82px, auto);
  align-items: center;
  justify-content: stretch;
  gap: 10px;
  min-width: 0;
  min-height: 38px;
  padding: 6px 10px;
  border-color: rgba(224, 192, 120, 0.16);
  background:
    linear-gradient(90deg, rgba(117, 213, 205, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(224, 192, 120, 0.06), transparent 62%),
    #080808;
}

.battle-command-box .hud__section--score.is-changing {
  filter: drop-shadow(0 0 12px rgba(224, 183, 88, 0.18));
}

.battle-command-box .hud__section--score .hud__label {
  color: rgba(224, 192, 120, 0.72);
  font-size: 7.5px;
  line-height: 1;
}

.battle-command-box .hud__score-meta {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
}

.battle-command-box .hud__section--score .hud__val {
  justify-self: end;
  min-width: 0;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 218, 126, 0.96);
  font-size: 24px;
  line-height: 1;
  text-align: right;
  place-items: center end;
  text-shadow:
    0 0 11px rgba(224, 183, 88, 0.34),
    0 2px rgba(0, 0, 0, 0.42);
  white-space: nowrap;
}

.battle-command-box .hud__section--score .score-multiplier {
  position: static;
  min-width: 0;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: rgba(245, 229, 183, 0.86);
  margin-top: 0;
  font-size: 10px;
  transform: none;
  justify-self: start;
}

.battle-command-box .hud__section--score .score-bar {
  justify-self: end;
  gap: 4px;
  margin-left: 0;
  margin-top: 0;
}

.battle-command-box .hud__section--score .score-bar__star {
  width: 15px;
  height: 15px;
}

@keyframes score-overlay-wake {
  0% {
    opacity: 1;
    transform: translateX(-50%) scale(0.98);
  }

  18% {
    opacity: 1;
    transform: translateX(-50%) scale(1.02);
  }

  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

.is-battle-screen .stage {
  grid-template-columns: var(--rail-w) var(--rail-w) minmax(0, 1fr);
  grid-template-areas: "support units board";
  column-gap: var(--stage-gap);
  padding: 0 var(--battle-stage-pad-right) 0 var(--battle-stage-pad-left);
}

.is-battle-screen .board-wrap {
  --board-frame-right: var(--battle-board-frame-right);
  --board-frame-width: min(var(--battle-board-frame-max), calc(100% - var(--battle-board-frame-gutter)));
  --turn-hud-right: 10px;
  --turn-hud-width: 150px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
  overflow: visible;
}

.is-battle-screen .board-frame {
  right: var(--board-frame-right);
  left: auto;
  top: calc(50% + 20px);
  width: var(--board-frame-width);
  max-height: calc(100% - 10px);
  transform: translateY(-50%);
}

.live-coordinate-labels {
  pointer-events: none;
}

.live-coordinate-label__cell {
  fill: rgba(5, 20, 22, 0.18);
  stroke: rgba(117, 213, 205, 0.42);
  stroke-width: 0.75;
}

.live-coordinate-label__cell--base {
  fill: rgba(224, 192, 120, 0.12);
  stroke: rgba(224, 192, 120, 0.46);
}

.live-coordinate-label__dot {
  fill: rgba(5, 10, 11, 0.82);
  stroke: rgba(255, 232, 160, 0.72);
  stroke-width: 0.8;
}

.live-coordinate-label__text {
  fill: #fff0b8;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.82);
  stroke-width: 2.8px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.live-coordinate-label--base .live-coordinate-label__text {
  fill: #75d5cd;
}

.battle-action-panel {
  position: relative;
  z-index: 5;
  grid-column: 2;
  grid-row: 1;
  justify-self: stretch;
}

.base-modal {
  --base-modal-x: 50%;
  --base-modal-y: 50%;
  --base-modal-size: 232px;
  position: absolute;
  z-index: 40;
  inset: 0;
  pointer-events: none;
}

.base-modal[hidden] {
  display: none;
}

.base-modal__backdrop {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.base-modal__panel {
  position: absolute;
  top: var(--base-modal-y);
  left: var(--base-modal-x);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 6px;
  box-sizing: border-box;
  width: min(var(--base-modal-size), calc(100% - 24px));
  height: min(var(--base-modal-size), calc(100% - 24px));
  min-height: 0;
  padding: 8px;
  overflow: hidden;
  border: 1px solid rgba(226, 177, 73, 0.76);
  border-radius: 8px 3px 8px 3px;
  color: #f5e5b7;
  background:
    linear-gradient(180deg, rgba(7, 11, 10, 0.88), rgba(3, 5, 5, 0.97)),
    #030505;
  box-shadow:
    0 0 0 3px rgba(2, 4, 4, 0.9),
    0 0 0 4px rgba(117, 213, 205, 0.25),
    0 18px 38px rgba(0, 0, 0, 0.68),
    inset 0 0 28px rgba(226, 177, 73, 0.08);
  pointer-events: auto;
  transform: translate(-50%, -50%);
}

.base-modal__panel::before {
  position: absolute;
  inset: -16% -8%;
  z-index: 0;
  background:
    url("../assets/generated-art/ui/fieldwork-bay-render-v2.png") center / cover no-repeat;
  content: "";
  opacity: 0.12;
  pointer-events: none;
}

.base-modal__panel::after {
  position: absolute;
  inset: 4px;
  z-index: 0;
  border: 1px solid rgba(242, 211, 134, 0.12);
  border-radius: 5px 1px 5px 1px;
  content: "";
  pointer-events: none;
}

.base-modal__header,
.base-modal__hardware,
.base-modal__footer {
  position: relative;
  z-index: 1;
}

.base-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 23px;
  padding: 0 1px 5px 5px;
  border-bottom: 1px solid rgba(226, 177, 73, 0.28);
}

.base-modal__heading {
  display: block;
}

.base-modal__heading small {
  display: none;
}

.base-modal__heading strong {
  color: #f2d48a;
  font-family: var(--font-display);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.base-modal__breach-trap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px;
  border: 1px solid rgba(222, 73, 55, 0.72);
  border-radius: 2px;
  color: #ffb19a;
  background: rgba(60, 12, 8, 0.72);
  font-family: var(--font-label);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.07em;
}

.base-modal__breach-trap[hidden] {
  display: none;
}

.base-modal__breach-trap i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e44736;
  box-shadow: 0 0 6px rgba(255, 78, 57, 0.9);
}

.base-modal__close {
  display: grid;
  place-items: center;
  width: 23px;
  height: 21px;
  padding: 0;
  border: 1px solid rgba(226, 177, 73, 0.36);
  border-radius: 2px;
  color: rgba(242, 212, 138, 0.78);
  background: rgba(3, 7, 7, 0.78);
  font-family: var(--font-label);
  font-size: 13px;
  line-height: 1;
}

.base-modal__close:hover,
.base-modal__close:focus-visible {
  border-color: #e2b149;
  color: #fff0bd;
  outline: 2px solid rgba(226, 177, 73, 0.2);
  outline-offset: 2px;
  background: rgba(44, 29, 8, 0.9);
}

.base-modal__hardware {
  display: grid;
  grid-template-rows: 50px minmax(0, 1fr);
  gap: 6px;
}

.base-modal__cannon {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 50px;
  padding: 5px 12px;
  border: 1px solid rgba(117, 213, 205, 0.54);
  border-radius: 4px 1px 4px 1px;
  color: #f5d481;
  background:
    radial-gradient(circle at 50% 34%, rgba(117, 213, 205, 0.18), transparent 37%),
    linear-gradient(145deg, rgba(226, 177, 73, 0.1), transparent 48%),
    rgba(3, 10, 10, 0.9);
  font-family: var(--font-label);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.base-modal__cannon > span {
  grid-column: 1;
  color: #75d5cd;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.base-modal__cannon strong {
  grid-column: 2;
  color: #f5d481;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
}

.base-modal__cannon.is-armed {
  border-color: #75d5cd;
  box-shadow: inset 0 0 12px rgba(117, 213, 205, 0.14);
}

.base-modal__cannon:not(:disabled):hover,
.base-modal__cannon:not(:disabled):focus-visible,
.base-fieldwork-slot__deploy:not(:disabled):hover,
.base-fieldwork-slot__deploy:not(:disabled):focus-visible {
  border-color: #75d5cd;
  color: #d9fff9;
  outline: 2px solid rgba(117, 213, 205, 0.18);
  outline-offset: 2px;
  box-shadow: 0 0 18px rgba(117, 213, 205, 0.16);
}

.base-modal__cannon:disabled,
.base-fieldwork-slot__deploy:disabled,
.base-fieldwork-slot__trash:disabled {
  cursor: default;
}

.base-modal__fieldwork-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.base-modal__fieldwork-slots[data-bay-count="1"] {
  grid-template-columns: minmax(0, 1fr);
}

.base-fieldwork-slot {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(226, 177, 73, 0.38);
  border-radius: 4px 1px 4px 1px;
  background:
    linear-gradient(180deg, rgba(226, 177, 73, 0.06), transparent 40%),
    rgba(3, 8, 8, 0.84);
  box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.5);
}

.base-fieldwork-slot__deploy {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: end;
  min-width: 0;
  padding: 3px 2px 5px 5px;
  overflow: hidden;
  border: 0;
  border-right: 1px solid rgba(226, 177, 73, 0.16);
  color: #f5d481;
  background: transparent;
  font-family: var(--font-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.base-fieldwork-slot__crate {
  position: absolute;
  inset: 1px 0 20px;
  background:
    url("../assets/generated-art/ui/fieldwork-shipping-container-v2.png") center / contain no-repeat;
  filter:
    saturate(0.88)
    brightness(0.88)
    drop-shadow(0 5px 5px rgba(0, 0, 0, 0.68));
  opacity: 0.94;
  transform: scale(1.12);
  transform-origin: center bottom;
}

.base-fieldwork-slot--empty .base-fieldwork-slot__crate {
  background-image:
    linear-gradient(rgba(3, 7, 7, 0.62), rgba(3, 7, 7, 0.74)),
    url("../assets/generated-art/ui/fieldwork-bay-render-v2.png");
  background-size: cover, cover;
  filter: grayscale(0.5) brightness(0.48);
  opacity: 0.55;
  transform: scale(1.18);
}

.base-fieldwork-slot--incoming .base-fieldwork-slot__crate {
  animation: base-fieldwork-crate-arrival 2160ms steps(1, end) var(--fieldwork-refresh-delay, 0ms) 1 forwards;
}

.base-fieldwork-slot__copy {
  position: relative;
  z-index: 2;
  display: grid;
  grid-column: 1;
  grid-row: 2;
  padding: 3px 2px 0;
  background: linear-gradient(90deg, rgba(3, 7, 7, 0.92), rgba(3, 7, 7, 0.48));
}

.base-fieldwork-slot__copy strong {
  color: #f1d58e;
  font-size: 18px;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.base-fieldwork-slot__lamp {
  position: absolute;
  z-index: 3;
  top: 5px;
  left: 5px;
  width: 7px;
  height: 7px;
  border: 2px solid #1d2928;
  border-radius: 50%;
  background: #c93f35;
  box-shadow: 0 0 7px rgba(255, 73, 61, 0.74);
}

.base-fieldwork-slot__trash {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 6px 1px;
  border: 0;
  color: rgba(231, 150, 111, 0.8);
  background:
    linear-gradient(180deg, rgba(117, 37, 25, 0.12), rgba(15, 7, 5, 0.86));
}

.base-fieldwork-slot__trash span {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-label);
  font-size: 10px;
  line-height: 1;
}

.base-fieldwork-slot__trash:not(:disabled):hover,
.base-fieldwork-slot__trash:not(:disabled):focus-visible {
  color: #ffbb91;
  outline: 2px solid rgba(235, 111, 74, 0.28);
  outline-offset: -2px;
  background:
    linear-gradient(180deg, rgba(117, 37, 25, 0.48), rgba(24, 7, 4, 0.94));
}

.base-fieldwork-slot.is-selected {
  border-color: #f0b94d;
  color: #fff0b8;
  outline: 2px solid rgba(240, 185, 77, 0.22);
  outline-offset: 2px;
  box-shadow: 0 0 18px rgba(240, 185, 77, 0.2);
}

.base-fieldwork-slot--ready .base-fieldwork-slot__lamp {
  background: #63e08f;
  box-shadow: 0 0 9px rgba(99, 224, 143, 0.85);
}

.base-fieldwork-slot--incoming .base-fieldwork-slot__lamp,
.base-fieldwork-light--incoming {
  animation: base-fieldwork-arrival 2160ms steps(1, end) var(--fieldwork-refresh-delay, 0ms) 1 forwards;
}

.base-fieldwork-slot--empty .base-fieldwork-slot__deploy,
.base-fieldwork-slot--incoming .base-fieldwork-slot__deploy,
.base-fieldwork-slot__trash:disabled {
  opacity: 0.58;
}

.battle-command-box .hud__section--turn.is-deadline .hud__val {
  color: #f0b94d;
}

.battle-command-box .hud__section--turn.is-deadline-critical .hud__val {
  color: #ff7a67;
  text-shadow: 0 0 10px rgba(255, 86, 70, 0.42);
}

.enemy-strength-hud {
  --enemy-strength-progress: 100%;
  position: absolute;
  top: clamp(28px, 4vh, 48px);
  right: var(--turn-hud-right);
  z-index: 6;
  display: grid;
  justify-items: center;
  gap: 20px;
  width: var(--turn-hud-width);
  color: #f5e5b7;
  pointer-events: none;
  filter: drop-shadow(0 0 24px rgba(38, 220, 204, 0.2));
}

.enemy-strength-hud__label {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  clip-path: none;
  color: rgba(245, 229, 183, 0.92);
  background: transparent;
  box-shadow: none;
  font-family: var(--font-display);
  font-size: 8.5px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.1em;
  text-align: center;
  text-shadow:
    0 0 9px rgba(4, 12, 13, 0.9),
    0 1px 2px rgba(4, 12, 13, 0.92),
    0 0 14px rgba(38, 220, 204, 0.28);
  text-transform: uppercase;
  white-space: nowrap;
}

.enemy-strength-hud__dial {
  position: relative;
  display: grid;
  place-items: center;
  width: 108px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(245, 229, 183, 0.2) 0 3px, transparent 4px 100%),
    conic-gradient(
      from -90deg,
      #31e0d4 0 var(--enemy-strength-progress),
      rgba(232, 196, 116, 0.16) var(--enemy-strength-progress) 100%
    );
  box-shadow:
    inset 0 0 0 2px rgba(232, 196, 116, 0.54),
    inset 0 0 0 10px rgba(4, 12, 13, 0.82),
    0 0 0 1px rgba(38, 220, 204, 0.42),
    0 0 32px rgba(38, 220, 204, 0.3);
}

.enemy-strength-hud__dial::before,
.enemy-strength-hud__dial::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.enemy-strength-hud__dial::before {
  inset: 17px;
  background:
    repeating-conic-gradient(from -90deg, rgba(245, 229, 183, 0.22) 0 2deg, transparent 2deg 30deg),
    radial-gradient(circle, rgba(5, 15, 16, 0.94) 0 56%, rgba(5, 15, 16, 0.2) 57% 100%);
  box-shadow:
    inset 0 0 0 1px rgba(38, 220, 204, 0.36),
    inset 0 0 18px rgba(38, 220, 204, 0.16);
}

.enemy-strength-hud__dial::after {
  inset: -7px;
  border: 1px solid rgba(232, 196, 116, 0.24);
  border-left-color: rgba(38, 220, 204, 0.82);
  border-bottom-color: transparent;
}

.enemy-strength-hud__core {
  position: relative;
  z-index: 1;
  width: 21px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f5e5b7;
  box-shadow:
    0 0 0 7px rgba(38, 220, 204, 0.12),
    0 0 21px rgba(245, 229, 183, 0.64);
}

.end-turn.enemy-turn-hud {
  position: absolute;
  top: clamp(178px, 21.5vh, 226px);
  right: var(--turn-hud-right);
  z-index: 7;
  display: grid;
  place-items: center;
  width: var(--turn-hud-width);
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid rgba(117, 213, 205, 0.82);
  border-radius: 2px;
  color: #d8fff8;
  background:
    linear-gradient(90deg, rgba(117, 213, 205, 0.22), transparent 26%, transparent 74%, rgba(232, 196, 116, 0.18)),
    linear-gradient(180deg, rgba(7, 34, 36, 0.98), rgba(2, 10, 11, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(38, 220, 204, 0.3),
    inset 0 1px rgba(255, 255, 255, 0.14),
    inset 0 -7px 14px rgba(0, 0, 0, 0.24),
    0 0 24px rgba(38, 220, 204, 0.18),
    0 11px 22px rgba(0, 0, 0, 0.44);
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-shadow: 0 0 12px rgba(38, 220, 204, 0.34);
  animation: enemy-turn-ready-pulse 2.8s ease-in-out infinite;
}

.end-turn.enemy-turn-hud::before,
.end-turn.enemy-turn-hud::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.end-turn.enemy-turn-hud::before {
  inset: 4px;
  border: 1px solid rgba(232, 196, 116, 0.28);
  border-radius: 1px;
  box-shadow: inset 0 0 12px rgba(38, 220, 204, 0.12);
}

.end-turn.enemy-turn-hud::after {
  inset: auto 16px 6px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 196, 116, 0.64), transparent);
  box-shadow: 0 0 10px rgba(232, 196, 116, 0.24);
}

.end-turn.enemy-turn-hud:hover,
.end-turn.enemy-turn-hud:focus-visible {
  border-color: rgba(117, 213, 205, 0.88);
  color: #f5e5b7;
  background:
    linear-gradient(90deg, rgba(38, 220, 204, 0.3), transparent 26%, transparent 74%, rgba(232, 196, 116, 0.24)),
    linear-gradient(180deg, rgba(8, 32, 34, 0.96), rgba(4, 12, 13, 0.98));
  outline: 2px solid rgba(117, 213, 205, 0.18);
  outline-offset: 2px;
  transform: translateY(-1px);
}

.end-turn.enemy-turn-hud:disabled {
  animation: none;
  opacity: 0.42;
}

@keyframes enemy-turn-ready-pulse {
  0%,
  100% {
    filter: brightness(1);
    box-shadow:
      inset 0 0 0 1px rgba(38, 220, 204, 0.3),
      inset 0 1px rgba(255, 255, 255, 0.14),
      inset 0 -7px 14px rgba(0, 0, 0, 0.24),
      0 0 24px rgba(38, 220, 204, 0.18),
      0 11px 22px rgba(0, 0, 0, 0.44);
  }

  50% {
    filter: brightness(1.08);
    box-shadow:
      inset 0 0 0 1px rgba(38, 220, 204, 0.38),
      inset 0 1px rgba(255, 255, 255, 0.18),
      inset 0 -7px 14px rgba(0, 0, 0, 0.2),
      0 0 30px rgba(38, 220, 204, 0.3),
      0 11px 24px rgba(0, 0, 0, 0.42);
  }
}

.enemy-strength-hud.is-low .enemy-strength-hud__dial {
  background:
    radial-gradient(circle at 50% 50%, rgba(245, 229, 183, 0.22) 0 3px, transparent 4px 100%),
    conic-gradient(
      from -90deg,
      #e0b653 0 var(--enemy-strength-progress),
      rgba(232, 196, 116, 0.16) var(--enemy-strength-progress) 100%
    );
}

.enemy-strength-hud.is-critical .enemy-strength-hud__dial {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 114, 94, 0.28) 0 3px, transparent 4px 100%),
    conic-gradient(
      from -90deg,
      #ff725e 0 var(--enemy-strength-progress),
      rgba(232, 196, 116, 0.16) var(--enemy-strength-progress) 100%
    );
}

.enemy-strength-hud.is-empty {
  opacity: 0.62;
}

.battle-action-panel {
  align-self: end;
  display: grid;
  margin-bottom: 52px;
}

.battle-command-box {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(232, 196, 116, 0.42);
  border-radius: 2px;
  color: #f5e5b7;
  background:
    linear-gradient(180deg, rgba(12, 14, 12, 0.88), rgba(3, 3, 3, 0.94)),
    #030303;
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(117, 213, 205, 0.1),
    inset 0 1px rgba(255, 255, 255, 0.05);
}

.battle-command-box__topline {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 7px;
}

.battle-command-box__status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.battle-command-box .hud__section {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  min-width: 0;
  min-height: 54px;
  padding: 8px 9px;
  border-color: rgba(224, 192, 120, 0.13);
  background:
    linear-gradient(180deg, rgba(117, 213, 205, 0.04), transparent 45%),
    #080808;
  overflow: hidden;
}

.battle-command-box .hud__section::before {
  content: "";
  position: absolute;
  inset: 5px 6px auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(117, 213, 205, 0.34), transparent);
  opacity: 0.48;
  pointer-events: none;
}

.battle-command-box .hud__section--doctrine {
  position: relative;
  justify-items: center;
  border-color: rgba(117, 213, 205, 0.22);
  cursor: help;
}

.battle-command-box__topline .hud__section--doctrine {
  min-height: 38px;
  padding: 0;
  border-color: rgba(224, 192, 120, 0.22);
}

.doctrine-badge__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 0;
  color: #f4dfaa;
  background: transparent;
  font-family: var(--font-display);
  font-size: 12px;
  box-shadow: none;
  filter: drop-shadow(0 0 5px rgba(244, 223, 170, 0.24));
  overflow: visible;
}

.hud__section--doctrine:hover .doctrine-badge__mark,
.hud__section--doctrine:focus-within .doctrine-badge__mark {
  color: #ffe0a0;
  filter: drop-shadow(0 0 7px rgba(255, 224, 160, 0.34));
}

.hud__section--doctrine.is-armed .doctrine-badge__mark {
  color: #ffe0a0;
}

.doctrine-badge__mark svg {
  display: block;
  width: 25px;
  height: 25px;
  overflow: visible;
}

.doctrine-badge__image {
  display: block;
  width: 29px;
  height: 29px;
  object-fit: contain;
}

.doctrine-badge__image[hidden],
.doctrine-badge__mark svg[hidden] {
  display: none !important;
}

.doctrine-badge__mark.has-image,
.hud__section--doctrine:hover .doctrine-badge__mark.has-image,
.hud__section--doctrine:focus-within .doctrine-badge__mark.has-image {
  filter: none;
}

.doctrine-badge__mark.has-padlock .doctrine-badge__image {
  width: 30px;
  height: 30px;
}

.doctrine-badge__mark.has-image::before,
.doctrine-badge__mark.has-image::after {
  content: none !important;
}

.doctrine-badge__shield {
  fill: transparent;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.doctrine-badge__chevron {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0.8;
  stroke-linejoin: round;
}

.doctrine-badge__line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.battle-command-box__topline .hud__section--doctrine .hud__label,
.battle-command-box__topline .hud__section--doctrine .hud__val {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.battle-command-box .hud__label {
  color: rgba(245, 229, 183, 0.58);
  font-size: 7.5px;
  line-height: 1;
  text-align: center;
}

.battle-command-box .hud__val {
  color: #f5e5b7;
  font-size: 18px;
  line-height: 1;
  text-align: center;
}

.battle-command-box .hud__section--base .hud__val {
  color: #ffe0a0;
}

.battle-command-box .hud__section--cannon {
  padding: 0;
  border-color: rgba(224, 192, 120, 0.13);
  background:
    linear-gradient(180deg, rgba(117, 213, 205, 0.04), transparent 45%),
    #080808;
}

.battle-command-box .hud__section--cannon .hud__cannon-btn {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  width: 100%;
  min-height: 54px;
  padding: 8px 7px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.battle-command-box .hud__section--cannon .hud__label {
  font-size: 7.5px;
}

.battle-command-box .hud__section--cannon .hud__val {
  color: #ffe0a0;
  font-size: 18px;
  text-shadow:
    0 0 11px rgba(224, 183, 88, 0.28),
    0 2px rgba(0, 0, 0, 0.42);
}

.battle-action-panel .end-turn--hud {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  min-height: 53px;
  padding: 14px 21px;
  border: 1px solid rgba(232, 196, 116, 0.68);
  border-radius: 3px;
  font-size: 13px;
  line-height: 1;
  text-align: center;
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.34),
    0 0 18px rgba(224, 183, 88, 0.22),
    inset 0 2px rgba(255, 255, 255, 0.28),
    inset 0 -2px rgba(69, 46, 15, 0.3);
  animation: end-turn-ready-pulse 2.6s ease-in-out infinite;
}

.battle-action-panel .end-turn--hud:hover {
  transform: translateY(-1px);
}

.battle-action-panel .end-turn--hud:disabled {
  animation: none;
}

@keyframes end-turn-ready-pulse {
  0%,
  100% {
    filter: brightness(1);
    box-shadow:
      0 10px 24px rgba(0, 0, 0, 0.34),
      0 0 18px rgba(224, 183, 88, 0.22),
      inset 0 2px rgba(255, 255, 255, 0.28),
      inset 0 -2px rgba(69, 46, 15, 0.3);
  }

  50% {
    filter: brightness(1.08);
    box-shadow:
      0 12px 28px rgba(0, 0, 0, 0.36),
      0 0 26px rgba(224, 183, 88, 0.34),
      inset 0 2px rgba(255, 255, 255, 0.32),
      inset 0 -2px rgba(69, 46, 15, 0.3);
  }
}

@media (pointer: coarse) and (orientation: landscape), (orientation: landscape) and (max-height: 760px) {
  :root {
    --dock-bottom: max(26px, calc(var(--safe-bottom) + 20px));
  }

  .is-battle-screen #app {
    --battle-viewport-safe-x: 8px;
    --battle-viewport-safe-top: 6px;
    --battle-ribbon-top-y: 18px;
    --battle-board-frame-right: 41px;
    --battle-board-frame-max: 1093px;
    --battle-board-frame-gutter: 150px;
  }

  .is-battle-screen .hud {
    min-height: 0;
    padding-top: calc(12px + var(--battle-viewport-safe-top));
  }

  .is-battle-screen .hud__section {
    padding: 10px 9px;
  }

  .is-battle-screen .hud__menu {
    min-width: 88px;
    min-height: 34px;
    padding: 0 16px;
    font-size: 14px;
  }

  .is-battle-screen .score-toast {
    top: calc(100% + var(--battle-ribbon-top-y) + 10px);
    width: 296px;
  }

  .is-battle-screen .battle-command-box .hud__section--score {
    min-width: 0;
    min-height: 32px;
    padding: 5px 10px;
  }

  .is-battle-screen .battle-command-box .hud__section--score .hud__val {
    min-width: 0;
    font-size: 17px;
  }

  .is-battle-screen .score-bar {
    max-width: none;
  }

  .is-battle-screen .hud__section--discard {
    min-width: 108px;
  }

  .is-battle-screen .battle-command-box .hud__section--base,
  .is-battle-screen .battle-command-box .hud__section--cannon {
    min-width: 0;
  }

  .is-battle-screen .battle-action-panel {
    margin-bottom: 40px;
  }

  .is-battle-screen .battle-command-box {
    padding: 10px;
    gap: 9px;
  }

  .is-battle-screen .battle-command-box .hud__section {
    min-height: 53px;
    padding: 8px 9px;
  }

  .is-battle-screen .end-turn--hud {
    min-height: 46px;
    padding: 11px 15px;
    font-size: 11px;
  }

  .is-battle-screen .board-wrap {
    --board-frame-right: var(--battle-board-frame-right);
    --board-frame-width: min(var(--battle-board-frame-max), calc(100% - var(--battle-board-frame-gutter)));
  }

  .is-battle-screen .board-frame {
    top: calc(50% + 20px);
    right: var(--board-frame-right);
    width: var(--board-frame-width);
  }
}
.range-training-overlay {
  pointer-events: none;
}

.range-training-overlay__cell {
  fill: rgba(242, 223, 176, 0.025);
  stroke: rgba(242, 223, 176, 0.18);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  transition: fill 180ms ease, stroke 180ms ease, opacity 180ms ease;
}

.range-training-overlay__cell--1 {
  stroke-dasharray: 2 2;
}

.range-training-overlay__cell--2 {
  stroke-dasharray: 5 2;
}

.range-training-overlay__cell--3 {
  stroke-dasharray: 9 3;
}

.range-training-overlay__cell.is-active {
  fill: rgba(54, 226, 207, 0.13);
  stroke: rgba(54, 226, 207, 0.92);
  stroke-width: 2;
  filter: drop-shadow(0 0 3px rgba(54, 226, 207, 0.7));
}

.range-training-overlay__cell.is-cleared {
  fill: rgba(24, 143, 75, 0.04);
  stroke: rgba(24, 143, 75, 0.28);
}

.range-training-overlay__label {
  opacity: 0.66;
}

.range-training-overlay__label.is-active {
  opacity: 1;
}

.range-training-overlay__label-bg {
  fill: rgba(3, 13, 14, 0.9);
  stroke: rgba(242, 223, 176, 0.48);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.range-training-overlay__label.is-active .range-training-overlay__label-bg {
  fill: rgba(6, 35, 35, 0.96);
  stroke: #36e2cf;
  filter: drop-shadow(0 0 4px rgba(54, 226, 207, 0.74));
}

.range-training-overlay__label-text {
  fill: #f2dfb0;
  font-family: var(--font-label);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

@media (prefers-reduced-motion: reduce) {
  .range-training-overlay__cell {
    transition: none;
  }
}
