/* === 赛后四步（球场上）· 从 field-effect-mirror 移植 · 2026-07-01 === */
/* 清场：终场后比赛中的元素淡出，球场留作收战利品的舞台 */
body.postmatch-onpitch #end-turn-btn,
body.postmatch-onpitch #hand-tip,
body.postmatch-onpitch #settings-toggle,
body.postmatch-onpitch #resource-version-badge,
body.postmatch-onpitch .hud-corner.left-in,
body.postmatch-onpitch .hud-score,
body.postmatch-onpitch .hud-opponent,
body.postmatch-onpitch #opp-avatar,
body.postmatch-onpitch .route-breakout-readout,
body.postmatch-onpitch .danger-ledger-readout,
body.postmatch-onpitch #field-turn-badge,
body.postmatch-onpitch .field-narrative-host,
body.postmatch-onpitch .match-feedback,
body.postmatch-onpitch .combo-toast,
body.postmatch-onpitch .v77-hand-toast,
body.postmatch-onpitch .agg-toast,
body.postmatch-onpitch .region-home .region-tag,
body.postmatch-onpitch .field-shell .field-dyn {
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity .55s ease;
}
/* 手牌、抽弃牌栏、左上角分区数字：直接撤掉不占位（赛后不显示抽/弃，改用牌库入口） */
body.postmatch-onpitch #cards,
body.postmatch-onpitch #hand-bar,
body.postmatch-onpitch .field-zone-number-layer,
body.postmatch-onpitch #settings-toggle,
body.postmatch-onpitch #resource-version-badge,
body.postmatch-onpitch .match-feedback,
body.postmatch-onpitch .combo-toast,
body.postmatch-onpitch .v77-hand-toast,
body.postmatch-onpitch .agg-toast,
body.postmatch-onpitch .region-home .region-tag {
  display: none !important;
}
/* 球场草皮 / 线条留作舞台，只稍微压暗 */
body.postmatch-onpitch .field-lines {
  opacity: .7;
  transition: opacity .55s ease;
}

.pm-pitch-layer {
  position: absolute;
  inset: 0;
  z-index: 30;
  font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
}

/* 标题钉在卡上方固定间距：卡居中(top:50%) + 半高105px(210/2) + 30px 间隙 = 距底 50% + 135px。
   这样无论分辨率/球场高度怎么变，标题离卡都恒定，不再随高度漂移。 */
.pm-pitch-banner {
  position: absolute;
  bottom: calc(50% + 135px);
  top: auto;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 32;
  animation: pm-fade-in .5s ease both;
}
.pm-pitch-kicker {
  display: block;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(184, 190, 201, .72);
}
.pm-pitch-title {
  display: block;
  margin-top: 2px;
  font-size: 18px;
  font-weight: 800;
  color: #f0cb7e;
}
.pm-pitch-desc {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: #ccc;
}

.pm-pitch-card {
  position: absolute;
  width: 150px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  z-index: 31;
  opacity: 0;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform .18s cubic-bezier(.2, .8, .25, 1), filter .18s ease;
  animation: pm-fade-in .5s ease both;
  animation-delay: calc(var(--pm-i, 0) * 120ms + .35s);
}
@keyframes pm-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 卡牌用游戏大卡尺寸 150×210（钉死，避免球场坐标系把它压扁），点击放大 15% */
.pm-pitch-card .card {
  width: 150px !important;
  height: 210px !important;
  min-width: 150px !important;
  max-width: 150px !important;
  min-height: 210px !important;
  max-height: 210px !important;
  flex: 0 0 150px !important;
  padding: 9px !important;   /* 对齐游戏手牌内边距，否则美术被挤小 */
  margin: 0 !important;
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2, .8, .25, 1), box-shadow .18s ease;
}
/* 顶部那条金条来自底层 ::before；游戏手牌作用域把它压成透明，球场卡吃不到，这里补上对齐 */
.pm-pitch-card .card::before {
  background: transparent !important;
  inset: -8px !important;
  border: 0 !important;
}

