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

/* Back Button */
.back-button-container {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 100;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.9);
    color: #4a5568;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #667eea;
}

.back-btn span {
    font-size: 1.2rem;
    font-weight: bold;
}

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

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    text-align: center;
}

header {
    margin-bottom: 2rem;
}

header h1 {
    color: #4a5568;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
    color: #718096;
    font-size: 1.1rem;
}

.score-board {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.1rem;
}

.score, .question-count {
    color: #4a5568;
}

.flag-container {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.flag-image {
    max-width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border: 3px solid #e2e8f0;
}

.options-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.option-btn {
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    color: #4a5568;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.option-btn:hover {
    border-color: #667eea;
    background: #f7fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.option-btn.correct {
    border-color: #48bb78;
    background: #f0fff4;
    color: #22543d;
}

.option-btn.incorrect {
    border-color: #f56565;
    background: #fff5f5;
    color: #742a2a;
}

.option-btn.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.result-message {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.1rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-message.correct {
    background: #f0fff4;
    color: #22543d;
    border: 2px solid #48bb78;
}

.result-message.incorrect {
    background: #fff5f5;
    color: #742a2a;
    border: 2px solid #f56565;
}

.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.next-btn, .restart-btn, .play-again-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

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

.next-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.restart-btn, .play-again-btn {
    background: #48bb78;
    color: white;
}

.restart-btn:hover, .play-again-btn:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.game-over {
    text-align: center;
    padding: 2rem;
    background: #f7fafc;
    border-radius: 15px;
    margin-top: 2rem;
}

.game-over h2 {
    color: #4a5568;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.game-over p {
    color: #718096;
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.score-save-section {
    margin-bottom: 1.5rem;
    text-align: center;
}

.score-save-section label {
    display: block;
    margin-bottom: 0.5rem;
    color: #4a5568;
    font-weight: 500;
}

.score-save-section input {
    width: 100%;
    max-width: 200px;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.score-save-section input:focus {
    outline: none;
    border-color: #667eea;
}

.save-score-btn {
    background: #667eea;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.save-score-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.save-score-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.save-message {
    margin-top: 0.5rem;
    font-weight: 500;
    min-height: 20px;
}

.save-message.success {
    color: #48bb78;
}

.save-message.error {
    color: #f56565;
}

.nav-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

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

.stats-btn:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .options-container {
        grid-template-columns: 1fr;
    }
    
    .flag-image {
        height: 150px;
    }
    
    .score-board {
        flex-direction: column;
        gap: 0.5rem;
    }
}
