/* V1.144 — relationship-aware waiting context without exposing hidden actions. */
.battle-command-state[data-phase="locked"][data-wait-mix] > em {
  --wait-context-rgb: 166, 177, 255;
  justify-self: end;
  width: fit-content;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid rgba(var(--wait-context-rgb), 0.24);
  border-radius: 7px;
  color: rgba(236, 242, 255, 0.84);
  background: linear-gradient(90deg, transparent, rgba(var(--wait-context-rgb), 0.1));
  box-shadow: inset -2px 0 0 rgba(var(--wait-context-rgb), 0.58);
}

.battle-command-state[data-phase="locked"][data-wait-mix="ally"] > em {
  --wait-context-rgb: 92, 198, 235;
}

.battle-command-state[data-phase="locked"][data-wait-mix="enemy"] > em {
  --wait-context-rgb: 236, 115, 104;
}

.battle-command-state[data-phase="locked"][data-wait-mix="unknown"] > em {
  --wait-context-rgb: 194, 146, 228;
}

.battle-command-state[data-phase="locked"][data-wait-mix="mixed"] > em {
  border-color: rgba(162, 176, 221, 0.28);
  background:
    linear-gradient(90deg, rgba(92, 198, 235, 0.09), transparent 42%, rgba(236, 115, 104, 0.11)),
    rgba(7, 15, 28, 0.3);
  box-shadow:
    inset 2px 0 0 rgba(92, 198, 235, 0.6),
    inset -2px 0 0 rgba(236, 115, 104, 0.62);
}

.battle-command-state[data-phase="locked"][data-wait-mix="complete"] > em {
  --wait-context-rgb: 111, 235, 170;
  animation: battle-command-wait-complete 520ms ease-out both;
}

@keyframes battle-command-wait-complete {
  from { opacity: 0.68; filter: brightness(0.9); }
  46% { opacity: 1; filter: brightness(1.24); }
  to { opacity: 1; filter: none; }
}

@media (max-width: 720px) {
  .battle-command-state[data-phase="locked"][data-wait-mix] > em {
    justify-self: stretch;
    width: 100%;
    padding: 4px 7px;
    text-align: left;
  }
}

body[data-vfx-quality="low"] .battle-command-state[data-phase="locked"][data-wait-mix="complete"] > em {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .battle-command-state[data-phase="locked"][data-wait-mix] > em {
    animation: none !important;
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .battle-command-state[data-phase="locked"][data-wait-mix] > em {
    border: 1px solid CanvasText;
    color: CanvasText;
    background: Canvas;
    box-shadow: inset -2px 0 0 Highlight;
  }
}
