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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#app {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    max-width: 800px;
    width: 100%;
    min-height: 500px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.screen {
    transition: opacity 0.3s ease;
}

.hidden {
    display: none !important;
}

/* Category Selection Screen */
#category-screen {
    text-align: center;
}

#category-select {
    width: 100%;
    max-width: 400px;
    padding: 15px;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    margin-bottom: 20px;
    background: white;
    cursor: pointer;
}

#category-select:focus {
    outline: none;
    border-color: #667eea;
}

#start-game {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#start-game:hover:not(:disabled) {
    background: #5a6fd8;
}

#start-game:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Game Screen */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

#back-to-categories {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}

#back-to-categories:hover {
    background: #5a6268;
}

.score {
    display: flex;
    gap: 20px;
    font-size: 1.1rem;
    font-weight: 600;
}

.score span {
    padding: 8px 16px;
    border-radius: 8px;
    background: #f8f9fa;
}

.question-container {
    margin-bottom: 30px;
}

#question-text {
    font-size: 1.3rem;
    line-height: 1.6;
    margin-bottom: 25px;
    color: #333;
}

#answers-container {
    display: grid;
    gap: 15px;
}

.answer-button {
    background: white;
    border: 2px solid #e9ecef;
    padding: 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1rem;
    text-align: left;
    transition: all 0.3s ease;
    position: relative;
}

.answer-button:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.answer-button.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.answer-button.correct {
    border-color: #28a745;
    background: #28a745;
    color: white;
}

.answer-button.incorrect {
    border-color: #dc3545;
    background: #dc3545;
    color: white;
}

.answer-button.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

#result-message {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}

#result-message.correct {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

#result-message.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

#next-question {
    background: #28a745;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: block;
    margin: 0 auto;
}

#next-question:hover {
    background: #218838;
}

/* Game Complete Screen */
.game-complete {
    text-align: center;
    padding: 40px 20px;
}

.game-complete h2 {
    color: #333;
    margin-bottom: 30px;
    font-size: 2rem;
}

.game-complete p {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #666;
}

.btn-primary, .btn-secondary {
    padding: 15px 30px;
    font-size: 1.1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
    border: none;
    margin: 10px;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Responsive Design */
@media (max-width: 768px) {
    #app {
        padding: 20px;
        margin: 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .score {
        justify-content: center;
    }
    
    #answers-container {
        grid-template-columns: 1fr;
    }
}
