:root {
  --panel: rgba(255, 255, 255, 0.65);
  --border: rgba(15, 23, 42, 0.12);
}

.duelCard {
  width: min(1320px, 100%);
}

.topRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hud {
  margin-top: 10px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.06);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.hudLeft {
  display: grid;
  gap: 8px;
  min-width: 260px;
}
.hpRow {
  display: grid;
  grid-template-columns: 34px 1fr 46px;
  gap: 10px;
  align-items: center;
}
.hpLabel {
  font-weight: 1100;
  font-size: 13px;
  color: rgba(15, 23, 42, 0.78);
}
.hpBar {
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}
.hpFill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.95), rgba(34, 197, 94, 0.95));
}
.hpFill.isAi {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.95), rgba(245, 158, 11, 0.95));
}
.hpVal {
  text-align: right;
  font-weight: 1100;
  font-size: 12px;
  color: rgba(100, 116, 139, 0.95);
}

.hudRight {
  display: flex;
  gap: 12px;
  align-items: center;
}
.stat {
  display: grid;
  gap: 4px;
  place-items: end;
}
.statLabel {
  font-size: 12px;
  font-weight: 1000;
  color: rgba(100, 116, 139, 0.92);
}
.statVal {
  font-size: 14px;
  font-weight: 1200;
  color: rgba(15, 23, 42, 0.88);
}

.stage {
  margin-top: 10px;
  border-radius: 18px;
  border: 2px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.06);
  overflow: hidden;
  position: relative;
}
#cv {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
  touch-action: none; /* 手机上滑动不滚动页面，优先给游戏 */
  background: radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.12), transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(34, 197, 94, 0.12), transparent 45%),
    linear-gradient(180deg, rgba(219, 234, 254, 0.75), rgba(241, 245, 249, 0.75));
}

.joy {
  position: absolute;
  left: 0;
  top: 0;
  width: 116px;
  height: 116px;
  display: none;
  touch-action: none;
  z-index: 5;
}
.joy.isOn {
  display: block;
}
.joyBase {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.15);
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.12);
  backdrop-filter: blur(6px);
}
.joyKnob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  margin-left: -23px;
  margin-top: -23px;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.18);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.14);
}

/* 桌面端隐藏摇杆（手机端固定左下角显示） */
@media (hover: hover) and (pointer: fine) {
  .joy {
    display: none;
  }
}

.controls {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.controls .btn {
  width: 100%;
  padding: 12px 12px;
  font-size: 16px;
  font-weight: 1100;
}

.hint {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 900;
  color: rgba(100, 116, 139, 0.95);
  line-height: 1.5;
}

.armoryGrid {
  display: grid;
  gap: 10px;
}
.armoryItem {
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.70);
  padding: 12px 12px;
  display: grid;
  gap: 6px;
  text-align: left;
  cursor: pointer;
}
.armoryName {
  font-size: 16px;
  font-weight: 1200;
}
.armoryDesc {
  font-size: 13px;
  font-weight: 900;
  color: rgba(100, 116, 139, 0.95);
  line-height: 1.5;
}

@media (max-width: 820px) {
  .controls {
    grid-template-columns: 1fr 1fr;
  }
  .hudLeft {
    min-width: 100%;
  }
}
