/* ================================================================
   construction-applied.css
   ----------------------------------------------------------------
   Styles for "Applied and Pro Level" (Tier 9) on the Class 6 Math
   page (Geometry tools & constructions):

     - A.1  Spot the Mistake (Constructions)
     - A.2  Construction Step Writer
     - A.3  Reasoning Questions
     - A.4  Word Problems
     - A.5  Mixed Construction Challenge
     - A.6  Estimation Warm-Up

   Same shared popup shell as meet-tools (quiz-overlay / quiz-modal).
   Fully self-contained: every class starts with "pt9-", every popup
   has the extra class "pt9-overlay" and an id starting with "pro".
   Site variables (--primary, --secondary, --line, --sun) have fallbacks.

   Finish (kid-friendly, matt + shine): glossy violet / magenta / teal /
   gold / sky shapes with a soft shine and sparkle on a matt pastel
   lavender "paper" stage. Warm gold, cool teal, bold magenta accents:
   high contrast but never harsh.

   Layout notes
   - Answer chips ALWAYS stay on ONE row (flex-wrap: nowrap), 4 chips.
   - Android-native feel: >=52px touch targets, instant :active press,
     no 300ms delay, no grey tap flash, safe-area padding.

     <link rel="stylesheet" th:href="@{/css/pro-level.css}" />
   ================================================================ */

