/* ================================================================
   factor-multiple-foundations.css
   ----------------------------------------------------------------
   Styles for the "What is a factor? What is a multiple?
   (Foundations)" skill group on the Class 5 Math page. Sits right
   before Prime Time in the topic order, since factors are the
   building blocks Prime Time later builds on:

     - A.1  Skip-Counting Hop — a number-line frog hopping in jumps
            of 2, 3, or 5; the child taps where it lands next (new
            .fom-hop-* classes).

     - A.2  Equal Rows Puzzle (Arrays) — a scatter of dots the child
            must arrange into equal rows with nothing left over;
            each working row-count is a factor, discovered by play
            (new .fom-array-* classes).

     - A.3  The Fair-Share Check — stickers shared evenly among
            friends; the child works out how many (if any) are left
            over (new .fom-share-* classes).

     - A.4  Multiples vs Factors — Which Way Am I Going? — an anchor
            number with an "up" (multiples) and "in" (factors)
            legend; the child classifies a candidate number as a
            multiple, a factor, both, or neither (new .fom-sort-*
            classes).

     - A.5  Trap Questions: Is It Really a Factor? — a dot array
            forced into rows of a fixed width, leftover dots
            highlighted; the child reads off how many are left over
            to decide if it's really a factor (new .fom-trap-*
            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 "fom-" prefixed classes (including its own
   answer-chip wrapper, .fom-picker) instead of reusing any other
   skill file's markup, so it has no hidden cross-file dependency.
   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/factor-multiple-foundations.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. Each .fom-opt is
   a flexible (not fixed-width) item so the row shrinks to fit the
   quiz card instead of wrapping to a second line. */
.fom-picker {
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 10px;
    margin: 18px auto 4px;
    width: 100%;
    max-width: 420px;
}
.fom-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: 15.5px;
    color: var(--secondary);
    text-align: center;
    line-height: 1.2;
}
.quiz-number-opt.fom-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.fom-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);
}

.fom-caption {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    text-align: center;
    max-width: 340px;
    margin: 6px auto 0;
}

/* ================================================================
   A.1 Skip-Counting Hop
   ================================================================ */
.fom-hop-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 18px auto 6px;
    width: 100%;
}
.fom-hop-track-outer {
    position: relative;
    width: min(340px, 92%);
    height: 70px;
    margin-top: 10px;
}
.fom-hop-track {
    position: absolute;
    left: 0; right: 0; top: 34px;
    height: 4px;
    background: var(--line);
    border-radius: 2px;
}
.fom-hop-tick {
    position: absolute;
    top: 26px;
    width: 2px;
    height: 20px;
    background: var(--line);
    transform: translateX(-50%);
}
.fom-hop-tick.is-major {
    width: 3px;
    height: 26px;
    top: 23px;
    background: var(--secondary);
}
.fom-hop-tick.is-visited { background: var(--mint-bright); }
.fom-hop-num {
    position: absolute;
    top: 52px;
    transform: translateX(-50%);
    font-weight: 800;
    font-size: 12px;
    color: var(--secondary);
}
.fom-hop-frog {
    position: absolute;
    top: -2px;
    transform: translate(-50%, 0);
    font-size: 26px;
    line-height: 1;
    filter: drop-shadow(0 3px 3px rgba(0,0,0,0.15));
}

/* ================================================================
   A.2 Equal Rows Puzzle (Arrays)
   ================================================================ */
.fom-array-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 16px auto 6px;
}
.fom-array-grid {
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    gap: 6px;
    max-width: 260px;
    padding: 12px;
    border: 3px dashed var(--line);
    border-radius: 14px;
    background: #fff;
}
.fom-array-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--purple);
    flex: 0 0 auto;
}

/* ================================================================
   A.3 The Fair-Share Check
   ================================================================ */
