/**
 * 特效样式
 * Effects Styles
 */

/* ==================== 阵营选择弹窗 ==================== */
.side-selection-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: modal-fade-in 0.3s ease;
}

.side-selection-container {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-top: 20px;
}

.side-card {
    flex: 1;
    max-width: 300px;
    background: white;
    border-radius: 16px;
    padding: 40px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.side-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.side-red:hover {
    border-color: #C8102E;
}

.side-black:hover {
    border-color: #2C2C2C;
}

.side-icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
}

.side-card h3 {
    font-size: 28px;
    margin-bottom: 10px;
}

.side-red h3 {
    color: #C8102E;
}

.side-black h3 {
    color: #2C2C2C;
}

.side-card p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* ==================== 技能选择弹窗 ==================== */
.skill-selection-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: modal-fade-in 0.3s ease;
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(135deg, #FFF8DC, #FFE4B5);
    border-radius: 16px;
    padding: 30px;
    max-width: 900px;
    width: 90%;
    border: 3px solid #FFD700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: modal-slide-up 0.3s ease;
}

@keyframes modal-slide-up {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    text-align: center;
    color: #C8102E;
    font-size: 32px;
    margin-bottom: 30px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.skill-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #FFD700;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.skill-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-color: #C8102E;
}

.skill-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 15px;
}

.skill-card h3 {
    color: #C8102E;
    font-size: 24px;
    text-align: center;
    margin-bottom: 10px;
    font-weight: bold;
}

.skill-type {
    text-align: center;
    color: #8B4513;
    font-size: 14px;
    margin-bottom: 10px;
    padding: 5px 10px;
    background: #FFF8DC;
    border-radius: 4px;
    display: inline-block;
    width: 100%;
}

.skill-description {
    color: #2C2C2C;
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}

/* ==================== 吃子小马动画 ==================== */
.capture-horse-animation {
    position: absolute;
    font-size: 40px;
    z-index: 1000;
    animation: horse-cheer 1s ease-out forwards;
    pointer-events: none;
}

@keyframes horse-cheer {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    20% {
        transform: scale(1.2) rotate(10deg);
        opacity: 1;
    }
    40% {
        transform: scale(1) rotate(-10deg);
    }
    60% {
        transform: scale(1.1) rotate(5deg);
    }
    80% {
        transform: scale(1) rotate(0deg);
    }
    100% {
        transform: scale(0.5) translateY(-30px);
        opacity: 0;
    }
}

/* ==================== 技能特效 ==================== */
.skill-effect {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1500;
    pointer-events: none;
    animation: skill-effect-show 3s ease-out forwards;
}

@keyframes skill-effect-show {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    10% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    20% {
        transform: translate(-50%, -50%) scale(1);
    }
    80% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
}

.skill-effect-inner {
    background: linear-gradient(135deg, rgba(200, 16, 46, 0.9), rgba(230, 57, 70, 0.9));
    border-radius: 16px;
    padding: 30px 50px;
    border: 3px solid #FFD700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.skill-effect .skill-icon {
    font-size: 64px;
    display: block;
    margin-bottom: 15px;
}

