/* ========================================
 * Bot 选择样式（紧凑入口 + 弹窗选择）
 * ======================================== */

/* ---- 开始行（选择对手 + 开始按钮） ---- */
.start-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.start-row .bot-selector-compact {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.start-row #startBtn {
    flex-shrink: 0;
    white-space: nowrap;
    border-radius: 16px;
}

.start-row #startBtn:disabled {
    background: #ccc;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
}

/* ---- 紧凑入口 ---- */
.bot-selector-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #faf6f0;
    border: 2px solid #e0d5c5;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 10px;
}

.bot-selector-compact:hover {
    border-color: #8b7355;
    background: #f5f0e8;
}

.selector-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #e0d5c5;
    flex-shrink: 0;
}

.selector-info {
    flex: 1;
    min-width: 0;
}

.selector-name {
    font-size: 14px;
    font-weight: bold;
    color: #3b2a1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.selector-hint {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.selector-arrow {
    color: #999;
    font-size: 12px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.bot-selector-compact:hover .selector-arrow {
    transform: translateX(2px);
    color: #666;
}

/* 已选中状态 */
.bot-selector-compact.has-selection {
    border-color: #4CAF50;
    background: #f0fff0;
}

.bot-selector-compact.has-selection .selector-hint {
    color: #666;
}

/* ---- 弹窗内容 ---- */
.bot-modal-content {
    max-width: 520px;
    width: 90vw;
}

.bot-modal-body {
    padding: 16px 0;
}

.bot-modal-footer {
    display: flex;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #e0d5c5;
}

.btn-cancel,
.btn-confirm {
    flex: 1;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    text-align: center;
}

.btn-cancel {
    border: 1px solid #ccc;
    background: #fff;
    color: #666;
}

.btn-cancel:hover {
    background: #f5f5f5;
    border-color: #999;
}

.btn-confirm {
    border: none;
    background: #4CAF50;
    color: #fff;
    font-weight: bold;
}

.btn-confirm:hover:not(:disabled) {
    background: #43A047;
}

.btn-confirm:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ---- Tab 栏 ---- */
.bot-tabs {
    display: flex;
    border-bottom: 2px solid #e0d5c5;
}

.bot-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    font-size: 13px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.bot-tab:hover {
    color: #3b2a1f;
    background: rgba(0, 0, 0, 0.03);
}

.bot-tab.active {
    color: #3b2a1f;
    border-bottom-color: #4CAF50;
    background: rgba(76, 175, 80, 0.05);
}

/* ---- Tab 面板 ---- */
.tab-panel {
    display: none;
    padding: 12px 0;
}

.tab-panel.active {
    display: block;
}

/* ---- Bot 卡片网格 ---- */
.bot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

/* 单个 Bot 卡片 */
.bot-card {
    border: 2px solid #e0d5c5;
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #faf6f0;
    position: relative;
}

.bot-card:hover {
    border-color: #8b7355;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 42, 31, 0.15);
}

.bot-card.selected {
    border-color: #4CAF50;
    background: #f0fff0;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
}

.bot-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.bot-card.locked:hover {
    transform: none;
    box-shadow: none;
    border-color: #e0d5c5;
}

/* Bot 头像 */
.bot-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin: 0 auto 8px;
    display: block;
    object-fit: cover;
    background: #e0d5c5;
}

/* Bot 名称 */
.bot-name {
    font-weight: bold;
    font-size: 13px;
    color: #3b2a1f;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Bot 棋力 */
.bot-elo {
    color: #666;
    font-size: 11px;
    margin-bottom: 4px;
}

/* Bot 难度标签 */
.bot-difficulty {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
}

.difficulty-入门 {
    background: #e8f5e9;
    color: #2e7d32;
}

.difficulty-初级 {
    background: #e3f2fd;
    color: #1565c0;
}

.difficulty-中级 {
    background: #fff3e0;
    color: #ef6c00;
}

.difficulty-高级 {
    background: #fce4ec;
    color: #c62828;
}

.difficulty-大师 {
    background: #f3e5f5;
    color: #6a1b9a;
}

/* 锁定图标 */
.bot-lock {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 14px;
}

/* ---- 执棋方选择 ---- */
.side-selection {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 10px 12px;
    background: #f5f0e8;
    border-radius: 8px;
}

.side-selection-label {
    font-size: 13px;
    font-weight: bold;
    color: #3b2a1f;
}

.side-option {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 13px;
}

.side-option:hover {
    background: rgba(0, 0, 0, 0.05);
}

.side-option input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

.side-option.red-side {
    color: #c62828;
}

.side-option.black-side {
    color: #333;
}

/* ---- 自定义对局行 ---- */
.custom-config-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.custom-config-row select {
    flex: 1;
    min-width: 0;
    padding: 6px 10px;
    border-radius: 15px;
    border: 2px solid #b97f3a;
    background: #ffcf7a;
    font-size: 0.85rem;
    font-weight: bold;
    color: #3b2a1f;
    cursor: pointer;
    font-family: inherit;
}

.custom-config-row select:focus {
    outline: none;
    border-color: #8b5a2b;
}

.custom-config-row .vs-label {
    flex-shrink: 0;
    font-weight: bold;
    color: #3b2a1f;
    font-size: 13px;
}

/* ---- 响应式 ---- */
@media (max-width: 480px) {
    .bot-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .bot-card {
        padding: 10px 6px;
    }

    .bot-avatar {
        width: 40px;
        height: 40px;
    }

    .bot-name {
        font-size: 12px;
    }

    .side-selection {
        flex-wrap: wrap;
        gap: 8px;
    }

    .bot-modal-content {
        width: 95vw;
    }
}
