/* ================================================================
   battle-arena.css — 균열 전투 화면 v4 "HOLO ENGAGEMENT"
   세련된 SF 홀로그램 전투 UI. 헤어라인·글래스·절제된 글로우.
   유닛은 별도 인트로 없이 제자리에서 홀로그램으로 투영(전개)된다.
   테마와 무관하게 항상 다크(몰입 우선). 사운드 없음.
================================================================ */

.bt-popup-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: #030610;
    display: none; flex-direction: column;
    font-family: var(--font-ui);
    pointer-events: all;
    --bt-ally:  #2080ff;
    --bt-enemy: #ff3355;
    --bt-gold:  #ffd166;
    --bt-cyan:  #8ccdff;          /* 홀로그램 공통 시안 */
    --bt-line:  rgba(140,205,255,.14);   /* 헤어라인 */
    --bt-glass: rgba(8,15,30,.62);       /* 글래스 패널 */
    color: #eef2ff;
}
[data-theme="light"] .bt-popup-overlay { background: #030610; color: #eef2ff; } /* 전투는 항상 다크 */

.bt-popup-inner {
    width: 100%; height: 100%;
    display: flex; flex-direction: column; overflow: hidden;
    position: relative;
}

/* 히트스톱 — 모든 CSS 애니메이션 순간 정지 */
.bt-hitstop, .bt-hitstop * { animation-play-state: paused !important; }

/* ══ 1. 상단 HUD — 글래스 스트립 ═══════════════════════════ */
.bt-hud {
    flex-shrink: 0; position: relative; z-index: 30;
    display: flex; align-items: stretch;
    height: 50px;
    background: linear-gradient(180deg, rgba(8,15,30,.85), rgba(5,10,20,.6));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--bt-line);
}
.bt-hud::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
    background: linear-gradient(90deg,
        transparent 4%, rgba(32,128,255,.55) 22%, transparent 46%,
        transparent 54%, rgba(255,51,85,.45) 78%, transparent 96%);
}
/* 코너 틱 */
.bt-hud::before {
    content: ''; position: absolute; top: 7px; bottom: 7px; left: 10px; width: 1px;
    background: linear-gradient(180deg, var(--bt-cyan), transparent);
    opacity: .4;
}
.bt-hud-block {
    display: flex; flex-direction: column; justify-content: center;
    padding: 0 22px; gap: 3px; min-width: 0;
}
.bt-hud-block.mid { flex: 1; align-items: center; text-align: center; }
.bt-hud-block.right { align-items: flex-end; }
.bt-hud-kicker {
    font-family: var(--font-mono); font-size: .54rem; letter-spacing: .3em;
    text-transform: uppercase; color: rgba(140,205,255,.38); white-space: nowrap;
}
.bt-hud-main {
    font-family: var(--font-head); font-size: 1.14rem; letter-spacing: .16em;
    line-height: 1; color: #f2f6ff; white-space: nowrap;
    text-shadow: 0 0 16px rgba(140,205,255,.35);
}
.bt-hud-main .accent { color: var(--accent2, #00e0ff); }
.bt-hud-turn {
    font-family: var(--font-mono); font-size: .7rem; color: #7a90c0;
    letter-spacing: .1em; white-space: nowrap;
}
.bt-hud-turn b { color: var(--bt-gold); font-weight: 500; }
.bt-hud-phase {
    font-family: var(--font-mono); font-size: .6rem; letter-spacing: .16em;
    text-transform: uppercase; white-space: nowrap;
    padding: 3px 12px; border: 1px solid rgba(140,205,255,.25);
    color: var(--bt-cyan);
    clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
    background: rgba(140,205,255,.05);
    transition: all .2s;
}
.bt-hud-phase.enemy {
    border-color: rgba(255,51,85,.4); color: #ff8095; background: rgba(255,51,85,.06);
}
.bt-hud-phase.mine {
    border-color: rgba(255,209,102,.55); color: var(--bt-gold); background: rgba(255,209,102,.08);
    animation: btPhasePulse 1.2s ease-in-out infinite;
}
@keyframes btPhasePulse {
    0%,100% { box-shadow: 0 0 0 rgba(255,209,102,0); }
    50%     { box-shadow: 0 0 14px rgba(255,209,102,.3); }
}
.bt-hud-actions { display: flex; align-items: center; gap: 8px; padding-right: 16px; }
.bt-hud-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; cursor: pointer;
    background: rgba(10,18,36,.6); border: 1px solid var(--bt-line);
    color: #7a90c0; font-family: var(--font-mono); font-size: .6rem;
    letter-spacing: .12em; text-transform: uppercase;
    clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
    transition: all .15s;
}
.bt-hud-btn:hover { color: #eef2ff; border-color: rgba(140,205,255,.45); background: rgba(140,205,255,.08); }
.bt-hud-btn.danger { border-color: rgba(255,51,85,.35); color: #ff8095; }
.bt-hud-btn.danger:hover { background: rgba(255,51,85,.1); border-color: #ff3355; color: #ffccd5; }
.bt-hud-btn i { font-size: .85rem; }

/* ══ 2. 턴 오더 레일 ════════════════════════════════════════ */
.bt-turnrail {
    flex-shrink: 0; position: relative; z-index: 29;
    display: flex; align-items: center; gap: 10px;
    height: 54px; padding: 0 22px;
    background: rgba(5,10,20,.55);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(140,205,255,.08);
    overflow-x: auto; scrollbar-width: none;
}
.bt-turnrail::-webkit-scrollbar { display: none; }
.bt-turnrail-label {
    font-family: var(--font-mono); font-size: .54rem; letter-spacing: .26em;
    color: rgba(140,205,255,.3); text-transform: uppercase; flex-shrink: 0;
    margin-right: 6px;
}
.bt-tchip {
    position: relative; flex-shrink: 0;
    width: 36px; height: 36px;
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    background: rgba(15,26,48,.8);
    transition: transform .3s cubic-bezier(.34,1.5,.64,1), opacity .3s, filter .3s;
    opacity: .45;
}
.bt-tchip img, .bt-tchip .bt-tchip-ph {
    position: absolute; inset: 1.5px;
    clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
    width: calc(100% - 3px); height: calc(100% - 3px);
    object-fit: cover; object-position: top center;
}
.bt-tchip .bt-tchip-ph {
    display: flex; align-items: center; justify-content: center;
    background: #121d34; color: #3a4e72; font-size: .85rem;
}
.bt-tchip::before {
    content: ''; position: absolute; inset: 0;
    background: var(--chip, #2080ff);
    opacity: .85;
}
.bt-tchip.enemy::before { background: var(--bt-enemy); }
.bt-tchip.active {
    transform: scale(1.24) translateY(-1px); opacity: 1;
    filter: drop-shadow(0 0 8px var(--chip, #2080ff));
    z-index: 2;
}
.bt-tchip.dead { opacity: .15; filter: grayscale(1); transform: scale(.85); }
.bt-tchip-arrow {
    position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%);
    width: 0; height: 0; border: 4px solid transparent;
    border-bottom-color: var(--bt-gold);
    opacity: 0; transition: opacity .2s;
}
.bt-tchip.active .bt-tchip-arrow { opacity: 1; animation: btArrowBob .7s ease-in-out infinite; }
@keyframes btArrowBob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(2px); } }

/* ══ 3. 아레나 ══════════════════════════════════════════════ */
.bt-arena {
    flex: 1; min-height: 0; position: relative; overflow: hidden;
    background:
        radial-gradient(ellipse 120% 90% at 50% -20%, rgba(8,14,30,.85), transparent),
        #030610;
}
.bt-arena-bg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.bt-arena-fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 12; pointer-events: none; }

/* 가벼운 비네트만 (필름그레인 등 노이즈 제거) */
.bt-arena::after {
    content: ''; position: absolute; inset: 0; z-index: 13; pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 58%, rgba(0,0,8,.45) 100%);
}
#bt-fx-flash {
    position: absolute; inset: 0; z-index: 14; pointer-events: none; opacity: 0;
}
#bt-fx-danger {
    position: absolute; inset: 0; z-index: 14; pointer-events: none; opacity: 0;
    background: radial-gradient(ellipse at center, transparent 58%, rgba(255,0,40,.22) 100%);
    transition: opacity .5s;
}
#bt-fx-danger.on { opacity: 1; animation: btDanger 1.6s ease-in-out infinite; }
@keyframes btDanger { 0%,100% { opacity: .4; } 50% { opacity: 1; } }

