/* Chapter 9: rate graphs, glassware art, graph sketcher, parallax lab, outlier hunt and dartboard. */

.g-axis { stroke: #cfd9ef; stroke-width: 4; stroke-linecap: round; }
.g-axis.thin { stroke-width: 3; }
.g-grid { stroke: rgba(255, 255, 255, .08); stroke-width: 2; }
.g-curve { fill: none; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.g-curve.thick { stroke-width: 13; }
.g-curve.dashed { stroke-dasharray: 14 10; stroke-width: 5; }
.g-tangent { stroke: #ffd166; stroke-width: 5; stroke-dasharray: 12 8; stroke-linecap: round; }
.g-drop { stroke-width: 3; stroke-dasharray: 8 7; opacity: .8; }
.g-tick { font: 600 22px system-ui, sans-serif; fill: #9fb4dd; }
.g-tick.small { font-size: 20px; }
.g-tick.light { fill: #e8eefc; }
.g-title { font: 700 26px system-ui, sans-serif; fill: #cfd9ef; }
.g-title.small { font-size: 20px; }
.g-title.light { fill: #fff; }
.g-note { font: 700 26px system-ui, sans-serif; fill: #e8eefc; }
.g-note.small { font-size: 24px; }
.g-badge { font: 800 26px system-ui, sans-serif; fill: #0d1730; }
.g-lcd { font: 700 34px ui-monospace, SFMono-Regular, Menlo, monospace; fill: #69db7c; }
.gold-fill { fill: #ffd166; }
.blue-fill { fill: #74c0fc; }
.pink-fill { fill: #ff8fab; }
.green-fill { fill: #69db7c; }
.red-fill { fill: #ff8a8a; }
.muted-fill { fill: #9fb4dd; }
.dark-fill { fill: #0d1730; }
.eq-mid { font: 800 46px system-ui, sans-serif; fill: #fff; }
.tbl-cell { font: 800 44px system-ui, sans-serif; fill: #fff; }

.bubble { animation: ch9-rise 1.8s linear infinite; }
.bubble-out { animation: ch9-escape 1.8s linear infinite; }
@keyframes ch9-rise {
  from { transform: translateY(0); opacity: .95; }
  to { transform: translateY(-78px); opacity: 0; }
}
@keyframes ch9-escape {
  from { transform: translateY(0); opacity: .95; }
  to { transform: translateY(-110px); opacity: 0; }
}

/* Activities */
.lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: max(10px, 1.6cqw);
  width: 100%;
  align-items: start;
}
.lab-picture, .sketch-stage, .hunt-graph, .dart-stage { width: 100%; border-radius: .8em; overflow: hidden; background: #0d1730; }
.sketch-stage svg { touch-action: none; user-select: none; -webkit-user-select: none; }
.sketch-stage path, .sketch-stage line, .sketch-stage text, #sk-target { pointer-events: none; }
.lab-controls { display: flex; flex-direction: column; gap: 6px; }
.lab-controls .lab-tools { justify-content: flex-start; }
.lab-controls .chip-btn { padding: .35em .7em; font-size: .9em; }
.lab-readout { margin: 0; font-weight: 700; font-size: .88em; color: #e8eefc; min-height: 2.4em; }
.lab-readout.detail { color: #ffe7a8; min-height: 2.6em; }
.lab-task-list { display: flex; flex-direction: column; gap: 6px; }
.lab-task-list .chip-btn { text-align: left; }
.nudges .btn { padding: .3em .6em; }
.change-list .chip-btn.correct { color: #c9f7d4; }
#sk-handle { cursor: grab; }
#sk-handle:focus-visible { outline: none; stroke: #fff; stroke-width: 6; }
.sk-zone { cursor: pointer; }
.sk-zone:hover rect, .sk-zone:focus-visible rect { opacity: .22; }
.sk-zone:focus-visible { outline: none; }
.sk-zone.hint rect { stroke: #ffd166; stroke-width: 4; opacity: .25; }
.sk-zone-text { fill: #fff; font-weight: 800; }
.parallax-q { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.parallax-q[hidden] { display: none; }

.mini-graph { display: block; width: min(100%, 360px); margin: .4em auto 0; }

.hunt-body { display: flex; flex-direction: column; align-items: center; gap: max(8px, 1.2cqw); width: 100%; }
.trial-table { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 10px; width: min(100%, 520px); }
.trial-head { text-align: center; font-weight: 700; font-size: .85em; color: #9fb4dd; }
.trial-cell { text-align: center; font-weight: 800; font-size: 1.2em; }
.trial-cell.outlier-cell { border-color: var(--bad) !important; color: #ffd0d0; background: #4a1f2a !important; }
.avg-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; }
.calc-field { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 700; color: #cfd9ef; }
.calc-input {
  width: 5.5em;
  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:focus { outline: none; border-color: var(--gold); }
.calc-input.wrong { border-color: var(--bad); }
.calc-input.correct { border-color: var(--ok); background: #143a28; }
.calc-unit { font-weight: 700; color: #cfd9ef; }
.hunt-graph { width: min(100%, 560px); }
.hunt-point { cursor: pointer; }
.hunt-point:focus-visible { outline: none; }
.hunt-point:focus-visible .dot, .hunt-point:hover .dot { stroke: #fff; }
.hunt-point.hint .dot { stroke: #ffd166; stroke-width: 6; }

.dart-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: max(10px, 1.6cqw); align-items: center; width: 100%; }

.sort3 .sort-bins { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sort3 .sort-buttons { flex-wrap: wrap; }

@container (max-width: 620px) {
  .lab-grid, .dart-grid { grid-template-columns: 1fr; }
  .sort3 .sort-bins { grid-template-columns: 1fr; }
}
