/* AusSci · What makes a sound? (Year 2): the simulations' drawings and controls, the action buttons, the play-first
   box and the challenge cards, the instrument details and the pattern grid. Drawings are on a light plate with fixed
   colours in light and dark mode alike. Every action colour also has its word, so colour is never the only key. */

/* ---------- drawings ---------- */
.dia { display: block; width: 100%; height: auto; font-family: 'Atkinson Next', system-ui, sans-serif; touch-action: manipulation; }
.plate { background: #fbfbf6; border: 1px solid #d8ded9; border-radius: 4px; color: #15231d; }
.dia text { fill: #15231d; pointer-events: none; }
.d-small { font-size: 11.5px; fill: #34423c; }
.dia text.d-lab, .dia text.d-lab-s, .dia text.d-lab-b, .dia text.d-big, .dia text.d-lab-w { paint-order: stroke; stroke: #fbfbf6; stroke-width: 3.4px; stroke-linejoin: round; }
.dia text.d-lab { font-size: 14px; font-weight: 700; }
.dia text.d-lab-s { font-size: 12.5px; font-weight: 700; fill: #2c3a34; }
.dia text.d-lab-b { font-size: 15px; font-weight: 800; }
.dia text.d-big { font-size: 20px; font-weight: 800; }
.dia text.d-lab-w { font-size: 13px; font-weight: 800; fill: #ffffff; stroke: rgba(21, 35, 29, 0.75); stroke-width: 3px; }
.dia text.d-ok { fill: #1f7a4d; }
.dia text.d-bad { fill: #b5401f; }
.art { position: relative; width: 100%; }
.art-cv { display: block; width: 100%; height: auto; border-radius: 4px; background: #fbfbf6; }
.art .art-svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; overflow: visible; touch-action: manipulation; }

/* ---------- controls ---------- */
.ctl .label { margin-bottom: 0.3rem; }
.ctl + .ctl { margin-top: 0.6rem; }
.ctl-range label { display: block; font-size: 0.889rem; font-weight: 700; margin-bottom: 0.2rem; }
.ctl-range output { font-weight: 800; color: var(--y-deep); margin-left: 0.25rem; }
.ctl-range input[type="range"] { width: 100%; max-width: 36rem; accent-color: var(--accent); min-height: 2rem; }
.lab-run { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: center; margin-top: 0.6rem; }
.lab-run .btn[hidden], .ctl[hidden] { display: none; }
.seg { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.seg .btn { padding: 0.3rem 0.65rem; }
.seg .btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.seg .btn:disabled, .lab-run .btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- a simulation: the drawing, with its readings ---------- */
.sd-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; margin-top: 0.8rem; }
.sd-main { max-width: 52rem; }
.sd-box { padding: 0.25rem; }
.sd-read { margin: 0.45rem 0 0; font-size: 0.889rem; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sd-status { min-height: 2.6em; font-size: 1.056rem; }
.sd-todo { margin: 0; color: var(--ink-3); }

/* ---------- the words beside a simulation: answers, stages and feedback ---------- */
.sd-words { margin-top: 0.8rem; border-top: 1px dashed var(--rule); padding-top: 0.7rem; max-width: 46rem; }
.sd-words p { margin: 0 0 0.45rem; }
.sd-words dl { margin: 0; display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 0.3rem 0.8rem; }
.sd-words dt { font-weight: 700; }
.sd-words dd { margin: 0; }
@media (max-width: 640px) { .sd-words dl { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; } .sd-words dd { margin-bottom: 0.45rem; } }

/* ---------- the Sound button ---------- */
.sound-row { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: center; margin-bottom: 0.7rem; }
.sound-row .small { color: var(--ink-3); }
.btn-sound[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- screen 1: the action buttons and the table of sounds found ---------- */
.acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.4rem; max-width: 46rem; }
.act { display: flex; flex-direction: column; align-items: flex-start; gap: 0.05rem; text-align: left; padding: 0.45rem 0.7rem; border-left-width: 0.45rem; border-radius: 6px; }
.act b { font-size: 1.056rem; }
.act span { font-size: 0.833rem; color: var(--ink-2); font-weight: 400; }
.act-strike { border-left-color: #c0392b; }
.act-blow { border-left-color: #2a7ab0; }
.act-scrape { border-left-color: #b07d12; }
.act-pluck { border-left-color: #7a4aa8; }
.act-shake { border-left-color: #2f8a4a; }
.found-wrap { margin-top: 0.8rem; max-width: 40rem; }
table.found caption { text-align: left; font-weight: 800; margin-bottom: 0.3rem; }
table.found td { text-align: center; font-weight: 800; color: var(--ok); min-width: 3.2rem; }
@media (max-width: 640px) { table.found th, table.found td { padding: 0.3rem 0.2rem; font-size: 0.778rem; min-width: 0; } table.found th:first-child { width: 4.6rem; } }

/* ---------- guided play: the play-first box and the challenge cards ---------- */
.play, .challenges { border: 2px solid var(--y-stripe); border-radius: 6px; padding: 0.9rem 1.1rem 1rem; max-width: 46rem; background: var(--box); }
.play-tag { display: inline-block; font-size: 0.722rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--paper); background: var(--ink); border-radius: 3px; padding: 0.1rem 0.45rem; margin: 0 0 0.45rem !important; }
.play p, .challenges p { margin: 0 0 0.5rem; }
.play-text { font-size: 1.111rem; font-weight: 700; }
.ch-list { margin: 0.4rem 0 0.6rem; padding: 0; list-style: none; display: grid; gap: 0.5rem; counter-reset: ch; }
.ch { border: 1px solid var(--rule); background: var(--paper); border-radius: 4px; padding: 0.55rem 0.75rem 0.5rem 2.6rem; position: relative; counter-increment: ch; }
.ch::before { content: counter(ch); position: absolute; left: 0.6rem; top: 0.5rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid var(--ink-3); display: grid; place-items: center; font-weight: 800; font-size: 0.833rem; }
.ch.is-done { border-color: var(--ok); box-shadow: inset 0.3rem 0 0 var(--ok); }
.ch.is-done::before { content: '\2713'; border-color: var(--ok); background: var(--ok); color: var(--paper); }
.ch-t { font-weight: 800; margin: 0 0 0.25rem !important; }
.ch-hint summary { cursor: pointer; font-weight: 700; color: var(--ink-2); font-size: 0.944rem; }
.ch-hint p { margin: 0.3rem 0 0.2rem !important; }
.ch-done { margin: 0.2rem 0 0 !important; font-weight: 700; color: var(--ok); }
.ch-done:empty { display: none; }
.ch-count { font-weight: 800; }
.ch-talk { border-top: 1px dashed var(--rule); padding-top: 0.55rem; }

/* ---------- screen 5: the instrument details and the sorting messages ---------- */
.inst-info { margin-top: 0.8rem; border-top: 1px dashed var(--rule); padding-top: 0.7rem; max-width: 46rem; }
.inst-info h4 { margin: 0 0 0.35rem; font-size: 1.111rem; }
.inst-info dl { margin: 0; display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 0.3rem 0.8rem; }
.inst-info dt { font-weight: 700; }
.inst-info dd { margin: 0; }
@media (max-width: 640px) { .inst-info dl { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; } .inst-info dd { margin-bottom: 0.45rem; } }
.sort-msg { min-height: 1.4em; font-weight: 700; margin: 0.35rem 0 0.6rem; }

/* ---------- screen 6: the pattern grid ---------- */
.band-grid { margin-top: 0.8rem; display: grid; gap: 0.3rem; max-width: 46rem; }
.band-row { display: grid; grid-template-columns: 7.5rem repeat(8, minmax(0, 1fr)); gap: 0.25rem; align-items: center; }
.band-name { font-weight: 700; font-size: 0.944rem; }
.beat { min-height: 2.6rem; border: 1px solid var(--ink-3); border-radius: 4px; background: var(--paper); color: var(--ink); font: inherit; font-size: 0.722rem; font-weight: 800; cursor: pointer; padding: 0; }
.beat.is-soft { background: var(--y-stripe); color: #15231d; }
.beat.is-loud { background: var(--ink); color: var(--paper); }
.beat.is-now { outline: 3px solid var(--accent); outline-offset: 1px; }
@media (max-width: 640px) { .band-row { grid-template-columns: 4.6rem repeat(8, minmax(0, 1fr)); gap: 0.15rem; } .band-name { font-size: 0.778rem; } .beat { min-height: 2.4rem; font-size: 0.611rem; } }
