
/* #84 WiK Codex — Soldier Page V7 */
/* Common header, hero and footer geometry remain untouched. */
/* CSS gap property is not used. */

body.wik-v2[data-page="soldier"] .backdrop {
  background-image: url("../assets/bg/troop-training-bg.webp");
  background-position: center top;
}

.wik-soldier-main {
  --soldier-panel: #181b1c;
  --soldier-off: #0b0d0e;
  --soldier-line: #363c3e;
  --soldier-gold: #c8a66f;
  --soldier-value: #e4c78d;
  width: 100%;
  min-width: 0;
  padding-top: .25rem;
  color: #f2f2f2;
}

.wik-soldier-main button,
.wik-soldier-main input,
.wik-soldier-main select {
  font-family: var(--font-ui);
}

.wik-soldier-main button:focus-visible,
.wik-soldier-main input:focus-visible,
.wik-soldier-main select:focus-visible {
  outline: 2px solid #c8a66f;
  outline-offset: 2px;
}

/* Accordion */
.soldier-accordion {
  border: 1px solid var(--soldier-line);
  border-radius: 12px;
  overflow: hidden;
}

.soldier-accordion-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 62px;
  margin: 0;
  padding: 12px;
  border: 0;
  background: #151819;
  color: #f2f2f2;
  text-align: left;
}

.soldier-accordion-icon {
  display: inline-flex;
  flex: 0 0 29px;
  align-items: center;
  justify-content: flex-start;
  color: var(--soldier-gold);
  font-size: 19px;
}

.soldier-accordion-copy {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
}

.soldier-accordion-copy strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.soldier-accordion-copy small {
  display: block;
  margin-top: 3px;
  color: #a0a8aa;
  font-size: 10px;
  line-height: 1.4;
}

.soldier-accordion-chevron {
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  margin-right: 3px;
  border-right: 2px solid #aeb5b7;
  border-bottom: 2px solid #aeb5b7;
  transform: translateY(-2px) rotate(45deg);
}

.soldier-accordion-toggle[aria-expanded="true"]
.soldier-accordion-chevron {
  transform: translateY(2px) rotate(225deg);
}

.soldier-setup-body {
  padding: 10px 8px 8px;
  border-top: 1px solid #323839;
  background: #090b0c;
}

.soldier-close-setup {
  display: block;
  width: 100%;
  min-height: 38px;
  margin-top: 5px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: #adb6b6;
  font-size: 11px;
}

/* Calculation section */
.soldier-calc-section {
  margin-top: 24px;
}

.soldier-section-heading {
  margin: 0 0 12px;
  padding: 0 2px;
}

