/* ============================================================
   BATTLE v2 — アリーナと RPG の対戦の上書き（2026-10-11 Rii2発注）
   where: tmas-app/arena.html（#screen-battle.bfx）と rpg.html の対戦（.rpg-duel.bfx）。演出の動きは battle-fx.js と共通
   what:  ① スマホは「上=相手・下=自分」の対角構図＋親指の届く下段にコマンドを固定し、スクロールせずに
            両者のHPと手札が見えるようにする
          ② 爽快感の演出: 読み合いの激突(READ!)・踏み込み・ヒットストップ・大ダメージの数字・
            HPの残像バー・必殺技のカットイン・ガードの波紋・MISS・K.O. の判
   why:   旧画面は大きなカードを縦に2枚積み、コマンドが画面外（毎ターンスクロールが要った）。
   ⚠ arena-battle.css（共有の土台）は触らない。v2 の規則は .bfx 配下に閉じ、配置はアリーナ=#screen-battle・RPG=.rpg-duel.bfx の各ブロック。
   ⚠ 動きを減らす設定では揺れ・踏み込み・カットインの移動を止める（下の reduced-motion）。
   ============================================================ */

/* ── 共通: コマンドの見た目 ───────────────────────────────── */
.bfx .cmd{overflow:hidden;-webkit-tap-highlight-color:transparent;touch-action:manipulation;}
.bfx .cmd__t{display:flex;flex-direction:column;align-items:center;gap:2px;}
.bfx .cmd__l{display:block;font-size:.72rem;font-weight:800;letter-spacing:.06em;color:var(--c,var(--text));}
.bfx .cmd:not(:disabled){background:linear-gradient(180deg,color-mix(in srgb,var(--c,#c9a84c) 16%,var(--bg2)),var(--bg2));border-color:color-mix(in srgb,var(--c,#c9a84c) 55%,var(--border));}
.bfx .cmd:active:not(:disabled){transform:scale(.94);filter:brightness(1.25);}
.bfx .cmd.is-picked{opacity:1;border-color:var(--c,var(--gold));box-shadow:0 0 0 1px var(--c,var(--gold)),0 0 22px var(--c,var(--gold));animation:cmdPicked .5s ease-out;}
.bfx .cmd.is-picked .cmd__t,.bfx .cmd.is-picked .cmd__l{color:#fff;}
@keyframes cmdPicked{0%{transform:scale(.92);}55%{transform:scale(1.05);}100%{transform:scale(1);}}
.bfx .cmd--skill:not(:disabled){--c:#c060e0;}

/* ── HP の残像バー ───────────────────────────────────────── */
.bfx .hpbar{height:16px;}
.bfx .hpbar__ghost{position:absolute;inset:0 auto 0 0;width:100%;border-radius:var(--radius-pill);
  background:linear-gradient(90deg,#fff3c4,#ffd36a);opacity:.85;transition:width .55s cubic-bezier(.3,.7,.3,1) .28s;}
.bfx .hpbar__fill{position:relative;z-index:1;}
.bfx .hpbar__txt{z-index:2;}

/* ── 踏み込み・被弾・ガード・回避・ダウン ─────────────────── */
.bfx .fighter{--lx:34px;--ly:0px;}
.bfx .fighter.fighter--enemy{--lx:-34px;--ly:0px;}
.bfx .fighter{will-change:transform;}
.bfx .fighter.is-lunge{animation:lunge .3s cubic-bezier(.3,1.6,.5,1);z-index:4;}
@keyframes lunge{0%{transform:none;}40%{transform:translate(var(--lx),var(--ly)) scale(1.07);}100%{transform:none;}}
.bfx .fighter.is-hit{animation:hitShake .34s cubic-bezier(.36,.07,.19,.97);}
@keyframes hitShake{0%,100%{transform:none;}15%{transform:translate(-7px,2px) rotate(-2deg);}35%{transform:translate(6px,-2px) rotate(1.5deg);}55%{transform:translate(-4px,1px);}75%{transform:translate(3px,0);}}
.bfx .fighter::after{content:'';position:absolute;inset:0;z-index:2;border-radius:inherit;pointer-events:none;opacity:0;
  background:radial-gradient(circle at 50% 45%,rgba(255,255,255,.85),rgba(255,60,60,.35) 55%,transparent 75%);}
.bfx .fighter.flash-hit::after{animation:cardBurst .32s ease-out;}
@keyframes cardBurst{0%{opacity:1;}100%{opacity:0;}}
.bfx .fighter.is-guard::before{content:'';position:absolute;inset:-4px;z-index:3;border-radius:inherit;pointer-events:none;
  border:2px solid #7fb2ff;box-shadow:0 0 18px #5b8bd0,inset 0 0 18px #5b8bd088;animation:guardRing .5s ease-out forwards;}
@keyframes guardRing{0%{opacity:1;transform:scale(.92);}100%{opacity:0;transform:scale(1.08);}}
.bfx .fighter.is-evade{animation:evade .42s ease-out;}
@keyframes evade{0%{transform:none;opacity:1;}30%{transform:translateX(calc(var(--lx) * -.5));opacity:.35;}100%{transform:none;opacity:1;}}
.bfx .fighter.is-down{filter:grayscale(1) brightness(.55);transform:translateY(8px) rotate(-3deg);transition:filter .5s,transform .5s cubic-bezier(.5,0,.75,0);}

/* ダメージの数字: 通常＝赤、大ダメージ＝金で大きく。 */
.bfx .dmg-float{z-index:6;font-size:1.9rem;-webkit-text-stroke:1px rgba(0,0,0,.6);}
.bfx .dmg-float.is-big{font-size:2.8rem;color:#ffd23f;text-shadow:0 0 14px rgba(255,120,40,.9),0 3px 0 #7a1010;}
.bfx .dmg-float.miss{font-size:1.2rem;color:#d7e3ff;letter-spacing:.12em;}
.bfx .hit-tag{position:absolute;left:50%;top:14%;z-index:6;transform:translateX(-50%) rotate(-8deg);pointer-events:none;
  padding:2px 10px;font:900 .8rem/1.4 'Cinzel',serif;letter-spacing:.12em;color:#1a1206;background:linear-gradient(90deg,#ffe28a,#ffb43c);
  box-shadow:0 0 16px rgba(255,180,60,.8);animation:hitTag .9s cubic-bezier(.2,1.4,.4,1) forwards;}
@keyframes hitTag{0%{opacity:0;transform:translateX(-50%) rotate(-8deg) scale(2);}20%{opacity:1;transform:translateX(-50%) rotate(-8deg) scale(1);}80%{opacity:1;}100%{opacity:0;transform:translateX(-50%) rotate(-8deg) translateY(-8px);}}
#hit-flash.is-big{background:radial-gradient(ellipse at 50% 45%,rgba(255,255,255,.85),rgba(255,210,120,.25) 45%,transparent 75%);}

/* ヒットストップ: 盤面ごと一瞬ふくらんで止まる */
.bfx .field.hitstop{animation:hitstop .14s steps(2,end);}
.bfx .field.hitstop-big{animation:hitstopBig .26s cubic-bezier(.2,1.6,.4,1);}
@keyframes hitstop{0%{transform:scale(1.012);}100%{transform:none;}}
@keyframes hitstopBig{0%{transform:scale(1.035);filter:contrast(1.25) saturate(1.3);}100%{transform:none;filter:none;}}

/* ── 読み合いの激突（中央） ─────────────────────────────── */
.bfx .field{position:relative;}
.bfx .clash{position:absolute;left:50%;top:50%;width:0;height:0;pointer-events:none;z-index:7;}
.bfx .clash__chip{position:absolute;left:-26px;top:-26px;width:52px;height:52px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  background:rgba(8,9,17,.92);border:2px solid var(--c,var(--gold));color:var(--c,var(--gold));box-shadow:0 0 18px var(--c,var(--gold));opacity:0;}
.bfx .clash__chip .tico{width:26px;height:26px;}
.bfx .clash__spark{position:absolute;left:-60px;top:-60px;width:120px;height:120px;border-radius:50%;opacity:0;
  background:radial-gradient(circle,#fff 0,#ffe7a0 18%,rgba(255,170,60,.55) 40%,transparent 68%);}
.bfx .clash__verdict{position:absolute;left:0;top:34px;transform:translateX(-50%);white-space:nowrap;opacity:0;
  font:900 1.5rem/1 'Cinzel',serif;letter-spacing:.1em;color:#fff;text-shadow:0 0 12px rgba(0,0,0,.9),0 2px 0 #000;}
.bfx .clash.is-win .clash__verdict{color:#ffd23f;text-shadow:0 0 16px rgba(255,190,60,.9),0 2px 0 #3a2400;}
.bfx .clash.is-lose .clash__verdict{color:#ff6b6b;}
.bfx .clash.go .clash__chip--p{animation:chipInP .62s cubic-bezier(.2,.9,.3,1) forwards;}
.bfx .clash.go .clash__chip--e{animation:chipInE .62s cubic-bezier(.2,.9,.3,1) forwards;}
.bfx .clash.go .clash__spark{animation:spark .62s ease-out forwards;}
.bfx .clash.go .clash__verdict{animation:verdict .62s cubic-bezier(.2,1.5,.4,1) forwards;}
@keyframes chipInP{0%{opacity:0;transform:translate(-120px,0) scale(.6);}35%{opacity:1;transform:translate(-22px,0) scale(1.05);}55%{transform:translate(-30px,0) scale(1);}85%{opacity:1;}100%{opacity:0;transform:translate(-34px,0);}}
@keyframes chipInE{0%{opacity:0;transform:translate(120px,0) scale(.6);}35%{opacity:1;transform:translate(22px,0) scale(1.05);}55%{transform:translate(30px,0) scale(1);}85%{opacity:1;}100%{opacity:0;transform:translate(34px,0);}}
@keyframes spark{0%,30%{opacity:0;transform:scale(.3);}40%{opacity:1;transform:scale(1);}100%{opacity:0;transform:scale(1.6);}}
@keyframes verdict{0%,35%{opacity:0;transform:translateX(-50%) scale(2.2);}50%{opacity:1;transform:translateX(-50%) scale(1);}88%{opacity:1;}100%{opacity:0;transform:translateX(-50%) translateY(-6px);}}
.bfx .field__vs-t{display:inline-block;}

/* ── 必殺技のカットイン ─────────────────────────────────── */
.bfx .cutin{position:fixed;inset:0;z-index:60;pointer-events:none;display:flex;align-items:center;}
.bfx .cutin[hidden]{display:none;}
.bfx .cutin::before{content:'';position:absolute;inset:0;background:rgba(4,4,10,.55);opacity:0;}
.bfx .cutin.go::before{animation:cutDim .76s ease forwards;}
.bfx .cutin__band{position:relative;width:100%;height:118px;display:flex;align-items:center;gap:14px;padding:0 6vw;overflow:hidden;
  transform:skewY(-6deg);background:linear-gradient(90deg,#14060f 0,#5b1640 40%,#b06bd6 100%);
  border-block:3px solid #ffd36a;box-shadow:0 0 40px rgba(176,107,214,.7);}
.bfx .cutin--enemy .cutin__band{flex-direction:row-reverse;text-align:right;background:linear-gradient(270deg,#160606 0,#6a1717 40%,#e0603c 100%);box-shadow:0 0 40px rgba(224,96,60,.7);}
.bfx .cutin__img{width:118px;height:118px;flex:none;object-fit:cover;transform:skewY(6deg) scale(1.15);filter:drop-shadow(0 0 10px #000);}
.bfx .cutin__txt{transform:skewY(6deg);min-width:0;}
.bfx .cutin__who{display:block;font:700 .66rem/1.4 'JetBrains Mono',monospace;letter-spacing:.18em;color:#ffe9a8;}
.bfx .cutin__name{display:block;font:900 clamp(1.4rem,6.4vw,2.4rem)/1.2 'Noto Serif JP',serif;color:#fff;letter-spacing:.06em;
  text-shadow:0 3px 0 #000,0 0 18px rgba(255,210,120,.8);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;}
.bfx .cutin.go .cutin__band{animation:cutBand .76s cubic-bezier(.2,.9,.25,1) forwards;}
.bfx .cutin--enemy.go .cutin__band{animation-name:cutBandR;}
@keyframes cutDim{0%{opacity:0;}20%,80%{opacity:1;}100%{opacity:0;}}
@keyframes cutBand{0%{transform:skewY(-6deg) translateX(-110%);}22%{transform:skewY(-6deg) translateX(0);}78%{transform:skewY(-6deg) translateX(2%);}100%{transform:skewY(-6deg) translateX(110%);}}
@keyframes cutBandR{0%{transform:skewY(-6deg) translateX(110%);}22%{transform:skewY(-6deg) translateX(0);}78%{transform:skewY(-6deg) translateX(-2%);}100%{transform:skewY(-6deg) translateX(-110%);}}

/* ── K.O. の判 ─────────────────────────────────────────── */
.bfx .ko-stamp{position:fixed;left:50%;top:42%;z-index:61;pointer-events:none;transform:translate(-50%,-50%);white-space:nowrap;
  font:900 clamp(3.2rem,18vw,6rem)/1 'Cinzel',serif;letter-spacing:.06em;color:#fff;text-shadow:0 6px 0 #000,0 0 30px rgba(255,255,255,.6);}
.bfx .ko-stamp[hidden]{display:none;}
.bfx .ko-stamp.is-win{background:linear-gradient(135deg,#fff6c8,#ffd23f 45%,#ff8a1f);-webkit-background-clip:text;-webkit-text-fill-color:transparent;filter:drop-shadow(0 0 22px rgba(255,190,60,.8)) drop-shadow(0 5px 0 #000);text-shadow:none;}
.bfx .ko-stamp.is-lose{color:#ff5252;text-shadow:0 6px 0 #000,0 0 28px rgba(255,60,60,.7);}
.bfx .ko-stamp.go{animation:koStamp 1.15s cubic-bezier(.2,1.4,.4,1) forwards;}
@keyframes koStamp{0%{opacity:0;transform:translate(-50%,-50%) scale(3) rotate(-10deg);}18%{opacity:1;transform:translate(-50%,-50%) scale(.92) rotate(-4deg);}26%{transform:translate(-50%,-50%) scale(1.04) rotate(-4deg);}32%{transform:translate(-50%,-50%) scale(1) rotate(-4deg);}85%{opacity:1;}100%{opacity:0;transform:translate(-50%,-50%) scale(1.06) rotate(-4deg);}}
.bfx.is-finish .field{filter:contrast(1.15);}

/* ── ログ: 2行の帯。押すと広がる ──────────────────────────── */
.bfx .log{cursor:pointer;transition:max-height .25s ease;}
.bfx .log::after{content:'';}

/* ── スマホ: 対角構図＋親指の届く下段 ───────────────────── */
@media(max-width:640px){
  body.in-battle #screen-battle .arena{display:flex;flex-direction:column;min-height:calc(100dvh - 64px);padding:10px 10px 0;border-radius:14px;}
  #screen-battle .battle-turn{margin-bottom:6px;}
  #screen-battle .field{display:flex;flex-direction:column;gap:10px;flex:1;justify-content:center;}
  #screen-battle .field > .fighter-slot{flex-direction:row;align-items:center;gap:10px;}
  #screen-battle .field > .fighter-slot:first-child{order:3;}                      /* 自分=下・左にカード */
  #screen-battle .field > .fighter-slot:last-child{order:1;flex-direction:row-reverse;}   /* 相手=上・右にカード */
  #screen-battle .field__vs{order:2;display:block;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) rotate(-6deg);
    font-size:1.1rem;opacity:.9;z-index:5;}
  #screen-battle .field > .fighter-slot .fighter{flex:none;width:min(42vw,176px);aspect-ratio:1/1;min-height:0;}
  #screen-battle .fighter__info{flex:1;padding:0;}
  #screen-battle .field > .fighter-slot:last-child .fighter__info{text-align:right;}
  #screen-battle .field > .fighter-slot:last-child .fighter__title{justify-content:flex-end;}
  #screen-battle .fighter__name{font-size:.98rem;}
  #screen-battle .fighter__skill{display:none;}      /* 技名は下のスキルボタンに出ている */
  #screen-battle .fighter__body{padding:8px;}
  #screen-battle .fighter__role{top:6px;left:6px;}
  /* 対角構図に合わせて踏み込みも斜めに */
  #screen-battle .fighter{--lx:18px;--ly:-26px;}
  #screen-battle .fighter.fighter--enemy{--lx:-18px;--ly:26px;}
  /* 親指の届く下段に固定。HPと手札が同時に見える */
  #screen-battle .cmd-panel{position:sticky;bottom:0;z-index:8;margin:10px -10px 0;padding:10px 10px calc(10px + env(safe-area-inset-bottom));
    background:linear-gradient(180deg,rgba(10,10,18,0),rgba(10,10,18,.92) 18%,#0b0b13);gap:8px;}
  #screen-battle .cmd-row--main .cmd{min-height:66px;padding:8px 4px;}
  #screen-battle .cmd-row--skill .cmd{min-height:50px;padding:7px 6px;}
  #screen-battle .cmd__d{display:none;}               /* 説明は読み合いの帯と長押しの説明に任せ、押す面を大きく */
  #screen-battle .cmd__ico{width:1.9rem;height:1.9rem;}
  #screen-battle .cmd--skill .cmd__t{font-size:.8rem;}
  #screen-battle .rps-hint{margin:6px 0 0;font-size:.58rem;}
  #screen-battle .log{order:9;margin:6px 0 8px;max-height:46px;padding:6px 10px;font-size:.68rem;}
  #screen-battle .log.is-open{max-height:180px;}
}

/* ── RPG の対戦（rpg-battle.js の .rpg-duel.bfx）: スマホは上=相手・下=自分の対角構図（2026-10-11 Rii2発注「RPGもこのデザインに合わせて」） ── */
.rpg-duel.bfx .cmd:not(:disabled){background:linear-gradient(180deg,color-mix(in srgb,var(--c,#c9a84c) 16%,#121821),#121821);border-color:color-mix(in srgb,var(--c,#c9a84c) 55%,#ffffff26);}
.rpg-duel.bfx .cmd-row--main .cmd__t{flex-direction:column;gap:3px;}
.rpg-duel.bfx .cmd-row--main .cmd__t>span{font-size:12px;font-weight:800;letter-spacing:.06em;color:var(--c);}
@media(max-width:720px){
  .rpg-duel.bfx .field{display:flex;flex-direction:column;gap:10px;}
  .rpg-duel.bfx .fighter-slot{display:flex;flex-direction:row;align-items:stretch;gap:8px;flex:1;min-height:0;padding:4px;animation:none;}
  .rpg-duel.bfx .fighter-slot--enemy{order:1;flex-direction:row-reverse;}
  .rpg-duel.bfx .fighter-slot:not(.fighter-slot--enemy){order:3;}
  .rpg-duel.bfx .field__vs{order:2;}
  .rpg-duel.bfx .fighter-slot .fighter{flex:none;height:auto;aspect-ratio:1/1;max-width:44vw;max-height:100%;}
  .rpg-duel.bfx .fighter__info{flex:1;min-width:0;display:flex;flex-direction:column;justify-content:center;}
  .rpg-duel.bfx .fighter-slot--enemy .fighter__info{text-align:right;}
  .rpg-duel.bfx .fighter-slot--enemy .fighter__name{text-align:right;}
  .rpg-duel.bfx .fighter{--lx:18px;--ly:-26px;}
  .rpg-duel.bfx .fighter.fighter--enemy{--lx:-18px;--ly:26px;}
  .rpg-duel.bfx .cmd__d{display:none;}
  .rpg-duel.bfx .cmd-row--main .cmd{min-height:66px;}
  .rpg-duel.bfx .cmd-row--skill .cmd{min-height:50px;}
}

/* ══ 2026-10-11 3便目（Rii2発注） ═══════════════════════════════════════════════
   ① VS・K.O.・READ!・CRITICAL の書体を Molot（サイトの太字インパクト書体・tmas-app.css で読込済み）へ。斜体気味に傾け金属の金
   ② 読み合いの激突は丸い枠をやめ、アイコンだけを倍の大きさでぶつける
   ③ 必殺技のカットインは大きく・格好よく入る（帯が走る→白光→立ち絵が飛び込む→技名が叩き込まれる・集中線）
   ④ 名前・家・レベル・HP・SP を、TMAs の絵と同じ1枚のカードに見せる。絵には枠を付けず、カードの地へ溶かす */
.bfx{--disp:'Molot','Cinzel','Noto Serif JP',serif;}

/* ① 書体 */
.bfx .field__vs,.bfx .field__vs-t{font-family:var(--disp);font-weight:400;letter-spacing:.04em;}
.bfx .field__vs-t{display:inline-block;font-size:2rem;line-height:1;transform:skewX(-12deg);
  background:linear-gradient(180deg,#fffbe6 0%,#ffe08a 38%,#c9962e 62%,#7a5414 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
  filter:drop-shadow(0 2px 0 #1a1004) drop-shadow(0 0 12px rgba(255,190,70,.55));}
.rpg-duel.bfx .field__vs{width:auto;height:auto;background:none;border:0;box-shadow:none;color:inherit;}
.bfx .clash__verdict{font-family:var(--disp);font-weight:400;font-size:1.9rem;letter-spacing:.06em;}
.bfx .clash.is-win .clash__verdict{background:linear-gradient(180deg,#fffbe6,#ffd23f 50%,#ff8a1f);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
  filter:drop-shadow(0 3px 0 #2a1600) drop-shadow(0 0 14px rgba(255,180,60,.8));text-shadow:none;}
.bfx .hit-tag{font-family:var(--disp);font-weight:400;letter-spacing:.08em;font-size:.9rem;}
.bfx .ko-stamp{font-family:var(--disp);font-weight:400;font-size:clamp(4rem,24vw,8.5rem);letter-spacing:.02em;transform:translate(-50%,-50%) skewX(-10deg);}
.bfx .ko-stamp.is-win{background:linear-gradient(180deg,#fffef2 0%,#ffe48a 34%,#e8a630 60%,#8a5410 100%);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
  filter:drop-shadow(0 6px 0 #160c02) drop-shadow(0 0 30px rgba(255,180,60,.75));}
.bfx .ko-stamp.is-lose,.bfx .ko-stamp.is-draw{background:linear-gradient(180deg,#ffe2e2,#ff5a5a 50%,#7a0e0e);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
  filter:drop-shadow(0 6px 0 #140202) drop-shadow(0 0 26px rgba(255,60,60,.6));text-shadow:none;}
.bfx .ko-stamp.is-draw{background:linear-gradient(180deg,#f2f6ff,#9fb8ff 50%,#2c3f7a);-webkit-background-clip:text;background-clip:text;}
.bfx .ko-stamp.go{animation:koStamp2 1.15s cubic-bezier(.2,1.4,.4,1) forwards;}
@keyframes koStamp2{0%{opacity:0;transform:translate(-50%,-50%) skewX(-10deg) scale(3.2);}16%{opacity:1;transform:translate(-50%,-50%) skewX(-10deg) scale(.9);}24%{transform:translate(-50%,-50%) skewX(-10deg) scale(1.05);}30%{transform:translate(-50%,-50%) skewX(-10deg) scale(1);}86%{opacity:1;}100%{opacity:0;transform:translate(-50%,-50%) skewX(-10deg) scale(1.05);}}

/* ② 激突: 枠なし・アイコンだけを倍の大きさで */
.bfx .clash__chip{left:-36px;top:-36px;width:72px;height:72px;background:none;border:0;box-shadow:none;border-radius:0;
  filter:drop-shadow(0 0 10px var(--c,#c9a84c)) drop-shadow(0 3px 0 rgba(0,0,0,.85));}
.bfx .clash__chip .tico{width:60px;height:60px;stroke-width:2.2;}
.bfx .clash__spark{left:-80px;top:-80px;width:160px;height:160px;}
.bfx .clash__verdict{top:46px;}
.bfx .clash.go .clash__chip--p{animation:chipSlamP .62s cubic-bezier(.3,.9,.2,1) forwards;}
.bfx .clash.go .clash__chip--e{animation:chipSlamE .62s cubic-bezier(.3,.9,.2,1) forwards;}
@keyframes chipSlamP{0%{opacity:0;transform:translateX(-170px) rotate(-30deg) scale(.7);}32%{opacity:1;transform:translateX(-10px) rotate(8deg) scale(1.12);}46%{transform:translateX(-40px) rotate(-6deg) scale(1);}86%{opacity:1;}100%{opacity:0;transform:translateX(-46px) rotate(-6deg);}}
@keyframes chipSlamE{0%{opacity:0;transform:translateX(170px) rotate(30deg) scale(.7);}32%{opacity:1;transform:translateX(10px) rotate(-8deg) scale(1.12);}46%{transform:translateX(40px) rotate(6deg) scale(1);}86%{opacity:1;}100%{opacity:0;transform:translateX(46px) rotate(6deg);}}

/* ③ カットイン: 大きく・格好よく */
.bfx .cutin{align-items:center;overflow:hidden;}
.bfx .cutin::before{background:radial-gradient(ellipse at 50% 50%,rgba(4,4,10,.35),rgba(4,4,10,.82) 70%);}
.bfx .cutin::after{content:attr(data-kind);position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) skewX(-12deg);white-space:nowrap;pointer-events:none;
  font:400 clamp(4rem,22vw,10rem)/1 var(--disp);letter-spacing:.04em;color:transparent;-webkit-text-stroke:2px rgba(255,214,120,.55);opacity:0;}
.bfx .cutin.go::after{animation:cutWord 1.05s ease-out forwards;}
@keyframes cutWord{0%{opacity:0;transform:translate(-50%,-50%) skewX(-12deg) scale(1.4);}18%{opacity:1;}100%{opacity:0;transform:translate(-50%,-50%) skewX(-12deg) scale(1);}}
.bfx .cutin__band{height:200px;padding:0 6vw 0 calc(6vw + 220px);overflow:visible;background:none;border:0;box-shadow:none;transform:none;}
.bfx .cutin__band::before{content:'';position:absolute;inset:18px 0;transform:skewY(-6deg);z-index:0;
  background:repeating-linear-gradient(100deg,rgba(255,255,255,.07) 0 2px,transparent 2px 22px),linear-gradient(90deg,#120410 0,#5b1640 38%,#b06bd6 100%);
  border-block:4px solid #ffd36a;box-shadow:0 0 50px rgba(176,107,214,.75),inset 0 0 40px rgba(0,0,0,.45);}
.bfx .cutin--enemy .cutin__band{padding:0 calc(6vw + 220px) 0 6vw;}
.bfx .cutin--enemy .cutin__band::before{background:repeating-linear-gradient(80deg,rgba(255,255,255,.07) 0 2px,transparent 2px 22px),linear-gradient(270deg,#160606 0,#6a1717 38%,#e0603c 100%);box-shadow:0 0 50px rgba(224,96,60,.75),inset 0 0 40px rgba(0,0,0,.45);}
.bfx .cutin__img{position:absolute;z-index:1;left:4vw;bottom:-6px;width:240px;height:240px;transform:none;object-fit:cover;object-position:center top;
  -webkit-mask-image:linear-gradient(180deg,#000 72%,transparent);mask-image:linear-gradient(180deg,#000 72%,transparent);filter:drop-shadow(0 0 16px #000);}
.bfx .cutin--enemy .cutin__img{left:auto;right:4vw;}
.bfx .cutin__txt{position:relative;z-index:2;transform:none;}
.bfx .cutin__who{font:400 .95rem/1.4 var(--disp);letter-spacing:.14em;color:#ffe9a8;text-shadow:0 2px 0 #000;}
.bfx .cutin__name{font-size:clamp(1.8rem,8vw,3.4rem);text-shadow:0 4px 0 #000,0 0 24px rgba(255,210,120,.9);}
.bfx .cutin.go .cutin__band{animation:none;}
.bfx .cutin.go .cutin__band::before{animation:cutStrip 1.05s cubic-bezier(.2,.9,.2,1) forwards;}
.bfx .cutin--enemy.go .cutin__band::before{animation-name:cutStripR;}
.bfx .cutin.go .cutin__img{animation:cutImg 1.05s cubic-bezier(.2,1.3,.4,1) forwards;}
.bfx .cutin--enemy.go .cutin__img{animation-name:cutImgR;}
.bfx .cutin.go .cutin__txt{animation:cutTxt 1.05s cubic-bezier(.2,1.2,.3,1) forwards;}
@keyframes cutStrip{0%{transform:skewY(-6deg) scaleX(0);transform-origin:left;filter:brightness(3);}16%{transform:skewY(-6deg) scaleX(1);filter:brightness(1.6);}26%{filter:brightness(1);}82%{transform:skewY(-6deg) scaleX(1);opacity:1;}100%{transform:skewY(-6deg) scaleX(1) translateX(30%);opacity:0;}}
@keyframes cutStripR{0%{transform:skewY(-6deg) scaleX(0);transform-origin:right;filter:brightness(3);}16%{transform:skewY(-6deg) scaleX(1);filter:brightness(1.6);}26%{filter:brightness(1);}82%{transform:skewY(-6deg) scaleX(1);opacity:1;}100%{transform:skewY(-6deg) scaleX(1) translateX(-30%);opacity:0;}}
@keyframes cutImg{0%,10%{opacity:0;transform:translateX(-120px) scale(1.25);}28%{opacity:1;transform:translateX(8px) scale(1);}36%{transform:translateX(0);}84%{opacity:1;}100%{opacity:0;transform:translateX(40px);}}
@keyframes cutImgR{0%,10%{opacity:0;transform:translateX(120px) scale(1.25);}28%{opacity:1;transform:translateX(-8px) scale(1);}36%{transform:translateX(0);}84%{opacity:1;}100%{opacity:0;transform:translateX(-40px);}}
@keyframes cutTxt{0%,18%{opacity:0;transform:scale(1.8);filter:blur(6px);}32%{opacity:1;transform:scale(.96);filter:none;}38%{transform:scale(1);}84%{opacity:1;}100%{opacity:0;}}

/* ④ 1枚のカード: 絵（枠なし）＋名前・家・レベル・HP・SP */
.bfx .fighter-slot{position:relative;border-radius:16px;overflow:visible;
  background:linear-gradient(155deg,color-mix(in srgb,var(--accent,#c9a84c) 22%,#11131b) 0%,#0c0d14 62%,#08090e 100%);
  border:1px solid color-mix(in srgb,var(--accent,#c9a84c) 32%,rgba(255,255,255,.06));
  box-shadow:0 14px 34px rgba(0,0,0,.55),inset 0 1px 0 rgba(255,255,255,.07);}
.bfx .fighter-slot::after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;
  background:linear-gradient(115deg,transparent 40%,rgba(255,255,255,.05) 50%,transparent 60%);}
.bfx .fighter-slot .fighter{border:0;box-shadow:none;background:transparent;border-radius:16px 16px 0 0;overflow:hidden;
  -webkit-mask-image:linear-gradient(180deg,#000 68%,transparent 100%);mask-image:linear-gradient(180deg,#000 68%,transparent 100%);}
.bfx .fighter-slot .fighter .tcard__scrim{background:linear-gradient(180deg,rgba(8,8,14,0) 55%,rgba(8,8,14,.35) 100%);}
.bfx .fighter-slot .fighter__info{position:relative;z-index:1;padding:4px 14px 14px;}
.bfx .fighter-slot .hpbar{background:rgba(0,0,0,.45);border:1px solid rgba(255,255,255,.08);}
.rpg-duel.bfx .fighter-slot{padding:0;animation:duelCardIn .45s ease-out both;}
.rpg-duel.bfx .fighter-slot--enemy{animation-delay:.08s;}
/* 被弾・踏み込みはカードごと動かすと情報がぶれるので、絵（.fighter）だけが動く。カードは赤く脈打つ */
.bfx .fighter-slot:has(.fighter.flash-hit){animation:slotHit .32s ease-out;}
@keyframes slotHit{0%{box-shadow:0 0 0 2px #ff5a5a,0 0 30px rgba(255,60,60,.6);}100%{box-shadow:0 14px 34px rgba(0,0,0,.55),inset 0 1px 0 rgba(255,255,255,.07);}}

@media(max-width:640px){
  /* アリーナのスマホ: 横並びのカード。自分=絵が左・相手=絵が右。絵は内側へ溶ける */
  #screen-battle .field > .fighter-slot{gap:0;align-items:stretch;}
  #screen-battle .field > .fighter-slot:first-child .fighter{border-radius:16px 0 0 16px;
    -webkit-mask-image:linear-gradient(90deg,#000 70%,transparent 100%);mask-image:linear-gradient(90deg,#000 70%,transparent 100%);}
  #screen-battle .field > .fighter-slot:last-child .fighter{border-radius:0 16px 16px 0;
    -webkit-mask-image:linear-gradient(270deg,#000 70%,transparent 100%);mask-image:linear-gradient(270deg,#000 70%,transparent 100%);}
  #screen-battle .field > .fighter-slot .fighter__info{align-self:center;padding:10px 14px 10px 4px;}
  #screen-battle .field > .fighter-slot:last-child .fighter__info{padding:10px 4px 10px 14px;}
  .bfx .field__vs-t{font-size:1.6rem;}
  .bfx .cutin__band{height:160px;padding-left:calc(4vw + 150px);}
  .bfx .cutin--enemy .cutin__band{padding:0 calc(4vw + 150px) 0 4vw;}
  .bfx .cutin__img{width:170px;height:170px;left:0;}
  .bfx .cutin--enemy .cutin__img{right:0;}
}
@media(max-width:720px){
  .rpg-duel.bfx .fighter-slot{gap:0;padding:0;}
  .rpg-duel.bfx .fighter-slot:not(.fighter-slot--enemy) .fighter{border-radius:16px 0 0 16px;
    -webkit-mask-image:linear-gradient(90deg,#000 70%,transparent 100%);mask-image:linear-gradient(90deg,#000 70%,transparent 100%);}
  .rpg-duel.bfx .fighter-slot--enemy .fighter{border-radius:0 16px 16px 0;
    -webkit-mask-image:linear-gradient(270deg,#000 70%,transparent 100%);mask-image:linear-gradient(270deg,#000 70%,transparent 100%);}
  .rpg-duel.bfx .fighter-slot .fighter__info{padding:8px 12px 8px 4px;}
  .rpg-duel.bfx .fighter-slot--enemy .fighter__info{padding:8px 4px 8px 12px;}
}

/* ══ 2026-10-11 4便目（Rii2発注）: スマホのバトル画面は全画面・背景に画像 ═══════════════════════
   ・アリーナ = ノクターン・アリーナ（光の輪の闘技場） / RPG = 戦う施設・区画の絵（無ければブラッド・アリーナ）
   ・絵は map_BG の原画(2MB)を 1600px の webp(約70KB)に縮めた assets/bg/battle/ を使う
   ・スマホは見出し(ヘッダー)を畳み、バトルの器を画面いっぱいに固定する。結果画面に移ると元に戻る（body.in-battle が外れる） */
#screen-battle .arena{background:linear-gradient(180deg,rgba(6,6,12,.62),rgba(6,6,12,.38) 38%,rgba(6,6,12,.88) 100%),
  url('../assets/bg/battle/arena-nocturne.webp') center 32%/cover no-repeat,#07070c;}
.rpg-duel.bfx{background:linear-gradient(180deg,rgba(6,9,14,.66),rgba(6,9,14,.42) 38%,rgba(6,9,14,.9) 100%),
  var(--battle-bg,url('../assets/bg/battle/arena-blood.webp')) center 35%/cover no-repeat,#080e16;}
@media(max-width:640px){
  body.in-battle{overflow:hidden;}
  body.in-battle .tmas-header{display:none;}
  /* ⚠ ページ遷移の演出が .tmas-page に transform を残す。transform のある祖先は fixed の基準になり、全画面が80pxに縮んだ（実測） */
  body.in-battle .tmas-page{z-index:150;transform:none!important;animation:none!important;}
  body.in-battle #screen-battle{position:fixed;inset:0;z-index:150;max-width:none;margin:0;padding:0;overflow-y:auto;overscroll-behavior:contain;background:#07070c;}
  body.in-battle #screen-battle .arena{min-height:100dvh;margin:0;border:0;border-radius:0;box-sizing:border-box;
    padding:calc(10px + env(safe-area-inset-top)) 12px 0;}
  body.in-battle #screen-battle .cmd-panel{margin:10px -12px 0;padding-left:12px;padding-right:12px;}
}
@media(max-width:720px){
  body:has(.rpg-shell[data-mode="battle"]) .tmas-header{display:none;}
  .rpg-shell[data-mode="battle"] .rpg-view{inset:0;}
  .rpg-duel.bfx{padding-top:max(12px,env(safe-area-inset-top));}
}

/* ── 動きを減らす設定 ───────────────────────────────────── */
@media(prefers-reduced-motion:reduce){
  .bfx .fighter.is-lunge,.bfx .fighter.is-hit,.bfx .fighter.is-evade,
  .bfx .field.hitstop,.bfx .field.hitstop-big,.bfx .cmd.is-picked{animation:none;}
  .bfx .cutin.go .cutin__band{animation:none;transform:skewY(-6deg);}
  .bfx .ko-stamp.go{animation:none;opacity:1;}
  .bfx .clash.go .clash__chip--p,.bfx .clash.go .clash__chip--e{animation:none;opacity:1;}
  .bfx .clash.go .clash__chip--p{transform:translate(-30px,0);}
  .bfx .clash.go .clash__chip--e{transform:translate(30px,0);}
  .bfx .clash.go .clash__spark{animation:none;}
  .bfx .clash.go .clash__verdict{animation:none;opacity:1;}
  .bfx .hpbar__ghost{transition-duration:.2s;}
  .bfx .cutin.go .cutin__band::before,.bfx .cutin.go .cutin__img,.bfx .cutin.go .cutin__txt,.bfx .cutin.go::after{animation:none;opacity:1;}
  .bfx .fighter-slot:has(.fighter.flash-hit){animation:none;}
  .rpg-duel.bfx .fighter-slot{animation:none;}
}
