/* ==========================================================================
   GTO Matrix Pro · 现代化电竞扑克奢华暗黑色彩规范
   ========================================================================== */

:root {
    --bg-main: #0a0d14;
    --bg-card: rgba(18, 24, 38, 0.82);
    --bg-card-hover: rgba(28, 36, 56, 0.95);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(0, 240, 255, 0.3);
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* GTO 国际标准动作色彩系统 (严格对标 GTO Wizard / PioSolver 行业标准) */
    --color-fold: #2563eb;        /* 弃牌 Fold - 经典 GTO 皇家蓝 */
    --color-call: #16a34a;        /* 跟注/过牌 Call/Check - 经典 GTO 翡翠绿 */
    --color-raise-1: #ef4444;     /* 小加注 / Open - GTO 鲜明红 */
    --color-raise-2: #dc2626;     /* 大加注 / 3-Bet - GTO 纯正红 */
    --color-raise-3: #b91c1c;     /* 巨大加注 / 4-Bet - GTO 砖红色 */
    --color-allin: #7f1d1d;       /* 全下 All-In - GTO 标志性酱暗红 */

    /* 点缀与光效 */
    --accent-cyan: #06b6d4;
    --accent-gold: #fbbf24;
    --accent-purple: #8b5cf6;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 15% 15%, rgba(6, 182, 212, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(245, 158, 11, 0.04) 0%, transparent 40%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 16px 24px 40px;
}

/* ==================== 顶部导航栏 ==================== */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-chip {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 2px solid var(--accent-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--accent-cyan);
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.35);
}

.brand-text h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-text .accent {
    color: var(--accent-cyan);
    background: linear-gradient(90deg, #06b6d4, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text .sub {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    display: block;
    margin-top: 2px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.blueprint-selector-wrap label {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.custom-select {
    background: #0f172a;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.custom-select:hover, .custom-select:focus {
    border-color: var(--accent-cyan);
}

.game-meta-pills {
    display: flex;
    gap: 10px;
}

.meta-pill {
    background: #0f172a;
    border: 1px solid var(--border-subtle);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
}

.meta-pill .label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.meta-pill .value {
    font-size: 14px;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

.highlight-gold {
    color: var(--accent-gold);
}

.highlight-cyan {
    color: var(--accent-cyan);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: #10b981;
}

.status-indicator .dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* ==================== 主内容双栏布局 ==================== */
.main-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    align-items: start;
}

/* ==================== 左侧核心操作区 ==================== */
.board-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* 行动时间轴卡片 */
.timeline-card, .actions-card, .overall-strategy-card, .matrix-card, .detail-card, .guide-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-card);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.btn-reset {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reset:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

.timeline-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-height: 38px;
}

.step-chip {
    background: #0f172a;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.step-chip .step-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
}

.step-chip .step-round {
    color: var(--text-muted);
    text-transform: uppercase;
}

.step-chip .step-player {
    color: var(--accent-cyan);
    font-weight: 700;
}

.step-chip .step-action {
    font-weight: 600;
}

.action-turn-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.3);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}

.action-turn-badge .turn-round {
    color: var(--text-secondary);
}

.action-turn-badge .turn-player {
    color: var(--accent-cyan);
}

.step-chip:hover {
    background: #1e293b;
    border-color: var(--accent-cyan);
}

.step-chip.active {
    background: rgba(6, 182, 212, 0.12);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.step-chip .step-role {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 5px;
    border-radius: 3px;
}

.step-arrow {
    color: var(--text-muted);
    font-size: 12px;
}

/* 决策动作按钮组 */
.actions-card {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.45) 0%, rgba(15, 23, 42, 0.6) 100%);
    border-color: rgba(255, 255, 255, 0.1);
}

.actions-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.actions-header .title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.actions-header .hint {
    font-size: 11px;
    color: var(--text-muted);
}

.actions-button-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.action-btn {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #1e293b;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.action-btn.btn-fold {
    border-left: 4px solid var(--color-fold);
}
.action-btn.btn-fold:hover {
    background: rgba(37, 99, 235, 0.2);
    border-color: #2563eb;
}

.action-btn.btn-call {
    border-left: 4px solid var(--color-call);
}
.action-btn.btn-call:hover {
    background: rgba(22, 163, 74, 0.2);
    border-color: #16a34a;
}

.action-btn.btn-raise {
    border-left: 4px solid var(--color-raise-1);
}
.action-btn.btn-raise:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
}

.action-btn.btn-allin {
    border-left: 4px solid var(--color-allin);
}
.action-btn.btn-allin:hover {
    background: rgba(127, 29, 29, 0.35);
    border-color: #991b1b;
}

.action-btn .sub-freq {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* 总体范围频率条 */
.overall-strategy-card .bar-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
}

.overall-strategy-card .title {
    font-weight: 600;
    color: var(--text-secondary);
}

