/* === v1.11 hotfix-24 · result-box 脱离 grid 流，避免回合结算挤压中央 row === */
.game-arena {
  position: relative;
}

body.tactical-v77.match-started .region-home {
  min-height: 245px;
}

body.tactical-v77.match-started #result-box {
  position: absolute;
  left: 50%;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  z-index: 260;
  width: min(480px, calc(100vw - 56px));
  min-width: min(320px, calc(100vw - 56px));
  max-width: 480px;
  margin: 0;
  pointer-events: auto;
}

body.tactical-v77.match-started.result-review #result-box {
  position: fixed;
  left: 50vw;
  top: 50vh;
  transform: translate(-50%, -50%);
  z-index: 260;
}

/* === 2026-07-13 · 结果弹窗背景遮罩 + 点击拦截 ===
   覆盖三种共用 result-review 状态的弹窗：每回合结果、终场、连接中断。
   纯 CSS 伪元素，不新增 DOM 节点；z-index 压在 #result-box(260) 之下、盖住球场和手牌区。 */
body.tactical-v77.match-started.result-review::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 259;
  background: rgba(4, 6, 10, .72);
  pointer-events: auto;
}

/* 遮罩的配套例外：设置入口（含"重新开始本次杯赛"）在任何模态下都不能被锁死，
   否则连接中断这类异常状态玩家会彻底卡死、无路可退。z-index 数值沿用
   timeline-dock.css:118-123 赛后弹窗那条同类例外，保持项目内一致。 */
body.tactical-v77.match-started.result-review #settings-toggle,
body.tactical-v77.match-started.result-review .settings-panel {
  z-index: 1002;
}

body.tactical-v77.match-started #result-box:empty {
  display: none;
}

/* === v1.11 hotfix-26 · result-box 戏剧化升级（mode='turn' compact-result）=== */
body.tactical-v77.match-started #result-box:has(.rb-dramatic) {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.tactical-v77.match-started #result-box .rb-dramatic {
  position: relative;
  width: min(420px, calc(100vw - 56px));
  margin: 0 auto;
  padding: 18px 28px 16px;
  border: 2px solid #f0d99b;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(20, 22, 28, .98), rgba(14, 16, 21, .98));
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .65);
  text-align: center;
  animation: rb-dramatic-in .3s ease-out both;
}

@keyframes rb-dramatic-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

body.tactical-v77.match-started #result-box .rb-dramatic.res-goal {
  border-color: #6bcf7f;
  box-shadow: 5px 5px 0 rgba(107, 207, 127, .18);
}

body.tactical-v77.match-started #result-box .rb-dramatic.res-concede {
  border-color: #c44a4a;
  box-shadow: 5px 5px 0 rgba(196, 74, 74, .18);
}

body.tactical-v77.match-started #result-box .rb-dramatic.res-warn {
  border-color: #f0d99b;
  box-shadow: 5px 5px 0 rgba(212, 160, 74, .18);
}

body.tactical-v77.match-started #result-box .rb-dramatic.res-ok {
  border-color: #6b8fcf;
  box-shadow: 5px 5px 0 rgba(107, 143, 207, .16);
}

body.tactical-v77.match-started #result-box .rb-dramatic.res-relief {
  border-color: #7ed79a;
  box-shadow: 5px 5px 0 rgba(126, 215, 154, .2);
}

body.tactical-v77.match-started #result-box .rb-dramatic.rb-final-whistle {
  width: min(500px, calc(100vw - 48px));
  padding: 22px 30px 20px;
  border-width: 3px;
  background:
    linear-gradient(180deg, rgba(35, 32, 24, .98), rgba(14, 16, 21, .98));
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .72), 0 0 0 rgba(240, 217, 155, .16);
}

body.tactical-v77.match-started #result-box .rb-time {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, .55);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

body.tactical-v77.match-started #result-box .rb-hero {
  display: block;
  margin-bottom: 4px;
  color: #d5d9e2;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
}

body.tactical-v77.match-started #result-box .rb-dramatic.res-goal .rb-hero { color: #6bcf7f; }
body.tactical-v77.match-started #result-box .rb-dramatic.res-concede .rb-hero { color: #c44a4a; }
body.tactical-v77.match-started #result-box .rb-dramatic.res-warn .rb-hero { color: #f0d99b; }
body.tactical-v77.match-started #result-box .rb-dramatic.res-ok .rb-hero { color: #8bb6ff; }
body.tactical-v77.match-started #result-box .rb-dramatic.res-relief .rb-hero { color: #7ed79a; }

