/* ============================================
   中国象棋 — 5000YAN 主题集成
   ============================================ */

/* ===== 棋盘容器 ===== */
.chess-container {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1rem;
    transition: background-color 0.25s ease;
}

/* ===== 棋盘布局 ===== */
.chess_right {
    display: none;
}

.bn_box {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

/* ===== 游戏状态栏 ===== */
.game-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    max-width: 507px;
    margin: 0 auto;
    transition: background-color 0.25s ease;
}

.game-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 16px;
    border-radius: 50px;
    background: var(--success);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}

.game-turn-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ===== 游戏按钮 ===== */
.game-btn, .action-bar .action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 50px;
    line-height: 1;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    padding: 10px 22px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 500;
    border: none;
}

.game-btn:hover, .action-bar .action-btn:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-1px);
}

.game-btn:active, .action-bar .action-btn:active {
    transform: scale(0.97);
}

.action-bar .action-btn:disabled,
.action-bar .action-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* ===== Canvas ===== */
#chess {
    display: block;
    margin: 0 auto;
    border-radius: var(--radius);
    transition: background-color 0.25s ease;
}

/* ===== 游戏控制区（画布下方的按钮组） ===== */
.game-controls {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 16px 12px;
    margin-top: 12px;
}

.action-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

/* ===== AI 思考遮罩 ===== */
.thinking-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: background 0.25s ease;
}

.thinking-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 1.25rem 1.5rem;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.thinking-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(var(--accent-rgb), 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 移动信息面板 ===== */
.move_info {
    max-width: 320px;
    margin: 12px auto;
    font-size: 0.8125rem;
    line-height: 1.6;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 10px 14px;
    color: var(--text-muted);
}

.move_info h3 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.move_info h3::before {
    content: "\f1b2";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: var(--accent);
}

/* ===== 加载指示器 ===== */
.chess-container .spinner-border {
    color: var(--text-muted);
}

.jiazaizhong {
    color: var(--text-secondary);
    font-size: 0.9rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* ===== 浅色模式覆盖 ===== */
html.light .chess-container {
    background: var(--card-bg);
}

html.light .thinking-overlay {
    background: rgba(0, 0, 0, 0.3);
}

/* ===== 响应式 ===== */
@media (max-width: 576px) {
    .chess-container {
        padding: 0.75rem;
    }

    .game-status-bar {
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .game-btn {
        padding: 9px 16px;
        font-size: 0.8125rem;
    }

    .action-bar {
        gap: 6px;
        margin-top: 6px;
    }

    .action-bar .action-btn {
        padding: 9px 16px;
        font-size: 0.8125rem;
    }

    .game-controls {
        padding: 12px 8px;
    }

    .thinking-content {
        padding: 1.25rem 1.75rem;
        margin: 0 20px;
    }

    .move_info {
        padding: 10px 12px;
        font-size: 0.75rem;
    }
}

/* ===== 确认弹窗 ===== */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    animation: fadeIn 0.15s ease;
}

.confirm-box {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px 28px 20px;
    max-width: 360px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.confirm-body {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.confirm-actions button {
    padding: 10px 24px;
    border-radius: 50px;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.confirm-cancel {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.confirm-cancel:hover {
    background: var(--bg-secondary);
}

.confirm-ok {
    background: var(--accent);
    color: #fff;
}

.confirm-ok:hover {
    opacity: 0.85;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