/* hover：照搬游戏卡牌的金色光晕 + 提亮 + 呼吸 */
.pm-pitch-card .card:hover {
  border-color: rgba(240, 197, 116, .95) !important;
  filter: brightness(1.2);
  animation: pm-hover-breathe 1.85s ease-in-out infinite;
}
@keyframes pm-hover-breathe {
  0%, 100% { box-shadow: 5px 5px 0 rgba(0, 0, 0, .8), 0 0 30px rgba(240, 197, 116, .44); }
  50% { box-shadow: 5px 5px 0 rgba(0, 0, 0, .8), 0 0 52px rgba(240, 197, 116, .62); }
}
/* 选中：整张卡放大 15%（缩外层，避开游戏卡自身的 transform） */
.pm-pitch-card.picked {
  z-index: 33;
  transform: translate(-50%, -50%) scale(1.15);
}
.pm-pitch-card.picked .card {
  border-color: rgba(240, 197, 116, .98) !important;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .55), 0 0 26px rgba(240, 197, 116, .5) !important;
}
/* 未选中：不调透明度（避免透出草皮），只压暗 */
.pm-pitch-card.locked { filter: brightness(.5); }

/* 恢复态兜底：suppressRestoredEntrance 关闭了入场动画（.pm-fade-in），
   但候选卡基础态 opacity:0 是静态声明、不随动画关闭复原，会永久透明。
   只在恢复态生效，不碰正常入场路径。 */
.pm-restored-state .pm-pitch-card {
  opacity: 1;
}

/* 加牌：默认每张卡缓缓发光；选中后底部按钮也发光（与升/特质一致） */
.pm-add-card .card { animation: pm-up-glow 2.2s ease-in-out infinite; }
.pm-add-card.locked .card { animation: none; filter: none; }
.pm-pitch-skip.pm-add-action.confirm { animation: pm-up-btn-glow 1.8s ease-in-out infinite; }

/* 底部按钮：移到球场下方居中，对齐设计系统 */
/* 默认「不加牌」= btn-ghost */
.pm-pitch-skip {
  display: block;
  min-width: 230px;        /* 两个状态同宽，切换不跳动 */
  margin: 40px auto 6px;
  font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: #ccc;
  background: transparent;
  border: 2px solid #555;
  border-radius: 0;
  padding: 8px 18px;
  cursor: pointer;
  transition: filter .14s ease, box-shadow .14s ease, background .14s ease, color .14s ease, border-color .14s ease;
}
.pm-pitch-skip:hover {
  border-color: #6a6a6a;
  color: #fff;
}
/* 选中卡后「确认，加牌」= btn-primary */
.pm-pitch-skip.confirm {
  background: linear-gradient(135deg, #e5b567, #c9953a);
  border-color: #f0cb7e;
  color: #1a1a1a;
}
.pm-pitch-skip.confirm:hover {
  filter: brightness(1.06);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .5);
}

