/* ================================================================
   decimal-addsub.css
   ----------------------------------------------------------------
   Styles for the "Adding & Subtracting Decimals" skill group on the
   Class 4 Math page:

     - A.1  Same Place-Value Add/Subtract (Visual) — combine or
            remove shaded parts on a single matching 10-strip or
            100-grid (new .das-strip-* / .das-grid-* classes).

     - A.2  Crossing the Whole (Regrouping visual) — two source
            strips are shown "filling up" into 1 whole flat plus a
            leftover strip, the visual analog of carrying (new
            .das-cross-* classes).

     - A.3  Mismatched Place Values — Align by Grid, Not by Rule —
            a 10-strip (tenths) is shown converting into hundredths
            before combining with a 100-grid (new .das-align-*
            classes).

     - A.4  Money Add/Subtract as Real Practice — price tags and a
            bill are combined or used to make change (new
            .das-money-* / .das-tag-* / .das-bill-* 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 "das-" prefixed classes instead of reusing any
   other skill file's markup, so it has no hidden cross-file
   dependency — same philosophy as decimal-rwv.css's .drw- 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/decimal-addsub.css}" />
   ================================================================ */

/* ---------- shared: answer-chip picker row ---------- */
/* flex-wrap is intentionally "nowrap": there are always exactly 4
   decimal-value chips and they must always sit in a single row,
   never wrapping to a second line, on phone or desktop widths. Each
   .das-opt is a flexible (not fixed-width) item so the row shrinks
   to fit the quiz card instead of wrapping. */
.das-picker {
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 10px;
    margin: 18px auto 4px;
    width: 100%;
    max-width: 380px;
}
.das-opt {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    min-width: 0;
    max-width: 160px;
    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;
}
.quiz-number-opt.das-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.das-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: the "0.3 + 0.4 = ?" expression caption ---------- */
.das-expr-caption {
    font-weight: 800;
    font-size: 22px;
    color: var(--secondary);
    text-align: center;
    margin: 4px auto 10px;
    letter-spacing: 0.01em;
}
.das-expr-caption .das-op-glyph {
    display: inline-block;
    margin: 0 6px;
    color: var(--text);
    opacity: 0.75;
}

/* ---------- shared: small colour-key legend row ---------- */
.das-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 2px auto 10px;
}
.das-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 12.5px;
    color: var(--text);
}
.das-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
    border: 1.5px solid var(--line);
}
.das-legend-swatch.is-a { background: var(--mint); }
.das-legend-swatch.is-b { background: var(--sky); }
.das-legend-swatch.is-removed {
    background: repeating-linear-gradient(45deg, #fca5a5, #fca5a5 4px, #fecaca 4px, #fecaca 8px);
}

.das-caption {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--text);
    text-align: center;
    max-width: 320px;
}

/* ================================================================
   A.1 Same Place-Value Add/Subtract (Visual)
   ================================================================ */
.das-stage-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 10px auto 6px;
}
.das-strip {
    display: flex;
    width: min(320px, 90%);
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    border: 3px solid var(--line);
    background: #fff;
}
.das-strip-seg {
    flex: 1 1 0;
    border-right: 2px solid var(--line);
    background: transparent;
}
.das-strip-seg:last-child { border-right: none; }
.das-strip-seg.is-a { background: var(--mint); }
.das-strip-seg.is-b { background: var(--sky); }
.das-strip-seg.is-removed {
    background: repeating-linear-gradient(45deg, #fca5a5, #fca5a5 4px, #fecaca 4px, #fecaca 8px);
}

.das-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    gap: 1px;
    background: var(--line);
    border: 2px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    width: 200px;
    height: 200px;
}
.das-cell { background: #fff; }
.das-cell.is-a { background: var(--mint); }
.das-cell.is-b { background: var(--sky); }
.das-cell.is-removed {
    background: repeating-linear-gradient(45deg, #fca5a5, #fca5a5 4px, #fecaca 4px, #fecaca 8px);
}

/* ================================================================
   A.2 Crossing the Whole (Regrouping visual)
   ================================================================ */
.das-cross-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 8px auto 6px;
    width: 100%;
}
.das-cross-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.das-cross-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text);
    opacity: 0.65;
    text-align: center;
    margin-top: 2px;
}
.das-cross-strip {
    display: flex;
    width: 160px;
    height: 40px;
    border-radius: 9px;
    overflow: hidden;
    border: 3px solid var(--line);
    background: #fff;
}
.das-cross-seg {
    flex: 1 1 0;
    border-right: 1.5px solid var(--line);
    background: transparent;
}
.das-cross-seg:last-child { border-right: none; }
.das-cross-seg.is-a { background: var(--mint); }
.das-cross-seg.is-b { background: var(--sky); }

