﻿/* =========================
   EQ Ninjas – Let's Review (mr-*)
   No-scroll, phone-first layout
   ========================= */

.mr-wrapper {
    display: flex;
    flex-direction: column;
    height: 100dvh; /* dynamic viewport height (better on mobile) */
    padding: 0.75rem; /* tighter overall padding */
    box-sizing: border-box;
    overflow: hidden; /* no page scrolling */
}

/* ---------- Header ---------- */
.mr-header {
    text-align: center;
    margin-bottom: 0.5rem; /* tightened */
}

/* When .mr-hide-footer is present on the PageShell root, hide its footer wrapper entirely */
.eqn-page.mr-hide-footer .eqn-footer {
    display: none !important;
}


.mr-header img {
    width: 110px; /* slightly smaller to save vertical space */
    height: auto;
    border: none;
    padding: 0;
    background: none;
    border-radius: 0;
}

.mr-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--ninja-color, #f7b32b);
    margin: 0.4rem 0 0;
}

/* ---------- Quote / Prompt Block ---------- */
.mr-quote {
    background-color: #f5f5fc;
    padding: 0.75rem; /* tighter */
    border-left: 4px solid #888;
    margin-bottom: 0.75rem; /* tighter */
    font-style: italic;
    line-height: 1.45; /* tighter */
    border-radius: 6px;
}

/* ---------- Blanks ---------- */
.mr-blank,
.wgi-blank {
    display: inline-block;
    min-width: 72px; /* slightly smaller */
    border: 2px dashed #ff923e;
    border-radius: 8px;
    padding: 0.6em 0.35em; /* tighter */
    margin: 0 2px;
    font-weight: bold;
    color: #333;
    vertical-align: middle;
    line-height: .5;
}

    .mr-blank.filled {
        background-color: #e6ffe6;
        transition: background-color 0.3s ease;
    }

/* ---------- Middle: Question + Options (NO SCROLL) ---------- */
.mr-question {
    flex: 1 1 auto; /* takes remaining space but can shrink */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* keep content toward top of this section */
    text-align: center;
    overflow: hidden; /* no internal scrolling */
    margin-bottom: -.5rem; /* tighter to keep footer visible */
}

    .mr-question strong {
        display: block;
        font-size: 1.5rem;
        margin-bottom: 0.4rem; /* tighter */
        color: #333;
    }

.mr-full-sentence {
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.6; /* tighter */
    margin-bottom: 0.8rem; /* tighter */
    text-align: center;
    font-style: normal;
    color: #222;
    padding: 0 0.25rem; /* small side padding to prevent wrap overflow */
}

/* Options row – wraps to keep everything visible */
.mr-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem; /* tighter */
    margin-top: 0.5rem; /* tighter */
    padding: 0 0.25rem;
}

