/* ============================================================
 * v1.8 第一批：卡牌条件挂角 + hover preview 气泡
 * ============================================================ */

.card-family-tag {
  min-width: 22px;
  padding: 1px 5px;
  border-radius: 0;
  font-size: 9.5px;
  line-height: 1.25;
  font-weight: 700;
  text-align: center;
  margin-left: 4px;
  color: #e8ecf3;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  box-sizing: border-box;
  position: static;
}
.card-family-tag.family-control { color: #7ed79a; border-color: rgba(126, 215, 154, .35); background: rgba(95, 184, 120, .09); }
.card-family-tag.family-direct,
.card-family-tag.family-counter { color: #29e7ff; border-color: rgba(41, 231, 255, .34); background: rgba(41, 231, 255, .08); }
.card-family-tag.family-wing { color: #ffd36a; border-color: rgba(255, 211, 106, .36); background: rgba(255, 211, 106, .08); }
.card-family-tag.family-shot { color: #ff8fb0; border-color: rgba(255, 143, 176, .36); background: rgba(255, 143, 176, .08); }
.card-family-tag.family-set_piece { color: #f0d99b; border-color: rgba(212, 166, 74, .4); background: rgba(212, 166, 74, .09); }
.card-family-tag.family-defend { color: #9aa7ff; border-color: rgba(154, 167, 255, .34); background: rgba(154, 167, 255, .08); }
.card-family-tag.family-tempo { color: #c79cff; border-color: rgba(199, 156, 255, .34); background: rgba(199, 156, 255, .08); }

.card-conditions {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, .025);
  border: 1px solid var(--border, #2a2f3a);
  border-radius: 0;
  font-size: 10.5px;
  line-height: 1.4;
}
.card-cond {
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.card-cond-icon {
  font-weight: 700;
  font-size: 10.5px;
  min-width: 10px;
}
.card-cond-text {
  flex: 1;
  color: var(--text-muted, #8b94a3);
}
.card-cond.matched {
  background: rgba(95, 184, 120, .08);
  border-radius: 0;
  padding: 2px 4px;
  margin: -2px -4px;
}
.card-cond.matched .card-cond-icon { color: #7ed79a; }
.card-cond.matched .card-cond-text { color: #e8ecf3; }
.card-cond.pending .card-cond-icon { color: var(--dim, #6b7280); }

.card-preview-bubble {
  position: absolute;
  z-index: 1200;
  box-sizing: border-box;
  min-width: 240px;
  max-width: min(360px, calc(100vw - 16px));
  padding: 10px 14px;
  background: rgba(15, 17, 21, .95);
  border: 1px solid var(--gold-primary, #f0d99b);
  border-radius: 0;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .5);
  font-size: 12px;
  line-height: 1.35;
  color: #e8ecf3;
  pointer-events: none;
  visibility: visible;
  transition: opacity 0.14s ease, top 0.14s ease, left 0.14s ease;
}
.card-preview-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--gold-primary, #f0d99b);
}
.card-preview-bubble.below::after {
  bottom: auto;
  top: -6px;
  border-top: none;
  border-bottom: 6px solid var(--gold-primary, #f0d99b);
}
.card-preview-bubble.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.ui-tooltip-card {
  position: fixed;
  z-index: 1400;
  box-sizing: border-box;
  min-width: 190px;
  max-width: min(360px, calc(100vw - 20px));
  padding: 10px 12px;
  border: 1px solid var(--gold-primary, #f0d99b);
  border-radius: 0;
  color: #e8ecf3;
  background: rgba(15, 17, 21, .97);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .52);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-line;
  pointer-events: none;
}

.ui-tooltip-card::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--gold-primary, #f0d99b);
}

.ui-tooltip-card.below::after {
  top: -6px;
  bottom: auto;
  border-top: 0;
  border-bottom: 6px solid var(--gold-primary, #f0d99b);
}

.ui-tooltip-card.hidden {
  display: none;
}
.cpb-conclusion {
  font-size: 16px;
  font-weight: 700;
  color: #e6edf3;
  line-height: 1.25;
}

.cpb-detail {
  margin-top: 5px;
  font-size: 12px;
  color: #8a94a3;
  line-height: 1.35;
}

.cpb-head {
  font-size: 10.5px;
  letter-spacing: .6px;
  color: var(--gold-primary, #f0d99b);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.cpb-arrow {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}
.cpb-arrow b {
  font-size: 16px;
  color: #7ed79a;
}
.cpb-line {
  font-size: 11.5px;
  color: var(--text-muted, #8b94a3);
}
.cpb-line.cpb-ok { color: #7ed79a; }
.cpb-line.cpb-pending { color: var(--dim, #6b7280); }

/* C 线 hover 重做：防守账本预览的颜色信号 */
.card-preview-bubble .dz-arrow{ color:#6b7684; }
.card-preview-bubble .dz-after{ color:#ff7b72; font-weight:800; }
.card-preview-bubble .dtag{ font-size:.85em; padding:1px 6px; border-radius: 0; font-weight:600; }
.card-preview-bubble .dtag-ok{ background:rgba(86,211,100,.16); color:#56d364; }
.card-preview-bubble .dtag-bad{ background:rgba(248,81,73,.16); color:#f85149; }
