/* ================================================================
   hcf-highest-common-factor.css
   ----------------------------------------------------------------
   Styles for the "HCF (Highest Common Factor)" skill group placed
   right after "Common factors & common multiples" on the Class 5
   Math page:

     A.1  Biggest Shared Row — reuses the two-circle overlap idea
          from the Common Factors overlap circles, but this time the
          child circles the LARGEST number sitting in the overlap
          — that is the HCF (new .hcf-venn-* classes).

     A.2  HCF via Factor Lists (Guided) — two side-by-side factor
          lists with the matching (common) factors already
          highlighted; the child picks the BIGGEST match (new
          .hcf-list-* classes).

     A.3  HCF via Prime Factor Trees (light) — two rows of prime
          "ingredient" chips (from each number's prime
          factorisation) with the shared chips highlighted; the
          child multiplies only the shared chips (new .hcf-tree-*
          classes).

     A.4  HCF Real-Life Problem — Cutting Ribbon/Rope Fairly — two
          to-scale ribbon/rope bars with a ruler of 1-unit ticks;
          the child picks the longest equal piece length that cuts
          both evenly (new .hcf-ribbon-* classes).

     A.5  HCF Real-Life Problem — Packing Gift Bags — two rows of
          item dots (chocolates / candies); the child picks the
          biggest number of identical bags that uses everything
          with no leftovers (new .hcf-bags-* 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 "hcf-" prefixed classes, including its own
   answer-chip wrapper (.hcf-picker), so it has no hidden cross-file
   dependency on common-factors-multiples.css — same philosophy as
   that file's .cfm- 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/common-factors-multiples.css}" />
     <link rel="stylesheet" th:href="@{/css/hcf-highest-common-factor.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 .hcf-opt is a
   flexible (not fixed-width) item so the row shrinks to fit the
   quiz card instead of wrapping to a second line. */
.hcf-picker {
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 10px;
    margin: 18px auto 4px;
    width: 100%;
    max-width: 420px;
}
.hcf-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.hcf-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.hcf-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 ---------- */
.hcf-target-caption {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    text-align: center;
    margin: 4px auto 2px;
    max-width: 360px;
}
.hcf-target-caption .hcf-target-val {
    font-weight: 800;
    color: var(--secondary);
    font-size: 17px;
}

/* ================================================================
   A.1 Biggest Shared Row (overlap circles, pick the LARGEST)
   ================================================================ */
.hcf-venn-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 14px auto 6px;
    width: 100%;
}
.hcf-venn-stage {
    position: relative;
    width: min(330px, 92%);
    height: 208px;
    margin: 4px auto 0;
}
.hcf-venn-circle {
    position: absolute;
    top: 14px;
    width: 190px;
    height: 180px;
    border-radius: 50%;
    border: 3px solid var(--purple);
    background: rgba(157, 92, 255, 0.10);
}
.hcf-venn-circle.right {
    border-color: var(--sky);
    background: rgba(46, 155, 245, 0.10);
}
.hcf-venn-label {
    position: absolute;
    top: -4px;
    font-weight: 800;
    font-size: 12.5px;
    text-align: center;
    width: 130px;
}
.hcf-venn-label.left { left: 4px; color: var(--purple); }
.hcf-venn-label.right { right: 4px; color: var(--sky); text-align: right; }
.hcf-venn-pill {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 26px;
    padding: 0 6px;
    border-radius: 13px;
    background: #fff;
    border: 2px solid var(--secondary);
    font-weight: 800;
    font-size: 13px;
    color: var(--secondary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.10);
}
.hcf-venn-pill.is-overlap {
    border-color: var(--sun);
    color: #b8860b;
    background: #fff8e8;
}
.hcf-venn-pill.is-picked-correct {
    border-color: #10b981;
    color: #0a7a54;
    background: rgba(16,185,129,0.14);
    box-shadow: 0 0 0 3px rgba(16,185,129,0.22);
}
.hcf-venn-note {
    font-weight: 700;
    font-size: 12.5px;
    color: var(--text);
    opacity: 0.75;
    text-align: center;
    max-width: 300px;
}
.hcf-venn-note .hcf-overlap-word { color: var(--sun); font-weight: 800; }

/* ================================================================
   A.2 HCF via Factor Lists (Guided)
   ================================================================ */
.hcf-list-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 14px auto 6px;
    width: 100%;
}
.hcf-list-cols {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: nowrap;
    width: 100%;
}
.hcf-list-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.hcf-list-col-label {
    font-weight: 800;
    font-size: 13px;
    color: var(--purple);
    text-align: center;
}
.hcf-list-col.is-second .hcf-list-col-label { color: var(--sky); }
.hcf-list-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    max-width: 160px;
}
.hcf-list-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    background: #fff;
    border: 2px solid var(--secondary);
    font-weight: 800;
    font-size: 12.5px;
    color: var(--secondary);
    opacity: 0.85;
}
.hcf-list-item.is-match {
    border-color: var(--sun);
    color: #b8860b;
    background: #fff8e8;
    opacity: 1;
}
.hcf-list-note {
    font-weight: 700;
    font-size: 12.5px;
    color: var(--text);
    opacity: 0.75;
    text-align: center;
    max-width: 320px;
    margin-top: 2px;
}
.hcf-list-note .hcf-overlap-word { color: var(--sun); font-weight: 800; }

