/* ══════════════════════════════════════════════════════════════
   v0.1 Command Phase — Overrides
   All shared styles are in ../../shared/components/*.css
   This file contains ONLY command-phase-specific overrides.
══════════════════════════════════════════════════════════════ */

/* ── Backlink lowered to avoid VP bar overlap ── */
.backlink { top: 40px !important; }

/* ── Override shared action-bar label ── */
/* active-faction: command-phase mode label tracks the active player */
#status-label {
  flex: 0 0 auto !important;
  color: var(--active-faction) !important;
  min-width: auto !important;
}
#status-label.cmd-battle-shock { color: #ffaa00 !important; }
/* CP gain belongs to the player whose turn it is — paint it in their
   faction palette, same as the VP-scoring sibling rule below. The
   hardcoded `#00d4ff` cyan literal here was a pre-active-faction
   leftover that read as "+1 CP" in cobalt-blue against the Custodes
   gold scenario palette ("(seems new) +1 command point when first
   going into last stand shows in blue") — no race condition, just a
   token that never got migrated when the rest of the chrome did. */
#status-label.cmd-cp-gain     { color: var(--active-faction) !important; }
#status-label.cmd-vp-scoring  { color: var(--active-faction) !important; }
#status-label.cmd-done        { color: var(--text-sec) !important; }

/* ── Roll overlay max width ── */
#roll-overlay { max-width: 560px; }

/* ── Amber hull pulse for needs-test units on battlefield ── */
.unit-hull.cmd-needs-test {
  stroke: #ffaa00 !important;
  stroke-width: 2.5 !important;
  stroke-opacity: 1 !important;
  fill: rgba(255,170,0,0.1) !important;
  filter: drop-shadow(0 0 8px rgba(255,170,0,0.6));
  animation: hull-amber-pulse 1.2s ease-in-out infinite;
}
@keyframes hull-amber-pulse {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(255,170,0,0.4)); }
  50%      { filter: drop-shadow(0 0 14px rgba(255,170,0,0.8)); }
}

/* ── Battleshocked model tokens — dim red flicker ── */
.model-base.cmd-bs-token circle,
.model-base.cmd-bs-token rect {
  stroke: #992020 !important;
}
.model-base.cmd-bs-token {
  opacity: 0.7;
  animation: token-bs-dim 2.2s ease-in-out infinite;
}
@keyframes token-bs-dim {
  0%, 100% { opacity: 0.65; }
  50%      { opacity: 0.85; }
}

/* Battle-shock banner is now mounted dynamically into #banner-toasts by
   error-banner-registry.js with class .banner.banner-error — visual
   styling lives in shared/css/banners.css. */

/* ── Score tick animations ── */
@keyframes score-out {
  0%   { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(1.4) translateY(-8px); }
}
@keyframes score-in {
  0%   { opacity: 0; transform: scale(.6) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
/* active-faction: VP score flash belongs to the scoring (active) player */
@keyframes score-flash {
  0%, 100% { color: var(--active-faction); }
  40%      { color: #fff; text-shadow: 0 0 14px var(--active-faction), 0 0 30px var(--active-faction); }
}
.ticking-out { animation: score-out 0.2s ease-out forwards; }
.ticking-in  { animation: score-in 0.2s ease-out forwards, score-flash 0.5s ease-out forwards; }

/* ── Announce overlays — positioned inside #battlefield, centered on board ── */
.cmd-announce {
  position: absolute;
  /* Center horizontally in battlefield (accounts for roster sidebar) */
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  z-index: 200;
  pointer-events: none;
  text-align: center;
}
.cmd-announce.hidden { display: none; }

.cmd-announce-text {
  font: 400 32px/1 'Anton', sans-serif;
  letter-spacing: 4px;
  text-transform: uppercase;
  animation: announce-fade 1.5s ease-out forwards;
}
/* active-faction: CP and VP announces both belong to the player gaining
   the resource, so the text + glow tint with the activating faction
   (gold for Custodes, blue for Ultramarines, etc.). The hardcoded #00ff80
   green was a leftover semantic ("scoring") that read as a foreign
   palette — green isn't used anywhere else in chrome, so it stuck out. */
.cmd-announce-text.cp,
.cmd-announce-text.vp { color: var(--active-faction, #00d4ff); text-shadow: 0 0 30px color-mix(in srgb, var(--active-faction) 50%, transparent), 0 0 60px color-mix(in srgb, var(--active-faction) 20%, transparent); }

@keyframes announce-fade {
  0%   { opacity: 0; transform: scale(0.8); }
  15%  { opacity: 1; transform: scale(1); }
  70%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05); }
}

/* ── Objective flash for VP scoring ── */
.obj-hex-wrap.obj-scoring .obj-ring {
  animation: obj-score-pulse 0.8s ease-out;
}
@keyframes obj-score-pulse {
  0%   { stroke: rgba(0,255,128,0.2); stroke-width: 2; }
  40%  { stroke: rgba(0,255,128,0.9); stroke-width: 4; }
  100% { stroke: rgba(0,255,128,0.3); stroke-width: 2; }
}
/* SVG objective scoring flash */
.obj-scoring-svg polygon {
  animation: obj-score-svg-pulse 0.8s ease-out;
}
@keyframes obj-score-svg-pulse {
  0%   { stroke: rgba(0,255,128,0.2); stroke-width: 1.5; }
  40%  { stroke: rgba(0,255,128,0.9); stroke-width: 3; }
  100% { stroke: rgba(0,255,128,0.3); stroke-width: 1.5; }
}
/* Persistent objective held state — faction-colored border */
.obj-held-a polygon { stroke: var(--faction-a); stroke-width: 2; stroke-opacity: .8; }
.obj-held-b polygon { stroke: var(--faction-b); stroke-width: 2; stroke-opacity: .8; }
/* Priority Objective Identified — faction-tinted glow on marked objective.
   Painted via inline style from `_highlightPriorityObjective` so the
   colour matches whichever faction marked it (gold-by-default was a
   readability problem against the cyan/red faction palette). */
.obj-priority polygon { stroke-width: 2.5; stroke-opacity: 1; }
.obj-priority.obj-priority-a polygon { stroke: var(--faction-a); }
.obj-priority.obj-priority-b polygon { stroke: var(--faction-b); }
.obj-priority.obj-priority-a > svg text { fill: var(--faction-a); }
.obj-priority.obj-priority-b > svg text { fill: var(--faction-b); }
