/* Troop workbench: shared controls and typography remain in style.css. */
.troop-workbench {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  align-items: start;
  gap: clamp(18px, 2vw, 28px);
  margin-top: 24px;
}

.troop-workbench > *,
.troop-summary,
.troop-workbench .field-grid > * {
  min-width: 0;
}

.troop-summary {
  align-self: start;
}

.troop-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-block: 16px;
}

.troop-mode .button {
  min-height: 44px;
}

.troop-order,
.troop-queue {
  min-inline-size: 0;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(27, 62, 64, .72), rgba(11, 28, 36, .86));
  box-shadow: inset 0 1px 0 rgba(210, 230, 219, .035), 0 12px 36px rgba(0, 0, 0, .1);
}

.troop-order > legend,
.troop-queue > legend {
  max-width: calc(100% - 16px);
  padding: 0 10px;
  color: var(--gold);
  font-size: .95rem;
  font-weight: 650;
  letter-spacing: .025em;
  overflow-wrap: anywhere;
}

.troop-queue > legend svg {
  width: 19px;
  height: 19px;
  margin-right: 5px;
  vertical-align: -.2em;
}

.troop-order > .toolbar {
  margin-bottom: 16px;
}

.troop-order h3,
.troop-queue h3 {
  margin-block: 18px 10px;
}

.troop-check {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  min-height: 44px;
  padding-block: 12px;
  color: var(--text);
  font-size: .87rem;
  line-height: 1.6;
  cursor: pointer;
}

.troop-check input[type="checkbox"] {
  appearance: auto;
  width: 20px;
  height: 20px;
  min-height: 0;
  margin: .15em 0 0;
  padding: 0;
  accent-color: var(--emerald);
  cursor: pointer;
}

.troop-check input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.troop-costs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-block: 14px;
}

.troop-costs > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(3, 17, 25, .32);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.troop-costs strong {
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 650;
}

.troop-costs small,
.troop-costs .muted {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 400;
}

.troop-result-main {
  position: relative;
  overflow: hidden;
  border-color: rgba(228, 189, 115, .26);
  background: radial-gradient(ellipse at 95% 0%, rgba(104, 207, 173, .08), transparent 65%), var(--panel);
}

.troop-result-main::before {
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .7;
  pointer-events: none;
  content: "";
}

.troop-power {
  margin: 18px 0 8px;
  color: var(--gold);
  font-size: clamp(1.6rem, 3.2vw, 3rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.troop-summary .detail-grid {
  row-gap: 12px;
  font-size: .83rem;
}

.troop-summary .detail-grid dd {
  min-width: 0;
  margin: 0;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.troop-summary .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.troop-summary .form-actions .button {
  flex: 1 1 125px;
}

.troop-workbench details {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.troop-workbench summary {
  min-height: 44px;
  padding-block: 10px;
  color: var(--emerald);
  font-size: .84rem;
  cursor: pointer;
}

.troop-workbench details a {
  overflow-wrap: anywhere;
}

@media (min-width: 1350px) {
  .troop-order .troop-costs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .troop-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .troop-summary {
    position: static;
  }

  .troop-power {
    font-size: clamp(1.8rem, 7vw, 2.8rem);
  }
}

@media (max-width: 560px) {
  .troop-workbench {
    gap: 16px;
    margin-top: 16px;
  }

  .troop-order,
  .troop-queue {
    padding: 16px 13px;
    border-radius: 14px;
  }

  .troop-mode > .button {
    flex: 1 1 130px;
  }

  .troop-order .field-grid,
  .troop-queue .field-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .troop-costs {
    gap: 8px;
  }

  .troop-costs > div {
    padding: 10px;
  }

  .troop-check {
    font-size: .82rem;
  }
}
