#how-to-play{width:min(850px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:22px;background:#fffaf4;color:#422563;border:2px solid #c7acdf;border-radius:24px;text-align:left}
/* Results stay in normal flow. The former sticky CTA covered the actual time. */
#result-dialog #next{position:static!important}
#result-dialog #retry,#result-dialog #result-menu{max-width:100%;margin-inline:0}
#result-dialog .podium-own{margin:8px 0;padding:8px}
@media(min-width:900px) and (min-height:541px){
 #result-dialog[open]{display:grid!important;grid-template-columns:minmax(0,2.4fr) minmax(210px,1fr);gap:12px 20px;padding:20px!important;align-items:center}
 #result-dialog #result-title,#result-dialog #result-text{grid-column:1 / -1;margin:0!important}
 #result-dialog #result-title{grid-row:1}#result-dialog #result-text{grid-row:2}
 #result-dialog #podium-stage{grid-column:1;grid-row:3 / 7}
 #result-dialog .result-stats{grid-column:2;grid-row:3;flex-wrap:wrap;gap:12px;margin:0}
 #result-dialog #next{grid-column:2;grid-row:4}#result-dialog #retry{grid-column:2;grid-row:5}#result-dialog #result-menu{grid-column:2;grid-row:6}
}
#how-to-play header{display:flex;justify-content:space-between;align-items:center;gap:12px;position:sticky;top:-22px;background:#fffaf4;z-index:2;padding:10px 0}#how-to-play h2{margin:0;font-size:26px}#how-to-play button{min-width:48px;min-height:48px}#how-to-play p,#how-to-play li{font:16px/1.55 system-ui}#how-to-play li{margin-block:8px}#how-to-play h3{font-size:18px;margin:12px 0 0}.help-controls{display:grid;grid-template-columns:1fr 1fr;gap:12px}.help-controls section{border-radius:16px;background:#f0e6f7;padding:16px}.help-controls kbd{display:inline-block;padding:8px 12px;border:1px solid #aa85c5;background:white;border-radius:9px;color:#422563;font:700 16px system-ui}#how-to-play details{border-top:1px solid #d6c2e3;padding:16px 0}#how-to-play summary{cursor:pointer;font-size:18px;font-weight:700;min-height:44px;align-content:center}.help-table{overflow:auto}.help-table table{width:100%;border-collapse:collapse}.help-table th,.help-table td{padding:10px;border-bottom:1px solid #ddcbe5}#help-pause{display:block;width:100%;margin-top:12px}#how-to-play::backdrop{background:#180a32aa}@media(max-width:550px){.help-controls{grid-template-columns:1fr}#how-to-play{padding:16px}#how-to-play header{top:-16px}}

/* Help scrolls within its panel, including at enlarged text sizes. */
#how-to-play{box-sizing:border-box;max-width:calc(100vw - 24px);padding:20px;scroll-padding-top:100px;overflow-wrap:anywhere}
#how-to-play header{top:-20px;padding:12px 0;align-items:center;border-bottom:1px solid #d6c2e3}
#how-to-play header small{font:700 11px/1.4 system-ui;letter-spacing:.08em}
#how-to-play #help-close{flex:0 0 48px;color:#fff;background:#674085;border:0;border-radius:14px;font:28px/1 system-ui}
#how-to-play .help-lead{font-size:18px;font-weight:600}
#how-to-play :focus-visible{outline:3px solid #7644a3;outline-offset:3px}
#how-to-play summary{display:list-item;padding:10px 4px;line-height:1.4}
#how-to-play details{padding:6px 0}
#how-to-play ul,#how-to-play ol{padding-inline-start:24px}
#how-to-play .help-example{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:18px 0 22px}
#how-to-play .help-example span{display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center;padding:12px 8px;border-radius:14px;background:#f0e6f7;font:600 14px/1.4 system-ui}
#how-to-play .help-example b{display:grid;place-items:center;background:#fff;border:1px solid #aa85c5;border-radius:12px;width:44px;height:44px;font:800 25px system-ui}
#how-to-play .help-speeds{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
#how-to-play .help-speeds section{background:#f0e6f7;border-radius:14px;padding:12px;min-width:0}
#how-to-play .help-speeds h3{margin:0 0 8px}
#how-to-play .help-speeds dl{margin:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}
#how-to-play .help-speeds dt{font:14px/1.4 system-ui}
#how-to-play .help-speeds dd{margin:4px 0 0;font:700 18px/1.4 system-ui}
@media(max-width:550px){#how-to-play .help-speeds{grid-template-columns:1fr}#how-to-play{padding:16px}#how-to-play header{top:-16px}#how-to-play .help-example{gap:5px}#how-to-play .help-example span{padding:10px 5px;font-size:13px}}

/* Loading recovery shares the existing error panel and remains usable on phones. */
#error[data-kind="assets"]{top:max(16px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));width:min(480px,calc(100% - 24px));margin-inline:auto;max-height:calc(100dvh - 32px);overflow:auto;padding:18px;background:#fffaf1;color:#312244;border-color:#7040ab;box-sizing:border-box;z-index:30}#asset-load-message{margin:0 0 12px}#asset-load-retry{min-height:48px;white-space:normal;padding:12px 18px}#asset-load-retry:focus-visible{outline:3px solid #312244;outline-offset:3px}

/* Keep camera changes available to touch users without crowding the race HUD. */
#pause-dialog #camera{display:flex!important;align-items:center;justify-content:center;min-height:44px}
#motion-panel [hidden]{display:none!important}
