/* ============================================================
   Enemy Hand Display — Visual states for enemy cards in STR combat
   Phase 3 of ENEMY_CARDS.md roadmap.

   States:
     .enemy-card-blvck         Hidden + non-interactable (greyed BLVCK joker)
     .enemy-card-interactable  Hidden + interactable (bright joker, pulsing border)
     .enemy-card-revealed      Face-up (card emoji + name visible)
     .enemy-card-destroyed     Stolen or destroyed (skull, faded)
   ============================================================ */

/* ── Container ───────────────────────────────────────────────── */

.enemy-hand-display {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 4px;
  padding: 4px 6px;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.enemy-hand-empty {
  font-family: 'Classic Console Neue', 'Courier New', monospace;
  font-size: 0.7em;
  color: rgba(0, 255, 65, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px;
}

/* ── Header label ────────────────────────────────────────────── */

.enemy-hand-label {
  font-family: 'Classic Console Neue', 'Courier New', monospace;
  font-size: 0.65em;
  color: rgba(0, 255, 65, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  padding: 2px 4px;
  align-self: center;
  flex-shrink: 0;
}

/* ── Card slot (shared base) ─────────────────────────────────── */

.enemy-card-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 48px;
  border: 1px solid rgba(0, 255, 65, 0.15);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
  transition: border-color 0.2s ease,
              opacity 0.2s ease,
              transform 0.15s ease,
              filter 0.2s ease;
  position: relative;
}

.enemy-card-glyph {
  font-size: 1.4em;
  line-height: 1;
  text-align: center;
  pointer-events: none;
}

.enemy-card-name {
  font-family: 'Classic Console Neue', 'Courier New', monospace;
  font-size: 0.45em;
  color: rgba(0, 255, 65, 0.7);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 34px;
  line-height: 1.1;
  margin-top: 1px;
  pointer-events: none;
}

/* ── State: BLVCK (hidden + non-interactable) ────────────────── */
/* Greyed joker — reuses visual language from .nch-joker-greyed   */

.enemy-card-slot.enemy-card-blvck {
  border-color: rgba(0, 255, 65, 0.06);
  cursor: not-allowed;
  pointer-events: none;
}

.enemy-card-slot.enemy-card-blvck .enemy-card-glyph {
  filter: grayscale(1) brightness(0.5) drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.7));
  opacity: 0.55;
}

/* ── State: Interactable (hidden + player can act on it) ─────── */
/* Bright joker with pulsing green border                         */

.enemy-card-slot.enemy-card-interactable {
  border-color: rgba(0, 255, 65, 0.6);
  cursor: pointer;
  animation: enemy-card-pulse 1.8s ease-in-out infinite;
}

.enemy-card-slot.enemy-card-interactable .enemy-card-glyph {
  filter: none;
  opacity: 1.0;
}

.enemy-card-slot.enemy-card-interactable:hover {
  border-color: rgba(0, 255, 180, 0.9);
  transform: scale(1.08);
  background: rgba(0, 255, 65, 0.06);
}

.enemy-card-slot.enemy-card-interactable:active {
  transform: scale(0.95);
}

@keyframes enemy-card-pulse {
  0%, 100% { border-color: rgba(0, 255, 65, 0.6); box-shadow: 0 0 4px rgba(0, 255, 65, 0.1); }
  50%      { border-color: rgba(0, 255, 65, 0.9); box-shadow: 0 0 8px rgba(0, 255, 65, 0.25); }
}

/* ── State: Revealed (face-up card) ──────────────────────────── */

.enemy-card-slot.enemy-card-revealed {
  border-color: rgba(255, 170, 50, 0.6);
  background: rgba(255, 170, 50, 0.06);
  cursor: default;
}

.enemy-card-slot.enemy-card-revealed .enemy-card-glyph {
  filter: none;
  opacity: 1.0;
}

