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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

header h1 {
    color: #5a67d8;
    font-size: 2.5em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.score-board {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.2em;
    font-weight: bold;
}

.score, .level {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.level {
    background: linear-gradient(45deg, #2196F3, #1976D2);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.game-area {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.card-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    perspective: 1000px;
}

.card {
    width: 400px;
    height: 250px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    cursor: pointer;
}

.card.flipped {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 3px solid #e2e8f0;
}

.card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border-color: #45a049;
}

.card h2 {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: #5a67d8;
}

.card-back h2 {
    color: white;
}

.card p {
    font-size: 1.1em;
    text-align: center;
    line-height: 1.6;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

button {
    padding: 12px 24px;
    font-size: 1em;
    font-weight: bold;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#new-question-btn {
    background: linear-gradient(45deg, #5a67d8, #4c51bf);
    color: white;
}

#new-question-btn:hover {
    background: linear-gradient(45deg, #4c51bf, #434190);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(90, 103, 216, 0.4);
}

#flip-card-btn {
    background: linear-gradient(45deg, #ed8936, #dd6b20);
    color: white;
}

#flip-card-btn:hover {
    background: linear-gradient(45deg, #dd6b20, #c05621);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237, 137, 54, 0.4);
}

#correct-btn {
    background: linear-gradient(45deg, #48bb78, #38a169);
    color: white;
}

#correct-btn:hover {
    background: linear-gradient(45deg, #38a169, #2f855a);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4);
}

#wrong-btn {
    background: linear-gradient(45deg, #f56565, #e53e3e);
    color: white;
}

#wrong-btn:hover {
    background: linear-gradient(45deg, #e53e3e, #c53030);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 101, 101, 0.4);
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #4CAF50, #45a049);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.stat {
    background: linear-gradient(135deg, #f7fafc, #edf2f7);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.category-selector {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.category-selector h2 {
    text-align: center;
    color: #5a67d8;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.categories {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-btn {
    background: linear-gradient(45deg, #805ad5, #6b46c1);
    color: white;
    padding: 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.category-btn:hover {
    background: linear-gradient(45deg, #6b46c1, #553c9a);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(128, 90, 213, 0.4);
}

.category-btn.active {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    transform: translateX(5px);
}

footer {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    color: #5a67d8;
    font-weight: bold;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
    
    .card {
        width: 300px;
        height: 200px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    button {
        width: 200px;
    }
    
    .score-board {
        flex-direction: column;
        gap: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .card {
        width: 250px;
        height: 180px;
    }
    
    .game-area, .category-selector {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.card:hover {
    animation: pulse 2s infinite;
}

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

.game-area, .category-selector {
    animation: fadeIn 0.6s ease-out;
}
