* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    max-width: 900px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    backdrop-filter: blur(10px);
}

.header {
    text-align: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 2.5rem;
    color: #333;
    margin: 0 0 10px 0;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header p {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    font-weight: 600;
}

.round-info {
    font-size: 1.2rem;
    color: #333;
}

.score-info {
    font-size: 1rem;
    color: #666;
}

.instruction {
    text-align: center;
    margin-bottom: 40px;
}

.instruction h2 {
    font-size: 1.5rem;
    color: #333;
    margin: 0;
    font-weight: 600;
}

.card-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cards-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.card-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    border: 3px solid transparent;
    width: fit-content;
    height: fit-content;
}

.card-option:hover {
    transform: translateY(-5px) scale(1.05);
}

.card-option:hover .card-image {
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    border: 3px solid #667eea;
    border-radius: 8px;
}

.card-option.selected {
    transform: scale(1.05);
}

.card-option.selected .card-image {
    border: 3px solid #667eea;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.card-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    border-radius: 8px;
}


.reveal-section {
    text-align: center;
}

.reveal-section h2 {
    font-size: 2rem;
    margin: 0 0 30px 0;
    color: #333;
}

.reveal-cards {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.reveal-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.reveal-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    color: #666;
    font-weight: 600;
}

.reveal-image {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 10px;
}


.next-button, .reset-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.next-button:hover, .reset-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.results-screen {
    text-align: center;
}

.results-screen h2 {
    font-size: 2.5rem;
    color: #333;
    margin: 0 0 30px 0;
    font-weight: 700;
}

.score-summary {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.score-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.score-label {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
}

.score-value.above-chance {
    color: #27ae60;
}

.score-value.below-chance {
    color: #e74c3c;
}

.game-history {
    margin-bottom: 30px;
}

.game-history h3 {
    font-size: 1.5rem;
    color: #333;
    margin: 0 0 20px 0;
    font-weight: 600;
}

.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.history-cards {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-card {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.history-item.correct {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #27ae60;
}

.history-item.incorrect {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #e74c3c;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .cards-grid {
        gap: 15px;
    }
    
    .reveal-cards {
        gap: 20px;
    }
    
    .score-summary {
        grid-template-columns: 1fr;
        padding: 20px;
    }
    
    .history-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation for card selection */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.card-option:hover {
    animation: pulse 0.6s ease-in-out;
}

/* Loading animation for images */
.card-image {
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