.das-cross-arrow {
    font-size: 22px;
    font-weight: 800;
    color: var(--secondary);
    text-align: center;
    margin: 2px 0;
}
.das-cross-regroup-text {
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
    text-align: center;
    max-width: 300px;
}

.das-whole-flat {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: var(--mint);
    border: 3px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.10);
}
.das-cross-plus {
    font-size: 20px;
    font-weight: 800;
    color: var(--secondary);
}

/* ================================================================
   A.3 Mismatched Place Values — Align by Grid, Not by Rule
   ================================================================ */
.das-align-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin: 8px auto 6px;
    width: 100%;
}
.das-align-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.das-align-convert {
    font-weight: 800;
    font-size: 14px;
    color: var(--mint-bright, var(--secondary));
    text-align: center;
    background: rgba(46,155,245,0.08);
    border-radius: 8px;
    padding: 3px 10px;
}
.das-align-op-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

/* ================================================================
   A.4 Money Add/Subtract as Real Practice
   ================================================================ */
.das-money-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 12px auto 6px;
}
.das-money-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 4px auto 2px;
}
.das-money-op {
    font-size: 24px;
    font-weight: 800;
    color: var(--secondary);
}
.das-tag {
    position: relative;
    width: 150px;
    height: 98px;
    background: linear-gradient(135deg, var(--sun), #ffcf6b);
    border-radius: 14px 30px 14px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}
.das-tag::before {
    content: "";
    position: absolute;
    top: 12px;
    right: 14px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid rgba(0,0,0,0.15);
}
.das-tag::after {
    content: "";
    position: absolute;
    left: -13px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-right: 14px solid var(--sun);
}
.das-tag-price {
    font-weight: 800;
    font-size: 23px;
    color: #7a4a00;
}
.das-bill {
    position: relative;
    width: 150px;
    height: 92px;
    background: linear-gradient(135deg, #8fd19e, #5fb87a);
    border-radius: 10px;
    border: 3px dashed #2f7a45;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}
.das-bill-amount {
    font-weight: 800;
    font-size: 22px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.das-money-caption {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--text);
    text-align: center;
    max-width: 300px;
}

/* ---------- phone responsiveness ---------- */
@media (max-width: 560px) {
    .das-picker { gap: 8px; margin: 14px auto 4px; max-width: 320px; }
    .das-opt { padding: 9px 5px; font-size: 14px; min-height: 46px !important; }
    .das-expr-caption { font-size: 19px; margin: 2px auto 8px; }
    .das-legend { gap: 10px; }

    .das-strip { height: 44px; }
    .das-grid { width: 160px; height: 160px; }

    .das-cross-strip { width: 130px; height: 32px; }
    .das-whole-flat { width: 46px; height: 46px; font-size: 15px; }

    .das-align-convert { font-size: 12.5px; padding: 3px 8px; }

    .das-tag { width: 128px; height: 84px; }
    .das-tag-price { font-size: 19px; }
    .das-bill { width: 128px; height: 78px; }
    .das-bill-amount { font-size: 18px; }
    .das-money-row { gap: 12px; }
}
@media (max-width: 380px) {
    .das-picker { gap: 6px; max-width: 280px; }
    .das-opt { padding: 7px 3px; font-size: 12.5px; }
    .das-expr-caption { font-size: 17px; }

    .das-grid { width: 136px; height: 136px; }
    .das-cross-strip { width: 112px; height: 28px; }
    .das-whole-flat { width: 40px; height: 40px; font-size: 13px; }

    .das-tag { width: 112px; height: 74px; }
    .das-tag-price { font-size: 16.5px; }
    .das-bill { width: 112px; height: 68px; }
    .das-bill-amount { font-size: 15.5px; }
}