/* Chapter 8: scene text, particle boxes, the collision simulator and the answer builder. */

.t-eq { font: 800 40px system-ui, sans-serif; fill: #fff; }
.t-head { font: 800 26px system-ui, sans-serif; fill: #ffd166; }
.t-cell { font: 600 24px system-ui, sans-serif; fill: #e8eefc; }
.t-cell.gold { fill: #ffd166; font-weight: 700; }
.t-note { font: 600 24px system-ui, sans-serif; fill: #9fb4dd; }
.t-small { font: 600 20px system-ui, sans-serif; fill: #9fb4dd; }
.t-axis { font: 700 26px system-ui, sans-serif; fill: #cfd9ef; }
.t-ok { font: 800 26px system-ui, sans-serif; fill: #69db7c; }
.t-bad { font: 800 26px system-ui, sans-serif; fill: #ff8a8a; }
.t-pink { font: 800 26px system-ui, sans-serif; fill: #ff8fab; }
.t-blue { font: 700 24px system-ui, sans-serif; fill: #74c0fc; }
.t-green { font: 700 24px system-ui, sans-serif; fill: #69db7c; }
.t-readout { font: 800 34px system-ui, sans-serif; fill: #ffd166; }
.t-digits { font: 800 30px ui-monospace, SFMono-Regular, Menlo, monospace; fill: #69db7c; }
.t-badge { font: 800 26px system-ui, sans-serif; fill: #14213d; text-anchor: middle; }

.ring-pulse { transform-box: fill-box; transform-origin: center; }
[data-el].on .ring-pulse { animation: ch8-ring 1.6s ease-in-out infinite; }
@keyframes ch8-ring { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* Collision simulator */
.lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: max(10px, 1.6cqw);
  width: 100%;
  align-items: start;
}
.lab-left { display: flex; flex-direction: column; gap: 6px; }
.lab-picture { width: 100%; border-radius: .8em; overflow: hidden; background: #0d1730; }
.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; }
.sim-slider { width: 100%; accent-color: #ffd166; height: 28px; }
.sim-temp { color: var(--gold); }
.lab-task-list { display: flex; flex-direction: column; gap: 6px; }
.lab-task { text-align: left; font-size: .85em; }
.lab-task.correct { border-color: var(--ok); background: #143a28; }
.sim-legend { font-size: .8em; justify-content: flex-start; }
.sim-live { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .9em; color: #cfd9ef; font-weight: 600; }
.sim-live b { color: var(--gold); font-size: 1.15em; }
.sim-bar { height: 12px; border-radius: 6px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.sim-bar-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #69db7c, #ffd166); transition: width .25s; }
.sim-rows { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; width: 100%; font-size: .85em; }
.sim-rows li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: .35em .7em; border-radius: .6em; background: rgba(255, 255, 255, .06); color: #cfd9ef; }
.sim-rows li.ready { background: rgba(105, 219, 124, .12); }
.sim-row-name { font-weight: 800; color: #fff; }
.sim-note { margin: 0; font-size: .78em; color: #9fb4dd; text-align: center; }

/* Answer builder */
.ans-question { margin: 0; line-height: 1.45; text-align: center; }
.ans-question b { color: var(--gold); }
.ans-box { width: 100%; padding: .5em .9em; border-radius: .8em; background: rgba(255, 255, 255, .05); border: 1px dashed rgba(255, 255, 255, .25); }
.ans-built { margin: .3em 0 0; padding-left: 1.4em; line-height: 1.4; color: #e8eefc; min-height: 1.4em; }
.ans-built li { margin: .15em 0; }
.chip-btn.option { text-align: left; padding: .5em .8em; line-height: 1.35; }
.chip-btn.hint { box-shadow: 0 0 0 3px var(--gold); }

@container (max-width: 620px) {
  .lab-grid { grid-template-columns: 1fr; }
  .sim-rows li { flex-direction: column; }
}
