/* ===== バトル画面：大型立ち絵・UI前面固定版 ===== */

/* 立ち絵はカードUIより前面に置き、入力は背後のカードへ通す */
.battle-character.has-large-battle-art {
    overflow: visible !important;
    background-size: contain !important;
    filter:
        drop-shadow(0 12px 16px rgba(0,0,0,.72))
        drop-shadow(0 0 8px var(--char-glow)) !important;
    transition: filter .16s ease, transform .16s ease !important;
}

.battle-character.has-large-battle-art::before,
.battle-character.has-large-battle-art .battle-character-mark {
    display: none !important;
}

.battle-character.has-large-battle-art .battle-character-name {
    display: none !important;
}

/* 自分側：顔が画面内に残るよう、上寄せではなく人物全体を左下へ配置 */
#player-battle-character.has-large-battle-art {
    left: -5vw !important;
    right: auto !important;
    top: 4vh !important;
    bottom: auto !important;
    width: min(39vw, 500px) !important;
    height: min(68vh, 720px) !important;
    transform: none !important;
    background-position: left 8% top 0% !important;
}

/* 相手側：顔を見切れさせず、右上から中央寄りに表示 */
#opponent-battle-character.has-large-battle-art {
    right: -4vw !important;
    left: auto !important;
    top: 8vh !important;
    bottom: auto !important;
    width: min(38vw, 490px) !important;
    height: min(66vh, 700px) !important;
    transform: none !important;
    background-position: right 7% top 0% !important;
}

#player-battle-character.has-large-battle-art:active,
#opponent-battle-character.has-large-battle-art:active {
    transform: scale(.985) !important;
}

/* ===== すべてのUIを立ち絵より前面へ ===== */
#phase-bar,
#revolution-status,
#turn-indicator,
#battle-log,
#game-log,
#player-field,
#opponent-field,
#hand-zone,
#player-graveyard,
#opp-graveyard,
#player-slash-zone,
#opp-slash-zone,
#player-deck,
#opp-deck,
#player-life,
#opponent-life,
#player-chain-menu,
#counter-menu,
#chain-hand-controls,
.action-buttons,
.field-area,
.player-area,
.opponent-area,
.card,
button,
.menu-button,
.log-button {
    position: relative;
    z-index: 40 !important;
}

/* 能力画面・モーダル・メニューは最前面 */
#character-ability-overlay,
#character-detail-modal,
#title-screen,
#home-screen,
#character-select-screen,
.modal,
.overlay {
    z-index: 600 !important;
}

/* 中央の場と手札には薄い背景を置き、立ち絵と重なっても読めるようにする */
#player-field,
#opponent-field,
#hand-zone,
.action-buttons {
    isolation: isolate;
}

#player-field::before,
#opponent-field::before,
#hand-zone::before {
    content: "";
    position: absolute;
    inset: -4px;
    z-index: -1;
    border-radius: 10px;
    background: rgba(0,0,0,.16);
    pointer-events: none;
}

/* スマホ */
@media (max-width: 700px) {
    #player-battle-character.has-large-battle-art {
        left: -15vw !important;
        top: 11vh !important;
        width: 62vw !important;
        height: 53vh !important;
        background-position: left top !important;
        opacity: .92;
    }

    #opponent-battle-character.has-large-battle-art {
        right: -15vw !important;
        top: 8vh !important;
        width: 60vw !important;
        height: 48vh !important;
        background-position: right top !important;
        opacity: .92;
    }
}

/* 狭いスマホ */
@media (max-width: 390px) {
    #player-battle-character.has-large-battle-art {
        left: -18vw !important;
        top: 13vh !important;
        width: 64vw !important;
        height: 49vh !important;
    }

    #opponent-battle-character.has-large-battle-art {
        right: -18vw !important;
        top: 9vh !important;
        width: 62vw !important;
        height: 45vh !important;
    }
}
