/* 战斗界面样式 — 重写，参考咸鱼之王5v5布局 */
.battle-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 6px;
  gap: 4px;
  background: linear-gradient(180deg, rgba(239,68,68,0.04) 0%, transparent 30%, transparent 70%, rgba(74,158,255,0.04) 100%);
}

.battle-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
}

.battle-top__round {
  font-size: var(--text-md);
  font-weight: bold;
  color: var(--color-primary-light);
}

/* 战斗区域 */
.battle-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  min-height: 0;
}

/* 敌方/我方阵容 */
.battle-team {
  display: flex;
  gap: 2px;
  justify-content: center;
  align-items: flex-end;
}

.battle-team--enemy {
  align-items: flex-start;
}

/* 单位 */
.b-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 56px;
  position: relative;
  transition: all var(--t-fast);
}

.b-unit--dead {
  opacity: 0.25;
  filter: grayscale(0.8);
}

.b-unit--dying {
  animation: bDeath 0.5s ease forwards;
}

@keyframes bDeath {
  to { opacity: 0; transform: scale(0.6) rotate(20deg); }
}

.b-unit--active {
  transform: translateY(-6px);
  filter: drop-shadow(0 0 8px var(--color-primary));
}

.b-unit__portrait {
  width: 48px;
  height: 56px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--quality-n);
  background: linear-gradient(180deg, var(--bg-panel-light), var(--bg-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.b-unit__portrait img {
  width: 100%; height: 100%; object-fit: cover;
}

.b-unit__name-big {
  font-size: 20px;
  font-weight: bold;
  color: var(--text-secondary);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.b-unit__name {
  font-size: 9px;
  text-align: center;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  color: var(--text-secondary);
}

.b-unit__bars {
  width: 100%;
  margin-top: 1px;
}

.b-unit__hp-text {
  font-size: 8px;
  text-align: center;
  color: var(--text-muted);
  line-height: 1.2;
}

.b-unit__buffs {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  justify-content: center;
  min-height: 12px;
  margin-top: 1px;
}

.buff-icon {
  font-size: 9px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* 怒气条 */
.b-unit__rage {
  height: 3px;
  background: rgba(0,0,0,0.4);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 1px;
}

.b-unit__rage-fill {
  height: 100%;
  background: linear-gradient(90deg, #f39c12, #e67e22);
  transition: width 0.3s;
}

/* 伤害飘字 */
.dmg-num {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  font-weight: bold;
  color: #ff5555;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8), 0 0 2px rgba(255,85,85,0.5);
  pointer-events: none;
  z-index: 10;
  animation: dmgFloat 0.8s ease forwards;
}

.dmg-num--crit {
  font-size: 22px;
  color: #ffdd00;
  text-shadow: 0 0 6px #ff4444, 0 1px 3px rgba(0,0,0,0.8);
}

.dmg-num--heal {
  color: #4cd964;
}

@keyframes dmgFloat {
  0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(0.5); }
  20% { transform: translateX(-50%) translateY(-10px) scale(1.2); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-40px) scale(1); }
}

/* 技能名标签 */
.b-skill-tag {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10px;
  font-weight: bold;
  color: var(--color-primary-light);
  background: rgba(0,0,0,0.7);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(232,169,48,0.3);
  animation: skillPop 1s ease forwards;
  z-index: 10;
}

@keyframes skillPop {
  0% { opacity: 0; transform: translateX(-50%) scale(0.5); }
  20% { opacity: 1; transform: translateX(-50%) scale(1.1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}

/* VS 分隔 */
.battle-vs {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 2px 0;
  position: relative;
}

.battle-vs::before,
.battle-vs::after {
  content: '';
  display: inline-block;
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  vertical-align: middle;
  margin: 0 6px;
}

/* 战斗日志 */
.battle-log {
  height: 90px;
  overflow-y: auto;
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 10px;
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.03);
}

.battle-log__line {
  padding: 1px 0;
  line-height: 1.3;
}

/* 战斗结果 */
.battle-result {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: var(--z-modal);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.4s;
}

.battle-result__title {
  font-size: 36px;
  font-weight: bold;
  text-shadow: 0 0 20px currentColor;
}

.battle-result__rewards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

/* 爬塔界面 */
.tower-screen {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tower-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tower-floor-display {
  font-size: var(--text-2xl);
  font-weight: bold;
  color: var(--color-primary-light);
}

/* 竞技场 */
.arena-screen {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.arena-opponent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background: var(--grad-card);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all var(--t-fast);
}

.arena-opponent:active {
  transform: scale(0.98);
}

/* 招募 */
.gacha-screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

/* 商店 */
.shop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--grad-card);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  border: 1px solid rgba(255,255,255,0.03);
}

/* 武将详情 */
.char-detail-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--grad-panel);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-top: 2px solid rgba(232,169,48,0.2);
  padding: 16px;
  max-height: 70vh;
  overflow-y: auto;
  z-index: var(--z-modal);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.char-detail__header {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.char-detail__portrait {
  width: 72px;
  height: 90px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--quality-n);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.char-detail__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  font-size: var(--text-sm);
}

.char-detail__skill {
  padding: 6px 8px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-size: var(--text-sm);
}

.char-detail__skill-name {
  color: var(--color-primary-light);
  font-weight: bold;
}

.char-detail__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* === 阵容槽位 === */
.team-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 72px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
}

.team-slot.empty {
  border: 2px dashed rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.2);
  gap: 2px;
}

.team-slot.filled {
  border: 2px solid var(--color-primary);
  background: rgba(232,169,48,0.08);
  gap: 2px;
}

.team-slot__char {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.team-slot__tag {
  font-size: 8px;
  color: var(--text-muted);
  margin-top: 2px;
}

.team-slot:active { transform: scale(0.92); }

/* === 武将列表卡片 === */
.team-char-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--grad-card);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all var(--t-fast);
}

.team-char-card.in-team {
  border-color: var(--color-primary);
  background: rgba(232,169,48,0.05);
}

.team-char-card__portrait {
  width: 40px;
  height: 46px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--quality-n);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.team-char-card__info {
  flex: 1;
  min-width: 0;
}

/* ===== 通用战斗界面：前 2 / 后 3 两排（F3） ===== */
.battle-field--formation {
  justify-content: center;
  gap: 2px;
}
.battle-side {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
}
.battle-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  min-height: 62px;
}
.battle-row__tag {
  width: 20px;
  flex-shrink: 0;
  font-size: 8px;
  color: var(--text-muted);
  text-align: right;
  padding-right: 2px;
  align-self: center;
}
.battle-row .b-unit {
  width: 46px;
}
.battle-row .b-unit__portrait {
  width: 40px;
  height: 46px;
}
.battle-row .b-unit__name {
  font-size: 9px;
  max-width: 46px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.battle-row .b-unit__bars {
  width: 40px;
}
.b-unit--ghost {
  width: 40px;
  height: 46px;
  opacity: 0;
}

/* ===== 竞技场两列阵型预览（F3） ===== */
.arena-form {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}
.arena-form__row {
  display: flex;
  align-items: center;
  gap: 3px;
}
.arena-form__tag {
  width: 26px;
  flex-shrink: 0;
  font-size: 9px;
  color: var(--text-muted);
}
.arena-form__unit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid;
  font-size: 10px;
  font-weight: bold;
  background: var(--bg-card);
}
.arena-form__empty {
  font-size: 9px;
  color: var(--text-muted);
}