/* ── State: Destroyed / Stolen ───────────────────────────────── */

.enemy-card-slot.enemy-card-destroyed {
  border-color: rgba(255, 0, 0, 0.12);
  opacity: 0.3;
  pointer-events: none;
  cursor: default;
}

.enemy-card-slot.enemy-card-destroyed .enemy-card-glyph {
  filter: grayscale(1) brightness(0.4);
}

/* ── Reveal sub-types (optional color tint by action) ────────── */
/* Steal-interactable: cyan tint */
.enemy-card-slot.enemy-card-interactable[data-action="steal"] {
  border-color: rgba(0, 220, 255, 0.6);
  animation-name: enemy-card-pulse-steal;
}
@keyframes enemy-card-pulse-steal {
  0%, 100% { border-color: rgba(0, 220, 255, 0.6); box-shadow: 0 0 4px rgba(0, 220, 255, 0.1); }
  50%      { border-color: rgba(0, 220, 255, 0.9); box-shadow: 0 0 8px rgba(0, 220, 255, 0.25); }
}

/* Destroy-interactable: red tint */
.enemy-card-slot.enemy-card-interactable[data-action="destroy"] {
  border-color: rgba(255, 60, 60, 0.6);
  animation-name: enemy-card-pulse-destroy;
}
@keyframes enemy-card-pulse-destroy {
  0%, 100% { border-color: rgba(255, 60, 60, 0.6); box-shadow: 0 0 4px rgba(255, 60, 60, 0.1); }
  50%      { border-color: rgba(255, 60, 60, 0.9); box-shadow: 0 0 8px rgba(255, 60, 60, 0.25); }
}

/* Reveal-interactable: yellow tint */
.enemy-card-slot.enemy-card-interactable[data-action="reveal"] {
  border-color: rgba(255, 200, 0, 0.6);
  animation-name: enemy-card-pulse-reveal;
}
@keyframes enemy-card-pulse-reveal {
  0%, 100% { border-color: rgba(255, 200, 0, 0.6); box-shadow: 0 0 4px rgba(255, 200, 0, 0.1); }
  50%      { border-color: rgba(255, 200, 0, 0.9); box-shadow: 0 0 8px rgba(255, 200, 0, 0.25); }
}

/* ── Phase 4: Context Menu ───────────────────────────────────── */

.enemy-card-context-menu {
  position: fixed;
  z-index: 9999;
  min-width: 160px;
  max-width: 220px;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid rgba(0, 255, 65, 0.4);
  border-radius: 6px;
  padding: 0;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.6),
    0 0 12px rgba(0, 255, 65, 0.08);
  font-family: 'Classic Console Neue', 'Courier New', monospace;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: ecm-appear 0.15s ease-out;
}

