/* Battle mode: a live game-tracking screen (turn/round, VP/CP, the tactical
   secondary deck, the current primary mission). Reuses mission-card.css's
   mc-section/mc-row/mc-intro/mc-action-* classes for card bodies — same
   card anatomy, just laid out inline instead of inside a flip-modal. */

.battle-view {
  overflow-y: auto;
  padding: 20px 24px 40px;
}

.bt-setup {
  max-width: 420px;
  margin: 60px auto 0;
  text-align: center;
}
.bt-setup h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.bt-setup .btn-row {
  justify-content: center;
  margin-top: 16px;
}
.bt-setup .btn { min-width: 120px; padding: 10px 18px; }

.bt-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.bt-round {
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.bt-round b { color: var(--text); font-size: 16px; }

.bt-turn {
  padding: 5px 14px;
  border-radius: 999px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.bt-turn.is-you { background: rgba(224, 118, 27, 0.18); color: var(--amber); }
.bt-turn.is-opp { background: rgba(75, 143, 199, 0.18); color: var(--blue); }

.bt-primary-inline {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}
.bt-primary-label {
  font-family: var(--display);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.bt-primary-inline .mc-mission-value {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
.bt-primary-cap {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
}

.bt-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.bt-counters {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.bt-counter {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 130px;
  padding: 7px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.bt-counter-label {
  flex: 1;
  min-width: 0;
  font-family: var(--display);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bt-counter-value {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}
.bt-counter-arrows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bt-arrow-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 13px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--amber-dim);
  border-radius: 2px;
  cursor: pointer;
}
.bt-arrow-btn:hover { background: rgba(224, 118, 27, 0.16); }
.bt-arrow-btn:active { transform: scale(0.9); }
.bt-arrow-btn svg { width: 8px; height: 5px; fill: var(--amber); }

.bt-block .block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.bt-block-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bt-hand {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}

.bt-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: 230px;
  height: 400px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color 80ms ease;
}
.bt-card:hover { border-color: var(--amber-dim); }

/* Dealt in from the side, rotating flat as it lands — a card being dealt
   off a deck held at an angle. Runs once on arrival; transform:none at
   rest keeps hover/whatever else on .bt-card unaffected afterward. */
@keyframes bt-deal-in {
  from { transform: translateX(70px) rotate(14deg); opacity: 0; }
  60% { opacity: 1; }
  to { transform: none; opacity: 1; }
}
.bt-card-dealing {
  animation: bt-deal-in 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Swap's "old card" half: flicked away to the lower-left before the
   replacement deals in — see initBattle()'s swap-card handler, which waits
   for this to finish before actually swapping the state. */
@keyframes bt-flyout {
  to { transform: translate(-170px, 50px) rotate(-28deg); opacity: 0; }
}
.bt-card-flyout {
  animation: bt-flyout 300ms ease-in both;
  pointer-events: none;
}
/* The detached copy flyOutThen() animates while the real card is already
   gone from state. It takes clicks (and does nothing with them) so a
   double-tap on a score button lands on it rather than on whichever card
   just slid into the vacated slot. */
.bt-card-ghost {
  position: fixed;
  z-index: 600;
  margin: 0;
  pointer-events: auto;
}
.bt-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  background: #1e4f7a;
  color: #fff;
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.bt-card-tag {
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 2px;
  font-size: 7.5px;
  letter-spacing: 0.06em;
}
.bt-card-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 2px;
  color: var(--amber);
  font-size: 10px;
}
.bt-card-body .mc-intro {
  color: var(--amber);
  margin-bottom: 7px;
  padding: 6px 7px;
  font-size: 9.5px;
  line-height: 1.4;
}
.bt-card-body .mc-section { border-color: var(--line); margin-bottom: 6px; }
.bt-card-body .mc-section-head { padding: 3px 7px; font-size: 7.5px; letter-spacing: 0.04em; }
.bt-card-body .mc-section-when { padding: 4px 7px 0; font-size: 8.5px; }
.bt-card-body .mc-row { padding: 5px 7px; gap: 6px; }
.bt-card-body .mc-row-text { font-size: 9.5px; line-height: 1.32; }
.bt-card-body .mc-row-vp { min-width: 26px; padding: 2px 1px; border-radius: 2px; }
.bt-card-body .mc-row-vp b { font-size: 11px; }
.bt-card-body .mc-row-vp small { font-size: 6px; }
.bt-card-body .mc-join { font-size: 7px; padding: 0 0 2px; }
.bt-card-body mark { background: none; color: #fff; font-weight: 700; }
.bt-card-body .mc-action-block { margin-bottom: 7px !important; }
.bt-card-body .mc-action-head { padding: 4px 7px; font-size: 9px; }
.bt-card-body .mc-action-tag { font-size: 6.5px; padding: 1px 4px; }
.bt-card-body .mc-action-row { padding: 4px 7px; gap: 6px; }
.bt-card-body .mc-action-label { flex-basis: 48px; font-size: 7px; }
.bt-card-body .mc-action-text { font-size: 9px; line-height: 1.3; }
.bt-card-body .bt-maxvp { padding: 2px 7px 5px; font-size: 7.5px; }
.bt-card-foot {
  display: flex;
  gap: 8px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.bt-card-foot .btn { position: relative; z-index: 1; }

.bt-score-btn {
  cursor: pointer;
  background: transparent;
  transition: background 80ms ease, transform 80ms ease;
}
.bt-score-btn:hover { background: rgba(224, 118, 27, 0.16); }
.bt-score-btn:active { transform: scale(0.94); }

.bt-zoom-wrap { max-width: none; display: flex; justify-content: center; }
.bt-zoom-card {
  width: 400px;
  max-width: 88vw;
  aspect-ratio: 230 / 400;
  max-height: 86vh;
}

/* A Scored Cards card has no Swap/Discard footer and isn't a zoom
   trigger — see scoredCardMarkup — so it shouldn't offer the hand card's
   zoom-in cursor. */
.bt-card-static { cursor: default; }
.bt-card-static:hover { border-color: var(--line); }

/* The row actually scored, picked out from the rest of the card's text.
   Only the specific VP button that was scored gets the solid fill — a
   "for each ... up to max N" row (see maxVpSteps) shows several amounts on
   one row, and the rest should stay outline-only. */
.mc-row.bt-row-scored {
  background: rgba(224, 118, 27, 0.22);
}
.mc-row-vp.bt-vp-scored {
  background: var(--amber);
  color: #1a1a1a;
  font-weight: 700;
}

/* The count stepper under a "for each" primary row's score button (see
   bRows) — a tiny ▼ N ▲ trio the same width as the button above it. */
.bt-multiplier {
  display: flex;
  align-items: center;
  gap: 3px;
}
.bt-mult-btn {
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--amber-dim);
  border-radius: 2px;
  padding: 2px 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 80ms ease, transform 80ms ease;
}
.bt-mult-btn:hover { background: rgba(224, 118, 27, 0.16); }
.bt-mult-btn:active { transform: scale(0.9); }
.bt-mult-btn svg { width: 8px; height: 5px; fill: var(--amber); }
.bt-mult-value {
  min-width: 18px;
  text-align: center;
  font-family: var(--display);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-dim);
}

/* The Battle-ready +10VP pick on the setup screen, and its tag on the VP
   counter once a side has taken it (see chooseFirst/vpFloor). */
.bt-battle-ready {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0 0;
  text-align: left;
}
.bt-br-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  cursor: pointer;
}
.bt-br-check input { accent-color: var(--amber); }
.bt-br-vp {
  font-weight: 700;
  color: var(--amber);
}
.bt-br-tag {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
  vertical-align: middle;
}

.bt-manual-pick {
  display: flex;
  gap: 8px;
  max-width: 460px;
  margin-top: 10px;
}
.bt-manual-pick select {
  flex: 1;
  min-width: 0;
}

.bt-maxvp {
  padding: 4px 10px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  text-align: right;
}

@media (max-width: 1000px) {
  .battle-view { padding: 14px 14px 32px; }
  .bt-header-actions { margin-left: 0; width: 100%; }
}

/* Phone width: shrink the hand cards (and their text a touch further) so
   two sit side by side instead of one filling most of the screen. */
@media (max-width: 480px) {
  .bt-hand { gap: 8px; }
  .bt-card { width: 160px; height: 280px; }
  .bt-card-head { padding: 5px 7px; font-size: 10px; }
  .bt-card-tag { display: none; }
  .bt-card-body { padding: 6px 6px 2px; font-size: 9px; }
  .bt-card-body .mc-row-text { font-size: 8.5px; }
  .bt-card-body .mc-section-when { font-size: 7.5px; }
  .bt-card-foot { padding: 5px 7px; gap: 5px; }
  .bt-card-foot .btn { padding: 5px 4px; font-size: 10px; }
}
