/* =========================================================
 * deal.css - 棋子配置（发牌过滤器）面板样式
 *
 * 从 style.css 拆出：对应 dealer.js 的发牌配置弹窗
 *   .deal-card  —— 弹窗卡片本体（覆盖 .modal-card 的 max-width）
 *   .deal-tabs  —— 包分页（基础 / 扩展 / 粉丝1）
 *   .deal-row   —— 每种棋子一行：色点 + 名称 + 数量 + 随机 + 开关
 *   .deal-head  —— 「每局登场种数」步进器（标了随机才可调）
 *   .deal-mode-tabs —— 玩法模式一行：普通 / 迷雾（沿用包分页样式）
 *   .deal-note  —— 迷雾提示行（只在迷雾模式出现）
 *   .deal-chip  —— 标题行右侧的「全部启用 / 全部取消」胶囊（只管扩展）
 *
 * 面板从上到下：标题行（含两个胶囊）+ 包分页 + 棋子列表 → 登场种数 → 玩法模式（+ 迷雾提示）
 *
 * 注意：.deal-card 与 .modal-card（style.css）同特异度，
 *       本文件必须在 style.css 之后加载，覆盖才能生效。
 * ========================================================= */

/* ==================== 发牌过滤器 ==================== */
.deal-card {
    max-width: 340px;
    /* 列表 + 步进器 + 模式行叠起来比别的小弹窗高，矮屏要能收住，列表自己缩 */
    max-height: calc(100vh - 36px);
    max-height: calc(100dvh - 36px);
    gap: 10px;
}

/* 顶栏按钮：自选模式给个提示色，不点开面板也看得出来 */
.deal-btn.is-draft {
    color: #0E7C6B;
}

/* 标题行：左边标题，右边两个胶囊（全部启用 / 全部取消，只管扩展棋子） */
.deal-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.deal-top .modal-title {
    margin-right: auto;
    text-align: left;
    font-size: 1rem;
}

.deal-chips {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.deal-chip {
    border: none;
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #7C766C;
    background: #E9E4D7;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.deal-chip:active:not(:disabled) {
    background: var(--text-main);
    color: #FFFFFF;
}

/* 迷雾提示行：只在迷雾模式出现，紧跟在玩法模式下面 */
.deal-note {
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text-muted);
    background: var(--bg-color);
    border-radius: var(--radius-md);
    padding: 7px 10px;
    text-align: center;
}

/* 每局登场种数：− N +
   左边文字（标题 + 说明），右边控件，整块垂直居中。
   不要再拆成「第一行标签+控件、第二行说明」——那样控件会贴在第一行上，看着歪。 */
.deal-head {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    padding: 9px 12px;
}

.deal-head-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.deal-head-label {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-main);
}

.deal-stepper {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--surface);
    border-radius: 10px;
    padding: 2px;
    box-shadow:var(--shadow-btn);
}

.deal-step-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.deal-step-btn:active:not(:disabled) {
    background: var(--bg-color);
}

.deal-step-btn:disabled {
    opacity: 0.28;
    cursor: not-allowed;
}

.deal-stepper b {
    min-width: 34px;
    text-align: center;
    font-size: 0.92rem;
    color: var(--text-main);
}

.deal-math {
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-muted);
}

/* 分页栏：基础 / 扩展 / 粉丝1 */
.deal-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-color);
    padding: 4px;
    border-radius: 11px;
}

.deal-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 7px 6px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    white-space: nowrap;
}

.deal-tab i {
    font-style: normal;
    font-size: 0.64rem;
    font-weight: 800;
    margin-left: 3px;
    opacity: 0.65;
}

.deal-tab.active {
    background: #FFFFFF;
    color: var(--text-main);
    box-shadow:var(--shadow-btn);
}

/* 玩法模式一行：普通 / 随机 / 迷雾 —— 与包分页同款，只是没有数量角标 */
.deal-mode-tabs .deal-tab {
    padding: 8px 6px;
}

/* 棋子列表：现在排在最上面，高度要让给下面三个区块，所以收到 34vh 并允许被压缩 */
.deal-scroll {
    max-height: 34vh;
    min-height: 88px;
    flex: 0 1 auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 2px;
}

.deal-scroll::-webkit-scrollbar { width: 4px; }
.deal-scroll::-webkit-scrollbar-thumb { background: #DCD6C8; border-radius: 2px; }

/* 行本身不随开关变样：关掉的棋子只有右侧开关是关的，别整行置灰 */
.deal-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 10px;
    background: var(--bg-color);
}

.deal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.15);
}

.deal-row .deal-name {
    font-size: 0.86rem;
    font-weight: bold;
    color: var(--text-main);
    white-space: nowrap;
}

.deal-cnt {
    font-size: 0.66rem;
    font-weight: 800;
    color: var(--text-muted);
}

.deal-pills {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* 随机开关：亮 = 这枚随机登场（由登场种数决定抽不抽到），暗 = 固定必发。
   暗态别做得太淡 —— 它和「禁用」是两回事，得看得出还能点。 */
.deal-pill {
    border: none;
    border-radius: 20px;
    padding: 4px 9px;
    font-size: 0.66rem;
    font-weight: 800;
    color: #7C766C;
    background: #E9E4D7;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.deal-pill.rand.active {
    background: var(--text-main)   ;
    color: #FFFFFF;
}

.deal-pill:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* 行内的开关比面板开关小一号 */
.deal-row .switch {
    width: 38px;
    height: 21px;
}

.deal-row .slider:before {
    height: 15px;
    width: 15px;
}

.deal-row .switch input:checked + .slider:before {
    transform: translateX(17px);
}
