/* ================================================================
   finding-identifying-efficiently.css
   ----------------------------------------------------------------
   Styles for the "Finding & Identifying Efficiently" skill group
   (Tier 3) on the Class 5 Math page:

     - A.1  The 2 Surprise — trap/misconception buster proving 2 is
            the only even prime number (new .fie-numbadge classes).

     - A.2  Sieve of Eratosthenes (Kid Version) — an interactive
            1-100... (1-30 here) grid where multiples of small
            primes are visibly "crossed out," so surviving numbers
            read as prime candidates (new .fie-sieve-grid /
            .fie-sieve-cell classes).

     - A.3  Quick Divisibility Checks (Mini-Helpers) — gentle rules
            (last digit / digit sum) shown as a highlighted "clue"
            under the number being tested (new .fie-clue classes).

     - A.4  Is It Prime? (Test It Yourself) — a step-by-step
            "detective" checklist testing small factors before
            declaring prime/composite (new .fie-test-row classes).

   This file is fully self-contained ("fie-" prefixed classes) so it
   has no hidden dependency on primes-composites.css or any other
   skill's stylesheet — same philosophy as prime-time.css's "pt-"
   classes and primes-composites.css's "dpc-" classes. Load it 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/finding-identifying-efficiently.css}" />
   ================================================================ */

/* ---------- shared: answer-chip picker row ---------- */
/* flex-wrap is intentionally "nowrap": there are always exactly 4
   answer chips and they must always sit in a single row on every
   screen size, phone included (Android browsers down to ~320px are
   the explicit target here). Each .fie-opt is a flexible item so
   the row shrinks to fit the quiz card instead of wrapping to a
   second line; text inside a chip may wrap to two lines, but the 4
   chips themselves never stack. */
.fie-picker {
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 10px;
    margin: 18px auto 4px;
    width: 100%;
    max-width: 420px;
}
.fie-opt {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    max-width: 170px;
    padding: 10px 6px;
    height: auto !important;
    min-height: 56px !important;
    max-height: none !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    overflow: hidden;
    font-weight: 800;
    color: var(--secondary);
    text-align: center;
    line-height: 1.2;
    gap: 4px;
}
/* Text/sentence chips (A.1, A.3, A.4) need a smaller base size since
   labels like "It has more than 2 factors" run long. */
.fie-opt.fie-opt-text {
    font-size: 13px;
}
/* Number chips (A.2 survivor picks) show a single big digit, so the
   digit itself can stay large. */
.fie-opt.fie-opt-number {
    font-size: 22px;
}
.quiz-number-opt.fie-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.fie-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: stage wrapper + caption ---------- */
.fie-stage-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px auto 4px;
}
.fie-caption {
    font-weight: 700;
    font-size: 14.5px;
    color: var(--text);
    text-align: center;
    max-width: 380px;
}
.fie-caption strong {
    color: var(--secondary);
}

/* ---------- A.1: big number badge ---------- */
.fie-numbadge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid var(--primary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    font-size: 36px;
    font-weight: 800;
    color: var(--secondary);
}
.fie-numbadge.fie-badge-even {
    border-color: var(--sun);
}

/* ---------- A.2: Sieve of Eratosthenes 1-30 grid ---------- */
.fie-sieve-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 5px;
    padding: 12px;
    background: #fff;
    border: 3px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    max-width: 380px;
}
.fie-sieve-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    font-weight: 800;
    font-size: 13px;
    color: var(--text);
    background: rgba(0,0,0,0.03);
    border: 2px solid transparent;
}
.fie-sieve-cell.is-one {
    color: var(--text);
    background: rgba(0,0,0,0.05);
    opacity: 0.55;
    font-style: italic;
}
.fie-sieve-cell.is-kept-prime {
    background: rgba(16,185,129,0.14);
    border-color: #10b981;
    color: #0a7a5c;
}
.fie-sieve-cell.is-crossed {
    background: rgba(239,68,68,0.07);
    color: #b91c1c;
    text-decoration: line-through;
    opacity: 0.55;
}
.fie-sieve-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}
.fie-sieve-legend span.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: middle;
}
.fie-sieve-legend .dot.kept { background: rgba(16,185,129,0.35); border: 1px solid #10b981; }
.fie-sieve-legend .dot.crossed { background: rgba(239,68,68,0.25); border: 1px solid #b91c1c; }

/* ---------- A.3: divisibility "clue" display ---------- */
.fie-clue-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    background: #fff;
    border: 3px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}
.fie-clue-number {
    font-size: 34px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 1px;
}
.fie-clue-number .fie-clue-highlight {
    color: #fff;
    background: var(--primary);
    border-radius: 8px;
    padding: 0 6px;
}
.fie-clue-rule {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--secondary);
    text-align: center;
    max-width: 300px;
}