.overall-strategy-card .combos-info {
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.stacked-bar-container {
    height: 18px;
    background: #0f172a;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
}

.bar-segment {
    height: 100%;
    transition: width 0.4s ease;
}

.legend-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.legend-item .color-badge {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.legend-item .pct {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}

/* ==================== 13x13 范围矩阵网格 ==================== */
.matrix-card {
    padding: 16px 20px;
}

.matrix-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.filter-pills {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-right: 4px;
}

.filter-btn {
    background: #0f172a;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover, .filter-btn.active {
    background: rgba(6, 182, 212, 0.15);
    border-color: var(--accent-cyan);
    color: var(--text-primary);
}

.search-box {
    position: relative;
    width: 180px;
}

.search-box input {
    width: 100%;
    background: #0f172a;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 5px 24px 5px 10px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--accent-cyan);
}

.search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    display: none;
}

.grid-wrapper {
    display: flex;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 4px;
}

.poker-grid {
    display: grid;
    grid-template-columns: repeat(13, minmax(42px, 58px));
    grid-template-rows: repeat(13, minmax(42px, 58px));
    gap: 4px;
    user-select: none;
}

.grid-cell {
    position: relative;
    border-radius: 4px;
    background: #111827;
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.grid-cell:hover {
    transform: scale(1.1);
    z-index: 10;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.65);
    border-color: #38bdf8;
}

.grid-cell.selected {
    border-color: var(--accent-gold);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
    z-index: 11;
}

.grid-cell.dimmed {
    opacity: 0.18;
    filter: grayscale(80%);
}

.grid-cell.highlight-search {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px var(--accent-cyan);
    animation: searchPulse 1.5s infinite;
}

@keyframes searchPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.grid-cell .cell-label {
    position: relative;
    z-index: 2;
    font-size: 12px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.grid-cell.type-pair .cell-label {
    color: #f8fafc;
}
.grid-cell.type-suited .cell-label {
    color: #bae6fd;
}
.grid-cell.type-offsuit .cell-label {
    color: #cbd5e1;
}

/* 渐变动作着色背景 */
.grid-cell .strategy-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* 到达概率半透明遮罩 */
.grid-cell .reach-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1;
    pointer-events: none;
    transition: height 0.3s;
}

/* ==================== 右侧分析边栏 (对标原 Demo rangeInfosParent) ==================== */
.sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.range-infos-parent-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

/* 1. InfoPanel 战局核心状态面板 */
.info-panel {
    background: rgba(15, 23, 42, 0.7);
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.info-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.info-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--text-primary);
}

/* 2. 当前选中手牌的各组合策略图解 (对标原 Demo rangeInfos) */
.range-combos-container {
    padding: 16px 20px;
}

.combos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.combos-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.combos-badge {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 15px;
    font-family: 'JetBrains Mono', monospace;
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

.combos-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.combos-reach-tag {
    font-size: 11px;
    color: #10b981;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 2px 8px;
    border-radius: 4px;
}

.range-combos-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 640px; /* 提高高度，与左侧 13x13 矩阵整体高度更契合 */
    overflow-y: auto;
    padding-right: 6px;
}

/* 自定义精致滚动条 */
.range-combos-grid::-webkit-scrollbar {
    width: 6px;
}
.range-combos-grid::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 3px;
}
.range-combos-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 3px;
}
.range-combos-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

/* 单个具体手牌组合卡片 (对标原 demo rangeInfos li，适度加高) */
.combo-visual-card {
    position: relative;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    padding: 13px 16px; /* 增加内边距，使图块高度更舒展大气 */
    min-height: 64px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.combo-visual-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
    border-color: #38bdf8;
}

.combo-visual-card .combo-bg {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.75;
    pointer-events: none;
}

.combo-visual-card .combo-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.combo-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 4px;
}

.combo-card-top .c-name {
    font-size: 14px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.combo-card-top .c-suits {
    font-size: 13px;
    letter-spacing: 2px;
}

.combo-actions-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.combo-action-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 6px;
    border-radius: 3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.combo-action-pill .act-label {
    color: #e2e8f0;
}

.combo-action-pill .act-pct {
    font-weight: 700;
    color: #38bdf8;
}

/* 战术卡片 */
.guide-card h3 {
    font-size: 13px;
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.guide-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.color-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.fold-dot { background: var(--color-fold); }
.call-dot { background: var(--color-call); }
.raise-dot { background: var(--color-raise-1); }
.allin-dot { background: var(--color-allin); }

.footer-note {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    border-top: 1px solid var(--border-subtle);
    padding-top: 10px;
}

/* 浮动 Tooltip */
.floating-tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 999;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--accent-cyan);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    display: none;
    backdrop-filter: blur(8px);
}

/* 响应式调整 */
@media (max-width: 1280px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

