* {
    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, #eff6ff 0%, #e0e7ff 100%);
    min-height: 100vh;
    padding: 1.5rem;
}

.container {
    max-width: 56rem;
    margin: 0 auto;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Level Selection Screen */
.header {
    text-align: center;
    margin-bottom: 3rem;
    margin-top: 2rem;
}

.icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    color: #1f2937;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.125rem;
    color: #6b7280;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.level-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.level-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.level-card:nth-child(1):hover {
    border-color: #4ade80;
}

.level-card:nth-child(2):hover {
    border-color: #60a5fa;
}

.level-card:nth-child(3):hover {
    border-color: #a78bfa;
}

.level-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.level-card h2 {
    font-size: 1.5rem;
    color: #1f2937;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.level-card p {
    color: #6b7280;
    font-size: 1rem;
}

/* Quiz Screen */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.back-button {
    background: none;
    border: none;
    color: #4f46e5;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s;
}

.back-button:hover {
    color: #3730a3;
}

.question-counter {
    font-size: 0.875rem;
    font-weight: 600;
    color: #6b7280;
}

.quiz-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.level-badge {
    display: inline-block;
    background: #e0e7ff;
    color: #4f46e5;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

.word {
    font-size: 2.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 2rem;
    text-align: center;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-button {
    width: 100%;
    padding: 1.25rem;
    text-align: center;
    border-radius: 0.75rem;
    border: 2px solid #e5e7eb;
    background: white;
    color: #374151;
    font-size: 1.125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.option-button:hover:not(:disabled) {
    border-color: #4f46e5;
    background: #eef2ff;
}

.option-button.correct {
    background: #f0fdf4;
    border-color: #22c55e;
    color: #15803d;
}

.option-button.incorrect {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.option-button.disabled {
    background: #f9fafb;
    border-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.progress-card {
    background: white;
    padding: 1rem;
    border-radius: 0.75rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #6b7280;
    font-weight: 500;
}

.score {
    color: #4f46e5;
    font-weight: 700;
}

.progress-bar {
    background: #e5e7eb;
    border-radius: 9999px;
    height: 0.75rem;
    overflow: hidden;
}

.progress-fill {
    background: #4f46e5;
    height: 100%;
    border-radius: 9999px;
    transition: width 0.5s ease;
    width: 0;
}

/* Result Screen */
.result-card {
    background: white;
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    text-align: center;
    margin-top: 2rem;
}

.trophy {
    font-size: 5rem;
    margin-bottom: 1.5rem;
}

.result-card h2 {
    font-size: 2.25rem;
    color: #1f2937;
    margin-bottom: 1rem;
    font-weight: 700;
}

.percentage {
    font-size: 3.75rem;
    font-weight: 700;
    color: #4f46e5;
    margin-bottom: 1rem;
}

.result-text {
    font-size: 1.5rem;
    color: #374151;
    margin-bottom: 1rem;
}

.questions-completed {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.message {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.message.excellent {
    color: #16a34a;
}

.message.good {
    color: #2563eb;
}

.message.keep-learning {
    color: #ea580c;
}

.retry-button {
    background: #4f46e5;
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    border: none;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.retry-button:hover {
    background: #4338ca;
}

.homepage-btn {
    margin: 32px auto 0 auto; /* Top/Auto/Bottom/Auto -- centers horizontally */
    display: block;
    padding: 14px 32px;
    font-size: 1.1rem;
    background: #2563eb;
    color: #fff;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.18s;
}
.homepage-btn:hover {
    background: #1e48b8;
}



/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .level-grid {
        grid-template-columns: 1fr;
    }

    .word {
        font-size: 1.875rem;
    }

    .quiz-card {
        padding: 1.5rem;
    }

    .result-card {
        padding: 2rem;
    }

    .percentage {
        font-size: 3rem;
    }
}