/* ===== battle ===== */
.bt { position: absolute; inset: 0; overflow: clip; }
.bt-bg { position: absolute; inset: -10px; background-size: cover; background-position: center; filter: saturate(.9) brightness(.8); }
.bt-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12, 10, 30, .15) 0%, rgba(12, 10, 30, .1) 45%, rgba(12, 10, 30, .82) 72%, rgba(10, 8, 26, .95)); }
.bt.shake { animation: shake .3s; }
.bt.enemy-phase .bt-hand { opacity: .55; filter: grayscale(.4); }

/* 敵 */
.bt-enemies { position: absolute; left: 400px; right: 120px; top: 70px; height: 470px; display: flex; justify-content: center; align-items: flex-end; gap: 30px; }
.en { position: relative; width: calc(240px * var(--sz)); display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: transform .2s; }
.en-body { position: relative; width: 100%; height: calc(250px * var(--sz)); display: flex; align-items: flex-end; justify-content: center; }
.en-img { max-width: 100%; max-height: 100%; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .5)); transition: filter .2s, transform .2s; animation: idle 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
.kind-adv .en-body { height: calc(330px * var(--sz)); }
@keyframes idle { 50% { transform: scale(1.02, .98); } }
.en.focus .en-img { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 10px rgba(255, 220, 120, .9)) drop-shadow(0 10px 14px rgba(0, 0, 0, .5)); }
.en.focus::after { content: "▼"; position: absolute; top: 74px; left: 50%; transform: translateX(-50%); color: var(--gold); font-size: 22px; animation: bob 1s infinite; pointer-events: none; }
.en.tasty .en-img { filter: drop-shadow(0 0 14px rgba(255, 110, 170, .95)) drop-shadow(0 10px 14px rgba(0, 0, 0, .5)); animation: tasty .8s ease-in-out infinite; }
@keyframes tasty { 50% { transform: scale(1.05, .95); } }
.en.hurt .en-img { animation: hurt .35s; }
@keyframes hurt { 0% { filter: brightness(3) saturate(0); } 30% { transform: translateX(-10px) rotate(-3deg); } 60% { transform: translateX(8px) rotate(2deg); } 100% { transform: none; } }
.en.attacking .en-body { animation: lunge .42s; }
@keyframes lunge { 40% { transform: translateY(30px) scale(1.1); } }
.en.dying { animation: dying .4s forwards; }
@keyframes dying { to { opacity: 0; transform: translateY(20px) scale(.8); filter: brightness(2); } }
.en.devoured .en-img { animation: devoured .8s forwards; }
@keyframes devoured { 0% { transform: scale(1); } 30% { transform: scale(1.1, .8); filter: hue-rotate(200deg) saturate(2); } 100% { transform: scale(.05) translateY(400px); opacity: 0; filter: hue-rotate(230deg) brightness(1.4); } }
.en.devoured .en-body::after { content: ""; position: absolute; inset: 10% 0 0; border-radius: 50%; background: radial-gradient(circle, rgba(140, 110, 255, .8), rgba(100, 70, 230, 0) 70%); animation: gulp .8s forwards; }
@keyframes gulp { 0% { transform: scale(.2); opacity: 0; } 40% { transform: scale(1.3); opacity: 1; } 100% { transform: scale(.4); opacity: 0; } }
.en.fleeing { animation: flee .6s forwards; }
@keyframes flee { to { transform: translateX(400px); opacity: 0; } }
.en.stunned .en-img { filter: grayscale(.4) drop-shadow(0 10px 14px rgba(0, 0, 0, .5)); }
.en-intent {
  position: relative; display: flex; align-items: center; gap: 6px; padding: 6px 14px; margin-bottom: 6px; border-radius: 999px;
  background: rgba(20, 16, 44, .88); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); font-weight: 900; font-size: 20px; white-space: nowrap; min-height: 40px;
}
.en-intent .ic { font-size: 22px; }
.en-intent .num { color: #ff8a8a; }
.en-intent.i-guard .num, .en-intent.i-buff .num { color: #9fd3ff; }
.en-intent .tg { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: 50% 10%; background: #fff; box-shadow: 0 0 0 2px #ff6b6b; }
.en-intent .nm { font-size: 13px; color: #ddd; font-weight: 700; }
.en-intent.i-charge, .en-intent.big { box-shadow: inset 0 0 0 2px #ffcf4a, 0 0 16px rgba(255, 200, 60, .6); animation: warn 1s infinite; }
@keyframes warn { 50% { transform: scale(1.06); } }
.en-name { margin-top: 4px; font-size: 18px; font-weight: 800; text-shadow: 0 2px 4px #000; white-space: nowrap; }
.rar { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 6px; font-size: 14px; font-weight: 900; color: #222; }
.rar.r-N { background: #c8d2e0; } .rar.r-R { background: #6ec0ff; } .rar.r-SR { background: linear-gradient(90deg, #ffe07a, #ffb52e); }
.en-aura { position: absolute; inset: 10% 5% 0; border-radius: 50%; filter: blur(18px); opacity: .55; animation: aura 2s ease-in-out infinite; }
.en-aura.r-N { background: #b8c4d6; opacity: .25; } .en-aura.r-R { background: #5ab0ff; } .en-aura.r-SR { background: #ffcf4a; opacity: .75; }
@keyframes aura { 50% { transform: scale(1.08); opacity: .8; } }
.en-hp { position: relative; width: 200px; height: 20px; margin-top: 4px; border-radius: 999px; background: rgba(0, 0, 0, .6); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .3); overflow: visible; }
.en-hp .fill { position: absolute; left: 2px; top: 2px; bottom: 2px; max-width: calc(100% - 4px); border-radius: 999px; background: linear-gradient(180deg, #ff8a8a, #e0445a); transition: width .35s; }
.en-hp .line { position: absolute; left: 2px; top: -4px; bottom: -4px; border-radius: 6px; background: rgba(255, 110, 180, .35); box-shadow: inset -3px 0 0 #ff6eb4; z-index: 1; transition: width .3s; }
.en.tasty .en-hp .fill { background: linear-gradient(180deg, #ffa0d0, #ff4f9a); }
.en-hp .txt { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 900; text-shadow: 0 1px 2px #000; z-index: 2; }
.en-hp .gd { position: absolute; left: -46px; top: -4px; font-size: 16px; font-weight: 900; background: #3a6fb0; border-radius: 8px; padding: 1px 6px; z-index: 3; }
.en-st, .pm-st { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 4px; min-height: 22px; }
.chip { font-size: 13px; font-weight: 800; padding: 1px 7px; border-radius: 999px; background: rgba(30, 24, 60, .9); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .3); white-space: nowrap; }
.chip.st-slime { background: #6b5bd6; } .chip.st-poison { background: #4a8a3a; } .chip.st-weak { background: #7a5a2a; } .chip.st-frail { background: #a03a5a; } .chip.st-fight { background: #c0562a; }
.chip.echo { background: #ff7aa8; color: #fff; }
.en-devour { position: absolute; bottom: 68px; left: 50%; transform: translateX(-50%); z-index: 5; font-size: 22px; padding: 10px 26px; animation: devourbtn .7s ease-in-out infinite; white-space: nowrap; }
@keyframes devourbtn { 50% { transform: translateX(-50%) scale(1.1); } }
.en-tasty { position: absolute; bottom: 74px; left: 50%; transform: translateX(-50%); font-weight: 900; color: #ff8ac0; text-shadow: 0 2px 4px #000; }
.en-act { position: absolute; top: 40%; left: 50%; transform: translateX(-50%); padding: 6px 16px; background: rgba(200, 40, 70, .92); border-radius: 10px; font-weight: 900; font-size: 20px; white-space: nowrap; z-index: 6; animation: fadein .2s both; }

/* 味方 */
.bt-party { position: absolute; left: 18px; bottom: 18px; width: 360px; display: flex; flex-direction: column-reverse; gap: 10px; }
.pm { position: relative; height: 150px; border-radius: 18px; background: rgba(22, 18, 50, .85); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .15); cursor: pointer; overflow: visible; transition: transform .15s, box-shadow .15s; }
.bt-party:has(.pm:nth-child(2)) .pm { height: 138px; }
.pm.active { box-shadow: inset 0 0 0 3px var(--gold), 0 0 20px rgba(255, 207, 74, .45); transform: translateX(6px); }
.pm.down { filter: grayscale(1) brightness(.6); }
.pm-art { position: absolute; left: 0; top: -18px; width: 130px; bottom: 0; background-size: 210%; background-position: 50% 6%; background-repeat: no-repeat; border-radius: 0 0 0 18px; }
.pm-key { position: absolute; left: 6px; top: 6px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0, 0, 0, .6); display: grid; place-items: center; font-size: 13px; font-weight: 900; }
.pm-name { position: absolute; left: 136px; top: 8px; font-size: 22px; font-weight: 900; }
.pm-name small { display: block; font-size: 13px; color: #c9c0ff; font-weight: 700; }
.pm-hp { position: absolute; left: 136px; right: 14px; top: 62px; height: 22px; border-radius: 999px; background: rgba(0, 0, 0, .55); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
.pm-hp .fill { position: absolute; left: 2px; top: 2px; bottom: 2px; max-width: calc(100% - 4px); border-radius: 999px; background: linear-gradient(180deg, #7dffb0, #22b866); transition: width .35s; }
.pm-hp .txt { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 900; text-shadow: 0 1px 2px #000; }
.pm-guard { position: absolute; right: 12px; top: 10px; font-size: 18px; font-weight: 900; background: #3a6fb0; border-radius: 10px; padding: 2px 8px; }
.pm-st { position: absolute; left: 136px; right: 10px; top: 88px; justify-content: flex-start; }
.pm-passive { position: absolute; left: 136px; right: 10px; bottom: 6px; font-size: 11.5px; color: #b9b0e8; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-party:has(.pm:nth-child(2)) .pm-passive { display: none; }
.pm.hurt { animation: phurt .3s; }
@keyframes phurt { 30% { transform: translateX(-8px); background: rgba(160, 30, 50, .9); } }
.pm.acting { animation: acting .25s; }
@keyframes acting { 50% { transform: translateX(14px); } }
.pm.swapping .pm-art { animation: swapping .45s; }
@keyframes swapping { 0% { filter: brightness(3); transform: scale(.6, 1.3); } 100% { filter: none; transform: none; } }
.bark { position: absolute; left: 120px; top: -46px; padding: 8px 14px; background: #fff; color: var(--ink); border-radius: 14px; font-weight: 800; font-size: 16px; white-space: nowrap; z-index: 8; animation: fadein .25s both; box-shadow: 0 4px 10px rgba(0, 0, 0, .4); }
.bark::after { content: ""; position: absolute; left: 20px; bottom: -8px; border: 8px solid transparent; border-top-color: #fff; border-bottom: 0; }

/* エネルギー・手札 */
.bt-energy { position: absolute; left: 400px; bottom: 150px; text-align: center; }
.bt-energy .orb { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; grid-auto-flow: column; align-content: center;
  background: radial-gradient(circle at 35% 30%, #ffe9a0, #ffb22e 55%, #c86a00); box-shadow: 0 0 0 4px #fff, 0 0 30px rgba(255, 190, 60, .6); color: #fff; text-shadow: 0 2px 0 #9a4f00; }
.bt-energy .orb b { font-size: 46px; font-weight: 900; }
.bt-energy .orb span { font-size: 22px; font-weight: 900; align-self: end; margin-bottom: 22px; }
.bt-energy .lbl { margin-top: 6px; font-size: 14px; font-weight: 800; }
.bt-energy.gain .orb { animation: gain .4s; }
@keyframes gain { 50% { transform: scale(1.2); } }
.bt-hand { position: absolute; left: 520px; right: 230px; bottom: -40px; height: 300px; }
.hand-card { position: absolute; bottom: 0; transform: translateY(var(--dy)) rotate(var(--rot)); transform-origin: 50% 120%; animation: deal .25s ease both; }
@keyframes deal { from { opacity: 0; transform: translate(200px, 100px) rotate(20deg); } }
.hand-card:hover { transform: translateY(-70px) scale(1.12); z-index: 20; }
.hand-card.played { animation: played .25s forwards; }
@keyframes played { to { transform: translateY(-260px) scale(.6); opacity: 0; } }
.hand-card.nope { animation: nope .3s; }
@keyframes nope { 25% { margin-left: -8px; } 75% { margin-left: 8px; } }
.hand-card.res-on { box-shadow: 0 0 0 4px var(--tag), 0 0 0 7px #fff, 0 0 22px var(--tag); }
.hand-card.held { box-shadow: 0 0 0 4px #ff7aa8, 0 0 0 7px #fff, 0 0 26px #ff7aa8; }
.hold-tab { position: absolute; left: 50%; top: -26px; transform: translateX(-50%); padding: 2px 10px; border-radius: 8px 8px 0 0; background: #ff7aa8; color: #fff; font-size: 12px; font-weight: 900; opacity: 0; transition: opacity .15s; white-space: nowrap; }
.hand-card:hover .hold-tab, .hand-card.held .hold-tab { opacity: 1; }
.hand-card.held .hold-tab { top: -24px; }
.bt-piles { position: absolute; right: 20px; bottom: 16px; display: flex; gap: 10px; }
.pile { padding: 6px 12px; border-radius: 10px; background: rgba(20, 16, 44, .85); font-size: 14px; font-weight: 700; }
.pile b { font-size: 18px; color: var(--gold); }
.bt-actions { position: absolute; right: 24px; bottom: 70px; display: flex; flex-direction: column; gap: 14px; align-items: flex-end; }
.bt-end { font-size: 26px; padding: 18px 40px; }
.bt-swap { font-size: 20px; }
.bt-tools { position: absolute; right: 20px; top: 16px; display: flex; gap: 10px; }
.bt-tools .btn { font-size: 15px; padding: 8px 18px; }
.bt-tools .btn.on { background: linear-gradient(180deg, #ff9cc0, #f0588f); box-shadow: 0 3px 0 #a52a5a; }
.bt-swappop { position: absolute; right: 24px; bottom: 230px; width: 470px; padding: 18px; z-index: 30; display: flex; flex-direction: column; gap: 10px; }
.bt-swappop .ttl { font-weight: 900; font-size: 20px; }
.bt-swappop .ttl small { display: block; font-size: 13px; color: #c9c0ff; font-weight: 700; }
.swap-opt { display: flex; gap: 12px; align-items: center; text-align: left; padding: 8px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .08); color: #fff; }
.swap-opt:hover { background: rgba(255, 122, 168, .25); }
.swap-opt img { width: 70px; height: 80px; object-fit: cover; object-position: 50% 5%; border-radius: 10px; background: rgba(255, 255, 255, .1); }
.swap-opt b { display: block; font-size: 17px; }
.swap-opt span { display: block; font-size: 13px; color: #ddd; }

/* 演出 */
.bt-fx { position: absolute; inset: 0; pointer-events: none; z-index: 40; }
.float { position: absolute; transform: translate(-50%, 0); font-weight: 900; font-size: 40px; text-shadow: 0 3px 0 #000, 0 0 10px rgba(0, 0, 0, .6); animation: float 1.1s ease-out forwards; white-space: nowrap; }
.float.dmg { color: #fff; } .float.pdmg { color: #ff6b6b; }
.float.heal { color: #7dffb0; font-size: 32px; } .float.guard { color: #9fd3ff; font-size: 28px; }
.float.slime { color: #c6b8ff; font-size: 26px; } .float.st, .float.pst { color: #ffd27a; font-size: 24px; } .float.res { color: #ffcf4a; font-size: 24px; }
@keyframes float { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -10px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -70px) scale(1); } }
.bt-turn { position: absolute; left: 0; right: 0; top: 38%; text-align: center; pointer-events: none; z-index: 45; opacity: 0; }
.bt-turn.show { animation: banner .9s ease both; }
.bt-turn b { display: block; font-size: 64px; font-weight: 900; font-family: var(--font-t); text-shadow: 0 4px 0 #3d2f9a, 0 0 24px rgba(140, 120, 255, .8); }
.bt-turn span { font-size: 22px; font-weight: 800; }
.bt-turn.devour b { color: #ffb0d8; font-size: 88px; text-shadow: 0 5px 0 #a0306a, 0 0 30px rgba(255, 110, 180, .9); }
.bt-turn.win b { color: var(--gold); font-size: 90px; text-shadow: 0 5px 0 #b26d00, 0 0 30px rgba(255, 200, 60, .9); }
.bt-turn.lose b { color: #aab; font-size: 70px; }
@keyframes banner { 0% { opacity: 0; transform: scale(1.5); } 20%, 75% { opacity: 1; transform: scale(1); } 100% { opacity: 0; } }
.bt-tip { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); width: 640px; padding: 26px 32px; z-index: 50; background: rgba(255, 250, 240, .97); color: var(--ink); border-radius: 20px; box-shadow: 0 0 0 4px #ff7aa8, 0 20px 50px rgba(0, 0, 0, .6); font-size: 22px; font-weight: 700; line-height: 1.6; text-align: center; }
.bt-tip .btn { margin-top: 14px; }
.tip-glow { outline: 4px solid #ff7aa8; outline-offset: 6px; border-radius: 16px; animation: tipglow 1s infinite; }
@keyframes tipglow { 50% { outline-color: #ffcf4a; } }
.bt-defeat { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 640px; padding: 36px; text-align: center; z-index: 50; }
.bt-defeat h2 { font-size: 40px; margin: 0 0 10px; }
.bt-defeat p { font-size: 19px; line-height: 1.6; }
.bt-defeat .hint { color: #c9c0ff; font-size: 16px; }
.bt-defeat .row { display: flex; gap: 20px; justify-content: center; margin-top: 18px; }

/* 報酬 */
.rw { position: absolute; inset: 0; z-index: 55; background: rgba(10, 8, 26, .78); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.rw-title { font-size: 54px; font-weight: 900; font-family: var(--font-t); color: #ffb0d8; text-shadow: 0 4px 0 #8a2a5a, 0 0 30px rgba(255, 110, 180, .7); }
.rw-box { position: relative; width: 1180px; min-height: 420px; max-height: 720px; padding: 30px 40px 80px; overflow: hidden; }
.rw-next { position: absolute; right: 30px; bottom: 20px; }
.rw-absorb { display: flex; gap: 30px; align-items: center; }
.rw-absorb-img { width: 300px; max-height: 380px; object-fit: contain; filter: drop-shadow(0 0 20px rgba(140, 110, 255, .8)) hue-rotate(0deg); animation: absorbimg 2.4s ease-in-out forwards; }
@keyframes absorbimg { 0% { opacity: 1; transform: none; } 100% { opacity: .25; transform: scale(.85) translateY(20px); filter: drop-shadow(0 0 30px rgba(140, 110, 255, 1)) hue-rotate(220deg) blur(2px); } }
.rw-absorb-txt p { font-size: 22px; line-height: 1.7; margin: 0 0 8px; animation: fadein .6s both; }
.rw-list { display: flex; flex-direction: column; gap: 10px; }
.rw-exp { font-size: 28px; font-weight: 900; color: var(--gold); }
.rw-exp span { font-size: 18px; color: #ddd; font-weight: 700; }
.rw-line { font-size: 20px; font-weight: 800; }
.rw-line.lv { color: #7dffb0; font-size: 26px; animation: fadein .4s both; }
.rw-line.vessel { color: #ffb0d8; }
.rw-sub { margin-top: 6px; font-weight: 900; color: #c9c0ff; }
.rw-cards { display: flex; gap: 22px; flex-wrap: wrap; }
.rw-card { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: fadein .5s both; }
.rw-card .cap { font-size: 13px; color: #ddd; }
.rw-form { display: flex; gap: 20px; align-items: center; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .07); animation: fadein .5s both; }
.rw-form img { width: 120px; height: 150px; object-fit: cover; object-position: 50% 5%; border-radius: 12px; background: rgba(255, 255, 255, .08); }
.rw-form b { font-size: 22px; }
.rw-form p { margin: 4px 0; font-size: 16px; }
.trait { display: inline-block; margin: 2px 4px; padding: 1px 8px; border-radius: 8px; background: #6b5bd6; font-size: 14px; }