/* ---------- A.4: detective test checklist ---------- */
.fie-test-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    max-width: 340px;
}
.fie-test-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 10px;
    background: rgba(0,0,0,0.03);
    border: 2px solid var(--line);
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
}
.fie-test-line .fie-test-icon {
    flex: 0 0 auto;
    font-size: 15px;
}
.fie-test-line.fail .fie-test-icon { color: #b91c1c; }
.fie-test-line.pass .fie-test-icon { color: #10b981; }
.fie-test-line.pass {
    background: rgba(16,185,129,0.08);
    border-color: #10b981;
}

/* ---------- phone responsiveness (Android + iOS + desktop) ---------- */
@media (max-width: 560px) {
    .fie-picker { gap: 8px; margin: 14px auto 4px; max-width: 340px; }
    .fie-opt { padding: 8px 5px; min-height: 50px !important; }
    .fie-opt.fie-opt-text { font-size: 11.5px; }
    .fie-opt.fie-opt-number { font-size: 19px; }

    .fie-numbadge { width: 68px; height: 68px; font-size: 28px; border-width: 3px; }

    .fie-sieve-grid { max-width: 320px; padding: 9px; gap: 4px; }
    .fie-sieve-cell { font-size: 11px; border-radius: 6px; }
    .fie-sieve-legend { font-size: 11px; gap: 6px 12px; }

    .fie-clue-wrap { padding: 11px 14px; }
    .fie-clue-number { font-size: 27px; }
    .fie-clue-rule { font-size: 12.5px; max-width: 260px; }

    .fie-test-row { max-width: 300px; }
    .fie-test-line { font-size: 12px; padding: 6px 10px; }

    .fie-caption { font-size: 13px; max-width: 300px; }
}
/* Common small-Android widths (Galaxy A/M series, budget phones). */
@media (max-width: 400px) {
    .fie-picker { gap: 7px; max-width: 320px; }
    .fie-opt { padding: 7px 4px; min-height: 48px !important; }
    .fie-opt.fie-opt-text { font-size: 10.5px; }
    .fie-opt.fie-opt-number { font-size: 17px; }

    .fie-sieve-grid { max-width: 290px; padding: 8px; gap: 3px; }
    .fie-sieve-cell { font-size: 10px; }

    .fie-clue-number { font-size: 24px; }
}
@media (max-width: 380px) {
    .fie-picker { gap: 6px; max-width: 300px; }
    .fie-opt { padding: 6px 3px; min-height: 46px !important; }
    .fie-opt.fie-opt-text { font-size: 10px; }
    .fie-opt.fie-opt-number { font-size: 16px; }

    .fie-sieve-grid { max-width: 270px; padding: 7px; gap: 3px; }
    .fie-sieve-cell { font-size: 9px; border-radius: 5px; }

    .fie-numbadge { width: 60px; height: 60px; font-size: 24px; }
    .fie-clue-number { font-size: 21px; }
    .fie-test-line { font-size: 11px; padding: 5px 8px; }
}
/* Extra-narrow Android browsers (e.g. 320px viewport). */
@media (max-width: 340px) {
    .fie-picker { gap: 5px; max-width: 280px; }
    .fie-opt { padding: 5px 2px; min-height: 44px !important; }
    .fie-opt.fie-opt-text { font-size: 9.5px; }
    .fie-opt.fie-opt-number { font-size: 15px; }

    .fie-sieve-grid { max-width: 250px; padding: 6px; gap: 2px; }
    .fie-sieve-cell { font-size: 8.5px; }
}