.mr-option-btn {
    padding: 0.6rem 0.9rem; /* tighter */
    background-color: #f0f0f0;
    border-radius: 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: 2px solid transparent;
    cursor: pointer;
    min-width: 140px; /* a bit smaller to fit more */
    text-align: center;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

    .mr-option-btn:hover {
        background-color: #e0e0e0;
    }

    .mr-option-btn.glow {
        box-shadow: 0 0 0 3px #3b82f6;
        transition: background-color 0.3s ease, box-shadow 0.3s ease;
    }

.mr-disabled-option {
    text-decoration: line-through;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

/* ---------- Feedback / Instructions ---------- */
.mr-feedback {
    margin-top: 0.5rem;
    font-weight: bold;
    font-size: 0.98rem;
}

.mr-correct {
    color: var(--ninja-color, green);
}

.mr-incorrect {
    color: red;
}

.mr-instruction {
    font-size: 0.98rem;
    font-weight: 500;
    color: #555;
    margin-top: 0.3rem; /* tighter */
    margin-bottom: 0.25rem; /* tighter */
}

/* ---------- Footer (Pinned, always visible) ---------- */
.mr-footer {
    margin-top: auto; /* pin footer to bottom of wrapper */
    padding-top: 0.6rem;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 1.25rem); /* more bottom space */
    display: flex;
    justify-content: center;
    background: #fff;
    z-index: 10;
    flex-shrink: 0; /* never collapse */
}

.mr-audio-btn {
    padding: 0.65rem 1.25rem; /* tighter */
    background-color: #ffd966;
    border-radius: 1rem;
    font-size: 0.98rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .mr-audio-btn:hover {
        background-color: #ffe490;
    }

.mr-next-btn {
    margin-top: 0; /* removed extra push down */
    padding: 0.65rem 1.25rem; /* tighter */
    background-color: #4caf50;
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 1rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .mr-next-btn:hover {
        background-color: #3b9441;
    }

/* ---------- Final paragraph (no scroll; tighter) ---------- */
.mr-final-header {
    font-size: 1.15rem;
    font-weight: bold;
    text-align: center;
    margin: 0.75rem auto 0.75rem;
}

.mr-final-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center; /* center in the available space */
    align-items: center;
    padding: 0.75rem;
    gap: 0rem; /* tighter */
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.mr-final-sentence {
    font-size: 1.02rem;
    line-height: 1.55; /* tighter */
    max-width: 100%;
    padding: 0 0.25rem;
}

/* ---------- Small phones: stack cleanly & shrink a touch ---------- */
@media (max-width: 480px) {
    .mr-options {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }

    .mr-option-btn {
        width: 100%;
        max-width: 300px;
        min-width: 0; /* allow narrower buttons if needed */
    }
}

/* ---------- Short screens (height-constrained) ---------- */
@media (max-height: 740px) {
    .mr-header img {
        width: 96px;
    }

    .mr-header h2 {
        font-size: 1rem;
    }

    .mr-quote {
        padding: 0.6rem;
        margin-bottom: 0.6rem;
    }

    .mr-full-sentence {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 0.9rem
    }

    .mr-option-btn {
        padding: 0.3rem 0.9rem;
        font-size: 0.95rem;
    }

    .mr-audio-btn, .mr-next-btn {
        padding: 0.6rem 1.1rem;
        font-size: 0.95rem;
    }
}

@media (max-height: 660px) {
    .mr-header {
        margin-bottom: 0.5rem;
    }

        .mr-header img {
            width: 88px;
        }

        .mr-header h2 {
            font-size: 1.05rem;
        }

    .mr-quote {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
        line-height: 1.4;
    }

    .mr-blank, .wgi-blank {
        min-width: 60px;
        padding: 0.5em 0.3em;
    }

    .mr-question strong {
        font-size: 1rem;
        margin-bottom: 0.35rem;
    }

    .mr-full-sentence {
        font-size: 0.92rem;
        line-height: 1.45;
        margin-bottom: 0.6rem;
    }

    .mr-options {
        gap: 0.45rem;
        margin-top: 0.45rem;
    }

    .mr-option-btn {
        min-width: 128px;
        padding: 0.5rem 0.85rem;
        font-size: 0.92rem;
    }

    .mr-final-header {
        font-size: 1.05rem;
        margin: 0.6rem 0;
    }

    .mr-final-sentence {
        font-size: 0.98rem;
        line-height: 1.45;
    }

    .mr-footer {
        padding-top: 0.5rem;
    }

    .mr-audio-btn, .mr-next-btn {
        padding: 0.55rem 1rem;
        font-size: 0.92rem;
    }
}


/* Shrink top quote and sentence blocks inside the review page */
.eqn-page .mr-quote,
.eqn-page .mr-full-sentence {
    font-size: 1rem; /* was ~0.98rem */
    line-height: 1.35; /* tighter */
    padding: 0.5rem; /* less padding */
    margin-bottom: 2rem; /* less margin */
}

/* On very small screens (short iPhones, etc.), shrink even more */
@media (max-height: 740px) {
    .eqn-page .mr-quote,
    .eqn-page .mr-full-sentence {
        font-size: .9rem;
        line-height: 1.3;
        padding: 0.4rem;
        margin-bottom: .75rem;
    }
}
