/**
 * 棋盘样式
 * Board Styles
 */

/* ==================== 棋盘基础样式 ==================== */
.chess-board {
    position: relative;
    background: linear-gradient(135deg, #DEB887, #D2B48C);
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    overflow: visible;
}

/* 棋盘木纹效果 */
.chess-board::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(139, 69, 19, 0.03) 10px,
        rgba(139, 69, 19, 0.03) 20px
    );
    pointer-events: none;
    border-radius: 8px;
}

/* ==================== 楚河汉界 ==================== */
.river {
    font-family: 'KaiTi', '楷体', serif;
    text-shadow: 1px 1px 2px rgba(139, 69, 19, 0.3);
    border-top: 2px solid #8B4513;
    border-bottom: 2px solid #8B4513;
}

/* ==================== 棋子样式 ==================== */
.piece {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    user-select: none;
    z-index: 10;
}

.piece:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

/* 红方棋子 */
.piece-red {
    background: radial-gradient(circle at 30% 30%, #FFF8DC, #DEB887);
    border: 3px solid #C8102E;
    color: #C8102E;
}

/* 黑方棋子 */
.piece-black {
    background: radial-gradient(circle at 30% 30%, #FFF8DC, #DEB887);
    border: 3px solid #2C2C2C;
    color: #2C2C2C;
}

/* 棋子名称 */
.piece-name {
    font-family: 'KaiTi', '楷体', serif;
    font-size: 28px;
    font-weight: bold;
    pointer-events: none;
}

/* 选中状态 */
.piece-selected {
    box-shadow: 0 0 20px 5px rgba(255, 215, 0, 0.8);
    transform: scale(1.15);
    z-index: 20;
}

/* 护盾效果 */
.piece-shield {
    position: relative;
}

.piece-shield::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 3px solid #FFD700;
    border-radius: 50%;
    animation: shield-pulse 2s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

/* 护盾图标 */
.shield-icon {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 20px;
    pointer-events: none;
    z-index: 2;
    animation: shield-icon-pulse 2s ease-in-out infinite;
}

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

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

/* 防御标记 */
.defense-mark {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 16px;
    pointer-events: none;
}

/* ==================== 移动提示 ==================== */
.move-hint {
    position: absolute;
    background: rgba(40, 167, 69, 0.6);
    border: 2px solid #28a745;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
    animation: hint-pulse 1.5s ease-in-out infinite;
}

.move-hint:hover {
    background: rgba(40, 167, 69, 0.8);
    transform: scale(1.2);
}

@keyframes hint-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ==================== 移动轨迹 ==================== */
.move-trajectory {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.8), rgba(255, 215, 0, 0));
    pointer-events: none;
    z-index: 3;
    animation: trajectory-fade 0.5s ease-out forwards;
}

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

/* ==================== 棋盘交叉点 ==================== */
.board-grid-point {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #8B4513;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* ==================== 棋盘边框装饰 ==================== */
.board-container::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-radius: 4px;
    pointer-events: none;
}

/* ==================== 响应式棋盘 ==================== */
@media (max-width: 768px) {
    .piece-name {
        font-size: 20px;
    }
    
    .piece {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
    
    .move-hint {
        width: 16px;
        height: 16px;
    }
}

/* ==================== 棋子动画 ==================== */
.piece-moving {
    transition: all 0.3s ease;
    z-index: 100;
}

.piece-captured {
    animation: piece-capture 0.5s ease-out forwards;
}

@keyframes piece-capture {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.5;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}