* {
    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;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 800px;
    width: 100%;
    background: white;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

.screen {
    padding: 40px;
    min-height: 400px;
}

.hidden {
    display: none !important;
}

/* Welcome Screen */
.character-icons {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
}

.character {
    font-size: 5em;
    animation: bounce 2s infinite;
}

.character:nth-child(2) {
    animation-delay: 0.2s;
}

.character:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

#welcome-screen h2 {
    text-align: center;
    font-size: 2em;
    color: #333;
    margin: 20px 0;
}

.category-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-size: 1.3em;
    cursor: pointer;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s;
}

.checkbox-label:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

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

.checkbox-label span {
    font-weight: 500;
    color: #333;
}

.quiz-timer {
    padding: 10px 20px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 20px;
    font-weight: bold;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    font-size: 1.2em;
    font-weight: bold;
    gap: 10px;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 20px;
}

.btn-tertiary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 15px;
}

.btn-tertiary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 20px;
    font-size: 1.5em;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    margin-top: 20px;
}

.btn-secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(245, 87, 108, 0.6);
}

.btn:active {
    transform: translateY(0);
}

/* Quiz Screen */
.quiz-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    font-size: 1.2em;
    font-weight: bold;
}

.question-number, .score-display {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
}

.question-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#question-text {
    font-size: 1.5em;
    text-align: center;
}

.answer-container {
    display: grid;
    gap: 15px;
}

.answer-btn {
    padding: 20px;
    font-size: 1.2em;
    border: 3px solid #667eea;
    border-radius: 15px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    font-weight: 500;
}

.answer-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    background: #f8f9ff;
}

.answer-btn.correct {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

.answer-btn.incorrect {
    background: #f44336;
    color: white;
    border-color: #f44336;
}

.answer-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Results Screen */
.result-box {
    text-align: center;
    padding: 40px;
}

#result-title {
    font-size: 2.5em;
    margin-bottom: 30px;
    color: #333;
}

.final-score {
    font-size: 2em;
    margin-bottom: 30px;
    color: #667eea;
}

#score-message {
    font-size: 1.3em;
    margin-bottom: 30px;
    color: #666;
}

.result-animation {
    font-size: 8em;
    margin: 30px 0;
}

@keyframes celebrate {
    0% { transform: scale(1); }
    50% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1); }
}

.celebrate {
    animation: celebrate 0.5s ease-in-out;
}

#loading {
    text-align: center;
    padding: 40px;
    font-size: 1.5em;
    color: #667eea;
}

/* Responsive */
/* Leaderboard Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.modal-body {
    padding: 30px;
}

.leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s;
}

.leaderboard-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.leaderboard-rank {
    font-size: 1.5em;
    font-weight: bold;
    margin-right: 15px;
    min-width: 50px;
    text-align: center;
}

.leaderboard-details {
    flex: 1;
}

.leaderboard-name {
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
}

.leaderboard-stats {
    color: #666;
    font-size: 0.9em;
    margin-top: 5px;
}

.leaderboard-score {
    font-weight: bold;
    color: #667eea;
    font-size: 1.2em;
}

.empty-leaderboard {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-leaderboard p {
    font-size: 1.2em;
    margin-bottom: 10px;
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.8em;
    }
    
    .character {
        font-size: 3em;
    }
    
    #question-text {
        font-size: 1.2em;
    }
    
    .btn {
        font-size: 1.2em;
        padding: 15px;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .leaderboard-item {
        padding: 12px;
    }

    .leaderboard-rank {
        font-size: 1.2em;
        min-width: 40px;
    }
}

