*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:#211a14;color:#fff2db;font:16px system-ui}main{max-width:1200px;margin:auto;padding:24px}header,.intro,.run-tools{display:flex;align-items:center;justify-content:space-between;gap:12px}header span,.intro small{font-size:11px;letter-spacing:2px;color:#d1a576}a{color:#f8c587;text-underline-offset:4px}h1{font-size:clamp(34px,5vw,58px);letter-spacing:-2px;line-height:1.03;margin:12px 0 22px}h1 span{display:block;color:#ee941f}.intro p{color:#d8b997;line-height:1.6}button,select{background:#33271e;color:#fff1d9;border:1px solid #a4794b;border-radius:14px;padding:10px 15px;cursor:pointer;touch-action:none;font:inherit;min-height:48px}button:disabled{opacity:.48;cursor:default}button:focus-visible,a:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #7aecd2;outline-offset:3px}button:active,.pressed{background:#88603c;transform:translateY(2px)}#expand{font-size:14px;font-weight:650;background:#51391f;border-color:#e6a64b;padding:10px 12px}.settings{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:15px}.settings label{display:flex;align-items:center;gap:8px;font-size:13px}.settings a{font-size:14px}.settings>span{font-size:12px;color:#d0b69a;flex:1;min-width:180px}.stage{position:relative;border-radius:18px;overflow:hidden;border:1px solid #91613a;background:#a96635;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}canvas{width:100%;display:block;aspect-ratio:1100/460;touch-action:none}.hud{position:absolute;top:12px;left:14px;right:14px;display:flex;justify-content:space-between;gap:8px;font-size:12px;font-weight:bold;pointer-events:none}.hud span{background:#2c1c16e6;padding:6px 10px;border-radius:7px}#notice{position:absolute;top:49px;left:50%;transform:translateX(-50%);max-width:90%;width:max-content;text-align:center;font-size:13px;color:#fff3c7;pointer-events:none;background:#332318e6;padding:5px 12px;border-radius:7px}.controls{position:absolute;bottom:12px;left:12px;right:12px;display:flex;justify-content:space-between;align-items:end;gap:16px}.cluster{display:flex;gap:8px;align-items:end}.controls button{min-height:72px;min-width:70px;padding:10px 15px;background:#241c16f0;font-size:17px;font-weight:650;border-color:#d1a475;box-shadow:0 4px 0 #25190f70}.controls small{display:block;letter-spacing:0;color:#f1d4ad;font:11px system-ui;margin-top:3px}.controls .balance button{font-size:30px}.controls [data-switch]{background:#214b43;border-color:#8bd5bb;min-width:112px;font-size:16px}.controls [data-switch] small{color:#c6efdf}.controls .brake{background:#643c2d;border-color:#c98c68}.controls .jump{background:#eea135;color:#251a0f;border-color:#ffe2a0;min-width:98px;font-size:20px}.run-tools{justify-content:center;margin-top:14px}.run-tools button[hidden]{display:none}.run-tools #start{background:#eea135;color:#251a0f;font-weight:bold;min-width:160px}.instructions{margin:22px 0;padding:18px;border-top:1px solid #785234;background:#2b2119;border-radius:12px;font-size:14px;color:#e2c6a4;scroll-margin-top:15px}.instructions summary{font-size:18px;font-weight:700;cursor:pointer;color:#ffe2b5}.guide-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:22px;line-height:1.65}.guide-grid strong{display:block;color:#f7ab4f;margin-bottom:7px}.instructions>p{line-height:1.65}footer{font-size:12px;line-height:1.6;color:#c09e7d;text-align:center;margin-top:22px}.bike-is-expanded{overflow:hidden!important}#bike[data-bike-expanded=true]{position:fixed;inset:0;z-index:10000;width:100vw;height:100dvh;max-width:none;background:#211a14;padding:0;overflow:hidden;isolation:isolate;display:flex;flex-direction:column}#bike[data-bike-expanded=true][data-bike-rotated=true]{inset:auto;left:50%;top:50%;width:var(--bike-wide);height:var(--bike-short);transform:translate(-50%,-50%) rotate(90deg);transform-origin:center}#bike[data-bike-expanded=true] .intro,#bike[data-bike-expanded=true] footer,#bike[data-bike-expanded=true] .instructions,#bike[data-bike-expanded=true] #difficulty-note{display:none}#bike[data-bike-expanded=true] header{height:43px;flex-shrink:0;padding:3px 10px}#bike[data-bike-expanded=true] header span{display:none}#bike[data-bike-expanded=true] header button{min-height:36px;font-size:12px;padding:6px 10px}#bike[data-bike-expanded=true] .stage{flex:1;min-height:0;border-radius:0;border-inline:0}#bike[data-bike-expanded=true] canvas{width:100%;height:100%;object-fit:contain;min-height:0;aspect-ratio:auto}#bike[data-bike-expanded=true] .settings{position:absolute;top:3px;left:50%;transform:translateX(-50%);z-index:3;margin:0;flex-wrap:nowrap;gap:7px}#bike[data-bike-expanded=true] .settings label{font-size:0;gap:0}#bike[data-bike-expanded=true] .settings select,#bike[data-bike-expanded=true] .settings button{min-height:36px;padding:5px 8px;font-size:11px}#bike[data-bike-expanded=true] .settings a{display:none}#bike[data-bike-expanded=true] .controls{position:absolute;bottom:9px;left:12px;right:12px;padding:0;background:none;grid-template-columns:1fr auto 1fr;display:grid;gap:16px}#bike[data-bike-expanded=true] .cluster{gap:7px}#bike[data-bike-expanded=true] .drive{justify-content:end}#bike[data-bike-expanded=true] .controls button{min-height:66px;min-width:62px;padding:7px 12px;font-size:16px}#bike[data-bike-expanded=true] .balance button{font-size:26px}#bike[data-bike-expanded=true] .controls .jump{min-width:92px;font-size:21px}#bike[data-bike-expanded=true] .controls [data-switch]{min-width:100px;font-size:15px}#bike[data-bike-expanded=true] .controls small{font-size:10px}#bike[data-bike-expanded=true] .run-tools{height:42px;margin:0;gap:8px;flex-shrink:0}#bike[data-bike-expanded=true] .run-tools button{min-height:34px;padding:4px 15px;font-size:12px}#bike[data-bike-expanded=true] .hud{top:5px;font-size:10px}#bike[data-bike-expanded=true] #notice{top:35px;font-size:11px}
@media(max-width:650px){main{padding:10px}header span,.intro p{display:none}.settings{gap:8px}.settings label{flex:1}.settings select{font-size:13px}.settings>span{flex-basis:100%}.controls{position:relative;bottom:auto;left:auto;right:auto;padding:9px;display:grid;grid-template-columns:1fr auto 1fr;gap:6px;background:#3a281c}.cluster{gap:5px}.drive{justify-content:end}.controls button{min-width:45px;padding:7px 8px;min-height:66px;font-size:13px}.controls .balance button{font-size:24px}.controls .jump{min-width:56px;font-size:16px}.controls [data-switch]{min-width:72px;font-size:12px;padding:7px}.controls small{font-size:9px}canvas{min-height:225px;object-fit:contain}.hud{font-size:10px}.hud span{padding:5px 7px}.run-tools button{font-size:13px}.guide-grid{grid-template-columns:1fr 1fr;gap:12px}.instructions{padding:13px}}
@media(max-width:360px){.controls{grid-template-columns:1fr auto;gap:8px}.controls .lanes{grid-column:1/-1;grid-row:2;justify-content:center}.controls [data-switch]{min-width:140px;min-height:48px}.guide-grid{grid-template-columns:1fr}}
#bike[data-bike-expanded=true] .lanes{grid-column:auto;grid-row:auto}@media(max-width:650px){.controls .balance button{min-width:54px}}
/* Four controls: balance on the left, change and jump together on the right. */
h1{font-family:Impact,'Arial Black',system-ui;font-style:italic;font-size:clamp(48px,7vw,76px);color:#ffad26;text-shadow:2px 3px #0f100e}h1 span{font-family:system-ui;font-style:normal;font-size:clamp(15px,2vw,22px);letter-spacing:0;color:#efd9bb;margin-top:8px}.intro img{object-fit:contain;border-radius:14px}.controls{display:flex;justify-content:space-between}.controls [data-switch]{min-width:88px;font-size:26px}.controls [data-switch] small{font-size:12px}#stage-progress{position:absolute;top:46px;left:14px;width:calc(100% - 28px);height:7px;accent-color:#ffb136;pointer-events:none}#stage-progress::-webkit-progress-bar{background:#30261dcc;border-radius:8px}#stage-progress::-webkit-progress-value{background:#ffb136;border-radius:8px}#notice{top:63px}#lane{position:absolute;top:63px;left:15px;font-size:10px;color:#ffe5b4;pointer-events:none}#trick{position:absolute;top:96px;left:50%;transform:translateX(-50%);color:#fff3a3;font-weight:800;text-shadow:1px 2px #39271e;pointer-events:none}.settings>span{min-width:0}.stage canvas{cursor:pointer}
@media(max-width:650px){.controls{display:flex;gap:8px;justify-content:space-between}.controls .balance button{min-width:48px}.controls [data-switch]{min-width:64px;font-size:24px}.controls .jump{min-width:66px}.intro img{width:94px;height:94px}.guide-grid{grid-template-columns:1fr 1fr}#notice{font-size:10px;top:61px;max-width:74%}#lane{top:82px;font-size:9px}#trick{top:105px;font-size:12px}}
#bike[data-bike-expanded=true] .controls{display:flex;justify-content:space-between}#bike[data-bike-expanded=true] #stage-progress{top:33px}#bike[data-bike-expanded=true] #notice{top:46px}#bike[data-bike-expanded=true] #lane{top:49px}#bike[data-bike-expanded=true] #trick{top:73px}#bike[data-bike-expanded=true] .settings>span{display:none}
@media(max-width:360px){.guide-grid{grid-template-columns:1fr}.controls{gap:5px}.controls .cluster{gap:4px}.controls button{padding:6px;min-width:43px}.controls [data-switch]{min-width:60px}.controls .jump{min-width:60px}}
.settings label{font-size:12px}.settings select{min-height:42px;font-size:13px;padding:7px 9px}.settings>span{min-width:90px}@media(max-width:650px){.settings label{flex:0 0 auto}.settings>span{order:3;flex-basis:50%;font-size:11px}.settings a{order:4;margin-left:auto}.settings #sound{margin-left:auto}.intro{gap:8px}}
.game-tools{position:absolute;top:8px;right:10px;display:flex;gap:5px;z-index:5}.game-tools button,.game-tools #expand{width:34px;height:32px;min-height:32px;padding:3px;font-size:21px;border-radius:8px;background:#34271bdc;border:1px solid #b58c54}.hud{right:94px}.hud #score{position:absolute;right:-80px;top:39px;font-size:10px}#notice{top:67px}.controls [data-switch]{font-size:24px;min-width:102px}.controls [data-switch] small{font-size:12px}#bike[data-bike-expanded=true] .game-tools{top:7px;right:8px}#bike[data-bike-expanded=true] .game-tools button{min-height:30px;width:32px;height:30px;font-size:19px}#bike[data-bike-expanded=true] header{height:30px;min-height:30px}#bike[data-bike-expanded=true] .hud{right:95px;top:7px}#bike[data-bike-expanded=true] #notice{top:48px}#bike[data-bike-expanded=true] .settings{display:none}#bike[data-bike-expanded=true] .hud #score{top:36px}@media(max-width:650px){.hud{right:89px}.game-tools{top:7px;right:8px;gap:4px}.game-tools button,.game-tools #expand{width:30px;height:30px;min-height:30px;font-size:19px}.hud #score{right:-74px;top:35px}#notice{top:66px}.controls [data-switch]{min-width:88px;font-size:24px}.controls [data-switch] small{font-size:10px}.settings>span{order:0;flex:1;flex-basis:auto}}

/* Equal touch targets and simple direction arrows, including narrow phones. */
.controls{display:grid;grid-template-columns:auto auto;justify-content:space-between;gap:12px}
.controls .cluster{display:grid;grid-template-columns:repeat(2,96px);gap:8px}
.controls button,.controls .balance button,.controls [data-switch],.controls .jump{width:100%;min-width:0;min-height:76px;padding:8px;border-radius:16px}
.controls .balance svg{display:block;width:36px;height:36px;margin:auto;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.controls small,.controls [data-switch] small{font-size:12px;line-height:1.15;white-space:normal}
@media(max-width:650px){
 .controls{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}
 .controls .cluster{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 .controls button,.controls .balance button,.controls [data-switch],.controls .jump{min-width:0;min-height:76px;padding:7px 4px}
 .controls small,.controls [data-switch] small{font-size:11px}
 .controls .jump{font-size:17px}
}
#bike[data-bike-expanded=true] .controls{display:grid;grid-template-columns:auto auto;gap:12px}
#bike[data-bike-expanded=true] .controls .cluster{grid-template-columns:repeat(2,90px);gap:8px}
#bike[data-bike-expanded=true] .controls button,#bike[data-bike-expanded=true] .controls .balance button,#bike[data-bike-expanded=true] .controls [data-switch],#bike[data-bike-expanded=true] .controls .jump{min-width:0;min-height:76px;padding:7px}
#bike[data-bike-expanded=true] .controls small{font-size:11px}

.state-panel{position:absolute;top:34%;left:50%;transform:translate(-50%,-50%);width:min(86%,520px);text-align:center;pointer-events:none;color:#fff0cd;text-shadow:0 2px 4px #241a14;line-height:1.4}
.state-panel[hidden]{display:none}.state-panel strong{display:block;font-size:clamp(21px,3vw,34px);margin-bottom:6px}.state-panel span{display:block;font-size:clamp(13px,1.6vw,17px)}
@media(max-width:650px){.state-panel{top:35%;width:86%}.state-panel strong{font-size:21px}.state-panel span{font-size:13px}}
#bike[data-bike-expanded=true] .state-panel{top:36%}

@media(max-width:360px){.controls button,.controls .balance button,.controls [data-switch],.controls .jump{height:80px}}

#notice[data-danger=fatal]{background:#652e24ed;color:#fff0d4;border:1px solid #f1b588}#notice[data-danger=bump]{background:#594321ed;color:#fff1c4}#notice[hidden]{display:none}

#bike[data-theme=coast] .stage{background:#398c9f}#bike[data-theme=night] .stage{background:#172640}

#next-level{margin:14px auto 0;padding:12px 22px;background:#f0ae32;color:#241a14;border:1px solid #ffdd91;border-radius:10px;font:700 15px system-ui;cursor:pointer;pointer-events:auto}#next-level[hidden]{display:none}#next-level:focus-visible{outline:3px solid #fff1c4;outline-offset:4px}#bike[data-state=intermission] .state-panel{background:#211a14f5;border:1px solid #dfba75;padding:24px;max-width:580px;pointer-events:auto}#bike[data-state=intermission] .state-panel strong{color:#ffdc94}

.controls .jump[data-action=continue]{font-size:13px;line-height:1.2;white-space:normal;padding:8px;overflow-wrap:normal}

.ranking-section{margin:24px 0;padding:24px;border:1px solid #6e5435;border-radius:16px;background:#2d231b}.ranking-section[hidden],.ranking-finish[hidden],#ranking-form[hidden]{display:none}.ranking-heading{display:flex;align-items:center;justify-content:space-between;gap:16px}.ranking-heading h2{margin:4px 0 0;color:#ffd48d;font-size:26px}.ranking-heading small{font-size:10px;letter-spacing:.15em;color:#bfa581}.ranking-section p{color:#d8c5a6;line-height:1.6}.ranking-section button{padding:11px 16px;border:1px solid #a97b43;border-radius:10px;background:#44301e;color:#ffe2ab;font:600 14px system-ui;cursor:pointer}.ranking-section button:disabled{opacity:.6;cursor:default}.ranking-section :focus-visible{outline:3px solid #ffd58f;outline-offset:4px}.ranking-finish{margin:20px 0;padding:20px;border:1px solid #d49e45;border-radius:12px;background:#382a1b}.ranking-finish h3{margin:0;color:#ffd28b}.ranking-fields{display:flex;gap:10px;margin:10px 0}.ranking-fields input{flex:1;min-width:0;padding:12px;border:1px solid #95764b;border-radius:9px;background:#211a14;color:#fff0d3;font:16px system-ui}.ranking-fields button{background:#edac35;color:#211a14}#ranking-form label{display:block;color:#fce8bd}#ranking-form small,.ranking-note{font-size:12px;color:#bca78b!important}.ranking-table{overflow-x:auto;margin:16px 0}.ranking-table table{width:100%;border-collapse:collapse;text-align:left}.ranking-table th{font-size:11px;text-transform:uppercase;letter-spacing:.12em;color:#cdb78d}.ranking-table td,.ranking-table th{padding:12px 8px;border-bottom:1px solid #5c4830}.ranking-table td{color:#fae8c3}.ranking-table td:last-child,.ranking-table th:last-child{text-align:right;font-variant-numeric:tabular-nums}.ranking-table tbody tr:first-child td{color:#ffd176}.ranking-note{margin-bottom:0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}@media(max-width:600px){.ranking-section{padding:16px}.ranking-fields{flex-direction:column}.ranking-heading h2{font-size:23px}}

#trick[data-flip=true]{font-size:clamp(20px,3vw,30px);line-height:1.2;text-align:center;background:#302219eb;color:#fff0a5;border:2px solid #edb844;border-radius:12px;padding:9px 16px;box-shadow:0 4px 14px #21180d66;max-width:88%;width:max-content}#trick:empty{display:none}@media(max-width:650px){#trick[data-flip=true]{font-size:20px;padding:8px 12px}}

#level-intro{position:absolute;top:105px;left:50%;transform:translateX(-50%);padding:14px 28px;text-align:center;color:#fff1cf;background:#2b241fe8;border:1px solid #e9b568;border-radius:14px;pointer-events:none;max-width:90%;width:max-content;box-shadow:0 5px 20px #30231755}#level-intro[hidden]{display:none}#level-intro small{display:block;font-size:11px;letter-spacing:2px;color:#efbf76;margin-bottom:5px}#level-intro strong{display:block;font-size:clamp(24px,4vw,38px);line-height:1.15}#bike[data-bike-expanded=true] #level-intro{top:91px}@media(max-width:650px){#level-intro{top:105px;padding:10px 20px}#level-intro strong{font-size:25px}#level-intro small{font-size:9px}}

/* Consistent control rows: the longest label wraps inside the same touch target. */
#bike .controls,#bike[data-bike-expanded=true] .controls{display:grid;grid-template-columns:auto auto;align-items:stretch;gap:16px}
#bike .controls .cluster,#bike[data-bike-expanded=true] .controls .cluster{display:grid;grid-template-columns:repeat(2,96px);align-items:stretch;gap:8px}
#bike .controls .drive,#bike[data-bike-expanded=true] .controls .drive{grid-template-columns:96px 140px}
#bike .controls button,#bike[data-bike-expanded=true] .controls button{box-sizing:border-box;width:100%;min-width:0;height:80px;min-height:80px;padding:8px 6px;border-radius:14px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;line-height:1.15;text-align:center;white-space:normal;overflow-wrap:normal}
#bike .controls .balance svg{width:30px;height:30px;margin:0;flex-shrink:0}
#bike .controls small,#bike[data-bike-expanded=true] .controls small{margin:0;font-size:11px;line-height:1.2;font-weight:500}
#bike .controls .jump,#bike[data-bike-expanded=true] .controls .jump{font-size:16px;font-weight:750}
@media(max-width:650px){
 #bike .controls,#bike[data-bike-expanded=true] .controls{grid-template-columns:minmax(0,1fr) minmax(0,1.35fr);gap:12px;padding:9px}
 #bike .controls .cluster,#bike[data-bike-expanded=true] .controls .cluster,#bike .controls .drive,#bike[data-bike-expanded=true] .controls .drive{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 #bike .controls button,#bike[data-bike-expanded=true] .controls button{height:76px;min-height:76px;padding:7px 4px;border-radius:12px}
 #bike .controls .jump,#bike[data-bike-expanded=true] .controls .jump{font-size:12px}
 #bike .controls small,#bike[data-bike-expanded=true] .controls small{font-size:10px}
 #bike .controls [data-switch]{font-size:24px}
}

#finish-website{display:inline-block;pointer-events:auto;margin:12px auto 0;padding:10px 18px;border-radius:10px;background:#f0ae32;color:#241a14;font:700 14px system-ui;text-shadow:none;text-decoration:none}#finish-website[hidden]{display:none}
