/* game.css - Styles for Cards Against Humanity Crowd Wisdom */

#cah-game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Stats Bar */
.cah-stats {
    display: flex;
    justify-content: space-around;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cah-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.cah-stat-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.cah-stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #000;
}

/* Game Container */
.cah-game {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Black Card */
.cah-black-card-container {
    display: flex;
    justify-content: center;
}

.cah-black-card {
    background: #000;
    color: #fff;
    padding: 30px;
    border-radius: 15px;
    min-height: 150px;
    width: 100%;
    max-width: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    line-height: 1.4;
}

/* Instructions */
.cah-instructions {
    text-align: center;
    color: #666;
    font-size: 16px;
}

.cah-instructions strong {
    color: #000;
}

/* White Cards */
.cah-white-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.cah-white-card {
    background: #fff;
    border: 3px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    font-size: 15px;
    line-height: 1.4;
}

.cah-white-card:hover:not(.cah-revealed) {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    border-color: #4CAF50;
}

.cah-white-card.cah-selected {
    border-color: #4CAF50;
    border-width: 4px;
    background: #f0f9f0;
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(76, 175, 80, 0.3);
}

.cah-white-card.cah-revealed {
    cursor: default;
}

.cah-white-card.cah-winner {
    border-color: #FFD700;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
}

.cah-white-card.cah-winner::after {
    content: '👑';
    position: absolute;
    top: -15px;
    right: -15px;
    font-size: 30px;
    animation: bounce 0.5s ease;
}

.cah-white-card.cah-user-pick.cah-winner {
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.cah-white-card.cah-user-pick:not(.cah-winner) {
    opacity: 0.7;
}

/* Vote bars */
.cah-vote-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: #eee;
    border-radius: 0 0 7px 7px;
    overflow: hidden;
}

.cah-vote-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50 0%, #45a049 100%);
    transition: width 0.5s ease;
}

.cah-winner .cah-vote-fill {
    background: linear-gradient(90deg, #FFD700 0%, #FFA500 100%);
}

.cah-vote-text {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: #666;
    background: rgba(255,255,255,0.9);
    padding: 2px 5px;
    border-radius: 3px;
    margin: 0 10px;
}

/* Buttons */
.cah-actions {
    display: flex;
    justify-content: center;
}

.cah-btn {
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cah-btn-primary {
    background: #4CAF50;
    color: white;
}

.cah-btn-primary:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.cah-btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Results */
.cah-results {
    text-align: center;
    padding: 20px;
}

.cah-result-message {
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

.cah-result-message h3 {
    margin: 0 0 10px 0;
    font-size: 28px;
}

.cah-result-message p {
    margin: 5px 0;
    font-size: 16px;
}

.cah-correct {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    color: #155724;
}

.cah-incorrect {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 2px solid #dc3545;
    color: #721c24;
}

.cah-low-votes {
    font-size: 14px !important;
    color: #856404;
    background: #fff3cd;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px !important;
}

/* Loading and Error States */
.cah-loading,
.cah-error {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #666;
}

.cah-error {
    background: #f8d7da;
    border-radius: 10px;
    color: #721c24;
}

/* Animations */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .cah-white-cards-container {
        grid-template-columns: 1fr 1fr;
    }
    
    .cah-black-card {
        font-size: 18px;
        padding: 25px;
    }
    
    .cah-stats {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .cah-white-card {
        font-size: 14px;
        min-height: 100px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .cah-white-cards-container {
        grid-template-columns: 1fr;
    }
}