/* 游戏主区域相关样式 */
#main-game-board {
  background: linear-gradient(135deg, #f6f8fa 60%, #e3eaff 100%);
  border-radius: 22px;
  box-shadow: 0 8px 32px #b3cfff66, 0 1.5px 0 #fff inset;
  border: 2.5px solid #e3eaff;
  flex-direction: column;
  flex: 1 0 0;
  height: 100%;
  display: flex;
}

/* 敌方区域横向排列，卡组-手牌-弃牌堆顺序调整，左右贴边 */
#op-area>div {
  display: flex;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 2px 12px #b3cfff22;
  padding: 8px;
  border-bottom: 1.5px solid #e3eaff;
  align-items: center;
}

#op-deck,
#op-discard,
#my-deck,
#my-discard {
  width: 80px;
  height: 114px;
  background: rgba(240, 245, 255, 0.85);
  border-radius: 8px;
  box-shadow: 0 2px 8px #b3cfff33;
  border: 1.5px solid #e3eaff;
  font-weight: bold;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 12px;
  padding: 4px;
}

/* 卡组图片样式 */
.deck-img {
  width: 60px;
  height: 84px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  margin: 2px 0;
  transition: all 0.2s ease;
  object-fit: cover;
}

/* 为卡组添加可点击的视觉提示 */
#my-deck,
#op-deck {
  transition: all 0.2s ease;
  cursor: pointer;
}

#my-deck:hover,
#op-deck:hover {
  background: rgba(220, 235, 255, 0.95);
  box-shadow: 0 4px 12px #b3cfff66;
  transform: translateY(-2px);
}

#my-deck:hover .deck-img,
#op-deck:hover .deck-img {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 当卡组为空时，禁用hover效果 */
#my-deck[data-empty="true"]:hover,
#op-deck[data-empty="true"]:hover {
  background: rgba(240, 245, 255, 0.85);
  box-shadow: 0 2px 8px #b3cfff33;
  transform: none;
  cursor: default;
}

#my-deck[data-empty="true"]:hover .deck-img,
#op-deck[data-empty="true"]:hover .deck-img {
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 当卡组被锁定时，禁用hover效果 */
#my-deck[data-locked="true"]:hover,
#op-deck[data-locked="true"]:hover {
  background: rgba(240, 245, 255, 0.85);
  box-shadow: 0 2px 8px #b3cfff33;
  transform: none;
  cursor: default;
}

#my-deck[data-locked="true"]:hover .deck-img,
#op-deck[data-locked="true"]:hover .deck-img {
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 为弃牌堆添加可点击的视觉提示 */
#my-discard,
#op-discard {
  transition: all 0.2s ease;
}

#my-discard:hover,
#op-discard:hover {
  background: rgba(220, 235, 255, 0.95);
  box-shadow: 0 4px 12px #b3cfff66;
  transform: translateY(-2px);
}

/* 当弃牌堆为空时，禁用hover效果 */
#my-discard[data-empty="true"]:hover,
#op-discard[data-empty="true"]:hover {
  background: rgba(240, 245, 255, 0.85);
  box-shadow: 0 2px 8px #b3cfff33;
  transform: none;
}

/* 当弃牌堆被锁定时，禁用hover效果 */
#my-discard[data-locked="true"]:hover,
#op-discard[data-locked="true"]:hover {
  background: rgba(240, 245, 255, 0.85);
  box-shadow: 0 2px 8px #b3cfff33;
  transform: none;
}

#op-hand,
#my-hand {
  gap: 8px;
  display: flex;
  align-items: center;
  min-height: 120px;
  overflow-x: auto;
  max-width: 50vw;
  padding-top: 20px;
  margin-top: -20px;
}

#my-action-bar {
  background: rgba(255, 255, 255, 0.92);
  align-items: center;
}

#my-cards-bar {
  display: flex;
  justify-content: space-between;
  flex: 1;
  margin: 16px;
  align-items: center;
}

/* 战场区域 */
#battlefield {
  display: flex;
  height: 100%;
}

#battlefield>div {
  display: flex;
  width: 100%;
  background: linear-gradient(90deg, #eaf1fb 60%, #f8faff 100%);
  border-radius: 0 0 18px 18px;
  box-shadow: 0 2px 16px #b3cfff22 inset;
}

#left-line,
#right-line {
  flex: 0 0 25%;
  display: flex;
  flex-direction: column;
}

#center-main,
#op-left,
#op-right,
#my-left,
#my-right {
  flex: 1 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#center-main {
  gap: 18px;
  margin: 8px;
}

#op-left,
#op-right {
  background: linear-gradient(180deg, #ffeaea90 60%, #fff 100%);
  justify-content: flex-end;
  border-radius: 14px 14px 0 0;
  border-bottom: 2px solid #fbb;
  margin: 8px 8px 0 8px;
}

#my-left,
#my-right {
  background: linear-gradient(0deg, #eaf3ff90 60%, #fff 100%);
  border-radius: 0 0 14px 14px;
  border-top: 2px solid #b3cfff;
  margin: 0 8px 8px 8px;
}

