/* ================================================================
   percent-real-life.css
   ----------------------------------------------------------------
   Styling for "Percentages in Real Life" (Tier 6 — application &
   light word problems) — A.1 Marks & Marksheets, A.2 Discounts &
   Shopping, A.3 Simple Increase/Decrease, and A.4 Percent Change
   Spotting in the Wild — on the Class 5 Math page. Same conventions
   as percent-foundations.css / percent-rwv.css / decimal-rwv.css:
     - reuses the shared .quiz-modal / .card / .quiz-number-opt /
       .bq-feedback / .slot-dot / .frac-parts-stage / .frac-friendly-
       -picker classes (and CSS variables like --sun, --sky, --line,
       --bg-light) from common.css / computation.css / quiz-popup-
       theme.css / quiz-modal-responsive.css / fraction.css, already
       loaded on the page
     - is otherwise fully self-contained: its own answer-chip row
       (.prl-options / .prl-opt — a full-width, always-single-line
       row of 4 text/₹/% chips, same forced-single-line technique as
       percent-foundations.css's .pf-options / .pf-opt, just kept
       independent here) and its own real-world scenes: an exam
       marksheet (A.1), a sale price tag (A.2), a pair of Before/
       After bars (A.3), and a "before -> after" readout plus a
       newspaper-headline card (A.4)
   Loaded on class5-math.html as a plain stylesheet link, after the
   other percent-*.css files:

     <link rel="stylesheet" th:href="@{/css/percent-real-life.css}" />

   The matching modal markup lives in partials/percentage-modals.html
   (fragment "percentageModals", appended after the Comparing &
   Ordering Percentages modals).
   ================================================================ */

/* ---- Big rounded question-sentence card, reused by all four skills
   here since every question is a short word-problem sentence rather
   than a bare picture caption (same idea as percent-foundations.css's
   .pf-question-card, kept as its own class so this file doesn't
   depend on that one). ---- */
