/* ================= 投资大亨游戏专用样式 ================= */

/* 移动端触摸优化 */
html {
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-touch-callout: none;
    -ms-touch-action: manipulation;
    touch-action: manipulation;
}

* { 
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* 投注金额按钮样式（配合Bootstrap） */
.bet-amount-btn {
    font-weight: 600;
    transition: all 0.2s ease;
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.bet-amount-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

.bet-amount-btn.active,
.bet-amount-btn:focus {
    transform: translateY(0);
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    box-shadow: 0 2px 8px rgba(108,117,125,0.3);
}

/* 游戏状态区域 */
.game-status-area {
    text-align: left;
    width: 100%;
}

/* 游戏进度条 */
.progress {
    height: 10px;
    margin-bottom: 1px;
}

/* 投资项目网格布局 */
.plant-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 15px;
}

/* 投资项目样式 - 简洁灰色调 */
.plant-item {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px 6px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    background-color: rgba(250, 250, 250, 0.6);
    position: relative;
}

.plant-item:hover {
    transform: scale(1.03);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border-color: #adb5bd;
}

.plant-item.selected {
    border: 2px solid #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
    transform: scale(1.02);
}

/* 植物名称 */
.plant-name {
    font-weight: bold;
    margin-bottom: 4px;
    color: #495057;
}

/* 植物投注信息 */
.plant-bet {
    text-align: left;
    font-size: 0.9rem;
    color: #666;
}

.plant-bet span.has-bet-amount {
    color: #dc3545;
    font-weight: bold;
}

/* 投资项目背景色 - 简洁单一背景 */
.plant-item {
    background-color: rgba(248, 249, 250, 0.8);
    border-color: #dee2e6;
}

/* 投注动态区域 */
#betDynamics {
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.dynamic-item {
    padding: 6px 0;
    border-bottom: 1px dashed #eee;
}

/* 冠军显示区域 */
#championDisplay {
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* 结果显示区域 */
#resultDisplay {
    margin: 5px 0;
    padding: 0;
    min-height: 0;
    font-size: 1.1rem;
}

/* 投注按钮容器 */
.d-flex.mt-3 {
    justify-content: center;
    align-items: center;
    gap: 10px;
}

/* 投注按钮 - 简洁蓝色 */
#betButton {
    flex: 1;
    max-width: 200px;
    background-color: #0d6efd;
    border: 1px solid #0d6efd;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

#betButton:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 投注摘要区域 */
.bet-summary {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
}

.summary-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: #495057;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.summary-total {
    border-top: 1px solid #dee2e6;
    margin-top: 8px;
    padding-top: 8px;
    font-weight: bold;
    color: #0d6efd;
}

/* 清除选择按钮 */
#clearSelectionsBtn {
    background-color: #6c757d;
    border-color: #6c757d;
    flex-shrink: 0;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 投注选择区域 */
.bet-selection {
    margin-top: 5px;
}

/* 响应式调整 - 移动端 */
@media (max-width: 576px) {
    .bet-amount-btn {
        font-size: 0.9rem;
        padding: 0.4rem 0.3rem;
    }
    
    .plant-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .plant-item {
        padding: 6px 3px;
        font-size: 0.85rem;
    }
    
    /* 移动端按钮调整 - 保持水平排列 */
    .d-flex.mt-3 {
        gap: 8px;
    }
    
    #betButton {
        flex: 1;
        max-width: none;
        font-size: 0.9rem;
        padding: 0.5rem 0.3rem;
    }
    
    #clearSelectionsBtn {
        flex-shrink: 0;
        font-size: 0.9rem;
        padding: 0.5rem 0.6rem;
    }
    
    /* 移动端保持简洁背景 */
    .plant-item {
        background-color: rgba(248, 249, 250, 0.8);
        border-color: #dee2e6;
    }
}

/* 电脑版优化 */
@media (min-width: 768px) {
    .plant-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 10px;
    }
    
    .plant-item {
        padding: 10px 8px;
    }
}

/* Alert样式优化 */
.bet-selection .alert {
    font-size: 0.9rem;
    margin-top: 8px;
    margin-bottom: 0;
    padding: 8px;
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-color: #17a2b8;
}

/* 植物项目焦点状态 */
.plant-item:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.25);
}

/* 触摸设备优化 */
.plant-item {
    -webkit-tap-highlight-color: transparent;
}

/* 移除装饰元素，保持简洁 */

/* ================= 历史记录页面样式 ================= */

/* 筛选器区域 */
.filter-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
}

