/* Precalculus games: math typesetting and the answer-box keypad (resources/shared/mathpad.js). */
.mq { font-size: 1.9rem; font-weight: 700; color: var(--ink); margin-top: 12px; line-height: 1.6; }
.mq.small { font-size: 1.45rem; }
.mtext { color: var(--ink) !important; font-size: 1.12rem !important; line-height: 1.45; }
/* Stacked fraction */
.mfr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 .12em; line-height: 1.15; }
.mfr > .mfn { border-bottom: 2px solid currentColor; padding: 0 .15em .04em; }
.mfr > .mfd { padding: .04em .15em 0; }
sup .mfr, .mex .mfr { font-size: .9em; }
/* Radical: the index sits on the tick, the bar runs over the radicand */
.mrad { display: inline-flex; align-items: stretch; white-space: nowrap; vertical-align: middle; margin: 0 .05em; }
.mri { font-size: .55em; align-self: flex-start; margin-right: -.45em; margin-top: .05em; position: relative; z-index: 1; }
.mrs { font-weight: 400; transform: scaleY(1.08); }
.mrc { border-top: 2px solid currentColor; padding: .02em .12em 0; margin-top: .22em; display: inline-flex; align-items: center; }
.mex { font-size: .62em; font-weight: 700; margin-left: .04em; }
.mvar { font-style: italic; font-family: "Times New Roman", Georgia, serif; font-weight: 600; }

/* Answer boxes */
.mp-box { text-align: center; }
.mp-ans { font-size: 1.9rem; font-weight: 700; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px; min-height: 2.6em; margin: 4px 0 6px; }
.mp-slot { min-width: 2.1em; min-height: 1.5em; padding: 0 .25em; border: 2px dashed var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; }
.mp-slot.on { border: 2px solid var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.mp-slot.empty::after { content: '?'; color: var(--muted); opacity: .45; }
.mp-box.locked .mp-slot.right { border: 2px solid var(--good); }
.mp-box.locked .mp-slot.wrong { border: 2px solid var(--bad); }
.mp-ans sup .mp-slot, .mp-ans .mex .mp-slot { font-size: 1.2rem; min-width: 2.6em; min-height: 1.9em; vertical-align: super; }
.mp-ans .mrc .mp-slot { margin: 2px 0; }
.mp-ans .mfr .mp-slot { margin: 2px 0; }
.mp-pad { grid-template-columns: repeat(4, 1fr); max-width: 360px; margin: 8px auto 0; }
.mp-pad .key { min-height: 52px; font-size: 1.35rem; }
.mp-pad .key.wide { grid-column: span 2; font-size: 1rem; }
.mp-pad .key.off { visibility: hidden; }

/* Choices that hold math */
.choice.c5 { background: #6b5a8e; }
.choice .mfr > .mfn, .choice .mrc { border-color: #fff; }
.choices.mathc .choice { font-size: 1.4rem; text-transform: none; }
.mnote { color: var(--muted); font-size: .95rem; margin-top: 10px; }
.intro .mq { font-size: 1.25rem; margin: 4px 0; }
.why .mfr, .correct .mfr { font-size: .95em; }
.movl { text-decoration: overline; }
.gr { display: block; width: 100%; max-width: 340px; margin: 10px auto 0; }
.gr-ax { stroke: var(--muted); stroke-width: 1.2; }
.gr-t { fill: var(--muted); font-size: 10px; text-anchor: middle; }
.gr-c { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.gr-l { stroke: #4b8fd1; stroke-width: 2.2; }
.gr-p { fill: var(--ink); }
.gr-d { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 3 3; }
.mp-ans.many { font-size: 1.4rem; gap: 2px; flex-wrap: nowrap; }
.mp-ans.many .mp-slot { min-width: 1.75em; padding: 0 .1em; }
.gq-g { stroke: var(--line); stroke-width: 1; }
.gq-g.ax { stroke: var(--muted); stroke-width: 1.6; }
.tq { max-width: 300px; }
.tq-arc { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.tq-tri { fill: color-mix(in srgb, var(--accent) 10%, transparent); stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.tq-v { fill: var(--ink); font-size: 13px; font-weight: 700; }
.tq-a { fill: var(--accent); font-size: 11px; font-weight: 600; }
.tq-s { fill: var(--ink); font-size: 12px; }
.tq-pt { fill: var(--ink); font-size: 11px; }
.mq.nw { white-space: nowrap; font-size: 1.2rem; }
/* Tables of values (MPM2D quadratic relations) */
.mtab { border-collapse: collapse; margin: 12px auto 0; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.mtab th, .mtab td { border: 1px solid var(--line); padding: 4px 9px; text-align: center; color: var(--ink); }
.mtab th { color: var(--muted); font-style: italic; font-family: "Times New Roman", Georgia, serif; }
/* Two similar triangles (MPM2D): side by side on wide screens, stacked on phones */
.tq-pair { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 8px; }
.tq-pair .gr { width: 100%; max-width: 250px; margin: 6px 0 0; }
.q-text { margin: 10px 0 0; font-size: 1.05rem; line-height: 1.5; color: var(--ink); }
.q-text.big { font-size: 1.45rem; font-weight: 700; }
.q-text.small { font-size: .85rem; color: var(--muted); }
.eq11 { white-space: normal; }
.eq11 b { color: var(--accent); margin-right: .04em; }
/* Vector names with an arrow above (MCV4U games) */
.vec { position: relative; display: inline-block; padding-top: .35em; }
.vec .arr { position: absolute; left: 0; right: 0; top: -.1em; font-size: .7em; line-height: 1; text-align: center; }
.nw { white-space: nowrap; }
