/* ===== 多人对战样式 ===== */

.mp-game-screen {
    flex-direction: column;
    background: linear-gradient(180deg, #0d1525 0%, #0a0a1a 50%, #0d1525 100%);
    height: 100vh;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* ===== 玩家区域通用 ===== */
.mp-player-area {
    flex-shrink: 0;
    padding: 6px 12px;
    transition: all 0.3s ease;
    border-radius: 8px;
}

.mp-player-area.current-turn {
    background: rgba(255, 215, 0, 0.08);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.15);
}

.mp-player-area.is-dead {
    opacity: 0.4;
    filter: grayscale(0.8);
}

.mp-player-area.is-dead::after {
    content: '阵亡';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    font-size: 32px;
    color: #ff3333;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
    z-index: 10;
    pointer-events: none;
}

.mp-player-area {
    position: relative;
}

/* 顶部AI */
.mp-top {
    background: linear-gradient(180deg, rgba(80,20,20,0.3) 0%, transparent 100%);
}

/* 底部玩家 */
.mp-bottom {
    background: linear-gradient(0deg, rgba(20,40,80,0.3) 0%, transparent 100%);
}

/* 中间行：左右AI + 中央 */
.mp-middle-row {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.mp-left {
    width: 220px;
    flex-shrink: 0;
    background: linear-gradient(90deg, rgba(80,40,20,0.2) 0%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mp-right {
    width: 220px;
    flex-shrink: 0;
    background: linear-gradient(-90deg, rgba(80,40,20,0.2) 0%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 中央区域 */
.mp-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 4px 8px;
    min-width: 0;
    overflow: hidden;
}

/* 牌堆信息 */
.mp-deck-info {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 4px 0;
    flex-shrink: 0;
}

.mp-deck-badge {
    font-size: 12px;
    color: #aaa;
    background: rgba(0, 0, 0, 0.4);
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 中央战斗日志 */
.mp-center .battle-log {
    flex: 1;
    min-height: 80px;
    max-height: 100%;
    overflow: hidden;
    padding: 8px 12px;
}

.mp-center .action-bar {
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ===== 玩家信息栏 ===== */
.mp-player-info-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mp-player-info-bar.mp-vertical {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

/* 头像 */
.mp-hero-avatar {
    width: 64px;
    height: 84px;
    border-radius: 8px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 4px;
    border: 3px solid;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    background-color: #1a1a2e;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    background-size: cover;
    background-position: center;
    position: relative;
}

.mp-hero-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0,0,0,0.6);
}

.mp-hero-avatar.targetable {
    border-color: #ff4444 !important;
    box-shadow: 0 0 12px rgba(255, 68, 68, 0.5);
    cursor: crosshair;
    animation: targetPulse 1s ease-in-out infinite;
}

@keyframes targetPulse {
    0%, 100% { box-shadow: 0 0 12px rgba(255, 68, 68, 0.5); }
    50% { box-shadow: 0 0 20px rgba(255, 68, 68, 0.8); }
}

.mp-hero-avatar .hero-card-mini {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0;
    position: relative;
}

.mp-hero-avatar .hero-card-faction-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    font-weight: bold;
    border: 2px solid rgba(255,255,255,0.6);
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

/* 身份标记 */
.mp-role-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: 2px solid #ffd700;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    z-index: 5;
}

.mp-role-badge.role-lord {
    background: linear-gradient(135deg, #FFD700, #B8860B);
    color: #4a2c00;
}

.mp-role-badge.role-loyalist {
    background: linear-gradient(135deg, #4a90d9, #2c5e8a);
    color: #fff;
}

.mp-role-badge.role-rebel {
    background: linear-gradient(135deg, #d94a4a, #8a2c2c);
    color: #fff;
}

.mp-role-badge.role-traitor {
    background: linear-gradient(135deg, #9a4ad9, #5e2c8a);
    color: #fff;
}

.mp-role-badge.role-unknown {
    background: linear-gradient(135deg, #555, #333);
    color: #aaa;
}

/* 详细信息 */
.mp-hero-details {
    flex-shrink: 0;
    min-width: 120px;
}

.mp-vertical .mp-hero-details {
    min-width: 0;
    width: 100%;
}

.mp-hero-name {
    font-size: 15px;
    color: #ffd700;
    font-weight: bold;
}

.mp-hero-faction {
    font-size: 11px;
    color: #aaa;
}

.mp-hp-bar {
    display: flex;
    gap: 2px;
    margin-top: 3px;
    flex-wrap: wrap;
}

.mp-hp-bar .hp-point {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #cc2222;
    border: 1px solid #ff6666;
    box-shadow: 0 0 4px rgba(255,50,50,0.6);
}

.mp-hp-bar .hp-point.lost {
    background: #333;
    border-color: #555;
    box-shadow: none;
}

.mp-hero-skills {
    font-size: 10px;
    color: #88ccff;
    margin-top: 2px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.mp-hero-skills .skill-tag {
    display: inline-block;
    background: linear-gradient(180deg, #3a2a5a 0%, #2a1a3a 100%);
    border: 1px solid #8a6aaa;
    border-radius: 4px;
    padding: 1px 6px;
    color: #ccaaee;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mp-hero-skills .skill-tag:hover {
    background: linear-gradient(180deg, #4a3a6a 0%, #3a2a4a 100%);
    border-color: #aa8acc;
}

/* 装备区 */
.mp-equip-area {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.mp-vertical .mp-equip-area {
    width: 100%;
}

.mp-equip-area .equip-slot {
    width: 36px;
    height: 48px;
    background: linear-gradient(180deg, #2a3a5a 0%, #1a2535 100%);
    border: 2px solid #5a7a9a;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #8aa;
    text-align: center;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.mp-equip-area .equip-slot.equipped {
    background: linear-gradient(180deg, #4a4a2a 0%, #3a3a1a 100%);
    border-color: #ffd700;
    color: #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.2);
}

/* 卡牌数量 */
.mp-card-count {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
    color: #ccc;
    flex-shrink: 0;
}

.mp-vertical .mp-card-count {
    margin-left: 0;
}

/* 手牌区域 */
.mp-hand-area {
    display: flex;
    justify-content: center;
    padding: 2px 0;
}

.mp-player-hand-area {
    padding: 4px 0;
}

/* AI手牌（背面） */
.mp-hand-area .card-back {
    width: 28px;
    min-width: 28px;
    height: 42px;
    border-radius: 3px;
    border: 1px solid #8b0000;
    background: linear-gradient(135deg, #8b0000 0%, #4a0000 50%, #8b0000 100%);
    box-shadow: 1px 1px 3px rgba(0,0,0,0.4);
    position: relative;
}

.mp-hand-area .card-back::after {
    content: "金";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: rgba(255,215,0,0.3);
}

/* 玩家手牌 */
.mp-player-hand-area .card {
    width: 60px;
    min-width: 60px;
    height: 84px;
}

/* ===== 回合指示器 ===== */
.mp-turn-arrow {
    position: absolute;
    font-size: 24px;
    color: #ffd700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
    z-index: 50;
    pointer-events: none;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* ===== 游戏结束身份展示 ===== */
.gameover-roles {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
}

.gameover-role-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gameover-role-item .role-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 2px solid;
}

.gameover-role-item .role-name {
    font-size: 14px;
    font-weight: bold;
}

.gameover-role-item .hero-name {
    font-size: 14px;
    color: #ffd700;
}

.gameover-role-item .role-status {
    margin-left: auto;
    font-size: 12px;
    color: #888;
}

/* ===== 目标选择面板 ===== */
#target-panel .response-cards {
    flex-wrap: wrap;
    max-width: 500px;
}

.target-player-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 2px solid #ff4444;
    background: rgba(80, 20, 20, 0.6);
    color: #ff8866;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.target-player-btn:hover {
    background: rgba(120, 30, 30, 0.8);
    border-color: #ff6666;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.3);
}

.target-player-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.target-player-btn .target-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    border: 2px solid;
    flex-shrink: 0;
}

/* ===== 日志区域适配 ===== */
.mp-center .battle-log .log-entry {
    font-size: 12px;
    padding: 3px 8px;
}

/* ===== 响应式适配 ===== */
@media screen and (max-width: 1024px) {
    .mp-left, .mp-right {
        width: 180px;
    }

    .mp-hero-avatar {
        width: 52px;
        height: 68px;
    }

    .mp-hero-name {
        font-size: 13px;
    }

    .mp-hero-details {
        min-width: 100px;
    }
}

@media screen and (max-width: 768px) {
    .mp-left, .mp-right {
        width: 140px;
    }

    .mp-hero-avatar {
        width: 44px;
        height: 58px;
    }

    .mp-hero-details {
        min-width: 80px;
    }

    .mp-hero-name {
        font-size: 12px;
    }

    .mp-hero-faction {
        font-size: 10px;
    }

    .mp-equip-area .equip-slot {
        width: 28px;
        height: 38px;
        font-size: 8px;
    }

    .mp-hand-area .card-back {
        width: 20px;
        min-width: 20px;
        height: 30px;
    }

    .mp-hand-area .card-back::after {
        font-size: 10px;
    }

    .mp-player-hand-area .card {
        width: 52px;
        min-width: 52px;
        height: 72px;
        font-size: 11px;
    }

    .mp-player-hand-area .card-name {
        font-size: 11px;
        letter-spacing: 1px;
    }

    .mp-player-hand-area .card-suit-number {
        font-size: 10px;
    }

    .mp-player-hand-area .card-type {
        font-size: 7px;
    }

    .mp-center .battle-log .log-entry {
        font-size: 11px;
    }

    .mp-card-count {
        font-size: 13px;
    }

    .mp-card-count .card-count-icon {
        font-size: 20px;
    }
}

@media screen and (max-width: 480px) {
    .mp-left, .mp-right {
        width: 110px;
    }

    .mp-hero-avatar {
        width: 36px;
        height: 48px;
    }

    .mp-hero-details {
        min-width: 60px;
    }

    .mp-hero-name {
        font-size: 11px;
    }

    .mp-equip-area .equip-slot {
        width: 24px;
        height: 32px;
        font-size: 7px;
    }

    .mp-hand-area .card-back {
        width: 16px;
        min-width: 16px;
        height: 24px;
    }

    .mp-player-hand-area .card {
        width: 46px;
        min-width: 46px;
        height: 64px;
        font-size: 10px;
    }

    .mp-player-hand-area .card-name {
        font-size: 9px;
        letter-spacing: 0;
    }

    .mp-player-hand-area .card-suit-number {
        font-size: 8px;
        gap: 1px;
    }

    .mp-player-hand-area .card-type {
        font-size: 6px;
    }

    .mp-player-hand-area .hand-cards {
        gap: 2px;
    }
}

/* 伤害闪烁动画适配 */
.mp-player-area .flash-damage {
    animation: flash 0.5s ease;
}

/* 治疗动画 */
.mp-player-area .heal-glow {
    animation: healGlow 0.5s ease;
}

/* 台词气泡适配 */
.mp-player-area .speech-bubble {
    position: absolute;
    background: linear-gradient(135deg, rgba(255, 248, 220, 0.97), rgba(255, 235, 180, 0.97));
    color: #4a2c00;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px) scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid #d4a017;
    max-width: 200px;
    text-overflow: ellipsis;
    overflow: hidden;
}

.mp-player-area .speech-bubble.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.mp-top .speech-bubble { bottom: -10px; left: 20px; }
.mp-bottom .speech-bubble { top: -10px; right: 20px; }
.mp-left .speech-bubble { right: -10px; top: 20px; }
.mp-right .speech-bubble { left: -10px; top: 20px; }
