/* ================================================================
   lcm-least-common-multiple.css
   ----------------------------------------------------------------
   Styles for the "LCM (Least Common Multiple)" skill group, placed
   right after "HCF (Highest Common Factor)" on the Class 5 Math
   page:

     A.1  Smallest Meeting Point — reuses the two-frog / two-track
          number-line idea from Common Multiples, but this time it's
          named as the LCM outright (new .lcm-lines-* classes, its
          own copy of the .cfm-lines-* two-track layout so this file
          has no hidden cross-file dependency).

     A.2  LCM via Multiples Lists (Guided) — two side-by-side
          multiples-list columns with every shared (common) multiple
          already highlighted; the child picks the SMALLEST match,
          the LCM (new .lcm-list-* classes).

     A.3  LCM via Prime Factor Trees (light) — two rows of prime
          "ingredient" chips per number, plus a combined row that
          takes the MOST of each prime needed; a gentle bridge to
          the formal method (new .lcm-tree-* classes).

     A.4  LCM Real-Life Problem: "Buses Leaving Together" — two bus
          "departure" rows on a shared timeline (new .lcm-bus-*
          classes, built on the same two-track layout as A.1).

     A.5  LCM Real-Life Problem: "Matching Packs" — a real-world
          pack-matching puzzle illustrated with two rows of item
          dots (new .lcm-pack-* classes).

   Every skill here shares the same 5-question-per-slot / star-
   reward / "practice more?" quiz shell as the rest of the site (via
   the .bq- / .quiz- classes from quiz-popup-theme.css and quiz-
   modal-responsive.css, loaded elsewhere). This file defines its
   own self-contained "lcm-" prefixed classes, including its own
   answer-chip wrapper (.lcm-picker), so it has no hidden cross-file
   dependency — same philosophy as common-factors-multiples.css's
   .cfm- classes and hcf-highest-common-factor.css's .hcf- classes.
   Load this file after the shared quiz shell stylesheets, e.g.:

     <link rel="stylesheet" th:href="@{/css/quiz-popup-theme.css}" />
     <link rel="stylesheet" th:href="@{/css/quiz-modal-responsive.css}" />
     <link rel="stylesheet" th:href="@{/css/lcm-least-common-multiple.css}" />
   ================================================================ */

/* ---------- shared: answer-chip picker row ---------- */
/* flex-wrap is intentionally "nowrap": there are always exactly 4
   chips and they must always sit in a single row on every screen
   size, including small Android phone browsers. Each .lcm-opt is a
   flexible (not fixed-width) item so the row shrinks to fit the
   quiz card instead of wrapping to a second line. */
.lcm-picker {
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 10px;
    margin: 18px auto 4px;
    width: 100%;
    max-width: 420px;
}
.lcm-opt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    max-width: 170px;
    padding: 12px 6px;
    height: auto !important;
    min-height: 52px !important;
    max-height: none !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    overflow: visible;
    font-weight: 800;
    font-size: 16px;
    color: var(--secondary);
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
}
.quiz-number-opt.lcm-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.lcm-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);
}

/* ---------- shared: target / instruction caption ---------- */
.lcm-target-caption {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    text-align: center;
    margin: 4px auto 2px;
    max-width: 360px;
}
.lcm-target-caption .lcm-target-val {
    font-weight: 800;
    color: var(--secondary);
    font-size: 17px;
}

/* ================================================================
   A.1 Smallest Meeting Point (two-track number lines)
   A.4 "Buses Leaving Together" reuses this same two-track layout
   with its own row accent classes.
   ================================================================ */
.lcm-lines-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin: 16px auto 8px;
    width: 100%;
}
.lcm-lines-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
}
.lcm-lines-row-label {
    font-weight: 800;
    font-size: 13px;
    color: var(--purple);
    text-align: center;
}
.lcm-lines-row.is-second .lcm-lines-row-label { color: var(--sky); }
.lcm-lines-row-label .lcm-lines-emoji { font-size: 15px; margin-right: 3px; }
.lcm-line-track-wrap {
    position: relative;
    width: min(430px, 94%);
    height: 40px;
}
.lcm-line-base {
    position: absolute;
    left: 0; right: 0; top: 18px;
    height: 4px;
    border-radius: 2px;
    background: var(--secondary);
    opacity: 0.20;
}
.lcm-line-tick {
    position: absolute;
    top: 10px;
    width: 2px;
    height: 20px;
    background: var(--secondary);
    opacity: 0.22;
    transform: translateX(-1px);
}
.lcm-line-num {
    position: absolute;
    top: 30px;
    transform: translateX(-50%);
    font-weight: 700;
    font-size: 9.5px;
    color: var(--secondary);
    opacity: 0.55;
}
.lcm-line-dot {
    position: absolute;
    top: 12px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transform: translate(-50%, 0);
    background: var(--purple);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}
.lcm-lines-row.is-second .lcm-line-dot { background: var(--sky); }
.lcm-line-dot.is-common {
    background: var(--sun);
    width: 20px;
    height: 20px;
    box-shadow: 0 0 0 3px rgba(255,193,7,0.25);
}

