/* Pythagoras explorer: mode buttons, sliders, the readout and the triangle with its three squares.
   Builds on the shared .explorer, .btn and .cx styles in styles.css. */
.pythagoras-explorer { min-width: 0; }

.py-body { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; align-items: flex-start; }
.py-panel { flex: 1 1 15rem; min-width: 0; display: flex; flex-direction: column; gap: 0.8rem; }
.py-stage { flex: 1 1 18rem; min-width: 0; max-width: 420px; }

.py-modes { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.py-mode { flex: 1 1 auto; min-height: 44px; }
.py-mode[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

.py-sliders { display: flex; flex-direction: column; gap: 0.5rem; }
.py-slider { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.1rem 0.6rem; font-weight: 600; font-size: 0.95rem; }
.py-value { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 700; }
.py-range { grid-column: 1 / -1; width: 100%; min-height: 44px; margin: 0; accent-color: var(--accent); }
.py-range:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }

/* The readout is the live region: it is also what the student reads. */
.py-readout { margin: 0; min-height: 3em; padding: 0.55rem 0.75rem; border-radius: 10px; background: var(--accent-soft); font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* The picture. Each square has its own colour and its own letter, so colour is never the only cue. */
.py-figure-wrap { max-width: 420px; border-radius: 10px; }
.py-square { stroke-width: 2; stroke-linejoin: round; }
.py-square--a { fill: color-mix(in srgb, var(--line) 24%, var(--surface)); stroke: var(--line); }
.py-square--b { fill: color-mix(in srgb, var(--good) 26%, var(--surface)); stroke: var(--good); }
.py-square--c { fill: color-mix(in srgb, var(--user-line) 26%, var(--surface)); stroke: var(--user-line); }
.py-triangle { fill: var(--surface); stroke: var(--text); stroke-width: 2.5; stroke-linejoin: round; }
.py-right-angle { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: miter; }
.py-label { fill: var(--text); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.py-none { fill: var(--muted); font-size: 16px; font-weight: 700; }

/* The legend says the same in words, next to a swatch of each colour. */
.py-legend { list-style: none; margin: 0.6rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.py-legend li { display: flex; align-items: center; gap: 0.5rem; }
.py-swatch { flex: none; width: 1.1rem; height: 1.1rem; border: 2px solid; border-radius: 4px; }
.py-swatch--a { background: color-mix(in srgb, var(--line) 24%, var(--surface)); border-color: var(--line); }
.py-swatch--b { background: color-mix(in srgb, var(--good) 26%, var(--surface)); border-color: var(--good); }
.py-swatch--c { background: color-mix(in srgb, var(--user-line) 26%, var(--surface)); border-color: var(--user-line); }
