.has-runner-game:not(.is-compact) .lesson-dialog-header { min-height:330px; padding-right:64%; }
.has-runner-game .lesson-dialog-header { flex-shrink:0; }
.lesson-dialog:has([data-runner-game]):focus { outline:none; }
.has-runner-game .lesson-header-surface::after { right:44%; opacity:.3; }
.runner-game { --runner-font:"SimHei","Heiti SC","Microsoft YaHei","Noto Sans SC",sans-serif; position:absolute; top:88px; left:43%; right:64px; color:#fff3d6; font-family:var(--runner-font); }
.runner-stage { position:relative; touch-action:manipulation; outline:none; isolation:isolate; }
.runner-score { position:absolute; z-index:-1; inset:0; display:grid; place-items:center; padding-bottom:12%; opacity:.13; font:700 clamp(90px,10vw,150px)/1 var(--runner-font); font-variant-numeric:tabular-nums; pointer-events:none; user-select:none; }
.runner-stage canvas { display:block; width:100%; height:auto; aspect-ratio:480 / 180; }
.runner-overlay { position:absolute; inset:0 0 27px; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:8px; }
.runner-overlay[hidden] { display:none; }
.runner-game .runner-action { min-height:44px; padding:10px 22px; border:0; border-radius:5px; color:#80501a; background:#fff3d6; box-shadow:0 2px 8px #80501a26; font:500 1.13rem var(--runner-font); letter-spacing:.04em; cursor:pointer; }
.runner-game .runner-action:hover { background:#fffbee; }
.runner-action:focus-visible { outline:1px solid #fff3d6; outline-offset:2px; }
.runner-overlay span { font-size:.64rem; opacity:.75; }
/* Announce results to assistive technology without showing hint text. */
.runner-feedback { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.is-compact .runner-game { display:none; }
@media(max-width:900px) {
  .has-runner-game:not(.is-compact) .lesson-dialog-header { min-height:0; padding-right:clamp(1.5rem,5vw,4.5rem); }
  .runner-game { position:relative; top:auto; left:auto; right:auto; width:100%; margin:60px 0 0; }
}
@media(max-height:650px) {
  .runner-stage canvas { height:142px; aspect-ratio:auto; }
  .runner-score { font-size:110px; }
  .has-runner-game:not(.is-compact) .version-panel { padding-block:8px; }
}
@media(max-height:650px) and (min-width:560px) {
  .has-runner-game:not(.is-compact) .lesson-dialog-header { min-height:265px; padding:25px 64% 18px 28px; }
  .runner-game { position:absolute; top:74px; left:43%; right:64px; width:auto; margin:0; }
}
/* Phone games are deferred, including existing manipulatives. */
@media(max-width:680px), (pointer:coarse) and (max-height:500px) {
  .runner-game,.average-game { display:none; }
  .lesson-dialog-inner:is(.has-runner-game,.has-average-game):not(.is-compact) .lesson-dialog-header { min-height:0; padding:calc(3.7rem + env(safe-area-inset-top)) 1rem 1.15rem; }
}
