/* ================================================================
   angle-lab.css
   ----------------------------------------------------------------
   Styles for "Angles" (Tier 5) on the Class 6 Math page
   (Geometry tools & constructions):

     - A.1  Angle Types Sort              (angle pictures, angle ladder)
     - A.2  Measure with a Protractor     (protractor, two scales)
     - A.3  Draw an Angle of Given Measure(lettered dots on the protractor)
     - A.4  Estimate the Angle            (benchmark pictures)
     - A.5  Copy an Angle (Compass)       (arcs, step-by-step replay)
     - A.6  Bisect an Angle               (arcs meeting at F)

   Same shared popup shell as the other skills (quiz-overlay / quiz-modal).
   Fully self-contained: every class starts with "an5-" and every popup
   id starts with "a5". Site colour variables (--primary, --secondary,
   --line, --sun) are read with fallbacks.

   Finish (kid-friendly, matt + shine): glossy violet / purple / magenta /
   teal / gold / sky shapes with a soft shine and a sparkle on a matt
   pastel lavender "paper" stage.

   Layout notes
   - Answer chips ALWAYS stay on ONE row (flex-wrap: nowrap), 4 chips.
   - Android-native feel: >=52px touch targets, instant :active press,
     no 300ms delay, no grey tap flash, safe-area padding.

     <link rel="stylesheet" th:href="@{/css/angle-lab.css}" />
   ================================================================ */