#left-city,
#right-city {
  flex: 0 0 10%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 8px;
  background: #fffbe6;
  border-radius: 10px;
  box-shadow: 0 2px 8px #ffe06655;
  border: 1.5px solid #ffe066;
  font-weight: bold;
  font-size: 17px;
  color: #b8860b;
}

.label-opponent {
  color: #d9534f;
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 4px;
}

.label-my {
  color: #0078d7;
  font-weight: bold;
  font-size: 16px;
  margin-top: 4px;
}

#op-main,
#my-main {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5vw 0;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  box-shadow: 0 2px 8px #b3cfff22;
  border: 1.5px solid #e3eaff;
  font-size: 18px;
  font-weight: bold;
  flex: 1 0 0;
}

.vs-label {
  color: #fff;
  background: linear-gradient(90deg, #0078d7 40%, #b3cfff 100%);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 28px !important;
  font-weight: bold;
  box-shadow: 0 2px 12px #0078d7aa;
  border: 2.5px solid #fff;
  margin: 0 0 0 0;
  letter-spacing: 2px;
}

#my-main-generals,
#op-main-generals {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 8px 0;
}

#my-left-generals,
#my-right-generals {
  min-height: 90px;
  display: flex;
  justify-content: center;
  padding: 8px 0;
  flex-direction: column;
}

#op-left-generals,
#op-right-generals {
  min-height: 90px;
  display: flex;
  justify-content: center;
  padding: 8px 0;
  flex-direction: column-reverse;
}

.general-img {
  background: #eee;
  cursor: pointer;
}

/* 选中将领高亮 */
.general-img.selected {
  border: 2.5px solid #0078d7;
  box-shadow: 0 0 12px #0078d799;
  /* transform: translateY(-8px) scale(1.08); */
  z-index: 2;
}

.inspire-hint {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 22px;
  color: #f39c12;
  display: none;
  pointer-events: none;
  z-index: 2;
}

.energy-line {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  max-width: 10vw;
  z-index: 1;
}

#mulligan-hand {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1vw;
  margin: 1vw 0 0.5vw 0;
}

.mulligan-card {
  width: min(7vw, 80px);
  height: min(10vw, 110px);
  margin: 0.5vw;
  border-radius: 10px;
  border: 2.5px solid #0078d7;
  background: #fff;
  box-shadow: 0 2px 8px #b3cfff;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border 0.15s;
}

.mulligan-card.selected {
  border: 2.5px solid #d9534f;
  box-shadow: 0 0 12px #d9534f99;
  transform: translateY(-8px) scale(1.08);
  z-index: 2;
}

.mulligan-card[style*="opacity:0.6"] {
  pointer-events: none;
}

.my-hand-card {
  width: min(10.8vw, 80px);
  height: min(15vw, 110px);
  margin: 0.5vw;
  border-radius: 10px;
  border: 2.5px solid #0078d7;
  background: #fff;
  box-shadow: 0 2px 8px #b3cfff;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border 0.15s;
}

.my-hand-card.disabled {
  filter: grayscale(1) brightness(0.7);
  cursor: not-allowed;
}

.my-hand-card.selected {
  border: 2.5px solid #d9534f;
  box-shadow: 0 0 12px #d9534f99;
  transform: translateY(-8px) scale(1.08);
  z-index: 2;
}

/* 敌方手牌，灰色细边框 */
.op-hand-card {
  width: min(7vw, 80px);
  height: min(10vw, 110px);
  border-radius: 10px;
  border: 1.5px solid #ccc;
  background: #f0f0f0;
  box-shadow: 0 2px 8px #b3cfff33;
}

.line-position {
  width: 100%;
  height: 20px;
  background: #0078d7;
  margin: 4px 0;
  border-radius: 1px;
  display: none;
  /* 默认隐藏 */
}

.score-bar {
  position: absolute;
  left: 0;
  min-width: 60px;
  background: #fffbe6;
  color: #b8860b;
  font-weight: bold;
  font-size: 16px;
  border-radius: 8px;
  box-shadow: 0 2px 8px #ffe06655;
  border: 1.5px solid #ffe066;
  padding: 4px 10px;
  z-index: 2;
}

#my-main .score-bar {
  top: 0;
}

#op-main .score-bar {
  bottom: 0;
}

.general-btn-bar {
  /* gap: 0.6vh;
  display: flex;
  flex-direction: column;
  right: 0;
  transform: translateX(100%); */
  position: absolute;
  z-index: 10;
}

.general-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border-radius: 8px;
  border: 1.5px solid rgb(187, 187, 187);
  background: rgb(255, 255, 255);
  cursor: pointer;
  padding: 0;
  margin: 0;
}

/* 强袭高亮，深红色细边框 */
.assault-highlight {
  box-shadow: 0 0 0 4px #8b0000cc !important;
  border: 1.5px solid #8b0000 !important;
  background: #ffe6e6 !important;
  transition: box-shadow 0.15s, border 0.15s, background 0.15s;
}

