#app {--panel-w:316px;}
#motion {width:100%;height:100%;touch-action:none;}
.stage-head {position:absolute;top:18px;left:24px;right:24px;display:flex;justify-content:space-between;align-items:center;pointer-events:none;}
.eyebrow {color:#8397ae;font-size:11px;letter-spacing:1px;}
.stage-head h2 {margin:3px 0 0;font-size:18px;font-weight:600;letter-spacing:.3px;}
.stage-badge {font:12px var(--mono);color:#93aec7;border:1px solid #26364a;padding:6px 10px;border-radius:8px;}
#app button {font:inherit;cursor:pointer;background:#151e2d;border:1px solid #304057;color:#dce7f2;border-radius:9px;min-height:44px;padding:8px 12px;font-size:12px;transition:background .15s,border-color .15s;}
#app button:hover {background:#223046;border-color:#819bb8;}
#app button:focus-visible,#app input:focus-visible,#app summary:focus-visible {outline:2px solid #64d6ff;outline-offset:3px;}
.scenes {position:absolute;top:80px;left:24px;display:flex;gap:4px;padding:3px;border:1px solid #243044;border-radius:12px;background:#0c121e;}
#app .scenes button {min-height:36px;padding:6px 17px;border-color:transparent;background:transparent;color:#9badc2;}
#app .scenes button.on {color:#ffe2a0;background:#3b301b;border-color:#75602e;}
#hint {top:91px;left:auto;right:24px;transform:none;padding:0;background:none;color:#859ab2;font-size:11px;}
#stageTools {position:absolute;left:24px;right:24px;bottom:38px;display:flex;align-items:center;gap:9px;padding:10px;background:#101825;border:1px solid #27374a;border-radius:14px;}
#app #stagePlay {background:#ffc94a;color:#201b0d;border-color:#ffc94a;font-weight:600;min-width:83px;}
#app #stageReset {font-size:21px;line-height:1;padding:6px 11px;}
.timeline {display:flex;align-items:center;gap:12px;flex:1;min-width:0;font-size:11px;color:#97abc0;}
.timeline input {min-width:30px;flex:1;height:30px;cursor:ew-resize;margin:0;}
.timeline output {font:15px var(--mono);color:#e9f0f7;min-width:48px;}
.time-end {white-space:nowrap;}
.learn-fab {bottom:7px;background:none;border:none;font-size:11px;padding:0;}
#panel {padding:22px 20px;background:#0e1420;}
#panel h1 {font-size:18px;margin:5px 0 8px;}
#panel .learn-link {color:#94b6d3;font-size:11px;margin-bottom:18px;}
#panel section {padding:17px 0;border-color:#233044;}
#panel h2 {font-size:12px;color:#c9d7e8;letter-spacing:0;}
#panel h2 .muted {float:right;font-size:10px;font-weight:400;}
#panel .readout {padding:15px !important;background:linear-gradient(135deg,#1c2635,#131d2a);border-color:#34445a !important;border-radius:12px;}
#status {font-size:15px;color:#ffc94a;}
#panel dl {grid-template-columns:1fr auto;gap:9px;font-size:12px;margin:15px 0;}
#panel dd {font-family:var(--mono);color:#e3edf6;}
#distanceRead {color:#ffc94a !important;} #speedRead {color:#64d6ff !important;}
#explain {padding-top:10px;border-top:1px solid #314055;color:#b2c3d5;line-height:1.8;}
#panel .note {font-size:11px;line-height:1.8;}
.slider {grid-template-columns:65px 1fr 28px;font-size:11px;min-height:38px;}
.slider input {height:30px;}
.slider[hidden] {display:none;}
#panel .switch {font-size:11px;min-height:36px;gap:8px;}
#panel .switch input {width:16px;height:16px;margin:0;}
.average {font:15px var(--mono);color:#ffc94a;margin:10px 0;}
#panel details {margin-top:14px;font-size:11px;color:#91a9c0;}
#panel summary {cursor:pointer;padding:8px 0;}
#records table {width:100%;font-size:11px;border-collapse:collapse;}
#records td,#records th {padding:7px 3px;border-bottom:1px solid #2a3446;text-align:left;font-weight:400;}
.actions {display:flex;gap:8px;margin:14px 0 0;} .actions button {width:100%;}
@media(max-width:1000px) and (min-width:761px) {#hint {display:none;} #app {--panel-w:285px;} .timeline>span:first-child {display:none;}}
@media(max-width:760px) {
 #app {min-height:720px;}
 .stage-head {top:12px;left:14px;right:14px;} .stage-head h2 {font-size:16px;} .stage-badge {display:none;} .eyebrow {font-size:10px;}
 .scenes {top:68px;left:14px;right:14px;gap:3px;} #app .scenes button {flex:1;padding:6px 8px;min-height:38px;}
 #hint {top:119px;right:20px;font-size:10px;max-width:none;}
 #stageTools {left:12px;right:12px;bottom:35px;padding:8px;gap:7px;} .timeline {gap:6px;}
 .timeline>span:first-child,.time-end {display:none;} .timeline output {font-size:13px;min-width:55px;} .timeline output::after {content:" s";font-size:10px;color:#97abc0;}
 #app #stagePlay {min-width:76px;padding:8px;} #app #stageReset {padding:6px 9px;}
 #app #panelToggle {top:13px;right:14px;border-radius:8px;min-height:38px;padding:6px 11px;font-size:11px;}
 #panel {padding:18px 20px 26px;max-height:72%;box-shadow:0 -12px 35px #0008;}
 #panel.collapsed {visibility:hidden;} .learn-fab {bottom:9px;}
}
@media(prefers-reduced-motion:reduce) {#app button,#panel {transition:none;}}