/* 무대(셰이크 대상) */
.bt-stage {
    position: absolute; inset: 0; z-index: 5;
    display: grid; grid-template-columns: 1fr 1fr;
    align-items: end;
    padding: 24px 4vw 7%;
    will-change: transform;
}
.bt-stage.bt-chroma { animation: btChromaPulse .36s steps(3) 1; }
@keyframes btChromaPulse {
    0%   { filter: none; }
    25%  { filter: drop-shadow(2.5px 0 0 rgba(255,0,60,.6)) drop-shadow(-2.5px 0 0 rgba(0,220,255,.6)); }
    60%  { filter: drop-shadow(-1.5px 0 0 rgba(255,0,60,.4)) drop-shadow(1.5px 0 0 rgba(0,220,255,.4)); }
    100% { filter: none; }
}

.bt-combatant-col {
    display: flex; align-items: flex-end; justify-content: center;
    gap: clamp(12px, 2.2vw, 38px);
    min-width: 0;
}
.bt-combatant-col.ally  { padding-right: clamp(16px, 4vw, 70px); }
.bt-combatant-col.enemy { padding-left:  clamp(16px, 4vw, 70px); }

/* 중앙 분리선 + VS — 절제된 워터마크 */
.bt-vs {
    position: absolute; left: 50%; top: 36%; transform: translate(-50%,-50%);
    z-index: 4; pointer-events: none;
    font-family: var(--font-head); font-size: clamp(1.2rem, 2.4vw, 1.8rem);
    letter-spacing: .26em; padding-left: .26em;
    color: rgba(140,205,255,.12);
}
.bt-vs::before, .bt-vs::after {
    content: ''; position: absolute; left: 50%; width: 1px; height: 6vh;
    background: linear-gradient(180deg, transparent, rgba(140,205,255,.18), transparent);
}
.bt-vs::before { bottom: calc(100% + 12px); }
.bt-vs::after  { top: calc(100% + 12px); }

/* ══ 4. 유닛 — 홀로그램 투영체 ══════════════════════════════ */
.btc-card {
    --team: var(--bt-ally);
    position: relative;
    display: flex; flex-direction: column; align-items: center;
    width: clamp(120px, 15vw, 215px);
    transform-origin: bottom center;
    transition: transform .35s cubic-bezier(.34,1.45,.64,1), opacity .4s, filter .4s;
    animation: btIdle 4.2s ease-in-out infinite;   /* 홀로그램 부유 */
}
.btc-card.enemy { --team: var(--bt-enemy); animation-delay: -2.1s; }
.btc-card:nth-child(2) { animation-delay: -1.4s; }
.btc-card:nth-child(3) { animation-delay: -2.8s; }
@keyframes btIdle {
    0%,100% { translate: 0 0; }
    50%     { translate: 0 -4px; }
}
.btc-card.my-turn { transform: translateY(-12px) scale(1.04); z-index: 6; }
.btc-card.dimmed  { opacity: .5; filter: saturate(.5) brightness(.7); }
.btc-card[data-dead="true"] {
    opacity: .2; filter: grayscale(1) brightness(.5);
    animation: none; transform: translateY(6px) scale(.97);
}

