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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 600px;
    width: 100%;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.score {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffeb3b;
}

.loading {
    text-align: center;
    color: white;
    font-size: 1.5rem;
    padding: 40px;
}

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

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

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

.card.reverse .card-front {
    background: #4CAF50;
}

.card.reverse .card-back {
    background: white;
}

.card.reverse .card-front .answer {
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    padding: 20px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.card-back {
    transform: rotateY(180deg);
    background: #4CAF50;
    color: white;
}

.card img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 15px;
    object-fit: contain;
}

.answer {
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    padding: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.controls {
    text-align: center;
    margin-bottom: 30px;
}

.btn {
    font-size: 1.2rem;
    padding: 15px 30px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    margin: 0 10px;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn-primary {
    background: #2196F3;
    color: white;
}

.btn-success {
    background: #4CAF50;
    color: white;
}

.btn-wrong {
    background: #f44336;
    color: white;
}

.btn-secondary {
    background: #666;
    color: white;
    font-size: 1rem;
    padding: 10px 20px;
    margin-top: 20px;
}

.progress {
    color: white;
    text-align: center;
}

.progress-text {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.progress-bar {
    background: rgba(255,255,255,0.3);
    border-radius: 25px;
    height: 20px;
    overflow: hidden;
}

.progress-fill {
    background: #4CAF50;
    height: 100%;
    border-radius: 25px;
    transition: width 0.3s;
    width: 0%;
}

.complete {
    text-align: center;
    color: white;
    padding: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.complete h2 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.complete p {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.category-select {
    text-align: center;
    color: white;
    padding: 20px;
}

.category-select h2 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.category-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    color: #333;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    background: rgba(255, 255, 255, 1);
}

.category-card h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #2196F3;
}

.category-card p {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}

.sequential-options {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    margin: 20px auto;
    max-width: 400px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    color: #333;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

@media (max-width: 480px) {
    .card {
        width: 90vw;
        height: 250px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .btn {
        font-size: 1rem;
        padding: 12px 24px;
    }
    
    .answer {
        font-size: 2rem;
    }
    
    .category-select h2 {
        font-size: 2rem;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .category-card {
        padding: 20px 15px;
    }
    
    .category-card h3 {
        font-size: 1.5rem;
    }
}