* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; background: #6d8963; }
body > .page { display: none; }
#runner-game { position: fixed; inset: 0; overflow: hidden; color: #513b27; touch-action: none; user-select: none; -webkit-user-select: none; }
#runner-game canvas { display: block; width: 100%; height: 100%; }
#runner-game [hidden] { display: none !important; }
#runner-game button { cursor: pointer; -webkit-tap-highlight-color: transparent; border: 2px solid #745338; border-radius: 20px; color: #513b27; background: #ff8a3d; min-height: 48px; padding: 10px 15px; font: 800 16px/1.3 inherit; box-shadow: 0 3px 0 #573b29; touch-action: none; }
#runner-game button:active { transform: translateY(2px); box-shadow: 0 1px 0 #573b29; }
#runner-game button:focus-visible { outline: 3px solid #fff3cc; outline-offset: 4px; }
#runner-game .run-hud { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 14px; right: 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; color: #513b27; font-weight: 700; text-shadow: none; pointer-events: none; }
#runner-game .run-hud > span:first-child { padding: 10px 14px; border: 2px solid #846448; border-radius: 22px; background: #fff6dfc9; box-shadow: 0 3px 0 #553b2522; font-size: 12px; }
#runner-game .run-hud > span:last-child { display: flex; gap: 8px; }
#runner-game .run-hud button { pointer-events: auto; background: #f5ecd6df; border-color: #6a7545; color: #425c38; min-width: 54px; font-size: 14px; padding: 10px; }
#runner-game #run-distance { color: #714221; font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
#runner-game #run-speed { display: block; margin-top: 4px; color: #6c644a; font-size: 11px; }
#runner-game .run-message { position: absolute; top: max(145px, calc(env(safe-area-inset-top) + 133px)); left: 16px; right: 16px; text-align: center; color: #3f5337; text-shadow: 0 1px 3px #fff8e9; font-size: 13px; font-weight: 700; pointer-events: none; }
#runner-game #effects { position: absolute; top: max(112px, calc(env(safe-area-inset-top) + 100px)); left: 16px; display: flex; gap: 6px; pointer-events: none; }
#runner-game #effects span { padding: 6px 10px; color: #435638; background: #fff5dcd9; border: 2px solid #72805a; border-radius: 14px; font-size: 12px; }
#runner-game #effects progress { display: block; width: 62px; height: 5px; margin-top: 4px; accent-color: #64864b; }
#runner-game .run-controls { position: absolute; left: 22px; right: 22px; bottom: max(25px, calc(env(safe-area-inset-bottom) + 16px)); display: flex; justify-content: space-between; gap: 25px; }
#runner-game .run-controls button { width: 42%; max-width: 190px; min-height: 62px; border-radius: 24px; border-color: #785238; background: linear-gradient(#ffbc75, #ff8a3d); color: #543722; font-size: 19px; box-shadow: inset 0 2px 0 #ffe8b9, 0 4px 0 #745035; }
#runner-game .run-fork, #runner-game .run-over, #runner-game #ranking { position: absolute; left: 6%; right: 6%; top: 23%; max-width: 440px; margin: auto; padding: 20px; max-height: 65%; overflow: auto; color: #513b27; border: 2px solid #806344; border-radius: 28px; background: #fff6e3eb; box-shadow: 0 10px 35px #35432b38; text-align: center; }
#runner-game .run-fork { top: max(180px, calc(env(safe-area-inset-top) + 168px)); padding: 12px; background: #fff6e3d9; }
#runner-game .run-fork p { margin: 0 0 10px; color: #48613b; font-size: 15px; font-weight: 800; }
#runner-game .run-fork button { width: 48%; min-height: 62px; background: #e3e9cadf; color: #425a37; border-color: #718052; padding: 8px 4px; font-size: 14px; }
#runner-game .run-fork small { font-size: 10px; font-weight: 500; }
#runner-game .run-over h2, #runner-game #ranking h2 { margin: 0 0 12px; font-size: 25px; color: #4d653d; }
#runner-game .run-over p { font-size: 15px; line-height: 1.8; }
#runner-game .run-over button { width: 100%; margin-top: 12px; }
#runner-game #ranking { touch-action: pan-y; }
#runner-game #ranking input { box-sizing: border-box; width: 100%; border: 2px solid #b7ac86; border-radius: 16px; padding: 12px; margin: 10px 0; font-size: 16px; background: #fffbed; color: #513b27; user-select: text; -webkit-user-select: text; }
#runner-game #ranking ol { text-align: left; padding-left: 28px; }
#runner-game #ranking li { padding: 12px 4px; border-bottom: 1px solid #9b926744; }
#runner-game #ranking p { font-size: 12px; color: #777454; }
@media (max-height: 640px) { #runner-game .run-controls button { min-height: 50px; } #runner-game .run-fork { top: 156px; padding: 8px; } #runner-game .run-message { top: 126px; } }
@media (max-width: 360px) { #runner-game .run-hud { left: 10px; right: 10px; gap: 6px; } #runner-game .run-hud button { min-width: 48px; padding: 9px; font-size: 13px; } }

/* Explicit type settings also apply inside the runtime-created game scene. */
#runner-game { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif; }
#runner-game button { font-family: inherit; font-weight: 800; line-height: 1.3; }
#runner-game .run-fork, #runner-game .run-over, #runner-game #ranking { z-index: 5; }
#runner-game #ranking { overscroll-behavior: contain; }
