/* 分析結果顯示樣式 */
.analysis-results {
    background: white;
    border-radius: 12px;
    padding: 10px; /* 減少內距，讓內容更寬 */
    margin-bottom: 10px; /* 減少外距 */
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    flex-shrink: 1; /* 允許內容自然擴展 */
}

.analysis-results h2 {
    margin-bottom: 10px;
    color: #2c3e50;
    text-align: center;
    font-size: 1.1rem;
}

/* 策略標籤 */
.strategy-tabs {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 10px; /* 減少區塊間距 */
    border-bottom: 1px solid #f8f9fa;
    padding-bottom: 10px;
}

.strategy-tab {
    padding: 4px 10px; /* 降低高度 */
    border: 1px solid #ddd;
    background: white;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #495057;
}

.strategy-tab:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    background: #f8f9fa;
}

.strategy-tab.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* 結果內容區域 */
.result-content {
    min-height: 200px;
}

.result-section {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 策略資訊 */
.strategy-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 10px;
    text-align: center;
}

.strategy-info h3 {
    font-size: 0.9rem;
    margin-bottom: 4px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.strategy-desc {
    font-size: 0.7rem;
    opacity: 0.9;
    line-height: 1.3;
}

/* 牌組顯示區域 */
.hands-display {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hand-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.hand-section:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.hand-section h4 {
    color: #495057;
    margin-bottom: 6px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between; /* 標題在左，資訊在右 */
    gap: 6px;
}

.hand-section h4 > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hand-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hand-section h4::before {
    content: '';
    width: 3px;
    height: 12px;
    background: linear-gradient(45deg, #007bff, #0056b3);
    border-radius: 2px;
}

/* 手牌卡片顯示 */
.hand-cards {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.result-card {
    width: 32px;
    height: 44px;
    border-radius: 4px;
    border: 1px solid #333;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.6rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.result-card:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.result-card.spades, .result-card.clubs {
    color: #000;
}

.result-card.hearts, .result-card.diamonds {
    color: #dc3545;
}

.result-card .rank {
    font-size: 0.6rem;
    margin-bottom: 1px;
}

.result-card .suit {
    font-size: 0.7rem;
}

/* 手牌資訊 */
.hand-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.hand-type {
    font-weight: bold;
    color: #495057;
    font-size: 0.7rem;
}

.hand-score {
    color: #007bff;
    font-weight: 500;
    font-size: 0.7rem;
}

/* 有效性狀態 */
.validity-status {
    text-align: center;
    padding: 6px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.7rem;
    margin-top: 6px;
}

.validity-status.valid {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.validity-status.invalid {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

/* 無結果狀態 */
.no-result {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-result h3 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.no-result p {
    line-height: 1.6;
    font-size: 1rem;
}

/* 分析資訊區域 */
.analysis-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px;
    margin-top: 16px;
    border: 1px solid #e9ecef;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: #495057;
}

.info-item span:last-child {
    color: #007bff;
    font-weight: 500;
}

/* 特殊牌型高亮 */
.hand-type.special {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #333;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.9rem;
}

/* 動畫效果 */
.hand-section {
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.6s ease-out forwards;
}

.hand-section:nth-child(1) { animation-delay: 0.1s; }
.hand-section:nth-child(2) { animation-delay: 0.2s; }
.hand-section:nth-child(3) { animation-delay: 0.3s; }

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .strategy-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .strategy-tab {
        padding: 6px 14px; /* 手機也更扁平 */
        font-size: 0.85rem;
    }
    
    .hands-display {
    gap: 12px;
    }
    
    .hand-section {
    padding: 10px;
    }
    
    .hand-cards {
        gap: 6px;
    }
    
    .result-card {
        width: 40px;
        height: 55px;
        font-size: 0.7rem;
    }
    
    .result-card .rank {
        font-size: 0.8rem;
    }
    
    .result-card .suit {
        font-size: 0.9rem;
    }
    
    .hand-info {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .analysis-info {
    padding: 10px;
    }
    
    .info-item {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .analysis-results {
    padding: 12px;
    }
    
    .strategy-info {
    padding: 10px;
    }
    
    .strategy-info h3 {
        font-size: 1.2rem;
    }
    
    .strategy-desc {
        font-size: 0.9rem;
    }
    
    .hand-section h4 {
        font-size: 1.1rem;
    }
    
    .result-card {
        width: 35px;
        height: 48px;
        font-size: 0.6rem;
    }
    
    .result-card .rank {
        font-size: 0.7rem;
    }
    
    .result-card .suit {
        font-size: 0.8rem;
    }
}