/* ---------- SVG paint ---------- */
.an5-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.an5-o { stroke: rgba(60, 38, 120, 0.60); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.an5-sh { filter: drop-shadow(0 4px 3px rgba(60, 38, 120, 0.25)); }
.an5-gloss { fill: #fff; opacity: 0.38; pointer-events: none; }
.an5-spark { fill: #fff; opacity: 0.9; pointer-events: none; }
.an5-nopt { pointer-events: none; stroke: none; }

.an5-t {
    font: 800 22px/1 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    fill: #34205f; text-anchor: middle; dominant-baseline: central;
    stroke: #fff; stroke-width: 5; paint-order: stroke; stroke-linejoin: round;
    pointer-events: none; user-select: none; -webkit-user-select: none;
}
.an5-t-lbl { font-size: 24px; }
.an5-t-small { font-size: 19px; }
.an5-t-tick { font-size: 15px; stroke: none; fill: #5a3d00; }
.an5-t-badge { font-size: 18px; stroke: none; fill: #34205f; }
.an5-t-white { fill: #fff; stroke: rgba(60, 38, 120, .55); stroke-width: 5; }
.an5-t-pi { font-size: 120px; fill: #fff; stroke: rgba(80, 40, 170, .65); stroke-width: 7; }
.an5-t-digit { font-size: 34px; letter-spacing: 1px; }

/* lines: white underlay + coloured core */
.an5-under { stroke: #fff; stroke-width: 11; stroke-linecap: round; opacity: .9; }
.an5-seg { stroke-width: 6; stroke-linecap: round; fill: none; }
.an5-dia { stroke: #2f7fe8; }
.an5-hot { stroke: #ef3b3b; }
.an5-neu { stroke: #34205f; }
.an5-string { stroke: #e0368a; stroke-width: 7; stroke-linecap: round; fill: none; }
.an5-ring { fill: none; stroke: #e0368a; stroke-width: 6; stroke-dasharray: 2 10; stroke-linecap: round; }
.an5-ring-solid { fill: none; stroke: #e0368a; stroke-width: 6; }
.an5-cdot { fill: #34205f; stroke: #fff; stroke-width: 3; }
.an5-pt-red { fill: #ef3b3b; stroke: #fff; stroke-width: 3; }
.an5-spoke { stroke: rgba(255, 255, 255, .8); stroke-width: 5; stroke-linecap: round; }
.an5-hub { fill: #fff; stroke: rgba(60, 38, 120, .6); stroke-width: 3; }
.an5-start { stroke: #10b981; stroke-width: 4; stroke-dasharray: 5 5; }
.an5-arrow { fill: none; stroke: #7c4dff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }

/* rulers and bars */
.an5-ruler { fill: #ffe9a8; stroke: rgba(90, 61, 0, .55); stroke-width: 2.5; }
.an5-rtick { stroke: #5a3d00; stroke-width: 2.5; stroke-linecap: round; }
.an5-ground { fill: #d9ccff; stroke: rgba(60, 38, 120, .45); stroke-width: 2.5; }
.an5-bar { stroke: rgba(60, 38, 120, .55); stroke-width: 2.5; }
.an5-bar-faint { opacity: .35; }
.an5-brace { fill: none; stroke: #34205f; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }

/* calculator-style display */
.an5-calc { fill: #2a1b5c; stroke: #7c4dff; stroke-width: 4; }
.an5-calc-t { font: 800 38px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; fill: #c8f7ff; text-anchor: middle; dominant-baseline: central; stroke: none; }
.an5-calc-s { font-size: 26px; fill: #ffd54a; }

/* ---------- picture card ---------- */
.quiz-overlay[id^="a5"] .quiz-modal { --an5-fig: 250px; }
.quiz-overlay[id^="a5"] .quiz-question b { color: var(--secondary, #4b3f8f); }
.quiz-overlay[id^="a5"] .bq-btn,
.quiz-overlay[id^="a5"] .bq-next-btn { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.quiz-overlay[id^="a5"] .bq-next-btn { margin-bottom: env(safe-area-inset-bottom, 0px); }
.quiz-overlay[id^="a5"] .bq-summary-buttons { margin-bottom: env(safe-area-inset-bottom, 0px); }
.quiz-overlay[id^="a5"] .quiz-modal { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }

.an5-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 8px auto 0; }
.an5-stage {
    position: relative;
    width: var(--an5-fig);
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
    padding: 6px;
    border-radius: 20px;
    background:
        radial-gradient(120% 90% at 25% 10%, rgba(255, 255, 255, .92), rgba(255, 255, 255, 0) 60%),
        linear-gradient(180deg, #f7f2ff 0%, #ece3ff 100%);
    border: 2px solid var(--line, #ddd2fb);
    box-shadow: 0 3px 0 rgba(75, 63, 143, 0.08), inset 0 0 22px rgba(167, 139, 250, .16);
}
.an5-stage > svg { width: 100%; height: 100%; }
.an5-stage.an5-wide { width: min(100%, calc(var(--an5-fig) * 1.7)); aspect-ratio: 2 / 1; }
.an5-hint { margin: 0; text-align: center; font-size: 13px; font-weight: 700; color: #7a71a8; line-height: 1.35; max-width: 360px; }
.an5-hint b { color: var(--secondary, #4b3f8f); }
.an5-replay {
    min-height: 44px; padding: 8px 20px; border: 2px solid var(--primary, #6c5ce7); border-radius: 999px;
    background: #fff; color: var(--primary, #6c5ce7); font: inherit; font-weight: 800; font-size: 15px;
    box-shadow: 0 3px 0 rgba(108, 92, 231, 0.20); cursor: pointer;
    touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
    transition: transform .08s ease, box-shadow .15s;
}
.an5-replay:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(108, 92, 231, 0.20); }

/* ================================================================
   Answer chips: ALWAYS a single line (4 chips)
   ================================================================ */
.quiz-number-options.an5-picker {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 480px;
    margin: 16px auto 4px;
}
.quiz-number-options.an5-picker:empty { display: none; }
.quiz-number-opt.an5-opt {
    display: inline-flex;
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: auto !important;
    min-height: 54px !important;
    max-height: none !important;
    box-sizing: border-box !important;
    padding: 10px 5px;
    white-space: normal !important;
    overflow: hidden;
    overflow-wrap: break-word;
    font-weight: 800;
    font-size: 15.5px;
    line-height: 1.2;
    text-align: center;
    color: var(--secondary, #4b3f8f);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    transition: transform .08s ease, box-shadow .15s, border-color .15s, background .15s;
}
.quiz-number-opt.an5-opt.an5-sym { font-size: 30px; line-height: 1; }
.quiz-number-opt.an5-opt:active:not(:disabled) { transform: scale(.96); background: rgba(124, 77, 255, 0.10); }
@media (hover: hover) {
    .quiz-number-opt.an5-opt:hover:not(:disabled) { border-color: var(--primary, #6c5ce7); }
}
.quiz-number-opt.an5-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.an5-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); }
.quiz-number-opt.an5-opt.has-thumb { padding: 6px 4px 8px; }
.an5-opt-thumb { display: block; width: 100%; max-width: 78px; aspect-ratio: 1 / 1; }
.an5-opt-letter { font-size: 13px; font-weight: 800; opacity: .85; }

/* ================================================================
   Responsive (phones): shrink the drawings and chips only
   ================================================================ */
@media (max-width: 560px) {
    .quiz-overlay[id^="a5"] .quiz-modal { --an5-fig: 232px; }
    .quiz-number-options.an5-picker { gap: 8px; margin-top: 14px; }
    .quiz-number-opt.an5-opt { font-size: 12.5px; padding: 8px 3px; min-height: 52px !important; letter-spacing: -0.1px; }
    .an5-opt-thumb { max-width: 68px; }

}
@media (max-width: 380px) {
    .quiz-overlay[id^="a5"] .quiz-modal { --an5-fig: 204px; }
    .quiz-number-opt.an5-opt { font-size: 11.5px; padding: 7px 2px; }
    .quiz-number-opt.an5-opt.an5-sym { font-size: 26px; }
    .quiz-number-opt.an5-opt.has-thumb { padding: 5px 2px 6px; }
    .quiz-number-options.an5-picker { gap: 6px; }
    .an5-opt-thumb { max-width: 58px; }
    .an5-hint { font-size: 12.5px; }

}
@media (pointer: coarse) {
    .quiz-number-opt.an5-opt { min-height: 56px !important; }
}
@media (max-height: 560px) and (orientation: landscape) {
    .quiz-overlay[id^="a5"] .quiz-modal { --an5-fig: 176px; }
}
@media (prefers-reduced-motion: reduce) {
    .quiz-number-opt.an5-opt, .an5-replay { transition: none; }
}
/* ---------- tools & line-art added for Tier 1 ---------- */
.an5-thin { stroke-width: 1.8; }
.an5-legu { stroke: #fff; stroke-width: 17; stroke-linecap: round; opacity: .9; }
.an5-leg  { stroke-width: 12; stroke-linecap: round; fill: none; }
.an5-legh { stroke: #fff; stroke-width: 3; stroke-linecap: round; opacity: .6; }
.an5-semi { fill-opacity: .8; }
.an5-cell { fill: rgba(255, 255, 255, .6); stroke: var(--line, #ddd2fb); stroke-width: 2.5; }

/* line art: white underlay + coloured core */
.an5-fu { fill: none; stroke: #fff; stroke-width: 15; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.an5-fs { stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.an5-dash { stroke-dasharray: 2 14; }
.an5-guide { stroke: #7c4dff; stroke-width: 2; stroke-dasharray: 4 5; opacity: .3; }
.an5-guide2 { fill: none; stroke: #7c4dff; stroke-width: 3; stroke-dasharray: 3 9; stroke-linecap: round; opacity: .35; }
.an5-leader { stroke: #34205f; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 2 6; }
.an5-spoke2 { stroke: #fff; stroke-width: 4; stroke-linecap: round; opacity: .85; }
.an5-ray { stroke-width: 9; stroke-linecap: round; }

/* compass drawing animation */
.an5-arc { fill: none; stroke: #e0368a; stroke-width: 8; stroke-linecap: round; }
.an5-arm { stroke: #7c4dff; stroke-width: 6; stroke-linecap: round; opacity: .85; }
.an5-pin { fill: #ef3b3b; stroke: #fff; stroke-width: 3; }
.an5-tipdot { fill: #ffd54a; stroke: #34205f; stroke-width: 3; }
.an5-gap { stroke: #ef3b3b; stroke-width: 5; stroke-dasharray: 3 8; stroke-linecap: round; }

/* start / arrows */
.an5-arrow { fill: none; stroke: #7c4dff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
/* ---------- Tier 5 additions ---------- */
.an5-prot-body { fill-opacity: .72; }
.an5-prot-in { fill: #f4fbff; fill-opacity: .9; stroke: rgba(30, 70, 130, .35); stroke-width: 2; }
.an5-ptick { stroke: #1d4f86; stroke-linecap: round; }
.an5-t-n { font-size: 14px; stroke-width: 3.5; }
.an5-t-letter { font-size: 18px; stroke: none; fill: #fff; }
.an5-wedge { fill: #ffd54a; fill-opacity: .5; stroke: none; }
.an5-wedge2 { fill: #7c4dff; fill-opacity: .14; stroke: none; }
.an5-anglearc { fill: none; stroke: #e0368a; stroke-width: 6; stroke-linecap: round; }
.an5-rt { fill: none; stroke: #e0368a; stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; }
.an5-dashed { fill: none; stroke: #7c4dff; stroke-width: 4; stroke-dasharray: 6 7; stroke-linecap: round; }
.an5-dashed-red { fill: none; stroke: #ef3b3b; stroke-width: 4; stroke-dasharray: 6 6; stroke-linecap: round; }
.an5-ladder { fill: #fff; stroke: rgba(60, 38, 120, .45); stroke-width: 2.5; }
.an5-clock { fill: #fff; stroke: rgba(60, 38, 120, .55); stroke-width: 3.5; }
.an5-hand { stroke-width: 7; stroke-linecap: round; }
.an5-pt-gold { fill: #ffd54a; stroke: #34205f; stroke-width: 3; }
.an5-step { transition: opacity .35s ease; }
.an5-step.an5-hide { opacity: 0; }
.an5-hint u { text-decoration-color: #e0368a; text-decoration-thickness: 2px; text-underline-offset: 2px; }
.an5-opt-text-sm { font-size: 14px; }
@media (max-width: 560px) { .an5-t-n { font-size: 15px; } }
@media (prefers-reduced-motion: reduce) { .an5-step { transition: none; } }