/* ==== 手牌卡牌 ==== */
.card {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 12px;
  background:
    linear-gradient(rgba(46,28,10,0.55), rgba(24,14,5,0.72)),
    url('../assets/board/metal.jpg');
  background-size: 300px;
  border: 2px solid #17100a;
  box-shadow:
    inset 0 0 0 2px #8a6a26,
    0 6px 14px rgba(0,0,0,0.65);
  overflow: visible;
  transform-origin: 50% 100%;
}
.card.type-spell {
  background:
    linear-gradient(rgba(30,20,50,0.62), rgba(14,8,26,0.78)),
    url('../assets/board/metal.jpg');
  background-size: 300px;
}

/* 卡图区 */
.card .art {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  height: 46%;
  border-radius: 8px 8px 40% 40%;
  overflow: hidden;
  border: 2px solid #0f0a05;
  box-shadow: inset 0 0 14px rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card .art img {
  width: 74%;
  height: 74%;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,0.55));
}

/* 名条 */
.card .name {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 47%;
  height: 24px;
  z-index: 2;
}
.card .name .ribbon-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.card .name span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: bold;
  color: #fff2cf;
  text-shadow: 0 1px 2px #000, 0 0 4px #000;
  letter-spacing: 1px;
}

/* 描述区 */
.card .text-box {
  position: absolute;
  left: 9px;
  right: 9px;
  top: 60%;
  bottom: 10px;
  border-radius: 8px;
  background:
    linear-gradient(rgba(238,222,180,0.16), rgba(238,222,180,0.16)),
    url('../assets/board/paper.jpg');
  background-size: 260px;
  border: 1.5px solid #4c3311;
  box-shadow: inset 0 0 8px rgba(60,38,8,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px 6px;
  text-align: center;
}
.card .text-box span {
  font-size: 10.5px;
  line-height: 1.35;
  color: #2a1a0a;
  font-weight: 600;
}

/* 费用/攻击/生命 宝石 */
.card .gem {
  position: absolute;
  width: 40px;
  height: 40px;
  z-index: 3;
}
.card .gem img { position: absolute; inset: 0; width: 100%; height: 100%; }
.card .gem.cost { top: -10px; left: -10px; width: 44px; height: 44px; }
.card .gem.atk  { bottom: -9px; left: -9px; }
.card .gem.hp   { bottom: -9px; right: -9px; }
.card .gem span, .stat span, .hero .stat b {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: bold;
  color: #fff;
  text-shadow: -1.5px 0 #000, 1.5px 0 #000, 0 -1.5px #000, 0 1.5px #000, 0 2px 3px #000;
}
.card .gem span { font-size: 21px; padding-bottom: 3px; }
.card .gem.cost span { font-size: 23px; }

/* 稀有度宝石 */
.card .rarity {
  position: absolute;
  left: 50%;
  top: 44.5%;
  transform: translateX(-50%);
  width: 15px;
  height: 15px;
  z-index: 3;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(0,0,0,0.8);
}

/* 数值增减着色 */
.buffed { color: #7CFC00 !important; }
.damaged-stat { color: #ff5a5a !important; }

/* 手牌可打出的发光 */
.card.playable {
  box-shadow:
    inset 0 0 0 2px #8a6a26,
    0 0 16px 4px rgba(96,255,140,0.65),
    0 6px 14px rgba(0,0,0,0.65);
}

/* ==== 战场随从 ==== */
.minion {
  position: relative;
  width: 92px;
  height: 112px;
  cursor: default;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.minion .body {
  position: absolute;
  inset: 0;
  border-radius: 46% 46% 44% 44% / 40% 40% 48% 48%;
  overflow: hidden;
  background: radial-gradient(ellipse at 40% 30%, #3a2a14, #16100a 80%);
  border: 3px solid #1a1208;
  box-shadow:
    inset 0 0 0 2.5px #8a6a26,
    inset 0 0 18px rgba(0,0,0,0.7),
    0 6px 12px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}
.minion .body img {
  width: 62%;
  height: 62%;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.6));
}
.minion.taunt .body {
  border-color: #556070;
  box-shadow:
    inset 0 0 0 3px #93a3b8,
    inset 0 0 18px rgba(0,0,0,0.7),
    0 0 0 3.5px #2e3844,
    0 6px 12px rgba(0,0,0,0.75);
}
.minion .stat {
  position: absolute;
  width: 36px;
  height: 36px;
  bottom: -7px;
  z-index: 3;
}
.minion .stat img { position: absolute; inset: 0; width: 100%; height: 100%; }
.minion .stat.atk { left: -7px; }
.minion .stat.hp  { right: -7px; }
.minion .stat span { font-size: 17.5px; padding-bottom: 2px; }
.hero .stat img { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero .stat b { font-size: 19px; padding-bottom: 3px; }

.minion .zzz {
  position: absolute;
  top: -12px;
  right: -2px;
  width: 30px;
  height: 30px;
  z-index: 4;
  opacity: 0.9;
  animation: floatZ 2.2s ease-in-out infinite;
}
.minion.divine-shield .body::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: radial-gradient(ellipse at 45% 30%, rgba(255,236,150,0.5), rgba(255,200,60,0.14) 60%, rgba(255,190,40,0.32));
  box-shadow: inset 0 0 16px rgba(255,214,90,0.8);
}
.minion.can-attack .body {
  box-shadow:
    inset 0 0 0 2.5px #8a6a26,
    inset 0 0 18px rgba(0,0,0,0.7),
    0 0 16px 4px rgba(96,255,140,0.7),
    0 6px 12px rgba(0,0,0,0.6);
}
.minion.taunt.can-attack .body {
  box-shadow:
    inset 0 0 0 3px #93a3b8,
    inset 0 0 18px rgba(0,0,0,0.7),
    0 0 0 3.5px #2e3844,
    0 0 18px 5px rgba(96,255,140,0.7);
}
.minion.targetable, .hero.targetable {
  filter: brightness(1.12);
}
.minion.targetable .body {
  box-shadow:
    inset 0 0 0 2.5px #8a6a26,
    inset 0 0 18px rgba(0,0,0,0.7),
    0 0 16px 5px rgba(255,80,60,0.8);
}
.hero.targetable .portrait-ring {
  box-shadow: 0 0 18px 6px rgba(255,80,60,0.8), inset 0 0 6px rgba(0,0,0,0.8);
}
.minion:hover { transform: translateY(-3px); }

/* 放置占位符 */
.drop-slot {
  width: 14px;
  height: 100px;
  border-radius: 7px;
  background: linear-gradient(rgba(255,230,150,0.15), rgba(255,230,150,0.4), rgba(255,230,150,0.15));
  box-shadow: 0 0 12px rgba(255,220,120,0.7);
  flex-shrink: 0;
}

/* ==== 悬停放大预览 ==== */
.card-preview {
  position: absolute;
  z-index: 90;
  pointer-events: none;
  transform: scale(2);
  transform-origin: center;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,0.8));
}

/* 对手手牌（卡背） */
.enemy-hand {
  position: absolute;
  top: -52px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  z-index: 4;
}
.card-back {
  width: 62px;
  height: 88px;
  margin: 0 -12px;
  border-radius: 8px;
  background:
    linear-gradient(rgba(40,24,60,0.55), rgba(16,8,28,0.72)),
    url('../assets/board/leather.jpg');
  background-size: 200px;
  border: 2px solid #120a04;
  box-shadow: inset 0 0 0 2px #8a6a26, 0 4px 10px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: 50% 0%;
}
.card-back img { width: 46%; opacity: 0.75; }
