/* =========================================
   card-styles.css - 扑克牌与选牌器 (优化版)
   ========================================= */

/* 1. 卡片基础 (Slots) */
.selected-card {
    width: 38px;
    height: 53px;
    border-radius: var(--radius-sm);
    margin: 0 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    font-family: 'Segoe UI', 'Arial', sans-serif;
    font-weight: 900;
    font-size: 15px;
    letter-spacing: -0.5px;
    user-select: none;
    transition: transform 0.1s;
}


/* 选牌器外部的卡片 - 4色系统 */
.selected-card[data-suit="h"]:not([data-card=""]) { 
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.6);
    color: #e74c3c;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.selected-card[data-suit="d"]:not([data-card=""]) { 
    background: rgba(241, 196, 15, 0.15);
    border: 1px solid rgba(241, 196, 15, 0.6);
    color: #f1c40f;
    box-shadow: 0 2px 8px rgba(241, 196, 15, 0.3);
}

.selected-card[data-suit="c"]:not([data-card=""]) { 
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.6);
    color: #2ecc71;
    box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
}

.selected-card[data-suit="s"]:not([data-card=""]) { 
    background: rgba(52, 152, 219, 0.15);
    border: 1px solid rgba(52, 152, 219, 0.6);
    color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* 选牌器内部的按钮保持原样（可选修改） */
.picker-card-btn[data-suit="h"] { color: var(--accent-red); }
.picker-card-btn[data-suit="d"] { color: var(--accent-blue); }
.picker-card-btn[data-suit="c"] { color: var(--accent-green); }
.picker-card-btn[data-suit="s"] { color: #2c3e50; }

/* 3. 容器布局 */
.hero-hand-display {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: -18px; /* 向上重叠 */
}

.board-cards-all-display {
    display: flex;
    justify-content: center;
    gap: 3px;
    padding: 6px 0;
    margin: 2px 0 8px 0;
    min-height: 50px;
    border-radius: var(--radius-lg);
    background: rgba(0, 0, 0, 0.2); /* 简单的深色底 */
}

/* 默认隐藏 Turn/River */
.board-card-slot[data-card-type="turn"],
.board-card-slot[data-card-type="river"] {
    display: flex;
}

/* 4. 选牌器弹窗 (Picker) */
.card-picker {
    width: 98vw;
    max-width: 600px;
    background: var(--bg-dark); /* 使用变量 */
    border: 1px solid #444;
    padding: 15px 5px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* 绝对定位，防止被键盘顶起 */
    position: absolute !important;
    top: 150px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

#suits-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 0;
}

.suit-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.picker-card-btn {
    width: 12%; /* 稍微宽一点 */
    height: 40px;
    font-size: 14px;
    border-radius: 4px;
    border: 1px solid #333;
    background: #3a4b61; /* 默认未选背景 */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

/* 选牌器内的花色背景 */
.picker-card-btn[data-suit="h"] { background: rgba(231, 76, 60, 0.15); border-color: rgba(231, 76, 60, 0.3); }
.picker-card-btn[data-suit="d"] { background: rgba(52, 152, 219, 0.15); border-color: rgba(52, 152, 219, 0.3); }
.picker-card-btn[data-suit="c"] { background: rgba(46, 204, 113, 0.15); border-color: rgba(46, 204, 113, 0.3); }
.picker-card-btn[data-suit="s"] { background: rgba(236, 240, 241, 0.8); border-color: #bdc3c7; }

/* 选中状态 */
.picker-card-btn.selected {
    background: var(--primary-color) !important;
    color: #000 !important;
    border-color: var(--primary-color) !important;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}

/* 5. 选牌器操作按钮 */
.picker-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.picker-actions button {
    flex: 1;
    height: 44px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

#picker-cancel { background: #34495e; color: var(--text-dim); }
#picker-confirm { background: var(--accent-green); color: white; }

/* 6. 确认动画遮罩 */
.card-confirm-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(46, 204, 113, 0.9);
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px;
    color: white; font-size: 20px; font-weight: bold;
    opacity: 0; pointer-events: none; transition: opacity 0.2s;
}

.selected-card.confirmed .card-confirm-overlay {
    opacity: 1;
    animation: fadeOutConfirm 0.5s forwards 0.2s;
}
/* --- Card Picker 去重样式 --- */
.picker-card-btn.disabled {
    opacity: 0.3;
    pointer-events: none; /* 禁止点击 */
    background-color: #000;
    border-color: #333;
    color: #555;
    text-decoration: line-through;
}
@keyframes fadeOutConfirm { to { opacity: 0; } }