/* ============================================================
   BOARD EFFECTS - tactical clarity states layered on top of fx.css.
   ============================================================ */

/* The board is a direct manipulation surface. Text selection and the mobile
   copy callout interfere with card drags, target clicks, and touch attacks. */
#screen-game,
#screen-game * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

@keyframes ready-card-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(242, 202, 80, 0.58), 0 0 12px rgba(242, 202, 80, 0.18); }
  50% { box-shadow: 0 0 0 2px rgba(255, 224, 136, 0.9), 0 0 24px rgba(242, 202, 80, 0.42); }
}

#selfBoard .minion-card.selected {
  outline: 0;
  border-color: #ffe088;
  animation: ready-card-pulse 1.2s ease-in-out infinite;
}

#screen-game .targetable {
  outline: 0;
  border-color: #ffb2a5;
  box-shadow: 0 0 0 2px rgba(255, 106, 89, 0.72), 0 0 22px rgba(255, 77, 77, 0.38);
}

#screen-game .hero-panel.targetable {
  border-color: #ffb2a5;
  box-shadow: 0 0 0 2px rgba(255, 106, 89, 0.66), 0 0 24px rgba(255, 77, 77, 0.3), inset 0 1px 0 rgba(255, 233, 198, 0.14);
}

.summoned-from-hand {
  box-shadow: 0 0 0 2px rgba(255, 224, 136, 0.82), 0 0 30px rgba(242, 202, 80, 0.42) !important;
}

.targeting-arrow {
  position: absolute;
  inset: 0;
  z-index: 24;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.targeting-arrow-path {
  fill: none;
  stroke: #ffe088;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 9 9;
  marker-end: url(#targetingArrowHead);
  filter: drop-shadow(0 0 5px rgba(242, 202, 80, 0.9));
  animation: targeting-dash 0.75s linear infinite;
}

.targeting-arrow marker path {
  fill: #ffe088;
}

@keyframes targeting-dash {
  to { stroke-dashoffset: -18; }
}

.card-dragging {
  cursor: grabbing !important;
  filter: brightness(1.15) saturate(1.08);
}

#screen-game .hand-card.action-pending,
#screen-game .btn-end-turn.action-pending {
  filter: brightness(1.18) saturate(1.08);
  opacity: 0.56;
  pointer-events: none;
}

.emote-control {
  position: relative;
  flex: 0 0 auto;
}

.btn-emotes {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(215, 233, 255, 0.55);
  border-radius: 50%;
  background: rgba(10, 18, 30, 0.32);
  color: rgba(225, 244, 255, 0.68);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.82;
}

.btn-emotes:hover,
.btn-emotes[aria-expanded="true"] {
  border-color: var(--mana);
  color: #e7f7ff;
  background: rgba(43, 108, 144, 0.35);
  box-shadow: 0 0 12px rgba(79, 195, 232, 0.35);
  opacity: 1;
}

.emote-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(3, 38px);
  gap: 5px;
  padding: 7px;
  border: 1px solid rgba(232, 179, 79, 0.5);
  border-radius: 8px;
  background: rgba(14, 11, 22, 0.96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.48);
}

.emote-choice {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.emote-choice:hover,
.emote-choice:focus-visible {
  border-color: rgba(232, 179, 79, 0.72);
  background: rgba(232, 179, 79, 0.16);
  outline: none;
}

.hero-panel { overflow: visible; }

.emote-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 16px);
  z-index: 30;
  display: grid;
  width: 58px;
  height: 50px;
  place-items: center;
  border: 1px solid rgba(255, 248, 220, 0.76);
  border-radius: 50%;
  background: rgba(246, 242, 226, 0.96);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.42);
  color: #1f1725;
  font-size: 31px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px) scale(0.78);
}

.emote-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 13px;
  height: 13px;
  border-right: 1px solid rgba(255, 248, 220, 0.76);
  border-bottom: 1px solid rgba(255, 248, 220, 0.76);
  background: rgba(246, 242, 226, 0.96);
  transform: translateX(-50%) rotate(45deg);
}

.emote-bubble-opponent {
  top: calc(100% + 16px);
  bottom: auto;
}

.emote-bubble-opponent::after {
  top: -7px;
  bottom: auto;
  transform: translateX(-50%) rotate(225deg);
}

.emote-bubble-show { animation: emote-bubble-pop 2.6s ease both; }

@keyframes emote-bubble-pop {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(0.78); }
  14%, 78% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -8px) scale(0.94); }
}

@media (max-width: 720px) and (orientation: portrait) {
  .btn-emotes { width: 27px; height: 27px; font-size: 16px; }
  .emote-panel { grid-template-columns: repeat(3, 34px); padding: 6px; gap: 4px; }
  .emote-choice { width: 34px; height: 34px; font-size: 20px; }
  .emote-bubble { width: 50px; height: 43px; font-size: 27px; }
}

#screen-game .hand-card.card-dragging-hand {
  z-index: 30;
  transition: none !important;
  pointer-events: none;
  box-shadow: 0 24px 34px rgba(0, 0, 0, 0.66), 0 0 26px rgba(242, 202, 80, 0.34);
}

#selfBoard .minion-card.card-dragging-attack {
  z-index: 20;
  transform: translateY(-14px) scale(1.08) !important;
  transition: transform 0.16s ease, filter 0.16s ease !important;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.66), 0 0 24px rgba(242, 202, 80, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  #selfBoard .minion-card.selected { animation: none; }
}