.prl-question-card {
    background: var(--bg-light, #f5f7fa);
    border: 3px solid var(--line, #d7dde5);
    border-radius: 18px;
    padding: 18px 22px;
    margin: 10px auto 6px;
    max-width: 560px;
    font-size: clamp(14.5px, 3.9vw, 18.5px);
    font-weight: 700;
    line-height: 1.5;
    color: #1E3A5F;
    text-align: center;
}

/* ---- A.1 Marks & Marksheets: exam marksheet scene ----
   A dashed-border "marksheet" card showing the raw marks/out-of a
   test, quiz, or project — the same numbers already named in the
   question sentence above it, restated visually so the child can
   picture an actual returned test paper while they work out the
   percent. */
.prl-scene-marksheet {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 3px dashed #8a94a6;
    border-radius: 14px;
    padding: 18px 30px;
    min-width: 190px;
    text-align: center;
    box-sizing: border-box;
}
.prl-scene-marksheet-title {
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a94a6;
    font-weight: 700;
}
.prl-scene-marksheet-subject {
    font-size: clamp(12px, 3.2vw, 14px);
    font-weight: 700;
    color: #4a5568;
}
.prl-scene-marksheet-score {
    font-size: clamp(28px, 8vw, 38px);
    font-weight: 800;
    color: #1E3A5F;
}
.prl-scene-marksheet-score small {
    font-size: 0.45em;
    font-weight: 700;
    color: #8a94a6;
}

/* ---- A.2 Discounts & Shopping: sale price-tag scene ----
   A warm "sale tag" card: item name, the original price with a
   strikethrough, a pink "% OFF" badge, and a "New price: ?" line
   that names exactly what the answer chips below are asking for. */
.prl-scene-pricetag {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #fff7e6, #ffe9c7);
    border: 3px solid #f0b429;
    border-radius: 16px;
    padding: 18px 28px;
    min-width: 200px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(30, 58, 95, 0.1);
    box-sizing: border-box;
}
.prl-scene-pricetag-item {
    font-size: clamp(12.5px, 3.4vw, 15px);
    font-weight: 700;
    color: #7a5b12;
    text-transform: capitalize;
}
.prl-scene-pricetag-original {
    font-size: clamp(17px, 4.6vw, 21px);
    font-weight: 700;
    color: #8a94a6;
    text-decoration: line-through;
}
.prl-scene-pricetag-badge {
    display: inline-block;
    background: #f5427d;
    color: #fff;
    font-weight: 800;
    font-size: clamp(13px, 3.6vw, 16px);
    padding: 4px 14px;
    border-radius: 999px;
}
.prl-scene-pricetag-question {
    font-size: clamp(13px, 3.4vw, 15px);
    font-weight: 700;
    color: #1E3A5F;
    margin-top: 2px;
}

/* ---- A.3 Simple Increase/Decrease: Before/After bars ----
   Two columns: a filled "Before" bar (always drawn at a fixed 50%
   reference height, since only the label carries the real number)
   and an unfilled, dashed-outline "After" bar with a "?" mark, so
   the picture never gives the new amount away — it only shows that
   an increase and a decrease from the same start don't mirror each
   other. A pill badge between them carries the "+P%" / "-P%" change. */
.prl-baf-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: clamp(14px, 5vw, 34px);
    margin: 12px auto 4px;
    max-width: 380px;
}
.prl-baf-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: clamp(70px, 20vw, 96px);
}
.prl-baf-track {
    width: 100%;
    height: clamp(110px, 28vw, 160px);
    background: #eef1f5;
    border: 3px solid var(--line, #d7dde5);
    border-radius: 10px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    box-sizing: border-box;
}
.prl-baf-fill {
    width: 100%;
    background: #7ecbff;
    border-radius: 6px 6px 0 0;
}
.prl-baf-col.is-after .prl-baf-track {
    border-style: dashed;
    background: #fff;
    align-items: center;
    justify-content: center;
}
.prl-baf-mark {
    font-size: clamp(24px, 7vw, 32px);
    font-weight: 800;
    color: #b8c0cc;
}
.prl-baf-label {
    font-weight: 800;
    color: #1E3A5F;
    font-size: clamp(12px, 3.3vw, 14.5px);
    text-align: center;
}
.prl-baf-badge {
    align-self: center;
    font-weight: 800;
    font-size: clamp(14px, 3.8vw, 18px);
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: clamp(46px, 13vw, 70px);
    white-space: nowrap;
}
.prl-baf-badge.is-up { background: #e3f9ef; color: #1a9c6d; }
.prl-baf-badge.is-down { background: #fde8ee; color: #d0316b; }

/* ---- A.4 Percent Change Spotting in the Wild: two scene shapes ----
   (a) a "before -> after" readout card for the weather / battery /
   quiz-score snippets, each with their own icon and caption, and
   (b) a newspaper-headline clipping for the population-growth
   snippet, which is a direct-read percent rather than a computed
   change. */
.prl-scene-change {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 3.4vw, 20px);
    background: #eef6ff;
    border: 3px solid #cfe6ff;
    border-radius: 16px;
    padding: 16px 22px;
    box-sizing: border-box;
}
.prl-scene-change-icon { font-size: clamp(28px, 8vw, 38px); line-height: 1; }
.prl-scene-change-caption {
    font-size: clamp(11px, 3vw, 13px);
    font-weight: 700;
    color: #4a7fb5;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.prl-scene-change-readout {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    color: #1E3A5F;
    font-size: clamp(15px, 4.2vw, 19px);
    white-space: nowrap;
}
.prl-scene-change-arrow { color: #8a94a6; font-size: clamp(16px, 4.4vw, 20px); }

.prl-scene-headline {
    background: #fffdf5;
    border: 3px solid #e8dcae;
    border-radius: 14px;
    padding: 18px 24px;
    max-width: 320px;
    text-align: center;
    box-sizing: border-box;
}
.prl-scene-headline-kicker {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b08d1f;
    font-weight: 800;
    margin-bottom: 6px;
}
.prl-scene-headline-text {
    font-size: clamp(14px, 3.8vw, 17px);
    font-weight: 700;
    color: #4a3f1f;
    line-height: 1.4;
}

/* ================================================================
   Answer-chip row — shared by all four skills (A.1-A.4)
   ----------------------------------------------------------------
   Every answer here is a short ₹ amount or a percent value rather
   than a single digit, so these chips read as full-width text pills
   instead of the small fixed circle other skills use elsewhere on
   this page. `flex-wrap: nowrap` + `flex: 1 1 0` on every chip is
   what forces all 4 options onto a single row no matter how narrow
   the screen is (down to small Android phone widths, ~320px) — text
   is allowed to wrap to a second line *inside* a chip instead, and
   font size shrinks gradually via clamp() so labels stay readable
   rather than getting clipped. Same technique as
   percent-foundations.css's .pf-options / .pf-opt, kept as its own
   class here so this file has no dependency on that one.
   ================================================================ */
.prl-picker {
    /* .frac-friendly-picker (fraction.css) caps its own width at
       max-width: 420px — fine for Fraction Match's short fraction
       chips, but too tight for our longer ₹-amount/phrase chips on
       larger screens. Freed here; .prl-options below sets the
       actual responsive width instead. */
    max-width: none !important;
}
.prl-options.quiz-number-options {
    /* Confirmed in fraction.css: .frac-friendly-picker .quiz-number-
       -options sets `flex-wrap: wrap`, which is exactly the "chips
       drop to a second line on narrow screens" behavior we don't
       want here — `!important` below is a deliberate, minimal
       override of just that one property (plus flex-basis on each
       chip); everything else is left to cascade normally. */
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch;
    justify-content: center;
    gap: clamp(6px, 2vw, 14px);
    width: 100%;
    max-width: 560px;
    margin: 16px auto 4px;
    box-sizing: border-box;
}
.prl-opt.quiz-number-opt {
    flex: 1 1 0 !important;
    min-width: 0;
    width: auto;
    height: auto;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: auto;
    padding: clamp(8px, 2.4vw, 14px) clamp(4px, 1.8vw, 12px);
    font-size: clamp(11px, 3.1vw, 15px);
    line-height: 1.25;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(30, 58, 95, 0.08);
    transition: transform 0.12s ease, border-color 0.12s ease,
        background 0.12s ease, box-shadow 0.12s ease;
}
.prl-opt.quiz-number-opt:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--sky, #2e9bf5);
    box-shadow: 0 6px 14px rgba(30, 58, 95, 0.16);
}
.prl-opt.quiz-number-opt:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 3px rgba(30, 58, 95, 0.15);
}
.prl-opt.quiz-number-opt:focus-visible {
    outline: 3px solid var(--sky, #2e9bf5);
    outline-offset: 2px;
}
.prl-opt.quiz-number-opt.is-correct { box-shadow: 0 0 0 4px rgba(34, 192, 141, 0.18); }
.prl-opt.quiz-number-opt.is-wrong { box-shadow: 0 0 0 4px rgba(245, 66, 125, 0.15); }

/* Very small Android phone widths — tighten further so 4 chips
   still fit on one line without any text getting cut off. */
@media (max-width: 380px) {
    .prl-options.quiz-number-options { gap: 5px; margin-top: 12px; }
    .prl-opt.quiz-number-opt {
        font-size: 10.5px;
        min-height: 48px;
        padding: 7px 3px;
        border-radius: 12px;
    }
    .prl-scene-marksheet,
    .prl-scene-pricetag { padding: 14px 18px; min-width: 0; width: 100%; }
    .prl-scene-change { padding: 12px 14px; gap: 10px; }
    .prl-baf-wrap { gap: 10px; }
}

/* Slightly larger phones / small tablets */
@media (min-width: 480px) {
    .prl-opt.quiz-number-opt { font-size: 15px; min-height: 58px; }
}

/* Tablet and up */
@media (min-width: 700px) {
    .prl-options.quiz-number-options { max-width: 640px; gap: 16px; }
    .prl-opt.quiz-number-opt { font-size: 16px; min-height: 64px; padding: 14px 14px; }
    .prl-baf-track { height: 190px; }
}

/* Desktop */
@media (min-width: 1024px) {
    .prl-options.quiz-number-options { max-width: 680px; }
    .prl-opt.quiz-number-opt { font-size: 17px; }
}

/* Short windows / landscape phones — keep the Next button reachable
   by trimming vertical spacing rather than shrinking chips below a
   readable size. */
@media (max-height: 700px) {
    .prl-baf-track { height: clamp(90px, 22vw, 130px); }
    .prl-baf-badge { margin-bottom: clamp(36px, 10vw, 55px); }
    .frac-parts-stage { margin: 8px auto 4px; }
    .prl-question-card { padding: 12px 16px; margin: 6px auto 4px; }
    .prl-options.quiz-number-options { margin-top: 10px; }
}

/* Belt-and-braces scroll safety net, same pattern used for every
   other skill's overlay on this page: however tall a given
   question's content gets on a short screen, the chips and Next
   button stay reachable by scrolling rather than being clipped. The
   overlay's own centering/positioning is left untouched. */
#pctmarks-quiz-overlay .quiz-modal,
#pctdiscount-quiz-overlay .quiz-modal,
#pctincdec-quiz-overlay .quiz-modal,
#pctwild-quiz-overlay .quiz-modal {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}