body.tactical-v77.match-started #result-box .rb-relief-sub,
body.tactical-v77.match-started #result-box .rb-relief-counter {
  display: block;
  margin-top: 6px;
  color: rgba(235, 255, 241, .82);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

body.tactical-v77.match-started #result-box .rb-relief-counter {
  color: #29e7ff;
}

body.tactical-v77.match-started #result-box .rb-cause-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 10px auto 2px;
  color: rgba(220, 226, 237, .74);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

body.tactical-v77.match-started #result-box .rb-cause-chain i {
  color: rgba(255, 255, 255, .28);
  font-style: normal;
}

body.tactical-v77.match-started #result-box .rb-cause-chain b {
  color: #8bb6ff;
  font-weight: 900;
}

body.tactical-v77.match-started #result-box .rb-cause-chain.grade-high b,
body.tactical-v77.match-started #result-box .rb-cause-chain.grade-relief b {
  color: #7ed79a;
}

body.tactical-v77.match-started #result-box .rb-cause-chain.grade-mid b,
body.tactical-v77.match-started #result-box .rb-cause-chain.grade-warn b {
  color: #f0d99b;
}

body.tactical-v77.match-started #result-box .rb-cause-chain.grade-concede b {
  color: #c44a4a;
}

body.tactical-v77.match-started #result-box .rb-cause-chain.grade-goal b,
body.tactical-v77.match-started #result-box .rb-cause-chain.grade-counter b {
  color: #29e7ff;
}

body.tactical-v77.match-started #result-box .rb-score {
  display: block;
  margin: 8px 0 10px;
  color: #f0d99b;
  font-size: 36px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 6px;
  line-height: 1;
  animation: rb-score-pop .4s cubic-bezier(.2, 1.4, .35, 1) both;
}

body.tactical-v77.match-started #result-box .rb-goal-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px auto 8px;
  max-width: 370px;
}

body.tactical-v77.match-started #result-box .rb-goal-detail {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 0;
  background: rgba(255, 255, 255, .055);
  text-align: left;
}

body.tactical-v77.match-started #result-box .rb-goal-detail span {
  grid-row: span 2;
  color: rgba(255, 255, 255, .62);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 1.2px;
}

body.tactical-v77.match-started #result-box .rb-goal-detail b {
  color: rgba(238, 243, 250, .94);
  font-size: 13px;
  line-height: 1.35;
}

body.tactical-v77.match-started #result-box .rb-goal-detail em {
  color: #f0d99b;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

body.tactical-v77.match-started #result-box .rb-goal-detail.is-goal {
  border-color: rgba(107, 207, 127, .42);
  background: rgba(107, 207, 127, .085);
}

body.tactical-v77.match-started #result-box .rb-goal-detail.is-concede {
  border-color: rgba(196, 74, 74, .44);
  background: rgba(196, 74, 74, .095);
}

body.tactical-v77.match-started #result-box .rb-final-whistle .rb-score {
  margin: 10px 0 8px;
  font-size: 44px;
}

body.tactical-v77.match-started #result-box .rb-final-detail {
  display: block;
  color: rgba(232, 236, 243, .86);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

body.tactical-v77.match-started #result-box .rb-causal-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px auto 4px;
  max-width: 390px;
  text-align: left;
}

body.tactical-v77.match-started #result-box .rb-causal-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 0;
  background: rgba(255, 255, 255, .055);
}

body.tactical-v77.match-started #result-box .rb-causal-row span {
  color: rgba(255, 255, 255, .58);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .8px;
  line-height: 1.35;
}

body.tactical-v77.match-started #result-box .rb-causal-row b {
  min-width: 0;
  color: rgba(238, 243, 250, .92);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

body.tactical-v77.match-started #result-box .rb-causal-row.is-arbitration {
  border-color: rgba(41, 231, 255, .32);
  background: rgba(12, 66, 78, .18);
}

body.tactical-v77.match-started #result-box .rb-causal-row.is-exposure {
  border-color: rgba(240, 111, 111, .34);
  background: rgba(92, 26, 34, .20);
}

body.tactical-v77.match-started #result-box .rb-causal-row.is-time {
  border-color: rgba(240, 217, 155, .34);
  background: rgba(92, 72, 28, .18);
}

/* Batch A P0-002 修复 · compact-result 拆"主问题 / 我方攻势"两行归因。
   ISSUE-001 修复：补最小 CSS，让标签和正文之间分行 + 留白，避免"主问题主威胁..."粘连。 */