.fom-share-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 16px auto 6px;
}
.fom-share-stickers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    max-width: 280px;
}
.fom-share-sticker {
    font-size: 20px;
    line-height: 1;
}
.fom-share-friends {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
}
.fom-share-friend {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 24px;
    line-height: 1;
}
.fom-share-friend-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text);
    opacity: 0.7;
}

/* ================================================================
   A.4 Multiples vs Factors — Which Way Am I Going?
   ================================================================ */
.fom-sort-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin: 16px auto 6px;
}
.fom-sort-legend {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}
.fom-sort-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 12.5px;
    color: var(--text);
    background: #fff;
    border: 2px solid var(--line);
    border-radius: 999px;
    padding: 6px 12px;
}
.fom-sort-legend-item .fom-sort-arrow {
    font-size: 15px;
}
.fom-sort-legend-item.is-up .fom-sort-arrow { color: #10b981; }
.fom-sort-legend-item.is-in .fom-sort-arrow { color: var(--secondary); }
.fom-sort-anchor {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mint-bright), var(--mint));
    color: #fff;
    font-weight: 800;
    font-size: 30px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.14);
}
.fom-sort-vs {
    font-weight: 800;
    font-size: 13px;
    color: var(--text);
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.fom-sort-candidate {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    height: 84px;
    padding: 0 10px;
    border-radius: 18px;
    border: 3px solid var(--secondary);
    background: #fff;
    color: var(--secondary);
    font-weight: 800;
    font-size: 30px;
}

/* ================================================================
   A.5 Trap Questions: Is It Really a Factor?
   ================================================================ */
.fom-trap-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 16px auto 6px;
}
.fom-trap-grid {
    display: grid;
    gap: 5px;
    padding: 10px;
    background: #fff;
    border: 3px solid var(--line);
    border-radius: 14px;
}
.fom-trap-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--sky);
}
.fom-trap-dot.is-leftover {
    background: #ef4444;
    box-shadow: 0 0 0 2px rgba(239,68,68,0.25);
}

/* ---------- phone responsiveness ---------- */
@media (max-width: 560px) {
    .fom-picker { gap: 8px; margin: 14px auto 4px; max-width: 340px; }
    .fom-opt { padding: 9px 5px; font-size: 13.5px; min-height: 46px !important; }
    .fom-caption { font-size: 13px; }

    .fom-hop-track-outer { width: min(300px, 92%); height: 62px; }
    .fom-hop-frog { font-size: 22px; }
    .fom-hop-num { font-size: 11px; top: 48px; }
    .fom-hop-track { top: 30px; }
    .fom-hop-tick { top: 22px; height: 18px; }
    .fom-hop-tick.is-major { top: 19px; height: 24px; }

    .fom-array-grid { max-width: 220px; padding: 10px; gap: 5px; }
    .fom-array-dot { width: 13px; height: 13px; }

    .fom-share-stickers { max-width: 240px; }
    .fom-share-sticker { font-size: 17px; }
    .fom-share-friend { font-size: 20px; }

    .fom-sort-legend { gap: 10px; }
    .fom-sort-legend-item { font-size: 11px; padding: 5px 10px; }
    .fom-sort-anchor { width: 68px; height: 68px; font-size: 24px; }
    .fom-sort-candidate { min-width: 68px; height: 68px; font-size: 24px; }

    .fom-trap-dot { width: 13px; height: 13px; }
}
@media (max-width: 380px) {
    .fom-picker { gap: 6px; max-width: 300px; }
    .fom-opt { padding: 7px 4px; font-size: 12px; min-height: 42px !important; }

    .fom-hop-track-outer { width: min(270px, 92%); }

    .fom-array-grid { max-width: 190px; }
    .fom-array-dot { width: 11px; height: 11px; }

    .fom-share-stickers { max-width: 210px; }
    .fom-share-sticker { font-size: 15px; }

    .fom-sort-anchor { width: 58px; height: 58px; font-size: 20px; }
    .fom-sort-candidate { min-width: 58px; height: 58px; font-size: 20px; padding: 0 6px; }

    .fom-trap-dot { width: 11px; height: 11px; }
}