/* ================================================================
   A.2 LCM via Multiples Lists (Guided)
   ================================================================ */
.lcm-list-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 14px auto 6px;
    width: 100%;
}
.lcm-list-cols {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: nowrap;
    width: 100%;
}
.lcm-list-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.lcm-list-col-label {
    font-weight: 800;
    font-size: 13px;
    text-align: center;
    color: var(--purple);
}
.lcm-list-col.is-second .lcm-list-col-label { color: var(--sky); }
.lcm-list-items {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
}
.lcm-list-item {
    min-width: 46px;
    padding: 5px 8px;
    border-radius: 9px;
    background: #fff;
    border: 2px solid var(--secondary);
    font-weight: 800;
    font-size: 13.5px;
    color: var(--secondary);
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.lcm-list-item.is-common {
    border-color: var(--sun);
    color: #b8860b;
    background: #fff8e8;
}
.lcm-list-note {
    font-weight: 700;
    font-size: 12.5px;
    color: var(--text);
    opacity: 0.75;
    text-align: center;
    max-width: 320px;
}
.lcm-list-note .lcm-common-word { color: var(--sun); font-weight: 800; }

/* ================================================================
   A.3 LCM via Prime Factor Trees (light)
   ================================================================ */
.lcm-tree-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 14px auto 6px;
    width: 100%;
}
.lcm-tree-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 100%;
}
.lcm-tree-row-label {
    font-weight: 800;
    font-size: 13px;
    color: var(--purple);
    text-align: center;
}
.lcm-tree-row.is-second .lcm-tree-row-label { color: var(--sky); }
.lcm-tree-row.is-combined .lcm-tree-row-label { color: var(--sun); }
.lcm-tree-chips {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    max-width: 340px;
}
.lcm-tree-chip {
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #fff;
    border: 2px solid var(--purple);
    color: var(--purple);
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.lcm-tree-row.is-second .lcm-tree-chip { border-color: var(--sky); color: var(--sky); }
.lcm-tree-row.is-combined .lcm-tree-chip {
    border-color: var(--sun);
    color: #b8860b;
    background: #fff8e8;
}

/* ================================================================
   A.5 LCM Real-Life Problem: "Matching Packs"
   ================================================================ */
.lcm-pack-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 14px auto 6px;
    width: 100%;
}
.lcm-pack-story {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    text-align: center;
    max-width: 320px;
    line-height: 1.4;
}
.lcm-pack-groups {
    display: flex;
    justify-content: center;
    gap: 22px;
    flex-wrap: nowrap;
    width: 100%;
}
.lcm-pack-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.lcm-pack-group-label {
    font-weight: 800;
    font-size: 13px;
    color: var(--secondary);
    text-align: center;
}
.lcm-pack-row {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 130px;
    padding: 4px 6px;
    border-radius: 8px;
    border: 2px dashed var(--line);
}
.lcm-pack-dot {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.lcm-pack-question {
    font-weight: 800;
    font-size: 14.5px;
    color: var(--purple);
    text-align: center;
    max-width: 320px;
    margin-top: 2px;
}

/* ---------- phone responsiveness ---------- */
@media (max-width: 560px) {
    .lcm-picker { gap: 7px; margin: 14px auto 4px; max-width: 350px; }
    .lcm-opt { padding: 9px 5px; font-size: 14px; min-height: 46px !important; }

    .lcm-lines-wrap { gap: 10px; }
    .lcm-line-track-wrap { height: 36px; }
    .lcm-line-num { font-size: 8.5px; top: 27px; }
    .lcm-line-dot { width: 13px; height: 13px; top: 12.5px; }
    .lcm-line-dot.is-common { width: 17px; height: 17px; }

    .lcm-list-cols { gap: 12px; }
    .lcm-list-item { min-width: 40px; padding: 4px 6px; font-size: 12px; }

    .lcm-tree-chips { max-width: 280px; gap: 5px; }
    .lcm-tree-chip { min-width: 26px; height: 26px; font-size: 12.5px; }

    .lcm-pack-groups { gap: 14px; }
    .lcm-pack-row { max-width: 104px; }
    .lcm-pack-dot { width: 13px; height: 13px; font-size: 11px; }
    .lcm-pack-story, .lcm-pack-question { max-width: 280px; font-size: 13px; }
}
@media (max-width: 380px) {
    .lcm-picker { gap: 5px; max-width: 310px; }
    .lcm-opt { padding: 7px 4px; font-size: 12.5px; min-height: 44px !important; }

    .lcm-line-track-wrap { width: 96%; }
    .lcm-line-dot { width: 11px; height: 11px; }
    .lcm-line-dot.is-common { width: 15px; height: 15px; }

    .lcm-list-item { min-width: 36px; font-size: 11px; }
    .lcm-tree-chip { min-width: 24px; height: 24px; font-size: 11.5px; }

    .lcm-pack-groups { gap: 10px; }
    .lcm-pack-row { max-width: 88px; }
    .lcm-pack-dot { width: 11px; height: 11px; font-size: 10px; }
}