/* ---------- SVG paint ---------- */
.pt9-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pt9-o { stroke: rgba(60, 38, 120, 0.60); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.pt9-sh { filter: drop-shadow(0 4px 3px rgba(60, 38, 120, 0.25)); }
.pt9-gloss { fill: #fff; opacity: 0.38; pointer-events: none; }
.pt9-spark { fill: #fff; opacity: 0.9; pointer-events: none; }
.pt9-nopt { pointer-events: none; stroke: none; }

.pt9-t {
    font: 800 22px/1 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    fill: #34205f; text-anchor: middle; dominant-baseline: central;
    stroke: #fff; stroke-width: 5; paint-order: stroke; stroke-linejoin: round;
    pointer-events: none; user-select: none; -webkit-user-select: none;
}
.pt9-t-lbl { font-size: 24px; }
.pt9-t-small { font-size: 19px; }
.pt9-t-tick { font-size: 14px; stroke: none; fill: #5a3d00; }
.pt9-t-white { fill: #fff; stroke: rgba(60, 38, 120, .55); stroke-width: 5; }

/* line art: white underlay + coloured core */
.pt9-lu { fill: none; stroke: #fff; stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.pt9-ls { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.pt9-dsh { stroke-dasharray: 2 11; stroke-width: 4; opacity: .75; }
.pt9-cdot { fill: #34205f; stroke: #fff; stroke-width: 3; }
.pt9-rt { fill: none; stroke: #34205f; stroke-width: 3; stroke-linejoin: round; }
.pt9-road { stroke: #d6c9ff; stroke-width: 16; stroke-linecap: round; }
.pt9-box { fill: rgba(255, 255, 255, .65); stroke: #7c4dff; stroke-width: 4; stroke-dasharray: 10 6; }

/* compass drawing */
.pt9-legu { stroke: #fff; stroke-width: 17; stroke-linecap: round; opacity: .9; }
.pt9-leg { stroke-width: 11; stroke-linecap: round; fill: none; }
.pt9-pin { fill: #ef3b3b; stroke: #fff; stroke-width: 3; }
.pt9-tipdot { fill: #ffd54a; stroke: #34205f; stroke-width: 3; }

/* ruler strip */
.pt9-ruler { fill: #ffe9a8; stroke: rgba(90, 61, 0, .55); stroke-width: 2.5; }
.pt9-rtick { stroke: #5a3d00; stroke-width: 2.5; stroke-linecap: round; }

/* ---------- popup tweaks ---------- */
.pt9-overlay .quiz-modal { --pt9-fig: 250px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.pt9-overlay .quiz-question b { color: var(--secondary, #4b3f8f); }
.pt9-overlay .bq-btn,
.pt9-overlay .bq-next-btn { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.pt9-overlay .bq-next-btn { margin-bottom: env(safe-area-inset-bottom, 0px); }
.pt9-overlay .bq-summary-buttons { margin-bottom: env(safe-area-inset-bottom, 0px); }

.pt9-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 8px auto 0; width: 100%; }
.pt9-stage {
    position: relative;
    width: min(100%, calc(var(--pt9-fig) * 1.7));
    aspect-ratio: 2 / 1;
    box-sizing: border-box;
    padding: 6px;
    border-radius: 20px;
    background:
        radial-gradient(120% 90% at 25% 10%, rgba(255, 255, 255, .92), rgba(255, 255, 255, 0) 60%),
        linear-gradient(180deg, #f7f2ff 0%, #ece3ff 100%);
    border: 2px solid var(--line, #ddd2fb);
    box-shadow: 0 3px 0 rgba(75, 63, 143, 0.08), inset 0 0 22px rgba(167, 139, 250, .16);
}
.pt9-stage > svg { width: 100%; height: 100%; }
.pt9-hint { margin: 0; text-align: center; font-size: 13px; font-weight: 700; color: #7a71a8; line-height: 1.35; max-width: 380px; }
.pt9-hint b { color: var(--secondary, #4b3f8f); }

/* lettered / numbered statement cards (steps, explanations) */
.pt9-lets { list-style: none; margin: 0; padding: 0; width: min(100%, 460px); display: flex; flex-direction: column; gap: 8px; }
.pt9-lets li {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 9px 12px; box-sizing: border-box;
    border-radius: 14px; border: 2px solid var(--line, #ddd2fb);
    background: linear-gradient(180deg, #ffffff 0%, #f5efff 100%);
    box-shadow: 0 2px 0 rgba(75, 63, 143, 0.08);
}
.pt9-bd {
    flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 14px; color: #fff;
    background: radial-gradient(circle at 34% 28%, #ffd0ee 0%, #e0368a 55%, #a3186a 100%);
    box-shadow: 0 2px 0 rgba(120, 20, 80, .25), inset 0 1px 2px rgba(255, 255, 255, .6);
}
.pt9-lets li:nth-child(even) .pt9-bd { background: radial-gradient(circle at 34% 28%, #c9fbef 0%, #12a08a 55%, #0b6d5d 100%); box-shadow: 0 2px 0 rgba(10, 90, 75, .25), inset 0 1px 2px rgba(255, 255, 255, .6); }
.pt9-tx { flex: 1 1 auto; min-width: 0; font-size: 14.5px; line-height: 1.38; font-weight: 700; color: #34205f; overflow-wrap: break-word; text-align: left; }

/* ================================================================
   Answer chips: ALWAYS a single line (4 chips)
   ================================================================ */
.quiz-number-options.pt9-picker {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 480px;
    margin: 16px auto 4px;
}
.quiz-number-options.pt9-picker:empty { display: none; }
.quiz-number-opt.pt9-opt {
    display: inline-flex;
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: auto !important;
    min-height: 54px !important;
    max-height: none !important;
    box-sizing: border-box !important;
    padding: 10px 5px;
    white-space: normal !important;
    overflow: hidden;
    overflow-wrap: break-word;
    font-weight: 800;
    font-size: 15.5px;
    line-height: 1.2;
    text-align: center;
    color: var(--secondary, #4b3f8f);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    transition: transform .08s ease, box-shadow .15s, border-color .15s, background .15s;
}
.quiz-number-opt.pt9-opt:active:not(:disabled) { transform: scale(.96); background: rgba(124, 77, 255, 0.10); }
@media (hover: hover) {
    .quiz-number-opt.pt9-opt:hover:not(:disabled) { border-color: var(--primary, #6c5ce7); }
}
.quiz-number-opt.pt9-opt.is-correct { border-color: #10b981; background: rgba(16, 185, 129, 0.08); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
.quiz-number-opt.pt9-opt.is-wrong { border-color: #ef4444; background: rgba(239, 68, 68, 0.08); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18); }

/* ================================================================
   Responsive (phones): shrink the drawings and chips only
   ================================================================ */
@media (max-width: 560px) {
    .pt9-overlay .quiz-modal { --pt9-fig: 232px; }
    .quiz-number-options.pt9-picker { gap: 8px; margin-top: 14px; }
    .quiz-number-opt.pt9-opt { font-size: 12.5px; padding: 8px 3px; min-height: 52px !important; letter-spacing: -0.1px; }
    .pt9-tx { font-size: 13.5px; }
}
@media (max-width: 380px) {
    .pt9-overlay .quiz-modal { --pt9-fig: 204px; }
    .quiz-number-opt.pt9-opt { font-size: 11.5px; padding: 7px 2px; }
    .quiz-number-options.pt9-picker { gap: 6px; }
    .pt9-hint { font-size: 12.5px; }
    .pt9-tx { font-size: 13px; }
    .pt9-lets li { padding: 8px 10px; }
}
@media (pointer: coarse) {
    .quiz-number-opt.pt9-opt { min-height: 56px !important; }
}
@media (max-height: 560px) and (orientation: landscape) {
    .pt9-overlay .quiz-modal { --pt9-fig: 176px; }
}
@media (prefers-reduced-motion: reduce) {
    .quiz-number-opt.pt9-opt { transition: none; }
}