/* Quiz Button */
.quiz-btn {
    padding: 0.8rem 2rem;
    background: var(--donut-pink);
    color: white;
    border: 3px solid #000;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

.quiz-btn:hover {
    transform: translateY(-3px) rotate(-2deg);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.3);
    background: #ff7eb9;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: white;
    padding: 1.5rem;
    border-radius: 24px;
    border: 4px solid #000;
    width: 100%;
    max-width: 600px;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
    text-align: center;
    box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
}

.close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.8rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #000;
    transition: color 0.2s;
    z-index: 20;
    line-height: 1;
}

.close-btn:hover {
    color: var(--donut-pink);
}

.hidden {
    display: none !important;
}

/* Quiz Start Screen */
#quiz-start-screen h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--simpson-yellow);
    text-shadow: 2px 2px 0 #000;
    margin-bottom: 1rem;
    margin-top: 1rem;
}

#quiz-start-screen p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.primary-btn,
.secondary-btn {
    padding: 0.6rem 1.5rem;
    border: 3px solid #000;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.2);
    margin: 0.5rem;
}

.primary-btn {
    background: var(--simpson-blue);
    color: #000;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.2);
    background: #8ce1f5;
}

.secondary-btn {
    background: #fff;
    color: #000;
}

.secondary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.2);
    background: #f0f0f0;
}

/* Quiz Interface */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--text-secondary);
    padding-right: 2.5rem;
    min-height: 2rem;
}

.question-container h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    margin-bottom: 0.8rem;
    color: #000;
    line-height: 1.1;
    min-height: 3.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    flex-grow: 1;
    width: 100%;
}

.quiz-option {
    border: 3px solid #000;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    aspect-ratio: 1/1;
    position: relative;
    background: #ffffff;
    width: 100%;
    margin: 0;
}

.quiz-option img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.4rem;
}

.quiz-option:hover {
    transform: scale(1.02);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
    border-color: var(--simpson-blue);
}

.quiz-option.correct {
    border-color: #4CAF50;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.3);
}

.quiz-option.wrong {
    border-color: #F44336;
    opacity: 0.6;
}

/* Result Screen */
#quiz-result-screen h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

#medal-display {
    margin: 1rem 0;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 20px;
    border: 2px dashed #ccc;
}

.medal-icon {
    font-size: 4rem;
    margin-bottom: 0.5rem;
    display: block;
}

#medal-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--donut-pink);
}

#final-score {
    font-weight: bold;
    color: var(--simpson-blue);
    font-size: 1.5rem;
}

/* Responsive Quiz - Mobile Optimization */
@media (max-width: 600px) {
    .modal {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 1rem;
    }

    .modal-content {
        padding: 1rem;
        max-height: 98vh;
        border-radius: 16px;
        display: flex;
        flex-direction: column;
    }

    .quiz-header {
        margin-bottom: 0.2rem;
        font-size: 0.9rem;
        padding-right: 2rem;
    }

    .question-container h2 {
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
        min-height: 3rem;
    }

    .options-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }

    .quiz-option {
        border-width: 2px;
        border-radius: 10px;
    }

    .quiz-option img {
        padding: 0.2rem;
    }
}