.soldier-section-kicker {
  margin: 0;
  color: #b89a66;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

.soldier-section-heading h2 {
  margin: 4px 0 0;
  color: #f2f2f2;
  font-size: var(--type-section);
  font-weight: 650;
}

/* Rounded top tabs, connected to the content panel */
.soldier-tabs {
  display: flex;
  align-items: stretch;
  width: 100%;
  margin: 0;
  padding: 0;
  background: var(--soldier-off);
}

.soldier-tab {
  position: relative;
  display: flex;
  flex: 0 0 25%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 25%;
  min-width: 0;
  min-height: 56px;
  margin: 0;
  padding: 9px 1px 7px;
  border: 0;
  border-radius: 12px 12px 0 0;
  background: var(--soldier-off);
  color: #858f91;
  text-align: center;
  white-space: nowrap;
}

.soldier-tab + .soldier-tab:not(.is-active) {
  border-left: 1px solid #222729;
}

.soldier-tab.is-active {
  z-index: 1;
  background: linear-gradient(
    180deg,
    #2b2922 0%,
    #212221 40%,
    #181b1c 80%,
    #181b1c 100%
  );
  color: #f2f2f2;
  font-weight: 750;
}

.soldier-tab.is-active + .soldier-tab {
  border-left-color: transparent;
}

.soldier-tab-name {
  display: block;
  max-width: 100%;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
}

.soldier-tab-meta {
  display: block;
  margin-top: 4px;
  color: #879193;
  font-size: 10px;
  line-height: 1.3;
}

.soldier-tab.is-active .soldier-tab-meta {
  color: #c1c6c7;
}

.soldier-tab-panel {
  min-width: 0;
  margin: 0;
  padding: 15px 12px 17px;
  border: 1px solid var(--soldier-line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: var(--soldier-panel);
}

/* Shared form elements */
.soldier-panel-heading,
.soldier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.soldier-panel-heading strong {
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
}

.soldier-panel-heading small {
  padding-left: 7px;
  color: #a6aeaf;
  font-size: 10px;
  text-align: right;
}

.soldier-label {
  display: block;
  color: #d6dcdd;
  font-size: 12px;
  font-weight: 650;
}

.soldier-select,
.soldier-number {
  display: block;
  width: 100%;
  min-width: 0;
  height: 39px;
  margin: 0;
  padding: 0 9px;
  border: 1px solid #4a5355;
  border-radius: 7px;
  background: #0b0e0f;
  color: #f1f2f2;
  font-size: 13px;
}

.soldier-number {
  height: 43px;
  margin-top: 8px;
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.soldier-level-row {
  margin-top: 15px;
}

.soldier-level-control,
.soldier-tier-control {
  width: 43%;
  min-width: 0;
}

.soldier-subheading {
  margin: 16px 0 9px;
  color: var(--soldier-gold);
  font-size: 12px;
  font-weight: 750;
}

/* Survivor rows: 20 : 40 : 40 */
.soldier-survivor-head,
.soldier-survivor-row {
  display: flex;
  align-items: center;
  min-width: 0;
}

.soldier-survivor-head {
  padding: 0 8px 6px;
}

.soldier-survivor-head span {
  color: #a7b0b1;
  font-size: 10px;
}

.soldier-survivor-head span:first-child,
.soldier-survivor-name {
  flex: 0 0 20%;
  width: 20%;
}

.soldier-survivor-head span:nth-child(2),
.soldier-survivor-head span:nth-child(3),
.soldier-survivor-control {
  flex: 0 0 40%;
  width: 40%;
}

.soldier-survivor-head span:nth-child(2),
.soldier-survivor-head span:nth-child(3) {
  padding-left: 4px;
}

.soldier-survivor-row {
  min-height: 52px;
  padding: 6px 8px;
  border: 1px solid #363d3f;
  border-radius: 8px;
  background: #202425;
}

.soldier-survivor-row + .soldier-survivor-row {
  margin-top: 5px;
}

.soldier-survivor-name,
.soldier-survivor-control {
  min-width: 0;
}

.soldier-survivor-name {
  padding-right: 2px;
}

.soldier-survivor-title {
  display: block;
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1.3;
  white-space: nowrap;
}

.soldier-survivor-effect {
  display: block;
  margin-top: 3px;
  color: #d4b783;
  font-size: 10px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.soldier-survivor-control:nth-child(2) {
  padding-right: 4px;
}

.soldier-survivor-control:nth-child(3) {
  padding-left: 4px;
}

.soldier-survivor-control .soldier-select {
  height: 36px;
  padding: 0 5px;
  font-size: 12px;
}

.soldier-capacity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 15px;
}

.soldier-capacity span {
  color: #adb5b6;
  font-size: 11px;
}

.soldier-capacity strong {
  color: #ead1a3;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.soldier-extra-note {
  margin: 5px 0 0;
  color: #aeb6b7;
  font-size: 10px;
}

.soldier-save {
  display: block;
  width: 100%;
  min-height: 41px;
  margin-top: 15px;
  padding: 9px;
  border: 1px solid #92764f;
  border-radius: 8px;
  background: linear-gradient(180deg,#605037,#3c3429);
  color: #efe3d1;
  font-size: 13px;
  font-weight: 750;
}

.soldier-save-message {
  margin: 8px 0 0;
  color: #d9bd8e;
  font-size: 11px;
}

.soldier-save-message.is-error {
  color: #e2a8a2;
}

/* Two independent mode buttons */
.soldier-methods {
  display: flex;
  margin: 18px -5px 19px;
}

.soldier-method-cell {
  flex: 0 0 50%;
  width: 50%;
  min-width: 0;
  padding: 0 5px;
}

.soldier-method {
  display: block;
  width: 100%;
  min-height: 43px;
  padding: 8px 4px;
  border: 1px solid #434b4d;
  border-radius: 9px;
  background: #0e1112;
  color: #b9c2c4;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
}

.soldier-method.is-active {
  border-color: #967b54;
  background: linear-gradient(180deg,#625137,#3e3428);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  color: #f1e7d7;
}

.soldier-field {
  margin-top: 18px;
}

.soldier-automatic {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 13px;
}

.soldier-automatic span {
  color: #a6afb0;
  font-size: 12px;
}

.soldier-automatic strong {
  color: #e6d1ad;
  font-size: 16px;
}

.soldier-hint,
.soldier-error {
  margin: 10px 0 0;
  color: #a7b0b1;
  font-size: 11px;
  line-height: 1.5;
}

.soldier-error {
  color: #e2a8a2;
}

.soldier-buff-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px solid #343b3d;
  border-radius: 8px;
  background: #111516;
}

.soldier-buff-notice span {
  flex: 1 1 auto;
  color: #aeb6b7;
  font-size: 11px;
}

.soldier-buff-link {
  flex: 0 0 auto;
  min-height: 32px;
  margin-left: 8px;
  padding: 4px 9px;
  border: 1px solid #776244;
  border-radius: 7px;
  background: #26231d;
  color: #e7d1a8;
  font-size: 11px;
}

/* Compact calculation results */
.soldier-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  padding: 13px 0;
  border-top: 1px solid #353c3e;
  border-bottom: 1px solid #353c3e;
}

.soldier-stats-cell {
  width: 50%;
  min-width: 0;
}

.soldier-stats-cell:last-child {
  text-align: right;
}

.soldier-stats-cell small {
  display: block;
  color: #a7b0b1;
  font-size: 11px;
}

.soldier-stats-cell strong {
  display: block;
  margin-top: 3px;
  color: #f2f2f2;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.soldier-stats-cell:last-child strong {
  color: #dcc08c;
}

.soldier-unit {
  font-size: 11px;
  font-weight: 500;
}

.soldier-results-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 17px 0 9px;
}

.soldier-results-heading strong {
  font-size: 13px;
}

.soldier-results-heading span {
  color: #c6aa79;
  font-size: 11px;
  text-align: right;
}

.soldier-results {
  padding: 0 12px;
  border: 1px solid #373e40;
  border-radius: 10px;
  background: #202425;
}

.soldier-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 45px;
  padding: 7px 0;
}

.soldier-result-row + .soldier-result-row {
  border-top: 1px solid #343b3d;
}

.soldier-result-name {
  display: flex;
  align-items: center;
  min-width: 0;
  padding-right: 7px;
  color: #bbc4c5;
  font-size: 12px;
}

.soldier-resource-icon {
  display: block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-right: 7px;
  object-fit: contain;
}

.soldier-clock-icon {
  display: inline-block;
  flex: 0 0 18px;
  width: 18px;
  margin-right: 7px;
  color: #c4a677;
  font-size: 16px;
  text-align: center;
}

.soldier-result-value {
  min-width: 0;
  padding-left: 6px;
  text-align: right;
  white-space: nowrap;
}

.soldier-result-value strong {
  display: block;
  color: #e4c78d;
  font-size: 16px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.soldier-result-value small {
  display: block;
  margin-top: 1px;
  color: #aeb6b8;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.soldier-power {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 13px;
  color: #bac3c4;
  font-size: 12px;
}

.soldier-power strong {
  color: #f2f2f2;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.soldier-breakdown {
  margin-top: 10px;
  color: #929c9e;
  font-size: 10px;
  text-align: right;
}

.soldier-footnote {
  margin: 14px 2px 0;
  color: #939b9d;
  font-size: 10px;
  line-height: 1.6;
}

/* Narrow mobile screens */
@media (max-width: 380px) {
  .soldier-tab-name {
    font-size: 10px;
  }

  .soldier-tab-panel {
    padding-left: 9px;
    padding-right: 9px;
  }

  .soldier-survivor-row {
    padding-left: 6px;
    padding-right: 6px;
  }

  .soldier-survivor-title {
    font-size: 10px;
  }

  .soldier-survivor-effect {
    font-size: 9px;
  }

  .soldier-result-value strong {
    font-size: 15px;
  }

  .soldier-method {
    font-size: 12px;
  }
}