/* ── 전개(투영) 애니메이션 — 별도 인트로를 대체 ── */
.btc-card.bt-deploy {
    animation: btDeploy .6s cubic-bezier(.22,.9,.3,1) both;
    animation-delay: calc(var(--di, 0) * 90ms + 140ms);
}
@keyframes btDeploy {
    0%   { opacity: 0; transform: translateY(10px) scaleY(.04); filter: brightness(3.2) saturate(.2); }
    42%  { opacity: 1; transform: translateY(-3px) scaleY(1.03); filter: brightness(1.9) saturate(.7); }
    58%  { filter: brightness(.85); }
    72%  { filter: brightness(1.5); }
    100% { opacity: 1; transform: none; filter: none; }
}

/* 베이스 이미터 — 유닛 발밑 투영 패드 */
.btc-base {
    position: absolute; left: 50%; bottom: -14px; z-index: 0;
    width: 118%; height: 30px; transform: translateX(-50%);
    pointer-events: none;
}
.btc-base::before {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    background: radial-gradient(ellipse at center,
        color-mix(in srgb, var(--team) 28%, transparent) 0%,
        color-mix(in srgb, var(--team) 8%, transparent) 45%,
        transparent 72%);
    opacity: .85;
}
.btc-base i {
    position: absolute; border-radius: 50%; border: 1px solid var(--team);
    pointer-events: none;
}
.btc-base i:nth-child(1) { inset: 4px 8%;  opacity: .4; }
.btc-base i:nth-child(2) { inset: 10px 26%; opacity: .22; }
.btc-card.my-turn .btc-base::before { opacity: 1; filter: brightness(1.4); }

/* 라이트 콘 — 베이스에서 위로 퍼지는 투영광 */
.btc-cone {
    position: absolute; left: 50%; bottom: 0; z-index: 0;
    width: 116%; height: 108%;
    transform: translateX(-50%);
    pointer-events: none;
    background: linear-gradient(0deg,
        color-mix(in srgb, var(--team) 13%, transparent) 0%,
        color-mix(in srgb, var(--team) 4%, transparent) 45%,
        transparent 80%);
    clip-path: polygon(38% 0, 62% 0, 96% 100%, 4% 100%);
    opacity: .55;
    transition: opacity .3s;
    animation: btCone 5s ease-in-out infinite;
}
.btc-card.enemy .btc-cone { animation-delay: -2.5s; }
@keyframes btCone { 0%,100% { opacity: .42; } 50% { opacity: .62; } }
.btc-card.my-turn .btc-cone { opacity: .9; animation: none; }
.btc-card[data-dead="true"] .btc-cone,
.btc-card[data-dead="true"] .btc-base { opacity: .12; animation: none; }

