/* ========================================
   Lottery (ZC/RJ) Table Styles (足彩)
   Depends on: fifa_common.css, match_common.css
   ======================================== */

/* === Page Layout === */
.lottery-page-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 16px;
}

/* === Table Scroll Wrapper (防闪烁 + 滚动位置保持) === */
/* 包裹表格+投注栏的可滚动容器，renderMatchTable()时visibility:hidden防止闪烁 */
#lottery-table-wrap {
    overflow-y: auto;
    /* 使用 will-change 优化重绘性能 */
    will-change: scroll-position;
}
#lottery-table-wrap.updating {
    visibility: hidden;
    pointer-events: none;  /* 防止更新期间用户误操作 */
}

/* === Controls Bar (테이블 상단 컨트롤바) === */
.lottery-controls-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
/* Label before select */
.lottery-ctrl-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}
/* Issue select dropdown */
.lottery-ctrl-select {
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lottery-ctrl-select:focus { border-color:#818cf8; box-shadow:0 0 0 3px rgba(129,140,248,0.15); }

/* Prev Prize button (hidden by default, shown via JS inline style) */
.lottery-btn-prev-prize { display: none; }

/* Spacer */
.lottery-ctrl-spacer { flex: 1; }

/* Status badge area */
.lottery-status-wrap { display: inline-flex; align-items: center; }

/* Updated time */
.lottery-updated-time {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
}

/* === Mode Badge (面板模式标签) — XS size === */
.lottery-mode-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.lottery-mode-badge-zc { background: rgba(37,99,235,0.12); color: #2563eb; }
.lottery-mode-badge-rj { background: rgba(210,153,34,0.12); color: #d29922; }

/* === League Column (联赛列) === */
.lottery-league-cell {
    background-color: var(--league-bg);
    color: #ffffff;
    letter-spacing: 0.08em;
}

/* === Odds Type Column (数据列) === */
.lottery-odds-type-col { color: var(--odds-color); }

/* === Status Badge === */
.lottery-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.lottery-status-badge.selling { background: rgba(26,127,55,0.12); color: #3fb950; border: 1px solid rgba(63,185,80,0.25); }
.lottery-status-badge.pending { background: rgba(191,135,0,0.12); color: #d29922; border: 1px solid rgba(210,153,34,0.25); }
.lottery-status-badge.ended { background: rgba(207,34,46,0.12); color: #f85149; border: 1px solid rgba(248,81,73,0.25); }

/* === Info Grid === */
.lottery-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.lottery-info-card {
    background: var(--gh-bg);
    border: 1px solid var(--gh-border);
    border-radius: var(--gh-radius-md);
    padding: 12px 16px;
}
.lottery-info-card .label { font-size: 11px; color: var(--gh-text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.lottery-info-card .value { font-size: 15px; font-weight: 600; color: var(--gh-text-primary); }

/* === Mode Switcher === */
.mode-switch {
    display: flex;
    border: 1px solid var(--gh-border);
    border-radius: var(--gh-radius-md);
    overflow: hidden;
}
.mode-switch button {
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    border-radius: 0; /* mode-switch 内部按钮无圆角，由父容器控制 */
}
.mode-switch button.mode-active {
    background: #2563eb;
    color: #fff;
}
.mode-switch button:not(.mode-active) {
    background: #fff;
    color: var(--gh-text-secondary);
    border-left: 1px solid var(--gh-border);
}
.mode-switch button:not(.mode-active):hover {
    background: #f0f4ff;
    color: #2563eb;
}

/* === Unified Button System (三级尺寸体系) ===
   XS = 标签/徽章级  |  SM = 工具栏/内联操作  |  MD = 主要动作/弹窗
   ───────────────────────────────────────────────────────── */
.lottery-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    white-space: nowrap;
    font-weight: 500;
    background: none;
}
/* ---- Size Tiers ---- */
.lottery-btn-xs { padding: 2px 8px;   font-size: 11px; border-radius: 4px; } /* 标签、badge、tag */
.lottery-btn-sm { padding: 5px 12px;  font-size: 12px; border-radius: 6px; } /* 工具栏、表格操作、切换组 */
.lottery-btn-md { padding: 7px 16px;  font-size: 13px; border-radius: 8px; } /* 主动作、弹窗footer */

/* ---- Variant: Default (描边按钮) ---- */
.lottery-btn-default {
    background: #ffffff;
    color: #475569;
    border-color: #e2e8f0;
}
.lottery-btn-default:hover { background: #f1f5f9; border-color: #cbd5e1; color: #2563eb; }

/* ---- Variant: Primary (主操作-紫色渐变) ---- */
.lottery-btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.lottery-btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}

/* ---- Variant: Accent (强调-浅紫) ---- */
.lottery-btn-accent {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border-color: #c4b5fd;
    color: #6d28d9;
    font-weight: 700;
}
.lottery-btn-accent:hover {
    background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
    border-color: #a78bfa;
    color: #5b21b6;
}

/* ---- Variant: Danger (危险-红色) ---- */
.lottery-btn-danger {
    background: #ffffff;
    border-color: #fecaca;
    color: #ef4444;
}
.lottery-btn-danger:hover { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }

/* ---- Variant: Ghost (幽灵-透明) ---- */
.lottery-btn-ghost {
    background: transparent;
    border-color: transparent;
    color: #94a3b8;
}
.lottery-btn-ghost:hover { background: #fef2f2; border-color: #fecaca; color: #ef4444; }

/* ---- Disabled state ----
   !important 必须保留: disabled 需覆盖所有变体类(default/primary/accent/danger/ghost)
   这些变体可能已应用到同一按钮上，disabled 优先级最高
*/
.lottery-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #e2e8f0 !important;
    color: #94a3b8 !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

/* Legacy alias: lot-btn-sm → lottery-btn-sm + default (工具栏辅助按钮) */
.lot-btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #5c6370;
    background: var(--gh-bg);
    border: 1px solid var(--gh-border-light);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.lot-btn-sm:hover { background: #f0f4ff; border-color: #b8c5e8; color: #2563eb; }
.lot-btn-sm.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.lot-btn-sm.primary:hover { background: #1d4ed8; }

/* === Lottery Match Table === */
.lottery-match-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--gh-bg);
    border: 1px solid var(--gh-border-light);
    border-radius: var(--gh-radius-lg);
    overflow: hidden;
    box-shadow: var(--gh-shadow-sm);
    /* 表格布局策略: fixed 提升性能，列宽由 th width 属性控制 */
    table-layout: fixed;
}
/* ---- 列宽语义类 (配合 HTML th 上的 width%) ---- */
.lottery-match-table .col-idx      { width: 4%; }   /* 序号 */
.lottery-match-table .col-league   { width: 7%; }   /* 联赛 */
.lottery-match-table .col-time     { width: 8%; }   /* 比赛时间 */
.lottery-match-table .col-team     { width: 11%; }  /* 主队/客队 */
.lottery-match-table .col-score    { width: 5%; }   /* 赛果 */
.lottery-match-table .col-had      { width: 6%; }   /* 胜平负 HAD */
.lottery-match-table .col-odds-type{ width: 12%; }  /* 数据类型(下拉) */
.lottery-match-table .col-data     { width: 12%; }  /* 数据值 */
.lottery-match-table .col-selection{ width: 8%; }  /* 选择显示 */

.lottery-match-table th {
    background: linear-gradient(to bottom, #f8f9fb, #f1f3f6);
    color: #5c6370;
    font-size: 12px;
    font-weight: 600;
    padding: 10px 6px;
    text-align: center;
    border-bottom: 1px solid var(--gh-border-light);
    white-space: nowrap;
    vertical-align: middle;
    letter-spacing: 0.3px;
}
.lottery-match-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #f0f2f5;
    font-size: 12px;
    color: #3c4043;
    text-align: center;
    vertical-align: middle;
}
.lottery-match-table tr:hover td:not(.odds-cell.selected):not(.selected) { background-color: #f8f9fb; }
.lottery-match-table tr:last-child td { border-bottom: none; }

/* === HAD Odds Button === */
.lot-had-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--gh-bg);
    border: 1px solid var(--gh-border-light);
    border-radius: var(--gh-radius-lg);
    padding: 6px 10px;
    min-width: 48px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: var(--gh-shadow-sm);
}
.lot-had-btn:hover {
    background-color: #f0f4ff;
    border-color: #b8c5e8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
.lot-had-btn.user-selected {
    background: linear-gradient(135deg, #e8f0ff 0%, #d4e4ff 100%);
    border-color: #4a8aff;
    border-width: 2px;
    box-shadow: 0 2px 6px rgba(74,138,255,0.25);
}
.lot-had-btn .odd { font-size: 13px; font-weight: 600; color: #3c4043; }
/* user-selected 特异性(0-2-0) > 基础(0-1-0) */
.lot-had-btn.user-selected > .odd { color: #2563eb; }

/* === Odds Cell === */
.odds-cell {
    font-size: 13px;
    font-weight: 700;
    color: #1e40af;
    transition: all 0.15s ease;
    border-radius: var(--gh-radius-sm);
}
.odds-cell.clickable:not(.selected):hover {
    background: #dbeafe;
    transform: scale(1.02);
}
.odds-cell.selected {
    background: #f97316;
    color: #ffffff;
    font-weight: 700;
}

/* === Win Highlight (finished match - winning side by odds rank) === */
/* td. 前缀提高特异性(0-2-0 > .odds-cell 的 0-1-0)，无需 !important */
td.odds-cell.win-highlight {
    color: #ffffff;
    font-weight: 700;
    border-radius: 4px;
    border: none;
}
td.odds-cell.win-highlight.odds-rank-lowest {
    background: #3c64db;  /* lowest odds - blue */
    box-shadow: 0 2px 6px rgba(60, 100, 219, 0.3);
}
td.odds-cell.win-highlight.odds-rank-mid {
    background: #d8cb29;  /* mid odds - gold */
    box-shadow: 0 2px 6px rgba(216, 203, 41, 0.3);
}
td.odds-cell.win-highlight.odds-rank-highest {
    background: #ed5427;  /* highest odds - orange-red */
    box-shadow: 0 2px 6px rgba(237, 84, 39, 0.3);
}

/* === Selection Display (选择名称显示) === */
.selection-display {
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
}
.selection-display.has-selection {
    color: #f97316;
    font-weight: 700;
}

/* === Prev Prize Modal (上一期中奖) === */
.lottery-prevprize-dialog { max-width: 520px; }
.lottery-prev-content {
    padding: 16px 20px;
    overflow-y: auto;
    max-height: 60vh;
    min-height: 100px;
}

#prev-prize-modal .gh-border {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: #f8fafc;
}
#prev-prize-modal h4 {
    padding: 8px 0 4px;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 10px;
}
#prev-prize-modal .gh-grid > div {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 14px;
    transition: box-shadow 0.15s ease;
}
#prev-prize-modal .gh-grid > div:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* === Team Names === */
.team-name { font-weight: 500; font-size: 12px; color: #3c4043; }
.team-home { color: #3c4043; }
.team-away { color: #3c4043; }
.vs-text { color: #a0aec0; font-size: 10px; margin: 0 3px; font-weight: 500; }

/* === Loading / Empty States === */
.lottery-loading { text-align: center; padding: 60px 20px; color: var(--gh-text-tertiary); }
.lottery-loading i { font-size: 32px; display: block; margin-bottom: 12px; color: var(--gh-border); }
.lottery-empty { text-align: center; padding: 60px 20px; color: var(--gh-text-tertiary); }
.lottery-empty i { font-size: 48px; display: block; margin-bottom: 12px; color: var(--gh-border); }
.lottery-empty .title { font-size: 16px; font-weight: 600; color: var(--gh-text-secondary); margin-bottom: 4px; }
.lottery-empty .desc { font-size: 13px; }

/* === Prize Pool === */
.prize-pool { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.prize-item { text-align: center; padding: 8px; background: var(--gh-bg-secondary); border-radius: var(--gh-radius-md); }
.prize-item .tier { font-size: 11px; color: var(--gh-text-secondary); }
.prize-item .amount { font-size: 16px; font-weight: 700; color: var(--gh-success); }

/* === My Selections Panel (내 선택) — 可拖动 === */
#lottery-my-selections-panel {
    position: fixed;
    top: 0;
    right: 0;                          /* 默认右侧滑入 */
    width: 400px;
    height: 100vh;
    max-height: 100vh;
    background: #ffffff;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
    z-index: 1050;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    display: flex;
    flex-direction: column;
}
/* 拖动状态: 禁用transition避免延迟，增强阴影 */
#lottery-my-selections-panel.dragging {
    transition: none;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.25);
    user-select: none;                 /* 防止拖动时选中文本 */
}
#lottery-my-selections-panel.dragging > div:first-child {
    cursor: grabbing;
}

/* Header (拖拽手柄) */
#lottery-my-selections-panel > div:first-child {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    cursor: grab;                     /* 提示可拖动 */
}
#lottery-my-selections-panel > div:first-child h3 {
    margin: 0;
    font-size: 16px;
}
#lottery-my-selections-panel > div:nth-child(2) {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

/* Overlay */
#lottery-my-selections-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
#lottery-my-selections-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

/* Selection Cards inside panel */
/* hover 只设置 box-shadow/transform，不修改 border，无需 !important */
#lot-my-selections-list > div {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #f8fafc;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
#lot-my-selections-list > div:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}
#lot-my-selections-list > div strong {
    font-size: 14px;
    color: #1e293b;
}
#lot-my-selections-list > div > div:nth-child(2) {
    margin-top: 6px;
    color: #64748b;
}
#lot-my-selections-list > div > div:nth-child(3) {
    margin-top: 2px;
    color: #94a3b8;
    font-size: 11px;
}
/* Action buttons in selection panel — SM size */
#lot-my-selections-list button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s ease;
}
#lot-my-selections-list button:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #2563eb;
}
#lot-my-selections-list button.gh-text-danger:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

/* === Selection Card (我的选择列表卡片)
   hover 只设置 box-shadow/transform，不修改 border，无需 !important
*/
.lottery-sel-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #f8fafc;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.lottery-sel-card:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}
/* Header row */
.lottery-sel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.lottery-sel-header strong {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}
/* Badges area */
.lottery-sel-badges {
    display: flex;
    align-items: center;
    gap: 6px;
}
/* Category tag (ZC/RJ) — XS size */
.lottery-sel-tag {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}
.lottery-sel-tag-zc { background: #ede9fe; color: #6d28d9; }
.lottery-sel-tag-rj { background: #dbeafe; color: #1d4ed8; }
/* Bet type badge (实盘/模拟) — XS size */
.lottery-bettype-real {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: #dcfce7;
    color: #166534;
}
.lottery-bettype-mock {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    background: #dbeafe;
    color: #1e40af;
}
/* Meta info line */
.lottery-sel-meta {
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
}
/* Timestamp */
.lottery-sel-time {
    margin-top: 2px;
    font-size: 11px;
    color: #94a3b8;
}
/* Action buttons row */
.lottery-sel-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}
/* Restore button — SM size
   使用 #lot-my-selections-list 前缀提高选择器特异性(1-1-1)，
   自然覆盖 #lot-my-selections-list button:hover(1-0-2)，无需 !important
*/
#lot-my-selections-list .lottery-btn-restore {
    flex: 1;
    justify-content: center;
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 6px;
    background: #ffffff;
    border-color: #d1d5db;
    color: #475569;
}
#lot-my-selections-list .lottery-btn-restore:hover {
    background: #f1f5f9;
    border-color: #818cf8;
    color: #6366f1;
}
/* Delete button — SM size
   同上，提高特异性覆盖通用button hover样式
*/
#lot-my-selections-list .lottery-btn-delete {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 6px;
    background: #ffffff;
    border-color: #fecaca;
    color: #ef4444;
}
#lot-my-selections-list .lottery-btn-delete:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}
/* Empty state */
.lottery-sel-empty {
    text-align: center;
    padding: 32px 16px;
    color: #94a3b8;
    font-size: 13px;
}
/* Error state */
.lottery-sel-error {
    text-align: center;
    padding: 12px 16px;
    font-size: 12px;
    color: #ef4444;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
}

/* ==========================================
   Dialog Backdrop (遮罩层)
   ========================================== */
dialog.gh-modal::backdrop {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ==========================================
   Save Dialog (方案保存)
   ========================================== */
.lottery-chart-dialog { max-width: 640px; }
.lottery-save-dialog { max-width: 480px; }
.lottery-prevprize-dialog { max-width: 520px; }
.lottery-save-inner {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.08);
}
.lottery-save-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #ede9fe 100%);
    border-bottom: 1px solid #e2e8f0;
}
.lottery-save-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}
.lottery-save-close {
    cursor: pointer;
    background: none;
    border: none;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 18px;
    color: #94a3b8;
    transition: all 0.15s ease;
}
.lottery-save-close:hover { background: rgba(0,0,0,0.08); color: #ef4444; }
.lottery-save-close:active { transform: scale(0.92); }

/* Body */
.lottery-save-body { padding: 16px 20px; }

/* Summary card inside dialog */
.lottery-save-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
}
.lottery-save-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 0;
    font-size: 13px;
}
.lottery-save-label { color: #64748b; }
.lottery-save-val-link { color: #2563eb; }
.lottery-save-val-primary { color: #1e293b; font-weight: 600; }
.lottery-save-val-danger { color: #ef4444; font-weight: 700; }
.lottery-save-val-success { color: #16a34a; font-weight: 700; }

/* Input field */
.lottery-save-field { margin-bottom: 14px; }
.lottery-save-field .lottery-save-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 5px;
}
.lottery-save-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
    background: #ffffff;
    color: #1e293b;
}
.lottery-save-input:focus { border-color:#818cf8; box-shadow:0 0 0 3px rgba(129,140,248,0.15); }
.lottery-save-input::placeholder { color: #9ca3af; }

/* Bet type toggle buttons — SM size */
.lottery-bettype-group {
    display: flex;
    gap: 8px;
}
.lottery-bettype-btn {
    flex: 1;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    background: #ffffff;
    color: #64748b;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.lottery-bettype-btn:hover { background: #f1f5f9; border-color: #cbd5e1; color: #334155; }
.lottery-bettype-btn.active {
    background: linear-gradient(135deg,#ede9fe 0%,#ddd6fe 100%);
    border-color: #a78bfa;
    color: #6d28d9;
}

/* Public toggle */
.lottery-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
}
.lottery-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #8b5cf6;
    cursor: pointer;
}
.lottery-toggle-text { color: #475569; font-weight: 500; }

/* Error message */
.lottery-save-error {
    font-size: 12px;
    color: #ef4444;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 4px;
}
.lottery-save-error.hidden { display: none; }

/* Footer buttons */
.lottery-save-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Footer action buttons — MD size (弹窗/主要操作) */
.lottery-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}
.lottery-btn-cancel {
    background: #ffffff;
    color: #64748b;
    border-color: #d1d5db;
}
.lottery-btn-cancel:hover { background: #f1f5f9; color: #334155; }

.lottery-btn-primary, .lottery-action-save:not(:disabled) {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}
.lottery-btn-primary:hover,
.lottery-action-save:not(:disabled):hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}
.lottery-action-save:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #e2e8f0;
    color: #94a3b8;
}

/* ==========================================
   Info Bar (총 N경기 | 회차: XXXXX)
   ========================================== */
.lottery-info-bar {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
}
.lottery-info-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 13px;
}
.lottery-info-match-count {
    color: #64748b;
}
.lottery-info-match-count strong {
    font-weight: 700;
    color: #2563eb;
}
.lottery-info-issue {
    color: #64748b;
}
.lottery-info-issue strong {
    font-weight: 700;
    color: #334155;
}

/* ==========================================
   Bet Section Bottom Bar (表格下方操作栏)
   ========================================== */
.lottery-bet-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 10px 10px;
    flex-wrap: wrap;
}
.lottery-bet-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}
.lottery-bet-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}
.lottery-bet-label-sub {
    font-size: 12px;
    color: #94a3b8;
}
.lottery-bet-val-danger { font-size: 14px; font-weight: 700; color: #ef4444; }
.lottery-bet-val-success { font-size: 14px; font-weight: 700; color: #16a34a; }
.lottery-bet-val-base { font-size: 14px; font-weight: 600; color: #1e293b; }
.lottery-sep { color: #cbd5e1; font-size: 12px; }
.lottery-bet-spacer { flex: 1; }

/* Action buttons in bet section — SM size (表格下方操作栏) */
.lottery-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
    background: #ffffff;
    color: #475569;
}
.lottery-action-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #2563eb;
}
/* Accent: 정배당 auto-pick - purple highlight */
.lottery-action-accent {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border-color: #c4b5fd;
    color: #6d28d9;
    font-weight: 700;
}
.lottery-action-accent:hover {
    background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
    border-color: #a78bfa;
    color: #5b21b6;
}
/* Ghost: 초기화 clear - subtle */
.lottery-action-ghost {
    background: transparent;
    border-color: transparent;
    color: #94a3b8;
}
.lottery-action-ghost:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #ef4444;
}
