/* ================= 梦幻水果游戏专用样式 ================= */

/* 移动端触摸优化 */
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;
}

/* 水果网格布局 */
.fruit-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-top: 15px;
}

/* 水果项目样式 */
.fruit-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;
}

.fruit-item:hover {
    transform: scale(1.03);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.fruit-item.selected {
    border: 2px solid #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
}

/* 水果名称 */
.fruit-name {
    font-weight: bold;
    margin-bottom: 4px;
}

/* 水果投注信息 */
.fruit-bet {
    text-align: left;
    font-size: 0.9rem;
}

.fruit-bet span.has-bet-amount {
    color: red;
    font-weight: bold;
}

/* 水果背景色 - 每行不同颜色 */
.fruit-item:nth-child(5n+1) {
    background-color: rgba(255, 240, 240, 0.6);
}

.fruit-item:nth-child(5n+2) {
    background-color: rgba(255, 250, 220, 0.6);
}

.fruit-item:nth-child(5n+3) {
    background-color: rgba(230, 255, 230, 0.6);
}

.fruit-item:nth-child(5n+4) {
    background-color: rgba(230, 240, 255, 0.6);
}

.fruit-item:nth-child(5n) {
    background-color: rgba(250, 240, 255, 0.6);
}

/* 投注动态区域 */
#betDynamics {
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.dynamic-item {
    padding: 6px 0;
    border-bottom: 1px dashed #eee;
}

/* 冠军显示区域 */
#championDisplay {
    padding: 8px;
    border-radius: 6px;
    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: #28a745;
    border-color: #28a745;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#betButton:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* 投注摘要区域 */
.bet-summary {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px;
    margin-top: 15px;
}

.summary-title {
    font-weight: bold;
    margin-bottom: 8px;
}

.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;
}

/* 清除选择按钮 */
#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;
    }
    
    .fruit-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .fruit-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;
    }
    
    /* 重置背景色适配3列布局 */
    .fruit-item:nth-child(n) {
        background-color: rgba(250, 250, 250, 0.6);
    }
    
    .fruit-item:nth-child(3n+1) {
        background-color: rgba(255, 240, 240, 0.6);
    }
    
    .fruit-item:nth-child(3n+2) {
        background-color: rgba(255, 250, 220, 0.6);
    }
    
    .fruit-item:nth-child(3n) {
        background-color: rgba(230, 255, 230, 0.6);
    }
}

/* 电脑版优化 */
@media (min-width: 768px) {
    .fruit-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 10px;
    }
    
    .fruit-item {
        padding: 10px 8px;
    }
}

/* Alert样式优化 */
.bet-selection .alert {
    font-size: 0.9rem;
    margin-top: 8px;
    margin-bottom: 0;
    padding: 8px;
}

/* 水果项目焦点状态 */
.fruit-item:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

/* 触摸设备优化 */
.fruit-item {
    -webkit-tap-highlight-color: transparent;
}