/* 발밑 액티브 링 (내 턴) */
.btc-ring {
    position: absolute; left: 50%; bottom: -16px;
    width: 126%; height: 36px; transform: translateX(-50%);
    pointer-events: none; opacity: 0; transition: opacity .3s;
}
.btc-card.my-turn .btc-ring { opacity: 1; }
.btc-ring::before, .btc-ring::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    border: 1px solid var(--team);
    box-shadow: 0 0 14px color-mix(in srgb, var(--team) 70%, transparent);
    animation: btRingSpin 6s linear infinite;
    mask: conic-gradient(#000 0 70deg, transparent 70deg 100deg, #000 100deg 250deg, transparent 250deg 290deg, #000 290deg);
}
.btc-ring::after {
    inset: 6px 16%; opacity: .55;
    animation-direction: reverse; animation-duration: 4s;
    mask: conic-gradient(transparent 0 40deg, #000 40deg 160deg, transparent 160deg 220deg, #000 220deg 340deg, transparent 340deg);
}
@keyframes btRingSpin { to { rotate: 360deg; } }

/* 초상 프레임 — 각진 클립 + 헤어라인 홀로 림 */
.btc-img-wrap {
    width: 100%; aspect-ratio: 3 / 4;
    position: relative; overflow: visible; z-index: 1;
    filter: drop-shadow(0 16px 28px rgba(0,0,10,.7));
}
.btc-frame-rim {
    position: absolute; inset: -1.5px; z-index: 0;
    clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
    background:
        conic-gradient(from var(--rim-a, 0deg),
            transparent 0 22%, color-mix(in srgb, var(--team) 80%, #fff) 27%, transparent 33%,
            transparent 55%, color-mix(in srgb, var(--team) 55%, transparent) 60%, transparent 66%);
    animation: btRim 6s linear infinite;
    opacity: .4; transition: opacity .3s;
}
@property --rim-a { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes btRim { to { --rim-a: 360deg; } }
.btc-card.my-turn .btc-frame-rim { opacity: .95; animation-duration: 2.6s; }
.btc-frame-in {
    position: absolute; inset: 0; z-index: 1; overflow: hidden;
    clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
    background: rgba(8,15,30,.55);
    border: 1px solid color-mix(in srgb, var(--team) 32%, transparent);
}
.btc-img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: top center; display: block;
    transition: filter .3s;
}
.btc-card.my-turn .btc-img { filter: brightness(1.08) contrast(1.03); }
.btc-img-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background:
        repeating-linear-gradient(45deg, transparent 0 12px, rgba(140,205,255,.04) 12px 13px),
        #0d1730;
    color: #3a4e72; font-size: 2.6rem;
}
/* 홀로 오버레이 — 스캔라인 + 시안 틴트 + 미세 플리커 */
.btc-holo {
    position: absolute; inset: 0; z-index: 2; pointer-events: none;
    background:
        repeating-linear-gradient(0deg,
            rgba(140,205,255,.045) 0 1px, transparent 1px 3px),
        linear-gradient(180deg,
            color-mix(in srgb, var(--team) 7%, transparent),
            transparent 30%, transparent 64%,
            rgba(3,6,16,.85));
    mix-blend-mode: normal;
    animation: btHoloFlicker 7s linear infinite;
}
@keyframes btHoloFlicker {
    0%, 100%       { opacity: 1; }
    92.0%, 92.6%   { opacity: 1; }
    92.3%          { opacity: .75; }
    96.4%, 96.9%   { opacity: 1; }
    96.6%          { opacity: .85; }
}
/* 스캔 시트 — 내 턴에만 천천히 한 줄 통과 */
.btc-frame-in::before {
    content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
    background: linear-gradient(180deg, transparent 0%, rgba(180,225,255,.1) 50%, transparent 100%);
    background-size: 100% 36%; background-repeat: no-repeat;
    background-position: 0 -50%;
    opacity: 0;
}
.btc-card.my-turn .btc-frame-in::before { opacity: 1; animation: btScanPass 3.2s ease-in-out infinite; }
@keyframes btScanPass {
    0%, 30%  { background-position: 0 -50%; }
    75%, 100% { background-position: 0 160%; }
}
/* 코너 브래킷 — 헤어라인 */
.btc-corner {
    position: absolute; width: 12px; height: 12px; z-index: 3;
    border: 1px solid var(--team); opacity: .8;
    transition: all .25s;
}
.btc-corner.tl { top: -3px; left: -3px; border-right: 0; border-bottom: 0; }
.btc-corner.tr { top: -3px; right: -3px; border-left: 0; border-bottom: 0; }
.btc-corner.bl { bottom: -3px; left: -3px; border-right: 0; border-top: 0; }
.btc-corner.br { bottom: -3px; right: -3px; border-left: 0; border-top: 0; }
.btc-card.my-turn .btc-corner { width: 17px; height: 17px; box-shadow: 0 0 7px color-mix(in srgb, var(--team) 80%, transparent); }

/* 사망 — 신호 소실 */
.btc-dead-overlay {
    position: absolute; inset: 0; z-index: 4;
    clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
    background:
        repeating-linear-gradient(0deg, rgba(140,205,255,.02) 0 1px, transparent 1px 4px),
        rgba(2,4,10,.78);
    display: flex; flex-direction: column; gap: 5px;
    align-items: center; justify-content: center;
    font-size: 1.8rem; color: #4a5a7a;
    opacity: 0; transition: opacity .5s .25s; pointer-events: none;
}
.btc-dead-overlay::after {
    content: 'SIGNAL LOST'; font-family: var(--font-mono); font-size: .56rem;
    letter-spacing: .3em; padding-left: .3em; color: #ff3355;
    text-shadow: 0 0 10px rgba(255,51,85,.5);
}
.btc-card[data-dead="true"] .btc-dead-overlay { opacity: 1; }

/* 행동 중 태그 */
.btc-turn-crown {
    position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
    z-index: 5; white-space: nowrap;
    font-family: var(--font-mono); font-size: .54rem; letter-spacing: .24em;
    text-transform: uppercase; color: #04070f; font-weight: 700;
    background: var(--bt-gold); padding: 3px 12px;
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
    box-shadow: 0 0 14px rgba(255,209,102,.45);
    animation: btCrownIn .3s cubic-bezier(.34,1.6,.64,1);
}
@keyframes btCrownIn { from { transform: translateX(-50%) translateY(-8px); opacity: 0; } }

/* 타겟팅 — 플레이어 턴에 적 카드 클릭 가능 */
.btc-card.targetable { cursor: pointer; }
.btc-card.targetable:hover { transform: translateY(-6px) scale(1.03); }
.btc-reticle {
    position: absolute; inset: -10px; z-index: 7; pointer-events: none;
    opacity: 0; transition: opacity .15s;
}
.btc-card.targetable:hover .btc-reticle { opacity: 1; }
.btc-reticle span {
    position: absolute; width: 15px; height: 15px;
    border: 1.5px solid var(--bt-gold);
    filter: drop-shadow(0 0 5px rgba(255,209,102,.7));
    animation: btReticle .9s ease-in-out infinite;
}
.btc-reticle span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.btc-reticle span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.btc-reticle span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.btc-reticle span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
@keyframes btReticle { 0%,100% { margin: 0; } 50% { margin: 3px; } }

/* ── 네임플레이트 — 부유하는 헤어라인 플레이트 ── */
.btc-info {
    width: 104%; margin-top: 10px; position: relative; z-index: 5;
    background: linear-gradient(180deg, rgba(10,18,37,.72), rgba(6,11,22,.82));
    backdrop-filter: blur(8px);
    border: 1px solid color-mix(in srgb, var(--team) 22%, transparent);
    border-top: 1.5px solid var(--team);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
    padding: 7px 11px 9px;
    display: flex; flex-direction: column; gap: 5px;
    box-shadow: 0 8px 22px rgba(0,0,10,.5);
}
.btc-name {
    display: flex; align-items: center; gap: 6px;
    font-family: var(--font-cond); font-size: .88rem; font-weight: 600;
    letter-spacing: .05em; line-height: 1;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.btc-name::before {
    content: '◆'; font-size: .46rem; color: var(--team); flex-shrink: 0;
    text-shadow: 0 0 6px var(--team);
}
/* HP 바 — 즉시 하락 + 고스트 지연 바 */
.btc-hp-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.btc-hp-label {
    font-family: var(--font-mono); font-size: .5rem; letter-spacing: .24em;
    color: rgba(140,205,255,.35);
}
.btc-stat-num {
    font-family: var(--font-mono); font-size: .62rem; color: #7a90c0;
    white-space: nowrap; font-variant-numeric: tabular-nums;
}
.btc-stat-num b { color: #eef2ff; font-weight: 500; }
.btc-stat-track {
    position: relative; height: 6px; overflow: hidden;
    background: rgba(0,0,0,.5);
    clip-path: polygon(0 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
    border: 1px solid rgba(255,255,255,.06);
}
/* 세그먼트 눈금 */
.btc-stat-track::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(0,0,10,.75) calc(10% - 1px) 10%);
}
.btc-stat-ghost {
    position: absolute; inset: 0 auto 0 0; width: 100%;
    background: rgba(255,232,160,.8);
    transition: width .55s cubic-bezier(.2,0,.2,1) .28s;
}
.btc-stat-fill {
    position: absolute; inset: 0 auto 0 0; width: 100%;
    background: linear-gradient(90deg, #00c46a, #00f5a0);
    transition: width .18s ease-out, background .4s;
    box-shadow: 0 0 7px rgba(0,245,160,.35);
}
.btc-stat-fill.mid { background: linear-gradient(90deg, #cc8400, #ffb830); box-shadow: 0 0 7px rgba(255,184,48,.35); }
.btc-stat-fill.low {
    background: linear-gradient(90deg, #cc0030, #ff3355);
    box-shadow: 0 0 9px rgba(255,51,85,.5);
    animation: btHpLow .8s ease-in-out infinite;
}
@keyframes btHpLow { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.5); } }
.btc-status {
    font-family: var(--font-mono); font-size: .54rem; letter-spacing: .14em;
    min-height: 12px; line-height: 12px; text-transform: uppercase;
    color: rgba(140,205,255,.3); display: flex; align-items: center; gap: 5px;
}
.btc-status.acting { color: var(--bt-gold); }
.btc-status.dead   { color: #ff3355; }
.btc-status.defend { color: #7ab8ff; }

/* ── 데미지 넘버 ── */
.bt-dmgnum {
    position: absolute; z-index: 20; pointer-events: none;
    transform: translateX(-50%);
    font-family: var(--font-head); line-height: 1;
    animation: btDmgArc 1.05s cubic-bezier(.16,.9,.35,1) forwards;
    white-space: nowrap;
}
.bt-dmgnum.dmg {
    font-size: clamp(1.7rem, 2.8vw, 2.4rem); color: #fff;
    text-shadow: 0 0 4px #ff3355, 0 0 16px rgba(255,51,85,.8), 0 3px 10px rgba(0,0,0,.8);
}
.bt-dmgnum.crit {
    font-size: clamp(2.3rem, 4vw, 3.4rem); color: var(--bt-gold);
    text-shadow: 0 0 6px #ff7700, 0 0 24px rgba(255,85,0,.8), 0 4px 14px rgba(0,0,0,.85);
    animation: btDmgCrit 1.1s cubic-bezier(.16,.9,.35,1) forwards;
}
.bt-dmgnum.crit::after {
    content: 'CRITICAL'; display: block; text-align: center;
    font-family: var(--font-mono); font-size: .52rem; letter-spacing: .42em;
    padding-left: .42em; color: #ffb866; margin-top: 3px;
}
.bt-dmgnum.miss {
    font-size: 1.15rem; color: #9bb4e8; letter-spacing: .22em;
    font-family: var(--font-cond); font-weight: 600;
    text-shadow: 0 0 12px rgba(120,170,255,.65), 0 2px 8px rgba(0,0,0,.8);
}
.bt-dmgnum.guard {
    font-size: 1.35rem; color: #7ab8ff;
    text-shadow: 0 0 14px rgba(32,128,255,.7), 0 2px 8px rgba(0,0,0,.8);
}
@keyframes btDmgArc {
    0%   { opacity: 0; translate: 0 14px; scale: .5; }
    12%  { opacity: 1; scale: 1.35; }
    30%  { scale: 1; }
    75%  { opacity: 1; }
    100% { opacity: 0; translate: var(--drift, 0px) -70px; scale: .9; }
}
@keyframes btDmgCrit {
    0%   { opacity: 0; translate: 0 18px; scale: .4; rotate: -6deg; }
    10%  { opacity: 1; scale: 1.55; rotate: 2deg; }
    24%  { scale: 1.05; rotate: 0deg; }
    78%  { opacity: 1; }
    100% { opacity: 0; translate: var(--drift, 0px) -86px; scale: .92; }
}

/* ── 전투 액션 애니메이션 ── */
@keyframes btLungeR {
    0%   { translate: 0 0; }
    22%  { translate: -13px 0; }                        /* 예비 동작 */
    46%  { translate: clamp(40px, 5vw, 88px) -6px; }    /* 돌진 */
    72%  { translate: clamp(30px, 4vw, 68px) -4px; }
    100% { translate: 0 0; }
}
@keyframes btLungeL {
    0%   { translate: 0 0; }
    22%  { translate: 13px 0; }
    46%  { translate: clamp(-88px, -5vw, -40px) -6px; }
    72%  { translate: clamp(-68px, -4vw, -30px) -4px; }
    100% { translate: 0 0; }
}
.bt-anim-attack       { animation: btLungeR .62s cubic-bezier(.3,.1,.2,1); z-index: 8; }
.btc-card.enemy.bt-anim-attack { animation-name: btLungeL; }

@keyframes btHit {
    0%   { translate: 0 0; filter: brightness(1); }
    8%   { translate: -14px 0; filter: brightness(2.8) saturate(.25) drop-shadow(0 0 16px #fff); }
    24%  { translate: 11px 0;  filter: brightness(1.7); }
    42%  { translate: -7px 0;  filter: brightness(1.3); }
    62%  { translate: 5px 0; }
    82%  { translate: -2px 0; }
    100% { translate: 0 0; filter: brightness(1); }
}
.bt-anim-hit { animation: btHit .55s ease-out; }
.btc-card.enemy.bt-anim-hit { animation-direction: reverse; }

@keyframes btDodgeR {
    0%,100% { translate: 0 0; opacity: 1; }
    30% { translate: 40px -4px; opacity: .35; }
    55% { translate: 32px -2px; opacity: .8; }
}
@keyframes btDodgeL {
    0%,100% { translate: 0 0; opacity: 1; }
    30% { translate: -40px -4px; opacity: .35; }
    55% { translate: -32px -2px; opacity: .8; }
}
.bt-anim-dodge { animation: btDodgeR .5s ease-out; }
.btc-card.enemy.bt-anim-dodge { animation-name: btDodgeL; }
/* 잔상 클론 */
.bt-afterimage {
    position: absolute; pointer-events: none; z-index: 4;
    opacity: .45; filter: saturate(0) brightness(1.6) blur(1px) drop-shadow(0 0 10px var(--team, #8ccdff));
    animation: btAfter .45s ease-out forwards;
}
@keyframes btAfter { to { opacity: 0; scale: .97; } }

/* 사망 — 홀로그램 신호 붕괴 (수직 압축 + 채도 붕괴) */
@keyframes btDying {
    0%   { filter: brightness(1); }
    10%  { filter: brightness(3.4) saturate(0); }
    26%  { filter: brightness(.85) saturate(1.6) hue-rotate(-24deg); translate: -3px 0; }
    40%  { translate: 3px 0; filter: brightness(1.6) saturate(.4); }
    55%  { transform: scaleY(.96); }
    100% { filter: grayscale(1) brightness(.35); translate: 0 5px; }
}
.bt-anim-dying { animation: btDying .9s ease-out forwards; }

@keyframes btSpin { to { transform: rotate(360deg); } }
.bt-spin { display: inline-block; animation: btSpin .8s linear infinite; }

/* ══ 5. 하단 도크 — 로그 + 커맨드 (글래스) ══════════════════ */
.bt-dock {
    flex-shrink: 0; position: relative; z-index: 30;
    display: grid; grid-template-columns: minmax(0,1fr) minmax(330px, 420px);
    height: 192px;
    background: linear-gradient(0deg, rgba(4,8,18,.92), rgba(7,13,26,.78));
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--bt-line);
}
.bt-dock::before {
    content: ''; position: absolute; top: -1px; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(140,205,255,.5), transparent);
    opacity: .5;
}

/* 로그 터미널 */
.bt-pop-log-wrap {
    display: flex; flex-direction: column; min-width: 0;
    padding: 10px 18px 12px;
    border-right: 1px solid rgba(140,205,255,.1);
}
.bt-pop-log-hd {
    display: flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: .54rem; letter-spacing: .28em;
    color: rgba(140,205,255,.35); text-transform: uppercase;
    margin-bottom: 6px; flex-shrink: 0;
}
.bt-pop-log-hd::before {
    content: ''; width: 5px; height: 5px; border-radius: 50%;
    background: #00f5a0; box-shadow: 0 0 7px #00f5a0;
    animation: btDot 1.8s ease-in-out infinite;
}
@keyframes btDot { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.bt-pop-log {
    flex: 1; overflow-y: auto; display: flex; flex-direction: column;
    gap: 2px; scrollbar-width: thin; scrollbar-color: rgba(140,205,255,.25) transparent;
    mask: linear-gradient(180deg, transparent 0, #000 14px);
}
.btp-log-line {
    font-size: .68rem; line-height: 1.65; font-family: var(--font-mono);
    color: #5a6f9a; letter-spacing: .01em;
    animation: btLogIn .25s ease-out;
}
@keyframes btLogIn { from { opacity: 0; translate: -8px 0; } }
.btp-log-system { color: var(--accent2, #00e0ff); }
.btp-log-turn   { color: #9bb4e8; font-weight: 500; margin-top: 3px; }
.btp-log-death  { color: #ff3355; font-weight: 500; }
.btp-log-action { color: #aebede; }
.btp-log-info   { color: #46587e; }

/* 커맨드 콘솔 */
.bt-pop-panel {
    display: flex; flex-direction: column; justify-content: center;
    padding: 12px 18px; gap: 8px; overflow-y: auto;
    background:
        linear-gradient(135deg, rgba(140,205,255,.03), transparent 40%),
        rgba(10,18,37,.35);
}
.bt-panel-label {
    font-family: var(--font-mono); font-size: .54rem;
    letter-spacing: .3em; text-transform: uppercase;
    color: rgba(140,205,255,.35); display: flex; align-items: center; gap: 6px;
}
.bt-panel-label i { color: var(--bt-gold); }
.bt-panel-who {
    font-family: var(--font-cond); font-size: .95rem; color: #9bb4e8;
    letter-spacing: .03em;
}
.bt-panel-who span { font-weight: 600; }
.bt-panel-atk-list {
    display: flex; flex-direction: column; gap: 6px;
    max-height: 86px; overflow-y: auto; scrollbar-width: thin;
}
.bt-panel-sub-row { display: flex; gap: 6px; }
.bt-panel-btn {
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; width: 100%;
    font-family: var(--font-cond); font-size: .92rem; font-weight: 600;
    letter-spacing: .07em; cursor: pointer;
    color: #9bb4e8;
    background: rgba(13,23,44,.6);
    border: 1px solid rgba(140,205,255,.14);
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
    transition: all .14s ease-out;
}
.bt-panel-btn::before {
    content: ''; position: absolute; inset: 0 auto 0 0; width: 2px;
    background: currentColor; opacity: .5;
}
.bt-panel-btn::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.1) 48%, transparent 60%);
    translate: -110% 0; transition: translate .4s ease;
}
.bt-panel-btn:hover::after { translate: 110% 0; }
.bt-panel-btn:hover { color: #eef2ff; border-color: rgba(140,205,255,.45); transform: translateX(3px); }
.bt-panel-btn:active { transform: translateX(3px) scale(.97); }
.bt-panel-btn i { font-size: 1.05rem; flex-shrink: 0; }
.bt-panel-btn .key {
    margin-left: auto; font-family: var(--font-mono); font-size: .54rem;
    color: #46587e; border: 1px solid rgba(70,88,126,.55);
    padding: 1px 6px; letter-spacing: .05em;
}
.bt-panel-btn.atk {
    color: #ff8095; border-color: rgba(255,51,85,.3);
    background: linear-gradient(110deg, rgba(255,51,85,.09), rgba(13,23,44,.6) 55%);
}
.bt-panel-btn.atk:hover { border-color: #ff3355; color: #ffccd5; box-shadow: 0 0 16px rgba(255,51,85,.18); }
.bt-panel-btn.def {
    flex: 1; color: #7ab8ff; border-color: rgba(32,128,255,.3);
    background: linear-gradient(110deg, rgba(32,128,255,.09), rgba(13,23,44,.6) 55%);
}
.bt-panel-btn.def:hover { border-color: var(--bt-ally); box-shadow: 0 0 16px rgba(32,128,255,.18); }
.bt-panel-btn.flee { flex: 1; font-size: .82rem; color: #7a90c0; }
.bt-panel-waiting {
    font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em;
    color: #46587e; text-align: center;
    display: flex; align-items: center; justify-content: center;
    gap: 10px; height: 100%;
}
.bt-panel-end {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 8px; height: 100%;
}
.bt-panel-end-title {
    font-family: var(--font-head); font-size: 2rem; letter-spacing: .2em;
    padding-left: .2em;
    animation: btEndIn .5s cubic-bezier(.2,1.4,.4,1);
}
@keyframes btEndIn { from { scale: 2; opacity: 0; filter: blur(6px); } }
.bt-panel-end-sub { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .16em; color: #5a6f9a; }

/* ══ 6. 베팅 드로어 — 글래스 ════════════════════════════════ */
.bt-bet-tab {
    position: absolute; top: 50%; z-index: 32;
    translate: 0 -50%;
    writing-mode: vertical-rl; text-orientation: mixed;
    font-family: var(--font-mono); font-size: .56rem; letter-spacing: .32em;
    text-transform: uppercase; cursor: pointer;
    padding: 14px 5px; color: #5a6f9a;
    background: rgba(8,15,30,.78);
    backdrop-filter: blur(6px);
    border: 1px solid var(--bt-line);
    transition: all .2s;
    user-select: none;
}
.bt-bet-tab:hover { color: #eef2ff; background: rgba(140,205,255,.1); }
.bt-bet-tab.left  { left: 0;  border-left: 0;  clip-path: polygon(0 0, 100% 8px, 100% calc(100% - 8px), 0 100%); }
.bt-bet-tab.right { right: 0; border-right: 0; clip-path: polygon(0 8px, 100% 0, 100% 100%, 0 calc(100% - 8px)); }

.bt-bet-panel {
    position: absolute; top: 12px; bottom: 12px; z-index: 31;
    width: 232px; display: flex; flex-direction: column;
    padding: 18px 16px;
    background: rgba(6,12,24,.88);
    backdrop-filter: blur(10px);
    transition: translate .35s cubic-bezier(.3,1,.3,1);
    overflow-y: auto; scrollbar-width: thin;
}
.bt-bet-panel.left  { left: 0;  border-right: 1px solid rgba(32,128,255,.22); translate: -100% 0; }
.bt-bet-panel.right { right: 0; border-left: 1px solid rgba(255,51,85,.22);  translate: 100% 0; }
.bt-bet-panel.open  { translate: 0 0; box-shadow: 0 0 50px rgba(0,0,10,.7); }

.bt-bet-panel-title {
    font-family: var(--font-mono); font-size: .56rem;
    letter-spacing: .24em; text-transform: uppercase;
    color: rgba(140,205,255,.35); margin-bottom: 12px;
    display: flex; align-items: center; gap: 6px;
}
.bt-bet-panel-title i { color: var(--bt-gold); }
.bt-bet-close {
    margin-left: auto; cursor: pointer; color: #5a6f9a; background: none; border: 0;
    font-size: .8rem; padding: 2px;
}
.bt-bet-close:hover { color: #fff; }
.bt-bet-who {
    font-family: var(--font-cond); font-size: .9rem; font-weight: 600;
    margin-bottom: 10px; display: flex; align-items: center; gap: 7px;
    letter-spacing: .04em;
}
.bt-bet-who-dot { width: 8px; height: 8px; flex-shrink: 0; rotate: 45deg; }
.bt-bet-input-row { display: flex; gap: 6px; margin-bottom: 10px; }
.bt-bet-input {
    flex: 1; min-width: 0; padding: 7px 9px;
    background: rgba(0,0,0,.45); border: 1px solid rgba(140,205,255,.2);
    color: #eef2ff; font-size: .74rem; font-family: var(--font-mono);
    clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}
.bt-bet-input:focus { outline: none; border-color: var(--bt-gold); }
.bt-bet-btn {
    padding: 7px 12px; cursor: pointer; white-space: nowrap;
    background: rgba(255,209,102,.08); border: 1px solid rgba(255,209,102,.4);
    color: var(--bt-gold); font-size: .68rem;
    font-family: var(--font-mono); letter-spacing: .08em;
    clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
    transition: all .15s;
}
.bt-bet-btn:hover { background: var(--bt-gold); color: #04070f; }
.bt-bet-divider { height: 1px; background: rgba(140,205,255,.1); margin: 10px 0; }
.bt-bet-list-label {
    font-family: var(--font-mono); font-size: .52rem; letter-spacing: .22em;
    color: rgba(140,205,255,.3); text-transform: uppercase; margin-bottom: 6px;
}
.bt-bet-list { display: flex; flex-direction: column; gap: 4px; }
.bt-bet-entry {
    display: flex; justify-content: space-between; align-items: center;
    font-size: .64rem; font-family: var(--font-mono);
    color: #7a90c0; padding: 3px 0;
    border-bottom: 1px solid rgba(140,205,255,.06);
}
.bt-bet-entry-amt { color: var(--bt-gold); }
.bt-bet-empty { font-size: .6rem; font-family: var(--font-mono); color: #46587e; text-align: center; padding: 8px 0; }
.bt-bet-pool-total {
    margin-top: auto; padding-top: 12px;
    font-family: var(--font-mono); font-size: .64rem;
    color: #5a6f9a; border-top: 1px dashed rgba(140,205,255,.16);
}
.bt-bet-pool-total span { color: var(--bt-gold); }

/* ══ 7. 중앙 배너 (웨이브/승패) ═════════════════════════════ */
.bt-banner {
    position: absolute; left: 0; right: 0; top: 33%; z-index: 22;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    pointer-events: none;
    animation: btBannerLife 1.5s cubic-bezier(.2,.8,.3,1) forwards;
}
.bt-banner-line {
    width: min(560px, 70%); height: 1px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
}
.bt-banner-main {
    font-family: var(--font-head); font-size: clamp(1.7rem, 4.2vw, 3rem);
    letter-spacing: .28em; line-height: 1.1; padding-left: .28em;
    color: #fff;
}
.bt-banner-sub {
    font-family: var(--font-mono); font-size: .58rem; letter-spacing: .44em;
    text-transform: uppercase; padding-left: .44em;
}
.bt-banner.gold  { color: var(--bt-gold);  } .bt-banner.gold  .bt-banner-main { text-shadow: 0 0 22px rgba(255,209,102,.6); }
.bt-banner.red   { color: var(--bt-enemy); } .bt-banner.red   .bt-banner-main { text-shadow: 0 0 22px rgba(255,51,85,.6); }
.bt-banner.blue  { color: var(--bt-ally);  } .bt-banner.blue  .bt-banner-main { text-shadow: 0 0 22px rgba(32,128,255,.6); }
@keyframes btBannerLife {
    0%   { opacity: 0; transform: scaleX(.5); filter: blur(8px); }
    14%  { opacity: 1; transform: scaleX(1.015); filter: blur(0); }
    20%  { transform: scaleX(1); }
    78%  { opacity: 1; }
    100% { opacity: 0; transform: scaleX(1.04) translateY(-8px); }
}

/* ══ 8. 반응형 ══════════════════════════════════════════════ */
@media (max-width: 980px) {
    .bt-dock { grid-template-columns: minmax(0,1fr) minmax(280px, 340px); }
}
@media (max-width: 760px) {
    .bt-hud { height: 44px; }
    .bt-hud-block { padding: 0 12px; }
    .bt-hud-main { font-size: .95rem; }
    .bt-hud-kicker { display: none; }
    .bt-turnrail { height: 48px; padding: 0 12px; gap: 8px; }
    .bt-tchip { width: 30px; height: 30px; }
    .bt-stage { padding: 14px 3vw 9%; }
    .btc-card { width: clamp(86px, 24vw, 130px); }
    .btc-info { padding: 5px 8px 7px; }
    .btc-name { font-size: .74rem; }
    .bt-dock { grid-template-columns: 1fr; height: auto; max-height: 46vh; }
    .bt-pop-log-wrap { height: 92px; border-right: 0; border-bottom: 1px solid rgba(140,205,255,.1); }
    .bt-pop-panel { padding: 10px 14px 14px; }
    .bt-panel-atk-list { max-height: 96px; }
    .bt-bet-tab { display: none; }
    .bt-bet-panel { width: min(80vw, 280px); }
    .bt-vs { top: 30%; }
}