/* ================================================================
   A.3 HCF via Prime Factor Trees (light)
   ================================================================ */
.hcf-tree-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 14px auto 6px;
    width: 100%;
}
.hcf-tree-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}
.hcf-tree-row-label {
    font-weight: 800;
    font-size: 13px;
    color: var(--purple);
    text-align: center;
}
.hcf-tree-row.is-second .hcf-tree-row-label { color: var(--sky); }
.hcf-tree-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    max-width: 340px;
}
.hcf-tree-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 8px;
    background: #fff;
    border: 2px solid var(--secondary);
    font-weight: 800;
    font-size: 14px;
    color: var(--secondary);
    opacity: 0.75;
}
.hcf-tree-chip.is-shared {
    border-color: var(--sun);
    color: #b8860b;
    background: #fff8e8;
    opacity: 1;
    box-shadow: 0 0 0 3px rgba(255,193,7,0.20);
}
.hcf-tree-sep {
    font-weight: 800;
    font-size: 14px;
    color: var(--text);
    opacity: 0.4;
}
.hcf-tree-note {
    font-weight: 700;
    font-size: 12.5px;
    color: var(--text);
    opacity: 0.75;
    text-align: center;
    max-width: 320px;
}
.hcf-tree-note .hcf-overlap-word { color: var(--sun); font-weight: 800; }

/* ================================================================
   A.4 HCF Real-Life: Cutting Ribbon/Rope Fairly
   ================================================================ */
.hcf-ribbon-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 14px auto 6px;
    width: 100%;
}
.hcf-ribbon-story {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    text-align: center;
    max-width: 340px;
    line-height: 1.4;
}
.hcf-ribbon-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 100%;
}
.hcf-ribbon-row-label {
    font-weight: 800;
    font-size: 13px;
    color: var(--purple);
    text-align: center;
}
.hcf-ribbon-row.is-second .hcf-ribbon-row-label { color: var(--sky); }
.hcf-ribbon-bar-wrap {
    position: relative;
    height: 34px;
    margin-top: 2px;
}
.hcf-ribbon-bar {
    position: relative;
    height: 26px;
    border-radius: 7px;
    background: linear-gradient(180deg, rgba(157,92,255,0.28), rgba(157,92,255,0.14));
    border: 2px solid var(--purple);
    overflow: hidden;
}
.hcf-ribbon-row.is-second .hcf-ribbon-bar {
    background: linear-gradient(180deg, rgba(46,155,245,0.28), rgba(46,155,245,0.14));
    border-color: var(--sky);
}
.hcf-ribbon-tick {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(0,0,0,0.14);
}
.hcf-ribbon-length-label {
    font-weight: 800;
    font-size: 12px;
    color: var(--secondary);
    margin-top: 3px;
}

/* ================================================================
   A.5 HCF Real-Life: Packing Gift Bags
   ================================================================ */
.hcf-bags-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 14px auto 6px;
    width: 100%;
}
.hcf-bags-story {
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    text-align: center;
    max-width: 320px;
    line-height: 1.4;
}
.hcf-bags-groups {
    display: flex;
    justify-content: center;
    gap: 22px;
    flex-wrap: nowrap;
    width: 100%;
}
.hcf-bags-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.hcf-bags-group-label {
    font-weight: 800;
    font-size: 13px;
    color: var(--secondary);
}
.hcf-bags-dots {
    display: grid;
    grid-auto-flow: row;
    gap: 3px;
    max-width: 130px;
    justify-content: center;
}
.hcf-bags-dot {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}
.hcf-bags-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) {
    .hcf-picker { gap: 7px; margin: 14px auto 4px; max-width: 350px; }
    .hcf-opt { padding: 9px 5px; font-size: 14px; min-height: 46px !important; }

    .hcf-venn-stage { height: 190px; }
    .hcf-venn-circle { width: 168px; height: 160px; top: 14px; }
    .hcf-venn-pill { min-width: 24px; height: 22px; font-size: 11.5px; }
    .hcf-venn-label { font-size: 11px; width: 110px; }

    .hcf-list-cols { gap: 12px; }
    .hcf-list-items { max-width: 130px; }
    .hcf-list-item { min-width: 22px; height: 21px; font-size: 11px; }

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

    .hcf-ribbon-bar-wrap { height: 30px; }
    .hcf-ribbon-bar { height: 22px; }
    .hcf-ribbon-story { max-width: 280px; font-size: 13px; }

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

    .hcf-venn-stage { height: 172px; }
    .hcf-venn-circle { width: 148px; height: 142px; top: 12px; }
    .hcf-venn-pill { min-width: 22px; height: 20px; font-size: 10.5px; }
    .hcf-venn-label { font-size: 10px; width: 96px; }

    .hcf-list-cols { gap: 8px; }
    .hcf-list-items { max-width: 112px; }
    .hcf-list-item { min-width: 20px; height: 19px; font-size: 10px; }

    .hcf-tree-chips { max-width: 240px; gap: 4px; }
    .hcf-tree-chip { min-width: 24px; height: 24px; font-size: 11.5px; padding: 0 5px; }

    .hcf-ribbon-bar-wrap { width: 96%; }

    .hcf-bags-groups { gap: 10px; }
    .hcf-bags-dots { max-width: 88px; }
    .hcf-bags-dot { width: 11px; height: 11px; font-size: 10px; }
}