@keyframes ecm-appear {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

.ecm-header {
  font-size: 0.7em;
  color: rgba(0, 255, 65, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 12px 4px;
  white-space: nowrap;
}

.ecm-divider {
  height: 1px;
  background: rgba(0, 255, 65, 0.15);
  margin: 2px 8px 4px;
}

.ecm-action {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: rgba(0, 255, 65, 0.85);
  font-family: 'Classic Console Neue', 'Courier New', monospace;
  font-size: 0.75em;
  text-align: left;
  cursor: pointer;
  gap: 8px;
  transition: background 0.12s ease, color 0.12s ease;
}

.ecm-action:hover {
  background: rgba(0, 255, 65, 0.08);
  color: rgba(0, 255, 180, 1.0);
}

.ecm-action:active {
  background: rgba(0, 255, 65, 0.15);
}

.ecm-action:last-child {
  border-radius: 0 0 6px 6px;
}

.ecm-action-emoji {
  font-size: 1.2em;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.ecm-action-label {
  font-weight: bold;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.ecm-action-sub {
  font-size: 0.85em;
  color: rgba(0, 255, 65, 0.4);
  margin-left: auto;
}

/* Action-specific hover colors */
.ecm-action-reveal:hover { color: rgba(255, 200, 0, 1.0); background: rgba(255, 200, 0, 0.06); }
.ecm-action-steal:hover  { color: rgba(0, 220, 255, 1.0); background: rgba(0, 220, 255, 0.06); }
.ecm-action-destroy:hover { color: rgba(255, 60, 60, 1.0); background: rgba(255, 60, 60, 0.06); }

/* ── Phase 4: Toast feedback ─────────────────────────────────── */

.enemy-card-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  z-index: 9998;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(0, 255, 65, 0.3);
  border-radius: 4px;
  padding: 6px 14px;
  font-family: 'Classic Console Neue', 'Courier New', monospace;
  font-size: 0.75em;
  color: rgba(0, 255, 65, 0.9);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.enemy-card-toast.ecm-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Phase 4: Revealed card interactability (re-steal from revealed) ── */

.enemy-card-slot.enemy-card-revealed.enemy-card-interactable {
  cursor: pointer;
  animation: enemy-card-pulse 1.8s ease-in-out infinite;
}

.enemy-card-slot.enemy-card-revealed.enemy-card-interactable[data-action="steal"] {
  border-color: rgba(0, 220, 255, 0.6);
  animation-name: enemy-card-pulse-steal;
}

/* ══════════════════════════════════════════════════════════════ */
/* ── Phase 5: Information Duel (Canon-Compliant)                */
/* ── NO standalone HUD. State lives on existing surfaces.       */
/* ══════════════════════════════════════════════════════════════ */

/* ── Momentum dots (per enemy card slot) ── */
.idh-momentum-indicator {
  position: absolute;
  bottom: 1px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  pointer-events: none;
}

.idh-momentum-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(0, 255, 65, 0.7);
  box-shadow: 0 0 3px rgba(0, 255, 65, 0.3);
}

/* Momentum tag color overrides via data attribute */
.enemy-card-slot[data-momentum-tag="ballistic"] .idh-momentum-dot { background: rgba(255, 80, 80, 0.8); }
.enemy-card-slot[data-momentum-tag="wet"] .idh-momentum-dot { background: rgba(80, 160, 255, 0.8); }
.enemy-card-slot[data-momentum-tag="electrical"] .idh-momentum-dot { background: rgba(255, 220, 0, 0.8); }
.enemy-card-slot[data-momentum-tag="covert"] .idh-momentum-dot { background: rgba(180, 0, 255, 0.8); }
.enemy-card-slot[data-momentum-tag="improvised"] .idh-momentum-dot { background: rgba(80, 200, 80, 0.8); }
.enemy-card-slot[data-momentum-tag="black_market"] .idh-momentum-dot { background: rgba(60, 60, 60, 0.8); }

/* ── Power fantasy flash ── */
.idh-power-flash {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  font-family: 'Classic Console Neue', 'Courier New', monospace;
  font-size: 2.5em;
  font-weight: bold;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-shadow:
    0 0 20px currentColor,
    0 0 40px currentColor,
    0 2px 8px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  white-space: nowrap;
}

.idh-power-flash.idh-hidden {
  display: none;
}

.idh-power-flash.idh-flash-animate {
  display: block;
  animation: idh-flash-anim 1.2s ease-out forwards;
}

@keyframes idh-flash-anim {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  15%  { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
  30%  { transform: translate(-50%, -50%) scale(1.0); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.0) translateY(-20px); }
}

/* ── Mobile portrait compact ─────────────────────────────────── */
@media (max-width: 600px) and (orientation: portrait) {
  .enemy-card-slot {
    width: 28px;
    height: 38px;
  }
  .enemy-card-glyph {
    font-size: 1.1em;
  }
  .enemy-card-name {
    font-size: 0.35em;
    max-width: 26px;
  }
  .enemy-hand-label {
    font-size: 0.55em;
  }
}
