/*
 * balance-scales — two-pan SVG balance. Each pan holds number / variable
 * blocks; the beam tilts based on which side is heavier, and the
 * equation reads out the current values. Teaches equality as balance
 * (not "the answer goes here") and missing-value algebra.
 */

.maths-activity .bs-stage {
    background: #fffaf0;
    border: 1px solid var(--maths-border, #e0e7ef);
    border-radius: 14px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 10px rgba(20, 40, 80, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    align-items: center;
}

.maths-activity .bs-svg {
    width: 100%;
    max-width: 600px;
    height: auto;
    user-select: none;
}

.maths-activity .bs-stand {
    fill: #8d6e63;
    stroke: #4e342e;
    stroke-width: 2;
}

.maths-activity .bs-stand-base {
    fill: #5d4037;
    stroke: #4e342e;
    stroke-width: 2;
}

.maths-activity .bs-pivot {
    fill: #4e342e;
    stroke: #fffaf0;
    stroke-width: 2;
}

.maths-activity .bs-beam {
    stroke: #4e342e;
    stroke-width: 6;
    stroke-linecap: round;
}

.maths-activity .bs-rope {
    stroke: #4e342e;
    stroke-width: 2;
    stroke-linecap: round;
}

.maths-activity .bs-pan-arc {
    fill: #cfd8dc;
    stroke: #455a64;
    stroke-width: 2;
}

.maths-activity .bs-block {
    fill: #f9b900;
    stroke: #8b6300;
    stroke-width: 1.5;
}

.maths-activity .bs-block-variable {
    fill: #1565c0;
    stroke: #0b3a73;
}

.maths-activity .bs-block-text {
    fill: #1f2937;
    font-family: "Nunito", sans-serif;
    font-weight: 800;
    font-size: 16px;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}

.maths-activity .bs-block-variable + .bs-block-text { fill: #fff; }

.maths-activity .bs-pan-total {
    fill: var(--maths-primary-dark, #1b5e20);
    font-family: "Nunito", sans-serif;
    font-weight: 800;
    font-size: 18px;
    text-anchor: middle;
}

.maths-activity .bs-equation {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--maths-primary-dark, #1b5e20);
    text-align: center;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    background: #fff;
    border: 1px solid var(--maths-border, #e0e7ef);
    border-radius: 12px;
    padding: 0.625rem 1rem;
    width: 100%;
    max-width: 420px;
}

.maths-activity .bs-status {
    background: #fff;
    border: 1px solid var(--maths-border, #e0e7ef);
    border-radius: 12px;
    padding: 0.625rem 1rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
    font-weight: 800;
    transition: background-color 220ms ease-out, border-color 220ms ease-out, color 220ms ease-out;
}

.maths-activity .bs-status.bs-balanced {
    background: #e8f5e9;
    border-color: #66bb6a;
    color: #1b5e20;
}

.maths-activity .bs-status.bs-tilted-left,
.maths-activity .bs-status.bs-tilted-right {
    background: #fff8e1;
    border-color: #f0c14b;
    color: #8d4e0b;
}

.maths-activity .bs-controls {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--maths-border, #e0e7ef);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.maths-activity .bs-slider-label {
    font-weight: 700;
    color: var(--maths-text, #1f2937);
    font-size: 1rem;
}

.maths-activity .bs-slider-label strong {
    color: var(--maths-primary-dark, #1b5e20);
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
}

.maths-activity .bs-controls input[type="range"] {
    width: 100%;
    accent-color: var(--maths-primary, #2E7D32);
    cursor: pointer;
}

.maths-activity .bs-mode-chip {
    display: inline-block;
    background: var(--maths-primary, #2E7D32);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    margin-top: 0.25rem;
}

.maths-activity .bs-target-label {
    font-weight: 800;
    color: #8d4e0b;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.maths-activity .bs-target-prompt { flex: 1; font-weight: 700; color: #1f2937; }

.maths-activity .bs-your-turn {
    margin-top: 1.25rem;
    background: #f1f8e9;
    border: 1px solid #aed581;
    border-radius: 14px;
    padding: 1rem 1.25rem;
}

.maths-activity .bs-your-turn-label {
    font-weight: 800;
    color: #33691e;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.maths-activity .bs-your-turn-list { margin: 0; padding-left: 1.25rem; color: #1f2937; font-weight: 600; }
.maths-activity .bs-your-turn-list li { margin-bottom: 0.25rem; }

/* Display mode — show only the SVG balance. The shared maths-activity.css
 * hides the activity-header. Auxiliary readout panels (equation line,
 * status text, result callout) duplicate in prose what the tilted beam
 * already shows visually, so they're hidden too — the snapshot is the
 * diagram, full stop. */
/* Display mode — read-only snapshot. Show the scales SVG plus the
 * equation line and balance status (context for the worked example).
 * Hide the slider, target panel, transient callout, and challenge
 * runner. Cap the SVG so the scales don't dominate. Your-turn prompts
 * stay — those are display-only discussion prompts.
 */
body.display-mode .bs-target-panel,
body.display-mode .bs-controls,
body.display-mode .bs-callout,
body.display-mode #challengeRunner { display: none !important; }

body.display-mode .bs-stage {
    padding: 0.75rem;
    gap: 0.55rem;
    margin-bottom: 0.75rem;
}

body.display-mode .bs-svg {
    max-width: 420px;
    max-height: 260px;
}

body.display-mode .bs-equation {
    font-size: 1.1rem;
}