.skill-effect .skill-name {
    font-size: 28px;
    color: #FFD700;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* ==================== 护盾效果 ==================== */
.shield-effect {
    position: absolute;
    font-size: 50px;
    z-index: 999;
    animation: shield-pulse 2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shield-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* ==================== 护盾破碎效果 ==================== */
.shield-break-effect {
    position: absolute;
    font-size: 40px;
    z-index: 1000;
    animation: shield-break 0.5s ease-out forwards;
    pointer-events: none;
}

@keyframes shield-break {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.8;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* ==================== 移动动画 ==================== */

/* 虚影淡出动画 */
.move-ghost {
    pointer-events: none;
    z-index: 1;
}

@keyframes ghost-fade {
    0% {
        opacity: 0.5;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* 移动轨迹 */
.move-trajectory {
    pointer-events: none;
}

@keyframes trajectory-grow {
    0% {
        width: 0;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.3;
    }
}

/* 目标位置发光 */
.move-glow {
    pointer-events: none;
}

@keyframes glow-pulse {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* 移动箭头 */
.move-arrow {
    pointer-events: none;
}

@keyframes arrow-bounce {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translate(0, -10px) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translate(0, 0) scale(0.8);
        opacity: 0;
    }
}

/* ==================== 炮的动画 - 炮弹飞行 ==================== */
.cannonball-animation {
    pointer-events: none;
}

@keyframes cannon-explode {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.9;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* ==================== 马的动画 - 跳跃 ==================== */
.knight-jump-animation {
    pointer-events: none;
}

@keyframes dust-puff {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ==================== 车的动画 - 快速移动 ==================== */
.rook-trajectory {
    pointer-events: none;
}

@keyframes rook-speed {
    0% {
        width: 0;
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
    100% {
        opacity: 0.2;
    }
}

.rook-icon {
    pointer-events: none;
}

@keyframes brake-effect {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.5) translateY(-20px);
        opacity: 0;
    }
}

/* ==================== 象的动画 - 缓慢移动 ==================== */
.elephant-trajectory {
    pointer-events: none;
}

@keyframes elephant-slow {
    0% {
        width: 0;
        opacity: 0;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        opacity: 0.2;
    }
}

.elephant-icon {
    pointer-events: none;
}

/* ==================== 兵和士的动画 - 带刀特效 ==================== */
.sword-animation {
    pointer-events: none;
}

@keyframes sword-flash {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* ==================== 将和帅的动画 - 旗子飘扬 ==================== */
.king-flag-animation {
    pointer-events: none;
}

@keyframes halo-pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* 棋子发光效果 */
@keyframes piece-glow {
    0% {
        box-shadow: 0 0 10px 3px rgba(255, 215, 0, 0.6);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px 8px rgba(255, 215, 0, 0.9);
        transform: scale(1.1);
    }
    100% {
        box-shadow: 0 0 20px 5px rgba(255, 215, 0, 0.7);
        transform: scale(1);
    }
}

/* ==================== 游戏结束弹窗 ==================== */
.game-over-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    animation: modal-fade-in 0.5s ease;
}

.game-over-content {
    background: linear-gradient(135deg, #FFF8DC, #FFE4B5);
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    border: 4px solid #FFD700;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: modal-bounce 0.5s ease;
}

@keyframes modal-bounce {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.game-over-content h2 {
    color: #C8102E;
    font-size: 36px;
    margin-bottom: 30px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.winner-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}

.winner-icon {
    font-size: 80px;
    animation: winner-bounce 1s ease-in-out infinite;
}

@keyframes winner-bounce {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-10px) rotate(-5deg);
    }
    75% {
        transform: translateY(-10px) rotate(5deg);
    }
}

.winner-text {
    font-size: 32px;
    color: #C8102E;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.game-over-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.game-over-actions .btn {
    min-width: 150px;
}

/* ==================== 游戏消息 ==================== */
.game-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #C8102E, #E63946);
    color: #FFD700;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid #FFD700;
    z-index: 1800;
    animation: message-slide-down 0.3s ease;
}

@keyframes message-slide-down {
    from {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ==================== 粒子效果 ==================== */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #FFD700;
    border-radius: 50%;
    pointer-events: none;
    animation: particle-fly 1s ease-out forwards;
}

@keyframes particle-fly {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* ==================== 闪烁效果 ==================== */
.flash-effect {
    animation: flash 0.3s ease-in-out 3;
}

@keyframes flash {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}

/* ==================== 响应式特效 ==================== */
@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
    }
    
    .modal-content h2 {
        font-size: 24px;
    }
    
    .skills-container {
        grid-template-columns: 1fr;
    }
    
    .skill-card {
        padding: 15px;
    }
    
    .skill-icon {
        font-size: 36px;
    }
    
    .skill-card h3 {
        font-size: 20px;
    }
    
    .game-over-content {
        padding: 30px 20px;
    }
    
    .game-over-content h2 {
        font-size: 28px;
    }
    
    .winner-icon {
        font-size: 60px;
    }
    
    .winner-text {
        font-size: 24px;
    }
    
    .game-over-actions {
        flex-direction: column;
    }
    
    .game-over-actions .btn {
        width: 100%;
    }
}