/* ================================================================
   data-foundations.css
   ----------------------------------------------------------------
   Styles for "What is data? (Foundations)" (Tier 1) in Topic 9,
   "Data Handling and Presentation", on the Class 6 Math page:

     - A.1  Data Is Everywhere      (data cards vs. plain things)
     - A.2  Ask or Already Know?    (collect data vs. look it up)
     - A.3  Who Do I Ask?           (fair collection, dots = students)
     - A.4  Guess First, Then Check (vote stacks, guess vs. real data)

   Same shared popup shell as every other skill (quiz-overlay /
   quiz-modal), so this file only styles the pictures and the chips.
   Fully self-contained: every class starts with "dh-" and every
   popup id starts with "dh". Site variables (--primary, --secondary,
   --line, --sun) are read with fallbacks.

   Finish (kid-friendly, matt + shine): glossy sunny-yellow, coral,
   sky, mint and grape shapes with a soft white highlight, sitting on
   a matt pastel "paper" stage. Warm colours for things kids love,
   cool colours for calm background, one dark-indigo outline so every
   picture stays crisp on small phone screens.

   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/data-foundations.css}" />
   ================================================================ */

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

.dh-t {
    font: 800 20px/1 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    fill: #2b2a5f; 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;
}
.dh-t-s { font-size: 16px; }
.dh-t-white { fill: #fff; stroke: rgba(45, 42, 94, .60); stroke-width: 5; }
.dh-t-plain { stroke: none; }
.dh-emo {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Android Emoji", sans-serif;
    text-anchor: middle; dominant-baseline: central; stroke: none;
    pointer-events: none; user-select: none; -webkit-user-select: none;
}

/* little pieces */
.dh-badge { fill: #7c4dff; stroke: #fff; stroke-width: 3; }
.dh-bubble { fill: #fff; stroke: rgba(45, 42, 94, .5); stroke-width: 3; }
.dh-faint { opacity: .5; }
.dh-ring { fill: none; stroke: #ffb300; stroke-width: 4.5; }
.dh-arrow { fill: none; stroke: #7c4dff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.dh-ground { stroke: rgba(45, 42, 94, .35); stroke-width: 3; stroke-linecap: round; }

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

.dh-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 8px auto 0; }
.dh-stage {
    position: relative;
    width: var(--dh-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, .95), rgba(255, 255, 255, 0) 60%),
        linear-gradient(180deg, #fffaf0 0%, #eaf5ff 100%);
    border: 2px solid var(--line, #d9e6fb);
    box-shadow: 0 3px 0 rgba(75, 63, 143, 0.08), inset 0 0 22px rgba(110, 198, 255, .16);
}
.dh-stage > svg { width: 100%; height: 100%; }
.dh-stage.dh-wide { width: min(100%, calc(var(--dh-fig) * 1.7)); aspect-ratio: 2 / 1; }
.dh-hint { margin: 0; text-align: center; font-size: 13px; font-weight: 700; color: #6f7aa6; line-height: 1.35; max-width: 360px; }
.dh-hint b { color: var(--secondary, #4b3f8f); }
.dh-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;
}
.dh-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.dh-picker {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 520px;
    margin: 16px auto 4px;
}
.quiz-number-options.dh-picker:empty { display: none; }
.quiz-number-opt.dh-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.dh-opt:active:not(:disabled) { transform: scale(.96); background: rgba(124, 77, 255, 0.10); }
@media (hover: hover) {
    .quiz-number-opt.dh-opt:hover:not(:disabled) { border-color: var(--primary, #6c5ce7); }
}
.quiz-number-opt.dh-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.dh-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.dh-opt.has-thumb { padding: 6px 4px 8px; }
.dh-opt-thumb { display: block; width: 100%; max-width: 78px; aspect-ratio: 1 / 1; }
.dh-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^="dh"] .quiz-modal { --dh-fig: 232px; }
    .quiz-number-options.dh-picker { gap: 8px; margin-top: 14px; }
    .quiz-number-opt.dh-opt { font-size: 12.5px; padding: 8px 3px; min-height: 52px !important; letter-spacing: -0.1px; }
    .dh-opt-thumb { max-width: 68px; }
}
@media (max-width: 380px) {
    .quiz-overlay[id^="dh"] .quiz-modal { --dh-fig: 204px; }
    .quiz-number-opt.dh-opt { font-size: 11.5px; padding: 7px 2px; }
    .quiz-number-opt.dh-opt.has-thumb { padding: 5px 2px 6px; }
    .quiz-number-options.dh-picker { gap: 6px; }
    .dh-opt-thumb { max-width: 58px; }
    .dh-hint { font-size: 12.5px; }
    .quiz-overlay[id^="dh"] .quiz-question { font-size: 15.5px; }
}
@media (pointer: coarse) {
    .quiz-number-opt.dh-opt { min-height: 56px !important; }
}
@media (max-height: 560px) and (orientation: landscape) {
    .quiz-overlay[id^="dh"] .quiz-modal { --dh-fig: 176px; }
}
@media (prefers-reduced-motion: reduce) {
    .quiz-number-opt.dh-opt, .dh-replay { transition: none; }
}