body.tactical-v77.match-started #result-box .rb-attribution {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px auto 8px;
  max-width: 360px;
  text-align: left;
}

body.tactical-v77.match-started #result-box .rb-attr-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 0;
  background: rgba(255, 255, 255, .04);
  font-size: 13px;
  line-height: 1.4;
}

body.tactical-v77.match-started #result-box .rb-attr-label {
  flex: 0 0 auto;
  min-width: 60px;
  color: rgba(255, 255, 255, .55);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

body.tactical-v77.match-started #result-box .rb-attr-text {
  flex: 1 1 auto;
  color: rgba(232, 236, 243, .88);
  font-weight: 600;
}

body.tactical-v77.match-started #result-box .rb-attr-line.tone-concede .rb-attr-text { color: #c44a4a; }
body.tactical-v77.match-started #result-box .rb-attr-line.tone-warn .rb-attr-text { color: #f0d99b; }
body.tactical-v77.match-started #result-box .rb-attr-line.tone-ok .rb-attr-text { color: #7ed79a; }
body.tactical-v77.match-started #result-box .rb-attr-line.tone-neutral .rb-attr-text { color: rgba(232, 236, 243, .7); }

@keyframes rb-score-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

body.tactical-v77.match-started #result-box .rb-dramatic .continue-btn,
body.tactical-v77.match-started #result-box .rb-dramatic #continue-turn {
  display: inline-block;
  width: auto;
  min-width: 112px;
  margin: 14px auto 0;
  padding: 8px 18px;
  border: 2px solid var(--gold-light, #f0d99b);
  border-radius: 0;
  color: #1a1a1a;
  background: linear-gradient(135deg, var(--gold-primary, #f0d99b), var(--gold-dim, #c9953a));
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  transition: filter .12s ease, box-shadow .12s ease;
  cursor: pointer;
}

body.tactical-v77.match-started #result-box .rb-dramatic .continue-btn:hover,
body.tactical-v77.match-started #result-box .rb-dramatic .continue-btn:focus-visible,
body.tactical-v77.match-started #result-box .rb-dramatic #continue-turn:hover,
body.tactical-v77.match-started #result-box .rb-dramatic #continue-turn:focus-visible {
  filter: brightness(1.06);
  text-shadow: none;
  box-shadow: var(--shadow-card, 3px 3px 0 rgba(0, 0, 0, .3));
}

.cpb-line.cpb-counter {
  color: #29e7ff;
}

.cpb-line.cpb-defense {
  color: #7ed79a;
}

.cpb-line.cpb-threat b {
  color: #e8ecf3;
  font-weight: 850;
}

.res-outcome.res-relief,
.log-e.relief {
  color: #7ed79a;
  border-color: rgba(126, 215, 154, .38);
  background: rgba(32, 96, 58, .2);
}

.v112-continuation-pill {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  padding: 3px 8px;
  border: 1px solid rgba(41, 231, 255, .32);
  border-radius: 0;
  color: #29e7ff;
  background: rgba(12, 66, 78, .26);
  font-size: 11px;
  font-weight: 800;
}

#end-turn-btn,
.continue-btn,
#continue-turn,
button.again,
.copy-log-btn,
#field-tuner-open,
.pile-viewer-close {
  border: 2px solid #f0d99b;
  border-radius: 0;
  font-family: inherit;
}

#end-turn-btn,
.continue-btn,
#continue-turn,
button.again,
body.tactical-v77.match-started #result-box .rb-dramatic .continue-btn,
body.tactical-v77.match-started #result-box .rb-dramatic #continue-turn {
  background: linear-gradient(135deg, var(--gold-primary, #f0d99b), var(--gold-dim, #c9953a));
  color: #1a1a1a;
  font-weight: 800;
}

button.again {
  transition: filter .12s ease, box-shadow .12s ease;
}

button.again:hover,
button.again:focus-visible {
  background: linear-gradient(135deg, var(--gold-primary, #f0d99b), var(--gold-dim, #c9953a));
  filter: brightness(1.06);
  box-shadow: var(--shadow-card, 3px 3px 0 rgba(0, 0, 0, .3));
}

#end-turn-btn.is-skip,
.copy-log-btn,
.pile-viewer-close {
  background: transparent;
  color: #f0d99b;
}

.modal-content {
  border: 1px solid rgba(240, 217, 155, .48);
  border-radius: 0;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .44);
}
