/* ==========================================================================
   Hero Up - 1v1 单首领大型战术对决竞技场样式 (arena.css)
   ========================================================================== */

/* 核心对决舞台视口扩展 */
#arena-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 520px;
    height: 100%;
    max-height: 640px;
    padding: 6px 8px;
    box-sizing: border-box;
    position: relative;
    user-select: none;
}

/* 顶部首领史诗血量条与意图前摇横幅 (Boss Status Header) */
.boss-banner {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.9) 100%);
    border: 1.5px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(220, 38, 38, 0.2);
    margin-bottom: 6px;
    flex-shrink: 0;
}

.boss-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.boss-name-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.boss-name {
    font-size: 0.92rem;
    font-weight: 900;
    color: #f87171;
    letter-spacing: 0.02em;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.boss-badge-title {
    font-size: 0.68rem;
    color: #cbd5e1;
    background: rgba(0, 0, 0, 0.4);
    padding: 1px 6px;
    border-radius: var(--radius-full);
}

/* 首领当前招式意图前摇指示器 (Telegraph Intent Pill) */
.boss-intent-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 800;
    background: rgba(220, 38, 38, 0.25);
    border: 1px solid #ef4444;
    color: #fef2f2;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
    animation: pulseTelegraphPill 1.5s infinite ease-in-out;
}

.boss-intent-pill.stunned {
    background: rgba(234, 179, 8, 0.25);
    border-color: #eab308;
    color: #fef08a;
    box-shadow: 0 0 8px rgba(234, 179, 8, 0.6);
    animation: pulseStunnedPill 1.2s infinite ease-in-out;
}

@keyframes pulseTelegraphPill {
    0%, 100% { transform: scale(1); box-shadow: 0 0 6px rgba(239, 68, 68, 0.5); }
    50% { transform: scale(1.05); box-shadow: 0 0 14px rgba(239, 68, 68, 0.9); }
}

@keyframes pulseStunnedPill {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); filter: brightness(1.2); }
}

/* 分段式首领血条 */
.boss-hp-track {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.boss-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc2626 0%, #ef4444 60%, #f87171 100%);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
    transition: width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 核心 6x6 大型战术棋盘场地 (Tactical 6x6 Battle Arena) */
.arena-board {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 4px;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-height: 440px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.98) 100%);
    border: 3px solid #475569;
    border-radius: 12px;
    padding: 6px;
    box-sizing: border-box;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7), inset 0 0 24px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
}

/* 战术地砖 (Arena Tile) */
.arena-tile {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 41, 59, 0.65);
    border: 1px solid rgba(100, 116, 139, 0.25);
    border-radius: 6px;
    cursor: default;
    transition: all 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-sizing: border-box;
}

/* 危险前摇预警红区 (Red Danger Zone Overlay) */
.arena-tile.danger-zone {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.45) 0%, rgba(185, 28, 28, 0.7) 100%) !important;
    border: 1.5px solid #ef4444 !important;
    box-shadow: inset 0 0 14px rgba(239, 68, 68, 0.75), 0 0 10px rgba(239, 68, 68, 0.5);
    animation: dangerPulsing 1.4s infinite ease-in-out;
}

@keyframes dangerPulsing {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; filter: drop-shadow(0 0 6px #ef4444); }
}

/* 可移动候选绿圈 (Valid Move Tile) */
.arena-tile.valid-move {
    cursor: pointer;
    border: 1.5px solid #10b981 !important;
    box-shadow: inset 0 0 12px rgba(16, 185, 129, 0.4);
}

.arena-tile.valid-move::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #10b981;
    border-radius: var(--radius-full);
    opacity: 0.75;
    box-shadow: 0 0 10px #10b981;
    animation: moveCirclePop 1.2s infinite alternate ease-in-out;
}

@keyframes moveCirclePop {
    0% { transform: scale(0.8); opacity: 0.6; }
    100% { transform: scale(1.15); opacity: 0.95; }
}

.arena-tile.valid-move:hover {
    background: rgba(16, 185, 129, 0.35);
    transform: scale(1.03);
    z-index: 10;
}

/* 可近战攻击高亮 (Attack Target Tile) */
.arena-tile.valid-attack {
    cursor: pointer;
    border: 2px solid #f59e0b !important;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.8), inset 0 0 12px rgba(245, 158, 11, 0.4);
    animation: attackTileGlow 1.2s infinite ease-in-out;
}

@keyframes attackTileGlow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

