/* 局内 → 回合制 的过场(XX-COMBAT-001)
 *
 * 水墨晕染,不是黑屏 fade。
 * 思路:三块墨从画面外往中间涌 → 盖满 → 回合制立绘卷轴落下 → 墨退开。
 * 墨块用 radial-gradient 做出不规则边缘,避免"矩形色块"感。
 */
#tb-wash {
  position: absolute; inset: 0; z-index: 300; pointer-events: none;
  display: none; overflow: hidden;
}
#tb-wash.on { display: block; }
#tb-wash .tb-ink {
  position: absolute; width: 130%; height: 80%; left: -15%;
  top: 10%; opacity: 0;
  background:
    radial-gradient(60% 70% at 20% 40%, rgba(8,7,6,.98) 0 60%, transparent 72%),
    radial-gradient(55% 65% at 78% 55%, rgba(8,7,6,.98) 0 58%, transparent 70%),
    radial-gradient(70% 80% at 50% 85%, rgba(8,7,6,.99) 0 62%, transparent 74%);
  will-change: transform, opacity;
}
/* 覆盖层上的一行字 */
#tb-wash .tb-cap {
  position: absolute; left: 0; right: 0; top: 46%;
  text-align: center; color: var(--xx-paper, #ece5d3);
  font-size: 20px; letter-spacing: 8px; opacity: 0;
  text-shadow: 0 2px 10px rgba(0,0,0,.9); font-family: "Songti SC", serif;
  z-index: 2;
}

/* 进:墨从上下涌来盖满 */
#tb-wash.in .tb-ink:nth-child(1) { animation: tbIn .34s ease-in forwards; }
#tb-wash.in .tb-ink:nth-child(2) { animation: tbIn .40s ease-in .04s forwards; }
#tb-wash.in .tb-ink:nth-child(3) { animation: tbIn .46s ease-in .08s forwards; }
#tb-wash.in .tb-cap  { animation: tbCapIn .5s ease-out .30s forwards; }
@keyframes tbIn {
  from { opacity: 0; transform: translateY(-90%) scale(.6); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes tbCapIn { from { opacity: 0; } to { opacity: .92; } }

/* 出:墨往两侧退开 */
#tb-wash.out .tb-ink { animation: tbOut .40s ease-out forwards; }
#tb-wash.out .tb-ink:nth-child(2) { animation-delay: .05s; }
#tb-wash.out .tb-cap { animation: tbCapOut .3s ease-in forwards; }
@keyframes tbOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-90%) scale(.6); }
}
@keyframes tbCapOut { from { opacity: .92; } to { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  #tb-wash .tb-ink, #tb-wash .tb-cap { animation-duration: .01s !important; }
}