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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.audio-section {
    margin: 1.5rem auto;
    max-width: 600px;
}

.audio-player-container {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.audio-toggle {
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: #2d3748;
    font-size: 1.1rem;
    list-style: none;
    display: block;
    transition: all 0.2s ease;
}

.audio-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
}

.audio-toggle::before {
    content: '▶ ';
    display: inline-block;
    transition: transform 0.2s ease;
}

details[open] .audio-toggle::before {
    transform: rotate(90deg);
}

.audio-content {
    padding: 0 1.5rem 1.5rem;
}

.audio-content p {
    margin-bottom: 1rem;
    color: #4a5568;
}

.audio-iframe {
    width: 100%;
    border: none;
    border-radius: 8px;
    background: #f7fafc;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat {
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: white;
    backdrop-filter: blur(10px);
}

.stat-label {
    font-weight: 600;
}

.screen {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.screen.active {
    display: block;
}

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

.question-card, .result-card, .complete-card, .error-card, .welcome-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin: 0 auto;
}

.question-number {
    color: #667eea;
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.question-text {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
    outline: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.option:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

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

.option.correct {
    background: #48bb78;
    color: white;
    border-color: #48bb78;
}

.option.incorrect {
    background: #f56565;
    color: white;
    border-color: #f56565;
}

.option.disabled {
    pointer-events: none;
    opacity: 0.7;
}

.inline-result {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #e2e8f0;
}

.btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn.primary {
    background: #667eea;
}

.result-status {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
}

.result-status.correct {
    color: #48bb78;
}

.result-status.incorrect {
    color: #f56565;
}

.explanation {
    background: #f7fafc;
    border-left: 4px solid #667eea;
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
    line-height: 1.6;
}

.question-stats {
    text-align: center;
    margin: 1rem 0;
    padding: 0.5rem;
    background: #edf2f7;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #4a5568;
}

#welcome-screen {
    text-align: center;
    background: white;
    border-radius: 15px;
    padding: 3rem 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

#welcome-screen h2 {
    color: #2d3748;
    margin-bottom: 1rem;
}

#welcome-screen p {
    color: #4a5568;
    margin-bottom: 2rem;
    line-height: 1.6;
}

#json-upload {
    display: none;
}

.upload-btn {
    background: #e2e8f0;
    color: #4a5568;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    margin-bottom: 1rem;
}

.upload-btn:hover {
    background: #edf2f7;
    border-color: #a0aec0;
}

.final-stats {
    background: #f7fafc;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.final-stats div {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.complete-card {
    text-align: center;
}

.complete-card h2 {
    color: #48bb78;
    margin-bottom: 1rem;
}

.error-card {
    text-align: center;
}

.error-card h2 {
    color: #f56565;
    margin-bottom: 1rem;
}

.error-instructions {
    text-align: left;
    background: #f7fafc;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.error-instructions h3 {
    color: #2d3748;
    margin-bottom: 1rem;
}

.error-instructions ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.error-instructions li {
    margin: 0.5rem 0;
    line-height: 1.5;
}

.code-block {
    background: #2d3748;
    color: #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
}

.code-block code {
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .stats {
        gap: 1rem;
    }
    
    .question-card, .result-card, .complete-card {
        padding: 1.5rem;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .option {
        padding: 0.75rem;
    }
}