/* Chapter 1: scene text and graphs, the speed calculator, graph-to-story match and the motion-graph maker. */

.ph-text { font: 600 32px system-ui, sans-serif; fill: #e8eefc; }
.ph-text.bold { font-weight: 800; fill: #ffd166; }
.ph-text.orange, #scene tspan.orange { fill: #ff9f68; font-weight: 800; }
.ph-text.green, #scene tspan.green { fill: #69db7c; font-weight: 800; }
.ph-note { font: 600 24px system-ui, sans-serif; fill: #9fb4dd; }
.ph-tick { font: 600 22px system-ui, sans-serif; fill: #9fb4dd; }
.ph-axis-title { font: 700 26px system-ui, sans-serif; fill: #cfd9ef; }
.ph-grid { stroke: rgba(255, 255, 255, .12); stroke-width: 2; }
.ph-axis { stroke: #e8eefc; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.ph-huge { font: 800 120px system-ui, sans-serif; fill: #fff; }
.ph-big { font: 800 64px system-ui, sans-serif; fill: #fff; }
.ph-big.gold { fill: #ffd166; }
.ph-big.small { font-size: 48px; }
.ph-panel { fill: rgba(255, 255, 255, .05); stroke: #3a4f7d; stroke-width: 3; }
.ph-box { fill: rgba(255, 209, 102, .12); stroke: #ffd166; stroke-width: 4; }

.act [hidden] { display: none !important; }

.quiz-svg { display: block; width: min(100%, 40cqw); height: auto; margin: max(6px, .8cqw) auto 0; }
.quiz-letter { font: 800 22px system-ui, sans-serif; fill: #ffd166; }

.calc-question { margin: 0; font-size: 1.1em; line-height: 1.45; text-align: center; }
.calc-question b { color: var(--gold); }
.calc-body { display: flex; flex-direction: column; gap: max(8px, 1.2cqw); width: 100%; align-items: center; }
.calc-step { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.calc-values { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px; }
.calc-field { display: flex; align-items: center; gap: 6px; font-weight: 700; color: #cfd9ef; }
.calc-choice { width: auto; text-align: center; font-weight: 700; }
.calc-input {
  width: 8em;
  font: 700 1em ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: .45em .6em;
  border-radius: .6em;
  border: 2px solid #3a4f7d;
  background: #0f1a33;
  color: #fff;
}
.calc-input.short { width: 5em; }
.calc-input:focus { outline: none; border-color: var(--gold); }
.calc-input:disabled { opacity: .85; }
.calc-input.wrong { border-color: var(--bad); }
.calc-input.correct { border-color: var(--ok); background: #143a28; }
.calc-unit { font-weight: 700; color: #cfd9ef; }

.gm-wrap { display: flex; flex-wrap: wrap; gap: max(10px, 1.6cqw); width: 100%; align-items: flex-start; }
.gm-stories { flex: 1 1 240px; display: flex; flex-direction: column; gap: max(6px, .8cqw); }
.gm-graphs { flex: 1.2 1 300px; display: grid; grid-template-columns: repeat(3, 1fr); gap: max(6px, .8cqw); }
.gm-graph {
  position: relative;
  padding: 4px;
  border-radius: .8em;
  border: 2px solid #3a4f7d;
  background: #16223f;
  cursor: pointer;
}
.gm-graph svg { display: block; width: 100%; height: auto; }
.gm-graph span { position: absolute; top: 4px; right: 8px; font-weight: 800; color: var(--gold); }
.gm-graph:hover:not(:disabled) { border-color: #6f8bc4; }
.gm-graph:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.gm-graph.hint { box-shadow: 0 0 0 3px var(--gold); }
.gm-axis { font: 700 18px system-ui, sans-serif; fill: #9fb4dd; }

.mm-stage { align-self: center; }
.mm-stage.sim-stage.wide { width: min(100%, 48cqw); }
.mm-tick { font: 600 15px system-ui, sans-serif; fill: #9fb4dd; }
.mm-axis-title { font: 700 16px system-ui, sans-serif; fill: #cfd9ef; }
.mm-note { font: 700 15px system-ui, sans-serif; fill: #ffd166; }
.mm-readout { margin: 0; text-align: center; font-weight: 700; color: #cfd9ef; font-variant-numeric: tabular-nums; }
.mm-moves .chip-btn { min-width: 6.5em; }
.mm-q { text-align: center; flex-basis: 100%; }

@container (max-width: 620px) {
  .quiz-svg { width: 80%; }
  .gm-graphs { grid-template-columns: repeat(2, 1fr); }
  .mm-moves .chip-btn { min-width: 0; flex: 1 1 30%; }
  .mm-stage.sim-stage.wide { width: 100%; }
}