/* 统计摘要卡片 */
.stats-summary {
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.stat-card.win-loss.profit {
    border-color: #28a745;
    background: linear-gradient(135deg, #f8fff8 0%, #e8f5e8 100%);
}

.stat-card.win-loss.loss {
    border-color: #dc3545;
    background: linear-gradient(135deg, #fff8f8 0%, #f8e8e8 100%);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #495057;
    margin-bottom: 5px;
}

.stat-card.win-loss.profit .stat-value {
    color: #28a745;
}

.stat-card.win-loss.loss .stat-value {
    color: #dc3545;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
}

/* 记录项样式 */
.record-item {
    background: linear-gradient(135deg, #fff 0%, #fafafa 100%);
    border: 1px solid #e9ecef !important;
    transition: all 0.3s ease;
}

.record-item:hover {
    border-color: #007bff !important;
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
    transform: translateY(-1px);
}

.record-header {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}

.record-round {
    color: #007bff;
    font-size: 1.1rem;
}

.record-time {
    font-size: 0.9rem;
}

.record-details {
    margin-top: 10px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 2px 0;
}

.detail-label {
    font-weight: 500;
    color: #495057;
    flex-shrink: 0;
    margin-right: 10px;
}

.detail-value {
    font-weight: 600;
    text-align: right;
}

.win-highlight {
    animation: winPulse 2s ease-in-out;
}

@keyframes winPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* 响应式调整 */
@media (max-width: 576px) {
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 12px;
    }
    
    .detail-value {
        text-align: left;
        margin-top: 4px;
    }
    
    .record-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .stat-card {
        padding: 10px;
    }
}

/* ================= 我的结果页面样式 ================= */

/* 成绩摘要卡片 */
.performance-summary {
    margin-bottom: 25px;
}

.performance-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
}

.performance-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
    border-color: #007bff;
}

.performance-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.performance-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #495057;
    margin-bottom: 8px;
}

.performance-label {
    font-size: 0.95rem;
    color: #6c757d;
    font-weight: 500;
}

/* 最近结果卡片 */
.result-card {
    background: linear-gradient(135deg, #fff 0%, #fafafa 100%);
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.result-card.win-result {
    border-left: 4px solid #28a745;
}

.result-card.lose-result {
    border-left: 4px solid #dc3545;
}

.result-round {
    font-weight: bold;
    margin-bottom: 4px;
}

.result-plant {
    font-size: 0.9rem;
    color: #495057;
    margin-bottom: 2px;
}

.result-amount {
    font-size: 0.85rem;
    color: #6c757d;
}

.outcome-badge {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-bottom: 4px;
    display: inline-block;
}

.badge-win {
    background-color: #d4edda;
    color: #155724;
}

.badge-lose {
    background-color: #f8d7da;
    color: #721c24;
}

.profit-loss {
    font-weight: bold;
    font-size: 1.1rem;
}

.profit-percent {
    font-size: 0.85rem;
}

/* 投资分析区域 */
.analysis-section {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}

.analysis-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 15px;
}

.favorite-projects {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 8px;
    padding: 15px;
}

.favorite-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 10px;
}

.rank-badge {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 10px;
}

.project-name {
    font-weight: 500;
    color: #495057;
}

.project-stats {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
}

.bet-count {
    color: #6c757d;
}

.success-rate {
    font-weight: 500;
}

.habits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.habit-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.habit-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 8px;
}

.habit-value {
    font-weight: bold;
    color: #495057;
    font-size: 1.1rem;
}

.suggestion-item {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%) !important;
    border: 1px solid #ffc107;
    font-size: 0.9rem;
}

/* ================= 排行榜页面样式 ================= */

/* 排行榜标签 */
.ranking-tabs .nav-pills .nav-link {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    font-weight: 500;
    border-radius: 8px;
    margin: 0 2px;
    transition: all 0.3s ease;
}

.ranking-tabs .nav-pills .nav-link:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.ranking-tabs .nav-pills .nav-link.active {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-color: #007bff;
    color: white;
    box-shadow: 0 4px 8px rgba(0,123,255,0.3);
}

/* 排行榜项目 */
.ranking-item {
    background: linear-gradient(135deg, #fff 0%, #fafafa 100%);
    border: 1px solid #e9ecef !important;
    transition: all 0.3s ease;
}

.ranking-item:hover {
    border-color: #007bff !important;
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
    transform: translateY(-1px);
}

.ranking-item.top-rank {
    background: linear-gradient(135deg, #fff8dc 0%, #f5f5dc 100%);
    border-color: #ffc107 !important;
}

.ranking-item.top-rank:hover {
    border-color: #e0a800 !important;
    box-shadow: 0 4px 12px rgba(255,193,7,0.3);
}

.rank-number {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.rank-number .rank-text {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 2px;
}

.username {
    font-weight: bold;
    color: #495057;
    margin-bottom: 4px;
}

.user-stats {
    font-size: 0.85rem;
}

.rank-value .main-value {
    font-size: 1.2rem;
    font-weight: bold;
}

/* 我的排名卡片 */
.my-ranking .card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
}

.my-rank-details {
    padding: 10px;
}

.my-rank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.my-rank-item:last-child {
    border-bottom: none;
}

.rank-label {
    font-weight: 500;
    color: #495057;
}

.rank-value {
    font-weight: bold;
}

/* 排行榜头部 */
.ranking-header {
    text-align: center;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    margin-bottom: 20px;
}

/* 响应式调整 */
@media (max-width: 576px) {
    .performance-card {
        padding: 15px;
    }
    
    .performance-value {
        font-size: 1.4rem;
    }
    
    .performance-icon {
        font-size: 1.5rem;
    }
    
    .habits-grid {
        grid-template-columns: 1fr;
    }
    
    .project-stats {
        flex-direction: column;
        gap: 5px;
    }
    
    .rank-value .main-value {
        font-size: 1rem;
    }
    
    .my-rank-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}