:root{--ink:#23414c;--muted:#62766d;--cream:#f7f3e8;--line:#ced6c8;--green:#dceca7;--orange:#ef9c73}*{box-sizing:border-box}[hidden]{display:none!important}html{height:100%;background:var(--cream);color:var(--ink);font-family:Arial,'Noto Sans TC',system-ui,sans-serif;overflow:hidden}body{margin:0;position:fixed;inset:0;width:100%;height:var(--vh,100dvh);padding:max(10px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(7px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));display:grid;grid-template-rows:58px minmax(0,1fr) 24px;gap:9px}button,a,input{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;color:inherit}button:focus-visible,a:focus-visible,input:focus-visible{outline:3px solid #d9784c;outline-offset:3px}button:disabled{opacity:.5;cursor:wait}header{display:flex;align-items:center;gap:28px;min-width:0}.brand{display:flex;gap:8px;align-items:center;color:var(--ink);text-decoration:none;font-size:13px;font-weight:900;letter-spacing:1px}.brand i{display:grid;place-items:center;font-style:normal;width:36px;height:40px;border-radius:50% 50% 40% 40%;background:#315f5d;color:#f5d495;font-size:22px}.brand small{display:block;letter-spacing:5px;font-size:9px;margin-top:3px}.game-title{display:flex;align-items:baseline;gap:14px;border-left:1px solid var(--line);padding-left:24px}.game-title>span{font-size:14px;font-weight:600}.game-title h1{font-size:27px;letter-spacing:2px;margin:0}.game-title h1 small{font-size:12px;letter-spacing:1px;color:var(--muted)}nav{margin-left:auto;display:flex;gap:7px}nav button{background:#fffcf4;border:1px solid var(--line);width:43px;height:41px;border-radius:12px;font-size:21px}main{min-height:0;display:grid;grid-template-columns:105px minmax(0,1fr) 105px;gap:13px}.arena{grid-column:2;grid-row:1;position:relative;min-height:0;min-width:0;border:1px solid #b9cabc;border-radius:24px;overflow:hidden;background:#c3e5df}#scene{position:absolute;inset:0}#scene canvas{display:block;width:100%;height:100%}.hud{position:absolute;left:20px;right:20px;top:17px;display:flex;justify-content:space-between;pointer-events:none}.timer{display:grid;grid-template-columns:auto 24px;gap:0 5px;padding:10px 15px;background:#fffaf0ed;border:1px solid #ffffff8a;border-radius:15px;box-shadow:0 2px 0 #173c4012}.timer>span{grid-column:1/3;font-size:10px;letter-spacing:2px;font-weight:700}.timer strong{font-size:37px;line-height:1.15;font-variant-numeric:tabular-nums;letter-spacing:-1px}.timer small{align-self:end;font-size:12px;padding-bottom:5px}.race-info{text-align:right;display:flex;flex-direction:column;gap:5px;font-size:12px;text-shadow:0 1px 1px #f9f8e5}.race-info>span:first-child{font-size:13px;letter-spacing:1px}.race-info strong{font-size:15px}.course-progress{position:absolute;top:23px;left:50%;transform:translateX(-50%);display:flex;gap:4px;pointer-events:none}.course-progress i{display:block;width:17px;height:6px;border-radius:4px;background:#5c8d7f88}.course-progress i.hit{background:#d96b51}.course-progress i.clear{background:#3b8b75}.course-progress i.current{box-shadow:0 0 0 2px #fdf5df}.event-wrap{position:absolute;left:10px;right:10px;bottom:65px;text-align:center;pointer-events:none}#cue{display:inline-block;padding:9px 16px;color:#fff9e8;background:#244952ed;font-size:14px;font-weight:700;border-radius:30px;box-shadow:0 3px 0 #12313715;opacity:0;transition:opacity .15s}#cue.show{opacity:1}.arena-bottom{position:absolute;bottom:17px;left:20px;right:20px;display:flex;justify-content:space-between;gap:12px;font-size:12px;pointer-events:none}.arena-bottom span{padding:7px 10px;background:#fff9e8e8;border-radius:9px}.arena-bottom #best-label{font-variant-numeric:tabular-nums}#render-note{position:absolute;bottom:3px;right:15px;font-size:9px;opacity:.6}.controls{display:contents}.limbs{display:flex;flex-direction:column;justify-content:center;gap:14px}.body-left{grid-column:1;grid-row:1}.body-right{grid-column:3;grid-row:1}.limbs button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;height:130px;width:100%;padding:10px 3px 14px;border:1px solid #bbcbb7;border-bottom:5px solid #adbeaa;border-radius:22px;background:#fffbf1;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.limbs .leg{background:#f9eddb;border-color:#d5c4ac;border-bottom-color:#c3aa8d}.limbs kbd{font:900 30px Arial}.limbs span{font-size:18px;font-weight:700}.limbs small{font-size:11px;color:var(--muted);white-space:nowrap}.limbs button.active{transform:translateY(3px);border-bottom-width:2px;background:var(--green)}.limbs .leg.active{background:#f8b38a}.limbs .leg.armed{box-shadow:inset 0 0 0 3px #d5673f}.limbs em{position:absolute;bottom:7px;left:12px;right:12px;height:4px;border-radius:4px;overflow:hidden;background:#d6c1a63d}.limbs em:after{content:'';display:block;width:calc(var(--charge,0)*100%);height:100%;background:#ce603b;border-radius:4px}footer{display:flex;justify-content:space-between;align-items:center;font-size:10px;color:#748577;letter-spacing:.5px}footer b{margin-left:12px;font-weight:500}footer button{border:0;background:none;font-size:10px;padding:4px 8px;color:#748577;text-decoration:underline;text-underline-offset:3px}.private{border:1px solid #ccd5c6;padding:3px 7px;border-radius:20px}dialog{border:1px solid #d1d8c5;border-radius:26px;padding:30px;color:var(--ink);background:var(--cream);max-width:calc(100vw - 26px);max-height:calc(var(--vh,100dvh) - 26px);overflow:auto;overscroll-behavior:contain;box-shadow:0 25px 100px #173a4440}dialog:not([open]){display:none}dialog::backdrop{background:#25444c55;backdrop-filter:blur(3px)}#overlay{width:440px}.card-label{font-size:10px;letter-spacing:2px;font-weight:700;color:#698075;margin-bottom:23px}.tag{display:inline-block;font-size:11px;padding:6px 10px;background:#e5ebd6;border-radius:20px;font-weight:700;letter-spacing:1px}h2{font-size:34px;line-height:1.28;letter-spacing:-.6px;margin:19px 0 10px}.lead{font-size:14px;color:var(--muted);margin:0 0 23px}.rules{padding:15px 17px;border:1px solid #d8ddc9;border-radius:16px;background:#fffaf0}.rules p{display:flex;gap:14px;align-items:center;font-size:13px;line-height:1.6;margin:0 0 12px}.rules b{white-space:nowrap;font-size:17px;letter-spacing:2px;min-width:60px}.rules strong{font-weight:600;color:#467a6c}.rules .air-rule{display:block;font-size:11px;margin:0;padding-top:10px;border-top:1px solid #d8ddc9;color:#788475}.primary{width:100%;background:#294e54;color:#fff9e8;border:0;border-radius:13px;min-height:49px;padding:12px;margin-top:21px;font-size:16px;font-weight:700}.bottom-note{font-size:10px;text-align:center;color:#7f8b7a;margin:11px 0 0}.result-top{display:flex;align-items:center;justify-content:space-between}.eyebrow{font-size:11px;letter-spacing:1px;color:#62796d}.result-time{display:flex;gap:8px;align-items:baseline}.result-time strong{font-size:54px;letter-spacing:-2px;font-variant-numeric:tabular-nums;line-height:1.1}.result-time small{font-size:17px}.badge{padding:7px 9px;background:#e0eba7;border-radius:20px;font-size:11px;font-weight:700;max-width:100px;text-align:center}#overlay.result{width:540px;padding:22px}.result .card-label{margin-bottom:13px}.result h2{font-size:24px;line-height:1.35;margin:15px 0 7px}#result-subtitle{font-size:15px;color:#63796b;line-height:1.5;margin:0 0 12px}#finish-frame{margin:0;border-radius:13px;overflow:hidden;background:#c3e5df;height:190px}#finish-frame canvas{width:100%;height:100%;object-fit:cover;object-position:40% 65%;display:block}#result-detail{font-size:12px;color:#546f60;margin:11px 0}.share-buttons{display:grid;grid-template-columns:1fr 1fr;gap:7px}.share-buttons button{border:1px solid #c9d6bd;background:#edf0df;border-radius:10px;padding:10px 7px;min-height:43px;font-size:12px;font-weight:700}#save-image{grid-column:1/3;background:#dceca7;border-color:#ccdb9c;font-size:14px}#share-status{font-size:12px;line-height:1.4;margin:8px 0;overflow-wrap:anywhere}#share-status:empty{display:none}.share-note{font-size:10px;color:#7d8b79;line-height:1.5;margin:9px 0 0}.result .primary{margin-top:12px}.result .bottom-note{display:none}#settings{width:390px;position:relative;padding:26px}#settings h2{font-size:26px;margin-top:4px}#settings p{font-size:12px;line-height:1.6}#settings label{display:flex;flex-direction:column;gap:13px;font-size:14px;margin:24px 0}input[type=range]{width:100%;accent-color:#3f7f70;height:20px}#toggle-sound{padding:10px 16px;background:#e4ebd5;border:1px solid #c3d1b6;border-radius:10px;width:100%}.close{position:absolute;right:15px;top:12px;border:0;background:none;font-size:27px;width:36px;height:36px}details{margin-top:20px;font-size:12px;color:#63796b}summary{cursor:pointer}details a{color:#3c716b}#paused h2{font-size:30px}#paused p{font-size:15px;line-height:1.7;color:#62796d}
html[data-layout=bottom] main{grid-template-columns:1fr 1fr;grid-template-rows:minmax(0,1fr) 98px;gap:9px}html[data-layout=bottom] .arena{grid-column:1/3;grid-row:1}html[data-layout=bottom] .limbs{flex-direction:row;grid-row:2;gap:8px}html[data-layout=bottom] .body-left{grid-column:1}html[data-layout=bottom] .body-right{grid-column:2}html[data-layout=bottom] .limbs button{height:98px;border-radius:17px;gap:3px}html[data-layout=bottom] .limbs kbd{font-size:25px}html[data-layout=bottom] .limbs span{font-size:16px}html[data-layout=bottom] .limbs small{font-size:10px}
@media(max-width:680px){body{padding-left:9px;padding-right:9px;grid-template-rows:49px minmax(0,1fr) 19px;gap:7px}header{gap:10px}.brand i{width:30px;height:34px;font-size:19px}.brand>span{display:none}.game-title{border:0;padding-left:0;display:block}.game-title>span{display:block;font-size:9px;letter-spacing:1px}.game-title h1{font-size:22px;line-height:1.2}.game-title h1 small{font-size:10px}nav{gap:5px}nav button{width:37px;height:37px;border-radius:11px}.arena{border-radius:20px}.hud{top:14px;left:13px;right:13px}.timer{padding:8px 10px}.timer strong{font-size:29px}.race-info{font-size:10px}.race-info strong{font-size:13px}.course-progress{top:108px;gap:5px}.course-progress i{width:18px;height:5px}.arena-bottom{left:11px;right:11px;bottom:14px;font-size:10px;gap:4px}.arena-bottom span{padding:6px 7px}.event-wrap{bottom:54px}#cue{font-size:12px;padding:8px 12px}footer{font-size:9px}footer button{font-size:9px}footer b{margin-left:5px}.private{padding:2px 5px}#overlay{padding:24px}h2{font-size:31px}.card-label{margin-bottom:18px}.rules{padding:13px}.rules p{font-size:12px}.rules b{font-size:16px}.rules .air-rule{font-size:10px}#overlay.result{padding:19px}.result-time strong{font-size:47px}.result h2{font-size:22px}#result-subtitle{font-size:14px}#finish-frame{height:155px}}
@media(orientation:landscape) and (max-height:560px){body{grid-template-rows:40px minmax(0,1fr) 16px;gap:5px;padding-top:5px;padding-bottom:3px}header{gap:16px}.brand i{width:27px;height:31px;font-size:17px}.brand small{display:none}.game-title h1{font-size:21px}.game-title>span{font-size:11px}.game-title{padding-left:14px}nav button{width:35px;height:34px}main{grid-template-columns:79px minmax(0,1fr) 79px;gap:8px}.limbs{gap:9px}.limbs button{height:106px;min-height:58px;border-radius:15px;gap:2px}.limbs kbd{font-size:24px}.limbs span{font-size:15px}.limbs small{font-size:10px}.arena{border-radius:17px}.hud{top:10px;left:11px;right:11px}.timer{padding:5px 8px}.timer strong{font-size:28px}.timer>span{font-size:8px}.course-progress{top:14px}.course-progress i{width:12px;height:4px}.race-info strong{font-size:11px}.race-info{font-size:9px;gap:3px}.arena-bottom{bottom:10px;font-size:10px;left:11px;right:11px}.event-wrap{bottom:47px}#cue{font-size:11px;padding:6px 11px}.race-info>span:first-child{font-size:11px}#overlay{width:660px;padding:20px 25px}.card-label{margin-bottom:12px}#intro{display:grid;grid-template-columns:1fr 1fr;column-gap:26px}#intro .tag{justify-self:start;grid-column:1}#intro h2{grid-column:1;font-size:27px;margin:10px 0}#intro .lead{grid-column:1;font-size:12px;margin-bottom:0}#intro .rules{grid-column:2;grid-row:1/4;align-self:center}.primary{margin-top:15px;min-height:42px;padding:9px}.bottom-note{margin-top:7px}#overlay.result{width:760px;padding:17px 21px}.result .card-label{margin-bottom:8px}#result{display:grid;grid-template-columns:1fr 1fr;column-gap:20px}.result-top{grid-column:1;grid-row:1}.result-time strong{font-size:40px}.result h2{grid-column:1;grid-row:2;font-size:20px;margin:8px 0 3px}#result-subtitle{grid-column:1;grid-row:3;font-size:13px;margin:0}#finish-frame{grid-column:2;grid-row:1/4;height:147px}#result-detail{grid-column:2;grid-row:4;font-size:10px;margin:7px 0}.share-buttons{grid-column:1/3;grid-template-columns:1fr 1fr 1fr;gap:7px}#save-image{grid-column:auto}.share-buttons button{min-height:37px;font-size:11px;padding:8px}#share-status,.share-note{grid-column:1/3;font-size:9px;margin-top:5px}.result .primary{margin-top:8px;min-height:38px;padding:8px}footer{font-size:9px}footer button{font-size:9px}.private{padding:1px 5px}}
@media(prefers-reduced-motion:reduce){#cue{transition:none}.limbs button.active{transform:none}}
@media(orientation:landscape) and (max-height:350px){#overlay.result{padding:12px 18px}.result .card-label{font-size:9px;margin-bottom:6px}#finish-frame{height:112px}.result h2{font-size:19px;margin-top:5px}#result-subtitle{font-size:12px}.result-time strong{font-size:36px}#result-detail{font-size:9px;margin:5px 0}.share-buttons button{min-height:35px;padding:7px}.share-note{font-size:8px;line-height:1.25;margin-top:4px}.result .primary{min-height:38px;margin-top:6px}}
@media(orientation:portrait) and (max-height:700px){#overlay.result{padding:16px}.result .card-label{margin-bottom:8px}.result h2{margin-top:10px}#finish-frame{height:130px}#result-detail{margin:7px 0}.share-note{font-size:9px;line-height:1.4}.result .primary{margin-top:9px}}

/* 1.1: distance is a primary readout, without taking height from the arena. */
#distance{font-size:34px;line-height:1.1;font-weight:900;letter-spacing:-1px;font-variant-numeric:tabular-nums;padding:9px 13px;background:#fffaf0ed;border:1px solid #ffffff8a;border-radius:13px;box-shadow:0 2px 0 #173c4012;text-shadow:none}
.countdown{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;pointer-events:none;background:#c3e5df22}.countdown strong{font-size:clamp(80px,15vh,140px);font-weight:900;line-height:1;color:#23414c;text-shadow:0 5px 0 #fff9e8,0 12px 25px #29534e30}.countdown span{font-size:13px;font-weight:700;background:#fffaf0eb;border-radius:30px;padding:9px 15px}.countdown.go strong{font-size:clamp(60px,11vh,100px);color:#367563}
@media(max-width:680px){#distance{font-size:26px;padding:8px 10px}.race-info{gap:5px}}
@media(orientation:landscape) and (max-height:560px){#distance{font-size:26px;padding:6px 9px}.countdown{gap:5px}.countdown span{font-size:11px;padding:7px 11px}}
/* Keep course ticks below both primary badges when side controls narrow the arena. */
@media(min-width:681px) and (max-width:1000px){.course-progress{top:126px}}
@media(orientation:landscape) and (max-height:560px) and (max-width:1000px){.course-progress{top:86px}}
.arena:has(.countdown:not([hidden])) .event-wrap{visibility:hidden}

/* 1.2: result replay lives above the score, far from portrait running controls. */
#overlay.result #start{margin:0 0 14px;min-height:46px}
#overlay.result button[aria-disabled=true]{opacity:.55}
@media(orientation:landscape) and (max-height:560px){#overlay.result #start{margin:0 0 8px;min-height:38px}}

/* 1.2.1: protect only the live play area, including label descendants and gaps.
   Rules, results, credits, links and volume controls retain browser behavior. */
[data-play-surface]{touch-action:none}
[data-play-surface],[data-play-surface] *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
[data-play-surface] canvas,[data-play-surface] img{-webkit-user-drag:none}
[data-play-surface] [data-limb]>*{pointer-events:none}

/* Recorded finish replay: optional top actions, never near the running controls. */
#overlay.result{width:min(1080px,calc(100vw - 26px));padding:clamp(16px,3vw,28px);scrollbar-width:thin;scrollbar-color:#91a78d #e7eddd;scrollbar-gutter:stable}
#overlay.result::-webkit-scrollbar{width:9px}
#overlay.result::-webkit-scrollbar-track{background:#e7eddd;border-radius:12px}
#overlay.result::-webkit-scrollbar-thumb{background:#91a78d;border:2px solid #e7eddd;border-radius:12px}
#overlay.result .card-label{text-align:center;margin-bottom:14px}
#overlay.result .result-actions{display:flex;gap:12px;margin-bottom:20px}
#overlay.result #start,#overlay.result #replay-last{flex:1;min-width:0;min-height:48px;margin:0;padding:12px;border-radius:13px;font-size:16px;font-weight:700}
#replay-last{border:1px solid #bdcbae;background:#eef0dd;color:#294e54}
#overlay.result #result{display:flex;flex-direction:column;text-align:center}
#overlay.result .result-top{justify-content:center;gap:24px;flex-wrap:wrap}
#overlay.result .result-time{justify-content:center}
#overlay.result #verdict{font-size:clamp(23px,3vw,32px);margin:16px 0 7px}
#overlay.result #result-subtitle{font-size:15px;line-height:1.5;margin:0 0 18px}
#overlay.result #finish-frame{width:100%;height:auto;aspect-ratio:20/11;border-radius:17px;flex:none}
#overlay.result #finish-frame canvas{display:block;width:100%;height:auto;aspect-ratio:20/11;object-fit:contain;object-position:center}
#overlay.result #result-detail{font-size:12px;margin:13px 0 16px}
#overlay.result .share-buttons{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
#overlay.result .share-buttons button{min-height:46px;font-size:13px;padding:10px 7px;grid-column:auto}
#overlay.result .share-note{margin-top:12px}
.replay-panel{position:absolute;left:12px;right:12px;bottom:53px;z-index:3;display:flex;align-items:center;justify-content:center;gap:12px;padding:8px 12px;border:1px solid #bfd0b7;border-radius:14px;background:#fffaf0f5;font-size:12px}
.replay-panel button{border:1px solid #b8cbb1;border-radius:10px;min-height:44px;padding:9px 14px;background:#e5edcf;font-weight:700}
.arena:has(.replay-panel:not([hidden])) .event-wrap{visibility:hidden}
@media(max-width:480px){#overlay.result .result-actions{gap:8px;margin-bottom:16px}#overlay.result #start,#overlay.result #replay-last{font-size:14px;padding:10px 7px}#overlay.result .share-buttons{grid-template-columns:1fr 1fr}#overlay.result #save-image{grid-column:1/3;grid-row:1}#overlay.result #finish-frame{border-radius:12px}.replay-panel{font-size:11px;gap:6px;padding:6px 8px}.replay-panel button{padding:8px 10px}}

/* High-jump composition: compact summary, useful photo area, safe top actions. */
#overlay.result{width:min(720px,calc(100vw - 26px));padding:12px}
#overlay.result .card-label{font-size:9px;line-height:1.2;margin-bottom:4px}
#overlay.result .result-actions{gap:8px;margin-bottom:6px}
#overlay.result #start,#overlay.result #replay-last{min-height:44px;padding:8px;font-size:14px;line-height:1.2}
#overlay.result .result-top{gap:12px}
#overlay.result .eyebrow{font-size:9px;line-height:1.2;letter-spacing:.5px}
#overlay.result .result-time strong{font-size:36px;line-height:1.05;letter-spacing:-1px}
#overlay.result .result-time small{font-size:14px}
#overlay.result #verdict{font-size:16px;line-height:1.3;margin:4px 0 2px}
#overlay.result #result-subtitle{font-size:12px;line-height:1.3;margin:0 0 6px}
#overlay.result #finish-frame{background:transparent;border-radius:12px;aspect-ratio:auto;display:flex;align-items:center;justify-content:center}
#overlay.result #finish-frame canvas{width:auto;height:auto;max-width:100%;max-height:100%;border-radius:12px;aspect-ratio:auto;object-fit:contain}
#overlay.result #result-detail{font-size:10px;line-height:1.25;margin:4px 0}
#overlay.result .share-buttons{gap:8px}
#overlay.result .share-buttons button{min-height:44px;font-size:12px;padding:8px 4px}
#overlay.result .share-note{font-size:9px;line-height:1.25;margin:4px 0 0}
@media(min-width:768px){
 #overlay.result{height:min(700px,calc(var(--vh,100dvh) - 26px))}
 #overlay.result[open]{display:flex;flex-direction:column}
 #overlay.result>.card-label,#overlay.result>.result-actions{flex:none}
 #overlay.result #result{flex:1 1 auto;min-height:0}
 #overlay.result #result>*{flex-shrink:0}
 #overlay.result #finish-frame{flex:1 1 0;min-height:140px;height:0;aspect-ratio:auto}
 #overlay.result>.card-label{margin-bottom:4px}
 #overlay.result>.result-actions{margin-bottom:6px}
}
@media(max-width:767px) and (max-height:600px){
 #overlay.result #finish-frame{height:clamp(120px,35vh,240px);max-height:clamp(120px,35vh,240px)}
}