/* 可交互机关高亮 (Interactive Machine Tile) */
.arena-tile.valid-interact {
    cursor: pointer;
    border: 2px solid #38bdf8 !important;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.8), inset 0 0 12px rgba(56, 189, 248, 0.4);
    animation: interactTileGlow 1.2s infinite ease-in-out;
}

@keyframes interactTileGlow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 棋盘实体与道具容器 */
.tile-entity {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* 勇者精灵 (Hero Sprite) */
.hero-sprite {
    width: 82%;
    height: 82%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.6));
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 首领巨像精灵 (Boss Sprite) */
.boss-sprite {
    width: 90%;
    height: 90%;
    filter: drop-shadow(0 6px 14px rgba(220, 38, 38, 0.5));
    transition: transform 0.2s ease;
}

.boss-sprite.stunned {
    filter: drop-shadow(0 0 12px #eab308) grayscale(40%);
    animation: bossStunWobble 0.6s infinite alternate ease-in-out;
}

@keyframes bossStunWobble {
    0% { transform: rotate(-4deg); }
    100% { transform: rotate(4deg); }
}

/* 眩晕星环指示器 (Stun Indicator) */
.stun-stars-overlay {
    position: absolute;
    top: -4px;
    font-size: 0.85rem;
    animation: spinStars 2s linear infinite;
}

@keyframes spinStars {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 弱点背刺徽标 (Weak Spot Marker) */
.weak-spot-marker {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #eab308;
    color: #000;
    font-size: 0.62rem;
    font-weight: 900;
    padding: 1px 4px;
    border-radius: var(--radius-full);
    box-shadow: 0 0 8px #eab308;
    animation: bounceWeakSpot 0.8s infinite alternate ease-in-out;
}

@keyframes bounceWeakSpot {
    0% { transform: translateY(0); }
    100% { transform: translateY(-3px); }
}

/* 战场道具：远古石柱 (Ancient Pillar) */
.prop-pillar {
    width: 80%;
    height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.65));
}

/* 战场道具：攻城破甲重弩 (Siege Ballista) */
.prop-ballista {
    width: 85%;
    height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 10px rgba(56, 189, 248, 0.6));
    animation: ballistaReady 2s infinite ease-in-out;
}

@keyframes ballistaReady {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 战场道具：爆裂火药桶 (Explosive Barrel) */
.prop-barrel {
    width: 80%;
    height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 4px 8px rgba(239, 68, 68, 0.7));
}

/* 战场道具：战能符文圣泉 (Rune Altar) */
.prop-rune {
    width: 75%;
    height: 75%;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 10px rgba(52, 211, 153, 0.8));
    animation: runePulse 1.6s infinite alternate ease-in-out;
}

@keyframes runePulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    100% { transform: scale(1.1); opacity: 1; }
}

/* 底部勇者状态栏与战术控制面板 (Hero Tactical Control Panel) */
.arena-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.92) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    margin-top: 6px;
    flex-shrink: 0;
}

/* 勇者生命爱心槽 (Hearts Container) */
.hero-hearts-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.heart-unit {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.heart-unit.lost {
    opacity: 0.25;
    filter: grayscale(100%);
}

/* 战术行动力点数 (Action Points AP Beads) */
.hero-ap-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ap-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: #94a3b8;
}

.ap-bead {
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    border: 1px solid #7dd3fc;
    border-radius: var(--radius-full);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
    transition: all 0.2s ease;
}

.ap-bead.spent {
    background: rgba(51, 65, 85, 0.6);
    border-color: rgba(148, 163, 184, 0.3);
    box-shadow: none;
}

/* 战术操作按钮组 (遵守规则：无黑色按钮，采用红底 #c0392b) */
.arena-btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-end-turn {
    background: linear-gradient(135deg, #c0392b 0%, #991b1b 100%) !important;
    color: #ffffff !important;
    border: 1.5px solid #ef4444 !important;
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(192, 57, 43, 0.5);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-end-turn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.7);
}

.btn-end-turn:active {
    transform: scale(0.95);
}

/* 移动端与短屏深度响应式排版 */
@media (max-width: 480px) {
    #arena-container {
        padding: 4px;
        max-height: 100%;
    }

    .boss-banner {
        padding: 4px 8px;
    }

    .boss-name {
        font-size: 0.82rem;
    }

    .boss-intent-pill {
        font-size: 0.64rem;
        padding: 1px 6px;
    }

    .arena-board {
        gap: 2.5px;
        padding: 4px;
    }

    .arena-action-bar {
        padding: 4px 8px;
    }

    .btn-end-turn {
        padding: 5px 10px;
        font-size: 0.74rem;
    }

    .heart-unit {
        width: 17px;
        height: 17px;
    }
}
