/* =========================================================================
   バトル背景: MCHのバトル背景 ＋ ゆっくり流れるデザインされた帯（リボン）
   帯は UI より控えめ（半透明・小さめの文字）にして、UIの色を優先させる
   ========================================================================= */

.battle-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.battle-screen .battle-inner {
  z-index: 1;
}

/* MCHの背景はゆっくりパンさせる */
.bd-image {
  position: absolute;
  inset: -6%;
  background-size: cover;
  background-position: center;
  filter: saturate(0.9) brightness(0.62);
  animation: bd-pan 26s ease-in-out infinite alternate;
}

@keyframes bd-pan {
  from {
    transform: scale(1.04) translate(-1.5%, -1%);
  }
  to {
    transform: scale(1.1) translate(1.5%, 1%);
  }
}

/* 敵側（上）は赤、味方側（下）は水色に寄せ、網点を重ねる */
.bd-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle, rgba(0, 0, 0, 0.35) 1px, transparent 1.6px) 0 0 / 7px 7px,
    linear-gradient(180deg, rgba(60, 8, 22, 0.55), rgba(8, 10, 16, 0.2) 45%, rgba(6, 30, 44, 0.5)),
    radial-gradient(ellipse at 50% 52%, transparent 30%, rgba(0, 0, 0, 0.55) 100%);
}

/* ------------------------------------------------------------- 帯 */

.ribbon {
  position: absolute;
  left: -40%;
  width: 180%;
  display: flex;
  align-items: center;
  overflow: hidden;
  transform-origin: 50% 50%;
}

.ribbon-track {
  display: flex;
  width: max-content;
  animation: rb-scroll 50s linear infinite;
  will-change: transform;
}

@keyframes rb-scroll {
  to {
    transform: translateX(calc(-100% / 6));
  }
}

.rb-seg {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 14px;
  white-space: nowrap;
}

.rb-word {
  font-family: var(--font-num);
  font-weight: 700;
  letter-spacing: 0.14em;
}

.rb-word.jp {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.06em;
}

.rb-glyph {
  display: inline-flex;
  height: 1em;
}

.rb-glyph svg {
  height: 100%;
  width: auto;
}

/* タイトルのテープ: 黒地に黄色、上下に細い線 */
.rb-title {
  height: 26px;
  font-size: 13px;
  color: var(--accent);
  background: rgba(8, 9, 13, 0.82);
  box-shadow: inset 0 2px 0 rgba(255, 210, 63, 0.75), inset 0 -2px 0 rgba(255, 210, 63, 0.75);
  opacity: 0.85;
}

/* 注意テープ: 黄と黒の斜線が流れる */
.rb-caution {
  height: 14px;
  background: repeating-linear-gradient(-45deg, #ffd23f 0 10px, #111 10px 20px);
  background-size: 28.28px 100%;
  opacity: 0.38;
  animation: caution-move 2.4s linear infinite;
}

@keyframes caution-move {
  to {
    background-position: 28.28px 0;
  }
}

/* 敵陣の帯 */
.rb-enemy {
  height: 20px;
  font-size: 11px;
  color: #fff;
  background: linear-gradient(90deg, rgba(255, 79, 109, 0.72), rgba(196, 30, 70, 0.72));
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  opacity: 0.6;
}

/* 味方の帯 */
.rb-ally {
  height: 20px;
  font-size: 11px;
  color: #06222d;
  background: linear-gradient(90deg, rgba(57, 213, 255, 0.75), rgba(95, 227, 255, 0.6));
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  opacity: 0.55;
}

/* 細い番号のテープ: 白い線と数字 */
.rb-thin {
  height: 14px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.75);
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
  opacity: 0.6;
}

/* いちばん奥の大きな袋文字 */
.rb-giant {
  height: 120px;
  margin-top: -60px;
  font-size: 96px;
  color: transparent;
  opacity: 0.16;
}

.rb-giant .rb-word {
  -webkit-text-stroke: 2px #fff;
  letter-spacing: 0.04em;
}

.rb-giant .rb-glyph {
  color: #fff;
  height: 0.4em;
}

@media (prefers-reduced-motion: reduce) {
  .bd-image,
  .ribbon-track,
  .rb-caution {
    animation: none;
  }
}
