* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f77f00 0%, #d62828 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

footer {
            background: rgba(0, 0, 0, 0.8);
            color: white;
            text-align: center;
            padding: 2rem 0;
            margin-top: 4rem;
        }


nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: #d62828;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, #f77f00, #d62828);
    border-radius: 50%;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: #f77f00;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: #f77f00;
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: #333;
    margin: 3px 0;
    transition: 0.3s;
}

.quiz-container {
    max-width: 900px;
    margin: 2rem auto;
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.quiz-header {
    background: linear-gradient(45deg, #a11d1d, #d62828);
    color: white;
    padding: 2rem;
    text-align: center;
}

.quiz-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.quiz-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.level-selection {
    padding: 3rem 2rem;
    text-align: center;
}

.initial-name-section {
    margin-bottom: 2rem;
}

.initial-name-section h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.level-selection h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #333;
}

.level-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.level-btn {
    background: linear-gradient(45deg, #f77f00, #d62828);
    color: white;
    border: none;
    padding: 1.5rem 1rem;
    border-radius: 15px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(214, 40, 40, 0.3);
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
}

.level-btn h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.level-btn p {
    font-size: 0.85rem;
    opacity: 0.9;
    line-height: 1.3;
}

.level-btn:active {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(214, 40, 40, 0.4);
}

.level-btn.selected {
    background: linear-gradient(45deg, #2e7d32, #4caf50);
}

.start-quiz-btn {
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    -webkit-appearance: none;
    appearance: none;
}

.start-quiz-btn:active {
    transform: scale(1.03);
}

.start-quiz-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quiz-content {
    display: none;
    padding: 2rem;
}

.quiz-progress {
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #f77f00, #d62828);
    transition: width 0.3s ease;
}

.quiz-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-weight: bold;
}

.question-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.question-num {
    width: 40px;
    height: 40px;
    border: 2px solid #f77f00;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    background: white;
    color: #f77f00;
}

.question-num.current {
    background: #f77f00;
    color: white;
}

.question-num.answered {
    background: #4caf50;
    border-color: #4caf50;
    color: white;
}

.question-container {
    background: #f8f9fa;
    padding: 1.2rem;
    border-radius: 15px;
    margin-bottom: 1.2rem;
}

.question-text {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    color: #333;
}

.options {
    display: grid;
    gap: 1rem;
}

.option {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.option:active {
    border-color: #f77f00;
    transform: translateX(3px);
}

.option.selected {
    border-color: #f77f00;
    background: rgba(247, 127, 0, 0.1);
}

.quiz-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.control-btn {
    background: linear-gradient(45deg, #f77f00, #d62828);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.control-btn:active {
    transform: scale(1.03);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.submit-btn {
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
}

.results-container {
    display: none;
    padding: 3rem 2rem;
    text-align: center;
}

.congratulations {
    font-size: 2rem;
    color: #4caf50;
    margin-bottom: 1rem;
    font-weight: bold;
}

.score-display {
    font-size: 3rem;
    font-weight: bold;
    margin: 2rem 0;
    color: #d62828;
}

.results-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.result-item {
    background: rgba(255, 255, 255, 0.8);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.result-item h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.correct { color: #4caf50; }
.incorrect { color: #f44336; }

.next-level-btn {
    background: linear-gradient(45deg, #4caf50, #8bc34a);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1rem;
    -webkit-appearance: none;
    appearance: none;
}

.next-level-btn:active {
    transform: scale(1.03);
}

.answer-review-section {
    margin-top: 2rem;
    text-align: left;
}

.answer-item {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-left: 5px solid #e0e0e0;
}

.answer-item.correct {
    border-left-color: #4caf50;
    background: rgba(76, 175, 80, 0.05);
}

.answer-item.incorrect {
    border-left-color: #f44336;
    background: rgba(244, 67, 54, 0.05);
}

.answer-item.unanswered {
    border-left-color: #ff9800;
    background: rgba(255, 152, 0, 0.05);
}

.answer-question {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.answer-status {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    color: white;
}

.answer-status.correct { background: #4caf50; }
.answer-status.incorrect { background: #f44336; }
.answer-status.unanswered { background: #ff9800; }

.answer-details {
    display: grid;
    gap: 0.5rem;
}

.answer-row {
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.95rem;
}

.user-answer {
    background: rgba(247, 127, 0, 0.1);
    border: 1px solid #f77f00;
}

.correct-answer {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid #4caf50;
}

.wrong-user-answer {
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid #f44336;
}

.answer-label {
    font-weight: bold;
    margin-right: 0.5rem;
}

.name-input {
    width: 100%;
    max-width: 350px;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    border: 2px solid #f77f00;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    margin-top: 1rem;
    -webkit-appearance: none;
    appearance: none;
}

.name-input:focus {
    border-color: #d62828;
    box-shadow: 0 6px 15px rgba(214, 40, 40, 0.3);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@media (max-width: 1200px) {
    .level-buttons { gap: 0.8rem; }
    .level-btn { padding: 1.2rem 0.8rem; min-height: 110px; }
    .level-btn h3 { font-size: 1rem; }
    .level-btn p { font-size: 0.8rem; }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: left 0.3s ease;
    }

    footer {
            background: rgba(0, 0, 0, 0.8);
            color: white;
            text-align: center;
            padding: 2rem 0;
            margin-top: 4rem;
        }

    .nav-links.active { left: 0; }
    .mobile-menu-btn { display: flex; }
    .quiz-title { font-size: 2rem; flex-direction: column; gap: 0.5rem; }
    .level-buttons { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .quiz-info { flex-direction: column; gap: 1rem; }
    .quiz-controls { flex-direction: column; gap: 1rem; }
    .control-btn { width: 100%; }
    .results-details { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .container, .quiz-container { padding: 0 10px; margin: 1rem auto; }
    .quiz-header { padding: 1.5rem; }
    .level-selection, .quiz-content, .results-container { padding: 2rem 1rem; }
    .question-nav { justify-content: center; }
    .question-num { width: 35px; height: 35px; font-size: 0.9rem; }
    .question-text { margin-bottom: 0.8rem; font-size: 1.1rem; }
    .question-container { padding: 1rem; margin-bottom: 1rem; }
}