/* Matter Waves and the Particle in a Box: its colours, the graphs and drawings, the answers; the
   general look is in ui.css (shared by the apps). Particles and their waves blue, the screen of the
   diffraction tube dark, the walls of the box black. */
:root {
  --mw-wave: #1f5fc4; --mw-old: #8a8f98; --mw-beam: #1f5fc4; --mw-dens: rgba(31, 95, 196, 0.14);
  --mw-glass: rgba(80, 140, 200, 0.08); --mw-screen: #10233f; --mw-hit: #9fe0ff;
}
@media (prefers-color-scheme: dark) {
  :root { --mw-wave: #79a8ff; --mw-old: #9aa0a6; --mw-beam: #79a8ff; --mw-dens: rgba(121, 168, 255, 0.16); --mw-glass: rgba(120, 170, 230, 0.08); --mw-screen: #050b14; --mw-hit: #9fe0ff; }
}

#prompt p { margin: 6px 0; }
.law { text-align: center; font-family: var(--serif); font-size: 1.2rem; margin: 10px 0; }
.figs .fig svg.mw { margin: 0 auto; }

/* the drawings */
svg.mw text { font-family: var(--serif); fill: var(--ink); }
svg.mw .tick { font-size: 12px; fill: var(--muted); font-family: system-ui, sans-serif; }
svg.mw .lbl { font-size: 15px; }
svg.mw .lbl.small { font-size: 13px; }
svg.mw .grid { stroke: var(--line); stroke-width: 1; }
svg.mw .grid.minor { stroke-dasharray: 2 3; opacity: 0.7; }
svg.mw .ax { stroke: var(--ink); stroke-width: 1.3; }
svg.mw .axhead { fill: var(--ink); }
svg.mw .curve { fill: none; stroke: var(--mw-wave); stroke-width: 2.4; stroke-linejoin: round; }
svg.mw .curve.old { stroke: var(--mw-old); stroke-width: 2; }
svg.mw .dim { stroke: var(--muted); stroke-width: 1.1; }
svg.mw .dimhead { fill: var(--muted); }
svg.mw .guide { stroke: var(--muted); stroke-dasharray: 3 3; }
svg.mw .glass { fill: var(--mw-glass); stroke: var(--muted); stroke-width: 1.3; }
svg.mw .gun { fill: var(--muted); }
svg.mw .beam { stroke: var(--mw-beam); stroke-width: 2; }
svg.mw .beam.diff { stroke-dasharray: 5 4; }
svg.mw .foil { stroke: var(--ink); stroke-width: 3; }
svg.mw .screen { fill: none; stroke: var(--ink); stroke-width: 3; }
svg.mw .spot { fill: var(--mw-beam); }
svg.mw .screenface { fill: var(--mw-screen); }
svg.mw .ring { fill: none; stroke: var(--mw-hit); stroke-width: 3; opacity: 0.9; }
svg.mw .ring.outer { stroke-width: 2; opacity: 0.6; }
svg.mw.rings .spot { fill: var(--mw-hit); }
svg.mw.rings .dim { stroke: #fff; }
svg.mw.rings .dimhead { fill: #fff; }
svg.mw.rings text { fill: #fff; }
svg.mw .energy { stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 6 4; }
svg.mw .psi { fill: none; stroke: var(--mw-wave); stroke-width: 2.4; stroke-linejoin: round; }
svg.mw .dens { fill: var(--mw-dens); }
svg.mw .ax0 { stroke: var(--muted); stroke-width: 1; }
svg.mw .boxwall { fill: none; stroke: var(--ink); stroke-width: 3.5; }
svg.mw .hatch { stroke: var(--ink); stroke-width: 1; }
svg.mw.graph.small .tick { font-size: 11px; }
.legend .k-old { color: var(--mw-old); font-weight: 700; }
.legend .k-new { color: var(--mw-wave); font-weight: 700; }

/* number fields: the question above, then symbol, field and unit in a row */
.fields { grid-template-columns: max-content minmax(0, 9em) max-content 1fr; }
.field .what { grid-column: 1 / -1; color: var(--ink); font-size: 0.95rem; margin: 6px 0 -4px; }
.field .sym { white-space: nowrap; }
.field .unit { white-space: nowrap; }
@media (max-width: 640px) {
  .fields { grid-template-columns: max-content minmax(0, 1fr) max-content; }
  .field .sym { grid-column: auto; text-align: right; margin-top: 0; }
}

/* choices: a row of options per question; drawings to choose from; statements to tick */
.ask { font-weight: 600; margin: 12px 0 6px; }
.qrow { display: grid; gap: 6px; margin-bottom: 14px; }
.qrow .what { font-weight: 600; }
.qrow .fb { font-size: 0.9rem; }
.qrow .fb:empty { display: none; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opts label { position: relative; }
.opts input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opts span { display: block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.opts label:hover span { border-color: var(--accent); }
.opts input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.opts input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.qrow.ok input:checked + span { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.qrow.bad input:checked + span { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.qrow.ok .fb { color: var(--ok); }
.qrow.bad .fb { color: var(--bad); }
.qfb { color: var(--bad); margin: 0 0 12px; padding-left: 1.2em; }
.qfb:empty { display: none; }
.qfb li { margin: 3px 0; }
.cands { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 8px 0; }
.cand { position: relative; display: block; border: 2px solid var(--line); border-radius: 10px; background: var(--card); padding: 4px; cursor: pointer; }
.cand svg { display: block; width: 100%; height: auto; }
.cand input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cand .letter { position: absolute; left: 10px; top: 6px; font-weight: 700; color: var(--accent); }
.cand:hover { border-color: var(--accent); }
.cand:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.cand:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.cand.ok { border-color: var(--ok); background: var(--ok-bg); }
.cand.bad { border-color: var(--bad); background: var(--bad-bg); }
@media (max-width: 560px) { .cands { grid-template-columns: minmax(0, 1fr); } }
.stmts { list-style: none; margin: 8px 0 14px; padding: 0; display: grid; gap: 8px; }
.stmts li { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--card); }
.stmts label { display: flex; gap: 10px; align-items: baseline; cursor: pointer; }
.stmts input { flex: none; transform: translateY(1px); }
.stmts li.ok { border-color: var(--ok); background: var(--ok-bg); }
.stmts li.bad { border-color: var(--bad); background: var(--bad-bg); }
.stmts .fb { display: block; font-size: 0.9rem; margin: 4px 0 0 26px; }
.stmts .fb:empty { display: none; }
.stmts-fb { color: var(--bad); font-size: 0.9rem; margin: 4px 0 0; }
.stmts-fb:empty { display: none; }