/* 牌库入口：钉在球场右上角（赛后对手已不在，这块空出来），贴球场右缘不飘进黑边 */
body.tactical-v77.match-started.field-effect-mirror-page .game-arena { position: relative; }
.pm-deck-entry {
  position: absolute;
  top: 8px;
  right: 30px;   /* 与我队"TEAM_A"离球场左缘 30px 对称 */
  z-index: 40;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  padding: 0 14px;
  font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
  color: #f0d99b;
  background: linear-gradient(135deg, #3a2a1a, #1a0a00);
  border: 2px solid #6b4a2a;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .5);
  cursor: pointer;
}
.pm-deck-entry:hover { border-color: #f0d99b; color: #fff0c2; }
.pm-deck-entry-label { font-size: 15px; font-weight: 700; }
.pm-deck-entry-count { font-size: 14px; font-weight: 700; color: #cbb27a; }

/* 确认加牌：选中的飞向牌库 + 其余消失 + 牌库脉冲（手感对齐游戏抽牌） */
.pm-fly-card {
  position: fixed;
  z-index: 5000;
  pointer-events: none;
  transform: translate(0, 0) scale(1);
  transition: transform .46s cubic-bezier(.4, 0, .2, 1), opacity .46s ease;
}
.pm-fly-card .card {
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 9px !important;
  margin: 0 !important;
}
.pm-fly-card .card::before { background: transparent !important; inset: -8px !important; border: 0 !important; }

.pm-card-gone {
  transition: opacity .28s ease, transform .28s ease !important;
  opacity: 0 !important;
  transform: translate(-50%, -50%) scale(.86) !important;
  pointer-events: none;
}
.pm-fade-out {
  transition: opacity .28s ease !important;
  opacity: 0 !important;
  pointer-events: none;
}
body.postmatch-transition-out .pm-pitch-layer,
body.postmatch-transition-out .pm-pitch-skip,
body.postmatch-transition-out .pm-deck-entry {
  transition: opacity .4s ease !important;
  opacity: 0 !important;
  pointer-events: none;
}

.pm-deck-entry.pm-deck-pop {
  animation: pm-deck-pop .42s cubic-bezier(.22, 1, .36, 1);
}
@keyframes pm-deck-pop {
  0% { transform: scale(1); }
  35% {
    transform: scale(1.18);
    border-color: #f0d99b;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, .5), 0 0 26px rgba(212, 160, 74, .55);
  }
  100% { transform: scale(1); }
}

/* === 升牌：从牌库冒出来、卡下方写前→后、确认"练成"飞回牌库 === */
/* 进场用 JS 内联过渡驱动（从牌库冒出），关掉基础 fade-in 动画 */
.pm-up-card { animation: none; opacity: 1; }

/* 升级前→后：绝对定位挂卡下方空地，紧凑单行「威胁 -10 → 威胁 -13」，无文字框 */
.pm-up-diff {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
  font-size: 15px;
  font-weight: 700;
}
.pm-up-diff-row {
  display: grid;
  grid-template-columns: max-content auto max-content;
  align-items: center;
  gap: 7px;
}
.pm-up-before { color: #8a8a8a; }
.pm-up-arrow { color: #8a8a8a; font-size: 12px; line-height: 1.1; }
.pm-up-after { color: #f0cb7e; transition: transform .25s ease, color .25s ease; }
.pm-up-after.is-up { color: #7ed79a; transform: scale(1.1); }

/* 默认：每张可升级的卡缓缓发光（待练）；选中后只有选中的卡发光，其余停（已被压暗） */
@keyframes pm-up-glow {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(240, 197, 116, .35)); }
  50% { filter: drop-shadow(0 0 13px rgba(240, 197, 116, .7)); }
}
.pm-up-card .card { animation: pm-up-glow 2.2s ease-in-out infinite; }
.pm-up-card.locked .card { animation: none; filter: none; }

/* 选中后「确认，升级」按钮也一起缓缓发光（只挂升牌的按钮，不动加牌） */
@keyframes pm-up-btn-glow {
  0%, 100% { box-shadow: 3px 3px 0 rgba(0, 0, 0, .5), 0 0 10px rgba(240, 197, 116, .4); }
  50% { box-shadow: 3px 3px 0 rgba(0, 0, 0, .5), 0 0 22px rgba(240, 197, 116, .75); }
}
.pm-pitch-skip.pm-up-action.confirm { animation: pm-up-btn-glow 1.8s ease-in-out infinite; }

/* 升级完成后，旧值划掉（告诉玩家已升级） */
.pm-up-before.struck { text-decoration: line-through; }

/* 「升级中…」：进度条从空填到满（1.2s），斜纹流动，文字在上层 */
.pm-pitch-skip.pm-up-loading {
  position: relative;
  overflow: hidden;
  color: #1a1a1a;
  background: #3a2c12;          /* 空槽 */
  border-color: #f0cb7e;
  cursor: default;
  animation: none;
}
.pm-pitch-skip.pm-up-loading::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  z-index: 0;
  background-color: #c9953a;
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .25) 0 10px, transparent 10px 20px);
  background-size: 28.3px 100%;
  animation: pm-up-fill 1.6s linear forwards, pm-stripe-flow .5s linear infinite;
}
.pm-btn-label { position: relative; z-index: 1; }
@keyframes pm-up-fill {
  from { width: 0; }
  to { width: 100%; }
}
@keyframes pm-stripe-flow {
  to { background-position: 28.3px 0; }
}

/* 「升级完成！」：绿色成功态，发光提示点击 */
.pm-pitch-skip.pm-up-done {
  color: #14331c;
  background: linear-gradient(135deg, #7ed79a, #4caf50);
  border-color: #9be8b0;
  animation: pm-up-btn-glow 1.6s ease-in-out infinite;
}

/* 撕牌：确认键红色（破坏性动作） */
.pm-pitch-skip.pm-rm-action.confirm {
  color: #fff;
  background: linear-gradient(135deg, #e08a6a, #c0492c);
  border-color: #f0a585;
  animation: none;
}
/* 整副平铺重叠：位移/抬起由 JS 控（--rm-shift 邻牌让位、--rm-lift 抬起），入场逐张飞出 */
.pm-rm-card {
  animation: none;
  opacity: 1;
  transform-origin: center bottom;
  transform: translate(calc(-50% + var(--rm-shift, 0px)), calc(-50% + var(--rm-lift, 0px) + var(--rm-arc, 0px))) rotate(var(--rm-rot, 0deg));
}

/* 撕：抖一下 */
.pm-rm-card.pm-rm-tearing .card { animation: pm-tear-shake .46s ease; }

/* === 特质：3 选 1 徽记（复用游戏 .reward-trait-clean 样式），选中飞到顶部特质栏 === */
/* 固定宽高 + 背景半透明（草坪上好看）+ 默认缓缓发光 */
.pm-trait-card .reward-trait-clean {
  width: 210px !important;
  height: 272px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  margin: 0;
  cursor: pointer;
  overflow: hidden;
  background: #1a1c22 !important;          /* 实色，透明度 1 */
  border-color: #e5b567 !important;        /* 实心干净金，不发暗成巧克力色 */
  animation: pm-trait-glow 2.4s ease-in-out infinite;
}
/* 特质专用呼吸光：收敛一点、别在场上糊成一团 */
@keyframes pm-trait-glow {
  0%, 100% { box-shadow: 3px 3px 0 rgba(0, 0, 0, .5), 0 0 8px rgba(229, 181, 103, .3); }
  50% { box-shadow: 3px 3px 0 rgba(0, 0, 0, .5), 0 0 16px rgba(229, 181, 103, .5); }
}
/* 飞到特质栏后留下的常驻徽章：弹入 */
.pm-rail-newchip { animation: pm-chip-in .36s cubic-bezier(.2, .9, .3, 1.4) both; }
@keyframes pm-chip-in {
  0% { transform: scale(.2); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.pm-trait-card.locked .reward-trait-clean { animation: none; filter: none; }
.pm-trait-card.picked { z-index: 33; transform: translate(-50%, -50%) scale(1.06); }
.pm-trait-card.picked .reward-trait-clean {
  border-color: #f0cb7e;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .55), 0 0 24px rgba(240, 197, 116, .5);
}
/* 选中后「确认，加特质」按钮也发光 */
.pm-pitch-skip.pm-trait-action.confirm { animation: pm-up-btn-glow 1.8s ease-in-out infinite; }
.pm-trait-flyer {
  position: fixed;
  z-index: 5000;
  pointer-events: none;
  transform: translate(0, 0) scale(1);
  transition: transform .46s cubic-bezier(.4, 0, .2, 1), opacity .46s ease;
}
.pm-rail-pop { animation: pm-deck-pop .42s cubic-bezier(.22, 1, .36, 1); }
@keyframes pm-tear-shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-5px) rotate(-2deg); }
  40% { transform: translateX(5px) rotate(2deg); }
  60% { transform: translateX(-4px) rotate(-1.5deg); }
  80% { transform: translateX(3px) rotate(1deg); }
}

/* 确认升级：选中的卡"练成"闪一下 */
.pm-up-card.pm-up-trained .card { animation: pm-trained-flash .5s ease; }
@keyframes pm-trained-flash {
  0% { box-shadow: 3px 3px 0 rgba(0, 0, 0, .5); filter: brightness(1); }
  40% {
    box-shadow: 3px 3px 0 rgba(0, 0, 0, .5), 0 0 30px 6px rgba(126, 215, 154, .7);
    filter: brightness(1.3);
  }
  100% { box-shadow: 3px 3px 0 rgba(0, 0, 0, .5); filter: brightness(1); }
}
/* 牌库弹窗本体直接复用游戏 .pile-viewer 那套样式（result-box.css + pile-postmatch.css），不再自定义 */
