/* class3-math-GM-ch10-common-multilang.css
   Class 3 Maths Mela Ch.10 "Fun at Class Party!" (Measuring Length, Topic 10): pictures, tap / drag parts,
   the single-line answer chips and the native phone feel for every popup of the chapter
   (overlay class "lm-overlay", element ids start with "lm"). One file for all tiers.
   The popup frame itself (overlay, modal, stars, buttons) comes from the shared quiz css. */

.lm-overlay .quiz-modal { -webkit-tap-highlight-color: transparent !important; overscroll-behavior: contain !important; }

/* ---------------- language picker (top-right of the popup) ---------------- */
.lm-overlay .quiz-lang-selector { position: absolute; top: 14px; right: 56px; z-index: 10; }
.lm-overlay .lm-lang {
    background: #F8FAFC; border: 1px solid #D0DBE5; border-radius: 8px; padding: 6px 8px;
    font: 800 12px/1 "Nunito", system-ui, sans-serif; color: #556E85; cursor: pointer; min-height: 32px;
}

/* ---------------- the picture card: matt paper with a soft inner edge ---------------- */
.lm-overlay .lm-stage {
    margin: 6px auto 12px !important; width: 100% !important; max-width: 560px !important;
    padding: 10px 10px 12px !important; border-radius: 24px !important; box-sizing: border-box !important;
    background: linear-gradient(180deg, #FFF8E6 0%, #EAF5FF 100%) !important;
    box-shadow: inset 0 0 0 1.5px rgba(122, 104, 214, .16), 0 8px 18px rgba(60, 58, 110, .10) !important;
}
.lm-overlay .lm-svg {
    display: block !important; width: 100% !important; height: auto !important; max-height: 380px !important; overflow: visible !important;
    font-family: "Nunito", "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
    user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.lm-overlay .lm-svg.lm-dragsvg { touch-action: none !important; }
.lm-overlay .lm-hint { margin-top: 6px !important; text-align: center !important; font-size: 13.5px !important; line-height: 1.35 !important; font-weight: 700 !important; color: #5A4FA0 !important; }
.lm-overlay .lm-hint.is-good { color: #1E8A50 !important; }

/* ---------------- tap targets (arrows, strings, things) ---------------- */
.lm-overlay .lm-tap { cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.lm-overlay .lm-halo { fill: #7B5CE0; fill-opacity: 0; stroke: none; transition: fill-opacity .15s ease; }
.lm-overlay .lm-tap:hover .lm-halo { fill-opacity: .12; }
.lm-overlay .lm-tap:focus-visible .lm-halo { fill-opacity: .18; stroke: #7B5CE0; stroke-width: 2.5; }
.lm-overlay .lm-tap.is-right .lm-halo { fill: #2FB36A; fill-opacity: .30; stroke: #2FB36A; stroke-width: 3; }
.lm-overlay .lm-tap.is-wrong .lm-halo { fill: #E5604D; fill-opacity: .26; stroke: #E5604D; stroke-width: 3; }
.lm-overlay .lm-tap.is-dim { opacity: .55; }
.lm-overlay .lm-tap.paint-red .lm-body { fill: url(#lm-g-red); }
.lm-overlay .lm-tap.paint-green .lm-body { fill: url(#lm-g-green); }
.lm-overlay .lm-tap.paint-yellow .lm-body { fill: url(#lm-g-yellow); }
.lm-overlay .lm-tap.wob { animation: lmShake .36s ease; }

/* ---------------- picture cards (A, B, C, D) ---------------- */
.lm-overlay .lm-cardbg { fill: #fff; fill-opacity: .86; stroke: #CFC6F5; stroke-width: 2; }
.lm-overlay .lm-card.is-right .lm-cardbg { fill: #E4FBEE; fill-opacity: 1; stroke: #2FB36A; stroke-width: 4; }
.lm-overlay .lm-card.is-wrong .lm-cardbg { fill: #FFE6E1; fill-opacity: 1; stroke: #E5604D; stroke-width: 4; }

/* ---------------- drag parts ---------------- */
.lm-overlay .lm-drag { cursor: grab; outline: none; transition: transform .18s ease; -webkit-tap-highlight-color: transparent; }
.lm-overlay .lm-drag.is-drag { cursor: grabbing; transition: none; }
.lm-overlay .lm-drag.is-fixed { cursor: default; }
.lm-overlay .lm-drag:focus-visible .lm-halo { fill-opacity: .18; stroke: #7B5CE0; stroke-width: 2.5; }
.lm-overlay .lm-drag:not(.is-fixed) .lm-halo { fill-opacity: .08; }
.lm-overlay .lm-drag.is-drag .lm-halo { fill-opacity: .2; }
.lm-overlay .lm-drag.is-snap .lm-halo { fill: #2FB36A; fill-opacity: .25; }
.lm-overlay .lm-u.lm-hidden { opacity: 0; transition: opacity .25s ease; }
.lm-overlay .lm-u.lm-hidden.is-on { opacity: 1; }
.lm-overlay .lm-guide { transition: opacity .3s ease; }
.lm-overlay .lm-guide.is-off { opacity: 0; }
.lm-overlay .lm-pulse { animation: lmPulse 1.8s ease-in-out infinite; }
.lm-overlay .lm-svg.is-bad { animation: lmShake .4s ease; }

/* ---------------- the Done button (only on drag-to-order questions) ---------------- */
.lm-overlay .lm-actions { display: flex !important; justify-content: center !important; margin-top: 10px !important; }
.lm-overlay .lm-go {
    min-height: 48px !important; min-width: 150px !important; padding: 10px 26px !important; border: 0 !important; border-radius: 999px !important;
    font-family: "Nunito", "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
    font-size: 17px !important; font-weight: 800 !important; color: #fff !important;
    background: linear-gradient(180deg, #7DE0A8, #2FB36A) !important;
    box-shadow: 0 4px 0 #23915A, 0 8px 14px rgba(47, 179, 106, .28) !important;
    cursor: pointer !important; touch-action: manipulation !important; -webkit-tap-highlight-color: transparent !important;
}
.lm-overlay .lm-go:active:not(:disabled) { transform: translateY(2px) !important; box-shadow: 0 2px 0 #23915A !important; }
.lm-overlay .lm-go:disabled { opacity: .45 !important; cursor: default !important; }

/* ---------------- the answer chips: ONE line, always (2, 3, 4 or any number) ---------------- */
.lm-overlay .lm-picker,
.lm-overlay [id$="Options"] {
    display: flex !important; flex-wrap: nowrap !important; grid-template-columns: none !important;
    justify-content: center !important; align-items: stretch !important; gap: 8px !important;
    width: 100% !important; max-width: 620px !important; margin: 8px auto 6px !important; padding: 0 !important; box-sizing: border-box !important;
}
.lm-overlay [id$="Options"]:empty { display: none !important; }   /* tap / drag questions have no chips */
.lm-overlay .lm-opt {
    position: relative !important; flex: 1 1 0 !important; width: auto !important; min-width: 0 !important; max-width: none !important;
    min-height: 58px !important; margin: 0 !important; padding: 8px 4px !important;
    display: flex !important; align-items: center !important; justify-content: center !important; text-align: center !important;
    white-space: nowrap !important; overflow: hidden !important;
    border: 2px solid #CFC6F5 !important; border-radius: 16px !important;
    background: linear-gradient(180deg, #FFFFFF 0%, #F3EEFF 100%) !important; color: #2A2858 !important;
    font-family: "Nunito", "Poppins", "Noto Sans Devanagari", "Noto Sans Oriya", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif !important;
    font-weight: 800 !important; font-size: clamp(15px, 4.6vw, 24px) !important; line-height: 1.12 !important;
    box-shadow: 0 3px 0 #CFC6F5, 0 6px 12px rgba(60, 58, 110, .10) !important;
    cursor: pointer !important; touch-action: manipulation !important; -webkit-tap-highlight-color: transparent !important;
    transition: transform .08s ease, box-shadow .08s ease, background .15s ease;
}
/* longer words shrink first, then wrap INSIDE the chip: the row itself never wraps */
.lm-overlay .lm-opt.lm-sm { font-size: clamp(13px, 3.9vw, 20px) !important; }
.lm-overlay .lm-opt.lm-wrap { white-space: normal !important; overflow-wrap: anywhere !important; font-size: clamp(12px, 3.4vw, 18px) !important; line-height: 1.15 !important; }
.lm-overlay .lm-opt.lm-xs { white-space: normal !important; overflow-wrap: break-word !important; font-size: clamp(10px, 2.85vw, 15px) !important; line-height: 1.15 !important; padding: 6px 2px !important; }
.lm-overlay .lm-opt.lm-rich { padding: 5px 3px !important; min-height: 74px !important; }
.lm-overlay .lm-chipin { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; width: 100%; pointer-events: none; }
.lm-overlay .lm-chipin > span { display: block; max-width: 100%; font-size: clamp(12px, 3.4vw, 17px); line-height: 1.12; white-space: normal; overflow-wrap: anywhere; }
.lm-overlay .lm-dot { display: block; width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 2.5px rgba(0, 0, 0, .14), inset 0 -4px 0 rgba(0, 0, 0, .08); }
.lm-overlay .lm-chipsvg { display: block; width: 100%; max-width: 78px; height: auto; pointer-events: none; }
.lm-overlay .lm-opt:active:not(:disabled) { transform: translateY(2px) scale(.97) !important; box-shadow: 0 1px 0 #CFC6F5, 0 2px 6px rgba(60, 58, 110, .12) !important; }
.lm-overlay .lm-opt:disabled { cursor: default !important; }
.lm-overlay .lm-opt:disabled:not(.is-correct):not(.is-wrong) { opacity: .55 !important; }
.lm-overlay .lm-opt.is-correct {
    background: linear-gradient(180deg, #DDFBE8 0%, #9BEBB9 100%) !important; border-color: #2FB36A !important; color: #145A36 !important;
    box-shadow: 0 3px 0 #2FB36A, 0 6px 12px rgba(47, 179, 106, .25) !important; animation: lmPop .35s ease !important;
}
.lm-overlay .lm-opt.is-wrong {
    background: linear-gradient(180deg, #FFE6E1 0%, #FFB8AA 100%) !important; border-color: #E5604D !important; color: #8A2616 !important;
    box-shadow: 0 3px 0 #E5604D, 0 6px 12px rgba(229, 96, 77, .22) !important; animation: lmShake .32s ease !important;
}
@keyframes lmPop { 0% { transform: scale(.94); } 60% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes lmShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes lmPulse { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }

/* ---------------- phones ---------------- */
@media (max-width: 480px) {
    .lm-overlay .lm-stage { border-radius: 20px !important; padding: 8px 6px 10px !important; margin-bottom: 10px !important; }
    .lm-overlay .lm-hint { font-size: 12.5px !important; }
    .lm-overlay .lm-picker, .lm-overlay [id$="Options"] { gap: 6px !important; }
    .lm-overlay .lm-opt { min-height: 56px !important; border-radius: 14px !important; }
    .lm-overlay .lm-opt.lm-rich { min-height: 72px !important; }
    .lm-overlay .lm-go { width: 100% !important; max-width: 320px !important; }
    .lm-overlay .lm-dot { width: 22px; height: 22px; }
}
@media (max-width: 340px) {
    .lm-overlay .lm-picker, .lm-overlay [id$="Options"] { gap: 4px !important; }
}
/* ---------------- tablets and desktops: bigger pictures, roomier chips ---------------- */
@media (min-width: 700px) {
    .lm-overlay .lm-stage { max-width: 620px !important; padding: 14px 14px 16px !important; }
    .lm-overlay .lm-svg { max-height: 420px !important; }
    .lm-overlay .lm-hint { font-size: 15px !important; }
    .lm-overlay .lm-picker, .lm-overlay [id$="Options"] { gap: 12px !important; }
    .lm-overlay .lm-opt { min-height: 66px !important; }
    .lm-overlay .lm-opt.lm-rich { min-height: 84px !important; }
    .lm-overlay .lm-opt:hover:not(:disabled) { background: linear-gradient(180deg, #FFFFFF 0%, #E9E0FF 100%) !important; }
}
@media (prefers-reduced-motion: reduce) {
    .lm-overlay .lm-pulse, .lm-overlay .lm-tap.wob, .lm-overlay .lm-svg.is-bad,
    .lm-overlay .lm-opt.is-correct, .lm-overlay .lm-opt.is-wrong { animation: none !important; }
    .lm-overlay .lm-drag, .lm-overlay .lm-halo { transition: none; }
}