#question-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

#question-overlay.active {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    pointer-events: auto;
    padding-top: 10px;
}

.question-panel {
    background: rgba(245, 245, 240, 0.93);
    border: 3px solid #2D2D2D;
    padding: 14px 24px;
    max-width: 520px;
    width: 80%;
    text-align: center;
    position: relative;
    z-index: 11;
}

.question-text {
    font-family: 'Courier New', monospace;
    font-size: 17px;
    color: #1A1A1A;
    margin-bottom: 12px;
    line-height: 1.3;
    font-weight: bold;
}

.choices-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}

.choice-btn {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    padding: 8px 12px;
    background: #2D2D2D;
    color: #F5F5F0;
    border: 2px solid #2D2D2D;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    text-align: left;
}

.choice-btn:hover {
    background: #444444;
    transform: translateX(3px);
}

.choice-btn:active {
    transform: translateX(1px);
}

.choice-btn.correct {
    background: #2D8A4E;
    border-color: #2D8A4E;
}

.choice-btn.wrong {
    background: #CC3333;
    border-color: #CC3333;
}

.text-input-container {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.text-input-field {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    padding: 8px 12px;
    flex: 1;
    border: 2px solid #2D2D2D;
    background: #FFFFFF;
    color: #1A1A1A;
    outline: none;
}

.text-input-field:focus {
    border-color: #4A4A4A;
}

.submit-btn {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    padding: 8px 18px;
    background: #2D2D2D;
    color: #F5F5F0;
    border: 2px solid #2D2D2D;
    cursor: pointer;
    transition: background 0.15s;
}

.submit-btn:hover {
    background: #444444;
}

.timer-bar-container {
    width: 100%;
    height: 6px;
    background: #444444;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.timer-bar-fill {
    height: 100%;
    background: #CC3333;
    width: 100%;
    transition: width 0.1s linear;
}

.warning-text {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #CC3333;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.3s;
}

.warning-text.visible {
    opacity: 1;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.question-feedback {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    margin-top: 6px;
    min-height: 20px;
}

.question-feedback.correct {
    color: #2D8A4E;
}

.question-feedback.wrong {
    color: #CC3333;
}

/* ---- Mobile overrides ---- */
@media (max-width: 500px) {
    #question-overlay.active {
        padding-top: 4px;
    }

    .question-panel {
        padding: 8px 12px;
        max-width: 98%;
        width: 98%;
    }

    .question-text {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .choices-container {
        gap: 4px;
        margin-bottom: 6px;
    }

    .choice-btn {
        font-size: 11px;
        padding: 7px 8px;
    }

    .text-input-container {
        flex-direction: column;
        gap: 4px;
    }

    .text-input-field {
        font-size: 14px;
        padding: 8px;
    }

    .submit-btn {
        font-size: 13px;
        padding: 8px 12px;
        width: 100%;
    }

    .question-feedback {
        font-size: 13px;
    }
}