/* 不屈高亮，金色细边框 */
.unyielding-highlight {
  box-shadow: 0 0 0 4px #ffd700cc !important;
  border: 1.5px solid #ffd700 !important;
  background: #fffacd !important;
  transition: box-shadow 0.15s, border 0.15s, background 0.15s;
}

/* 冰冻高亮，浅蓝色细边框 */
.frozen-highlight {
  box-shadow: 0 0 0 4px #17a2b8cc !important;
  border: 1.5px solid #17a2b8 !important;
  background: #e6f7ff !important;
  transition: box-shadow 0.15s, border 0.15s, background 0.15s;
}

/* 沉默高亮，灰色细边框 */
.silenced-highlight {
  box-shadow: 0 0 0 4px #6c757dcc !important;
  border: 1.5px solid #6c757d !important;
  background: #f8f9fa !important;
  transition: box-shadow 0.15s, border 0.15s, background 0.15s;
}

/* 晕眩高亮，紫色细边框 */
.stunned-highlight {
  box-shadow: 0 0 0 4px #6f42c1cc !important;
  border: 1.5px solid #6f42c1 !important;
  background: #f3e8ff !important;
  transition: box-shadow 0.15s, border 0.15s, background 0.15s;
}

/* 重伤高亮，橙色粗边框 */
.wounded-highlight {
  box-shadow: 0 0 0 4px #ffa500cc !important;
  border: 2.5px solid #ffa500 !important;
  background: #fff8e1 !important;
  transition: box-shadow 0.15s, border 0.15s, background 0.15s;
}

/* 移动高亮，绿色背景 */
.line-position.option-highlight,
#my-left.option-highlight,
#my-right.option-highlight,
#my-main.option-highlight,
.move-highlight {
  box-shadow: 0 0 0 4px #28a745cc !important;
  border: 2.5px solid #28a745 !important;
  background: #e6ffe6 !important;
  transition: box-shadow 0.15s, border 0.15s, background 0.15s;
}

.line-position.option-highlight {
  display: block;
}

/* 攻城高亮，黄色背景 */
.siege-highlight {
  box-shadow: 0 0 0 4px #ffc107cc !important;
  border: 2.5px solid #ffc107 !important;
  background: #fff8e1 !important;
  transition: box-shadow 0.15s, border 0.15s, background 0.15s;
}

/* 攻击高亮，红色背景 */
.attack-highlight,
#op-left.option-highlight,
#op-right.option-highlight,
#op-main.option-highlight {
  box-shadow: 0 0 0 4px #dc3545cc !important;
  border: 2.5px solid #dc3545 !important;
  background: #ffe6e6 !important;
  transition: box-shadow 0.15s, border 0.15s, background 0.15s;
}

/* 城池对手不可攻城，青色背景，不要改变边框 */
.city-cant-siege {
  background: #00f853 !important;
  color: #004517 !important;
}

/* 城池不可攻城，青色边框 */
.city-op-cant-siege {
  border: 2.5px solid #00f853 !important;
  box-shadow: none !important;
}

/* 城池被破，灰色背景 */
.city-destroyed {
  background: #f0f0f0 !important;
  border: 2.5px solid #ccc !important;
  box-shadow: none !important;
  color: #888 !important;
}

/* 选中高亮，绿色细边框 */
.chosen-highlight {
  box-shadow: 0 0 0 4px #28a745cc !important;
  border: 1.5px solid #28a745 !important;
  background: #e6ffe6 !important;
  transition: box-shadow 0.15s, border 0.15s, background 0.15s;
}

/* 激活高亮，蓝色背景 */
.activate-highlight,
#right-line.option-highlight,
#left-line.option-highlight {
  box-shadow: 0 0 0 4px #007bffcc !important;
  border: 2.5px solid #007bff !important;
  background: #e6f0ff !important;
  transition: box-shadow 0.15s, border 0.15s, background 0.15s;
}

#my-btn-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
}

#surrender-btn {
  border-radius: 6px;
  background: #f8f8ff;
  color: #333;
  border: 1.5px solid #bbb;
  max-width: fit-content;
}

/* 结束回合按钮计时显示样式 */
#end-turn-btn {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

#end-turn-btn[style*="background: #dc3545"] {
  animation: pulse-red 1s infinite;
}

#end-turn-btn[style*="background: #ffc107"] {
  animation: pulse-yellow 1s infinite;
}

#end-turn-btn[style*="background: #28a745"] {
  animation: pulse-green 1s infinite;
}

@keyframes pulse-red {

  0%,
  100% {
    box-shadow: 0 0 5px #dc3545;
  }

  50% {
    box-shadow: 0 0 20px #dc3545, 0 0 30px #dc3545;
  }
}

@keyframes pulse-yellow {

  0%,
  100% {
    box-shadow: 0 0 5px #ffc107;
  }

  50% {
    box-shadow: 0 0 20px #ffc107, 0 0 30px #ffc107;
  }
}

@keyframes pulse-green {

  0%,
  100% {
    box-shadow: 0 0 5px #28a745;
  }

  50% {
    box-shadow: 0 0 20px #28a745, 0 0 30px #28a745;
  }
}