:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #10b981;
    --error: #ef4444;
    --bg: #0f172a;
    --bg-light: #1e293b;
    --text: #f1f5f9;
    --text-dim: #94a3b8;
    --border: #334155;
}

* {
    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, var(--bg) 0%, #1a1f3a 100%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.container {
    width: 100%;
    max-width: 600px;
    position: relative;
}

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

.screen.active {
    display: block;
}

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

/* Start Screen */
.logo {
    text-align: center;
    margin-bottom: 3rem;
}

.logo h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-dim);
    font-size: 1.1rem;
}

.settings {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dim);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

select:hover {
    border-color: var(--primary);
}

select:focus {
    outline: none;
    border-color: var(--primary);
}

.btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* Game Screen */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 2rem;
}

.progress {
    flex: 1;
}

#question-number {
    display: block;
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 8px;
    background: var(--bg-light);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
    width: 0%;
}

.score {
    font-size: 1.5rem;
    font-weight: 700;
    white-space: nowrap;
}

.question-container {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem;
}

.question {
    font-size: 2rem;
    margin-bottom: 2.5rem;
    line-height: 1.5;
    font-weight: 600;
    color: #ffffff;
}

.answers {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.answer {
    padding: 1.5rem 2rem;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-size: 1.5rem;
    line-height: 1.5;
    font-weight: 500;
    color: #ffffff;
}

.answer:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.answer.correct {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.answer.incorrect {
    background: var(--error);
    border-color: var(--error);
    color: white;
}

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

/* Results Screen */
.results {
    text-align: center;
}

.results h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.final-score {
    margin-bottom: 2rem;
}

.score-circle {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    margin-bottom: 1rem;
}

#final-score {
    font-size: 4rem;
    font-weight: 700;
}

.score-label {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
}

.result-message {
    font-size: 1.5rem;
    color: var(--text-dim);
    margin-bottom: 2rem;
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.loading.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .logo h1 {
        font-size: 2.5rem;
    }
    
    .question {
        font-size: 1.6rem;
    }
    
    .answer {
        font-size: 1.3rem;
        padding: 1.25rem 1.5rem;
    }
    
    .game-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .score-circle {
        width: 150px;
        height: 150px;
    }
    
    #final-score {
        font-size: 3rem;
    }
}
