/* Step 08 · Beat ICP: game overlay, scoreboard and quiz */
#s8 .s8-canvas-wrap { position: relative; }
#s8 canvas.plot { cursor: move; }
#s8 canvas.plot.is-locked { cursor: default; }
#s8 .s8-hud { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; }
#s8 .s8-pill { font-family: var(--f-mono); font-size: 0.78rem; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap;
  background: color-mix(in srgb, var(--surface) 90%, transparent); border: 1px solid var(--rule); border-radius: 999px; padding: 3px 10px; }
#s8 .s8-score-pill b { color: var(--ink); font-size: 0.95rem; font-weight: 600; margin-left: 2px; }
#s8 .s8-mode { position: absolute; left: 8px; bottom: 8px; pointer-events: none; font-family: var(--f-mono); font-size: 0.74rem; letter-spacing: 0.04em;
  color: var(--source); background: color-mix(in srgb, var(--surface) 90%, transparent); border: 1px solid var(--rule); border-radius: 6px; padding: 2px 8px; }
#s8 .s8-mode[hidden] { display: none; }

#s8 .ctl .ctl-val { grid-row: 1; grid-column: 2; }   /* keep the value beside its label (base auto-placement drops it below the slider) */
#s8 .s8-actions .btn { flex: 1 1 auto; }
#s8 .s8-view { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#s8 .s8-view[hidden] { display: none; }
#s8 .s8-view-k { font-size: 0.82rem; color: var(--muted); margin-right: 2px; }
#s8 .s8-view button { font: inherit; font-size: 0.82rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink); cursor: pointer; }
#s8 .s8-view button:hover { border-color: var(--accent); }
#s8 .s8-view button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
#s8 .s8-view button[disabled] { opacity: 0.5; cursor: default; }

#s8 .s8-board { border: 1px solid var(--rule); border-radius: 8px; background: var(--bg); overflow: hidden; }
#s8 .s8-board table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
#s8 .s8-board th, #s8 .s8-board td { padding: 5px 6px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
#s8 .s8-board th:first-child, #s8 .s8-board td:first-child { padding-left: 8px; }
#s8 .s8-board tbody th { white-space: nowrap; }
#s8 .s8-board thead th { font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 500; background: var(--tint); }
#s8 .s8-board tbody th { font-weight: 700; font-size: 0.84rem; }
#s8 .s8-board td { font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
#s8 .s8-board tr:last-child th, #s8 .s8-board tr:last-child td { border-bottom: 0; }
#s8 .s8-board tr[hidden] { display: none; }
#s8 .s8-board tr.win th, #s8 .s8-board tr.win td:first-of-type { color: var(--good); }
#s8 #s8-row-true th, #s8 #s8-row-true td { color: var(--muted); font-weight: 400; }
#s8 .s8-verdict { font-size: 0.92rem; line-height: 1.5; margin: 0; }
#s8 .s8-tally { font-family: var(--f-mono); font-size: 0.76rem; color: var(--muted); margin: 0; }
#s8 .s8-inline { font-family: var(--f-body); font-size: inherit; letter-spacing: 0; text-transform: none; color: var(--ink); margin: 0; }

/* quiz */
#s8 .s8-quiz { margin-top: 8px; }
#s8 .q { padding-block: 16px; }
#s8 .q .stem { line-height: 1.5; }
#s8 .opts button { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: start; line-height: 1.45; }
#s8 .opts button:hover:not([aria-disabled]) { border-color: var(--accent); }
#s8 .opts .ltr { font-family: var(--f-mono); font-size: 0.74rem; font-weight: 600; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--rule);
  display: grid; place-items: center; color: var(--muted); background: var(--surface); margin-top: -1px; }
#s8 .opts .otx { min-width: 0; overflow-wrap: anywhere; }
#s8 .opts button.right .ltr { background: var(--good); border-color: var(--good); color: var(--surface); }
#s8 .opts button.wrong .ltr { background: var(--bad); border-color: var(--bad); color: var(--surface); }
#s8 .q.answered .opts button { cursor: default; }
#s8 .q.answered .opts button:not(.right):not(.wrong) { opacity: 0.55; }
#s8 .why[hidden] { display: none; }
#s8 .why { line-height: 1.55; }
#s8 .why .res.good { color: var(--good); }
#s8 .why .res.bad { color: var(--bad); }
#s8 .s8-qfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 4px; }
#s8 .s8-qfoot p { margin: 0; font-family: var(--f-mono); font-size: 0.84rem; color: var(--muted); }
#s8 #s8-autotest { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.7rem; }

@media (max-width: 640px) {
  #s8 canvas.plot { aspect-ratio: 5 / 4; }   /* squarer on phones: the scene gets about 25% more pixels per metre */
}
@media (max-width: 520px) {
  #s8 .s8-pill { font-size: 0.72rem; padding: 2px 8px; }
  #s8 .s8-score-pill b { font-size: 0.86rem; }
}
