/* Toán 3 (gen/math3.js) — tiền tố class: .m3- */

.m3-ask { font-size: 19px; line-height: 1.6; margin: 8px 0 4px; font-weight: 600; }

/* m3group: khung tranh trong nút chọn nhiều */
.mopt .m3-grp { display: block; margin: 4px auto 0; max-width: 100%; height: auto; }
.m3-gbox { fill: #fffdf7; stroke: #c9b79c; stroke-width: 2; }
.m3-scene { display: block; width: 100%; height: auto; margin: 6px auto 8px; }

/* m3parity: số và hàng số */
.m3-n { display: inline-block; min-width: 1.6em; text-align: center; font-size: 24px; font-weight: 700; }
.m3-nums { font-size: 22px; font-weight: 700; letter-spacing: .5px; vertical-align: middle; }
.choice svg.art, .mopt svg.art { vertical-align: middle; }

/* m3matchcalc */
.m3-ex, .m3-res, .m3-code { font-size: 22px; font-weight: 700; white-space: nowrap; }
.m3-code { letter-spacing: 3px; color: #1d5f8a; }

/* m3truefalse */
.m3-tfs { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.m3-tf { display: flex; align-items: center; gap: 14px; font-size: 22px; }
.m3-st { min-width: 9.5em; white-space: nowrap; }
.m3-tf select.blank { width: 3.2em; font-size: 20px; }

/* m3pyramid */
.m3-pyrs { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; margin: 10px 0; }
.m3-pyr { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.m3-prow { display: flex; gap: 4px; }
.m3-pc { width: 54px; height: 42px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700;
  border: 2.5px solid #a9713d; border-radius: 8px; background: #fff3c4; box-sizing: border-box; }
.m3-pc.m3-pq { background: #eef8ff; border-color: #118ab2; border-style: dashed; }
.m3-pc .blank { width: 44px; height: 34px; padding: 0; text-align: center; font-size: 20px; border: 0; background: transparent; }

/* m3triangle: tam giác / ngôi sao số */
.m3-figs { display: flex; flex-wrap: wrap; gap: 14px 22px; justify-content: center; margin: 8px 0; }
.m3-figw { display: flex; flex-direction: column; align-items: center; }
.m3-exl { font-size: 14px; font-weight: 700; color: #6b6f85; border: 1.5px dashed #9aa3b5; border-radius: 6px; padding: 0 8px; margin-bottom: 2px; }
.m3-fig { position: relative; width: 200px; }
.m3-bg { position: absolute; left: 0; top: 0; }
.m3-tl { fill: #fff8ec; stroke: #f4a261; stroke-width: 4; stroke-linejoin: round; }
.m3-starp { fill: #fff6cc; stroke: #e9b100; }
.m3-c { position: absolute; width: 42px; height: 42px; box-sizing: border-box; border-radius: 50%; border: 2.5px solid #7b5ea7; background: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; }
.m3-c.m3-cc { border-color: #e76f51; background: #ffe8df; color: #c2410c; font-size: 22px; }
.m3-c.m3-cq { background: #eef8ff; border-color: #118ab2; border-style: dashed; }
.m3-c .blank { width: 34px; height: 30px; padding: 0; text-align: center; font-size: 18px; border: 0; background: transparent; }
.m3-sum { position: absolute; width: 42px; text-align: center; font-size: 24px; font-weight: 800; color: #c2410c; }

/* m3cross */
table.m3-cross { border-collapse: separate; border-spacing: 3px; margin: 10px auto; }
table.m3-cross td { width: 44px; height: 44px; text-align: center; font-size: 22px; padding: 0; box-sizing: border-box; }
td.m3-xn { border: 2px solid #4a6fa5; border-radius: 6px; background: #fff; font-weight: 700; }
td.m3-xo { border: 2px solid #4a6fa5; border-radius: 6px; background: #eaf2ff; color: #e76f51; font-weight: 800; }
td.m3-e { border: 0; }
td.m3-xq .blank { width: 38px; height: 36px; padding: 0; text-align: center; font-size: 20px; }

/* m3code */
.m3-key { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; padding: 6px 12px; margin: 6px 0 10px;
  border: 2px dashed #c9b79c; border-radius: 12px; background: #fffdf7; font-size: 22px; }
.m3-k { display: inline-flex; align-items: center; gap: 6px; }
.m3-k b { font-size: 26px; color: #1d5f8a; }
/* hàng hình KHÔNG được xuống dòng (thứ tự hình là dãy số) */
.m3-crow { display: inline-flex; flex-wrap: nowrap; gap: 1px; align-items: center; vertical-align: middle; white-space: nowrap; }
.m3-crow svg.art { flex: 0 0 auto; }
.match .m3-crow svg.art { width: 26px; height: 26px; }
.match:has(.m3-crow) .mleft { flex: 0 0 auto; }
.match:has(.m3-crow) .mright { flex: 1 1 auto; }
.match:has(.m3-crow) { gap: 18px; }
.match .m3-ex { font-size: 20px; }
.match .m3-code { font-size: 20px; letter-spacing: 1px; }
.m3-cells.m3-crow { display: flex; flex-wrap: nowrap; } /* hàng hình mã hóa không được xuống dòng: thứ tự đọc phải rõ */
.m3-cells { display: flex; gap: 10px; margin: 8px 0; }
.m3-cc { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.m3-cline { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 8px 0; font-size: 22px; }
.m3-cline .blank { width: 5.5em; }
.m3-arr { font-weight: 800; color: #e76f51; }

/* m3odd */
.m3-emo { display: block; font-size: 42px; line-height: 1.15; text-align: center;
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
.m3-cap { display: block; font-size: 13px; text-align: center; color: #555; }
.choice .m3-emo, .mopt .m3-emo { margin-top: 2px; }

.sheet-mode .m3-pc .blank, .sheet-mode .m3-c .blank, .sheet-mode td.m3-xq .blank { border: 0; }
.match .m3-crow svg { width: 24px; height: 24px; }
/* (bỏ overflow-x: làm mất chữ số cuối trên điện thoại) */
