.demo-bar{box-sizing:border-box;padding:12px 24px;display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;background:#2b2043;color:#f5edff;font:13px/1.5 system-ui,sans-serif;position:relative;z-index:4}.demo-bar nav{display:flex;gap:20px}.demo-bar a{color:#bda5ff;text-underline-offset:3px;min-height:30px;display:inline-flex;align-items:center}.demo-shell{margin:0;background:#100d1e;color:#f6f0ff;font:16px/1.6 system-ui,sans-serif}.demo-shell *{box-sizing:border-box}.demo-shell main,.demo-shell>header,.demo-shell>footer{max-width:1120px;margin:auto;padding:30px}.demo-shell a{color:#bda5ff}.demo-shell h1{font-size:clamp(42px,7vw,78px);line-height:1.03;letter-spacing:-3px;margin:18px 0 24px}.demo-shell h2{font-size:27px;line-height:1.2;letter-spacing:-.6px}.demo-shell p,.demo-shell li{color:#c0b4d6}.demo-shell .eyebrow{font-size:12px;letter-spacing:2px;font-weight:750;color:#bda5ff}.demo-shell .intro-grid{display:grid;grid-template-columns:1.5fr 1fr;align-items:center;gap:50px;margin-bottom:55px}.demo-shell .intro-grid img{width:100%;max-width:320px}.demo-shell .tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin:24px 0 48px}.demo-shell .tile{border:1px solid #514267;background:#251c3a;border-radius:20px;padding:24px;text-decoration:none;display:flex;flex-direction:column;min-height:250px;transition:transform .15s}.demo-shell .tile:hover{transform:translateY(-3px)}.demo-shell .tile h2{color:#f6f0ff}.demo-shell .tile p{flex:1}.demo-shell .tile .number{color:#b4a3d1;font-size:12px;letter-spacing:2px}.demo-shell button,.demo-shell .button{font:inherit;font-weight:700;background:#bda5ff;color:#100d1e;border:1px solid #bda5ff;border-radius:10px;padding:12px 18px;min-height:44px;cursor:pointer;text-decoration:none;display:inline-block}.demo-shell button.secondary{background:transparent;color:#bda5ff}.demo-shell a:focus-visible,.demo-shell button:focus-visible,.demo-shell input:focus-visible,.demo-shell textarea:focus-visible{outline:3px solid #e8d079;outline-offset:4px}.demo-shell .panel{border:1px solid #514267;border-radius:20px;background:#251c3a;padding:26px;margin:26px 0}.demo-shell .metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.demo-shell .metrics strong{display:block;font-size:40px;color:#bda5ff}.demo-shell .checklist label{display:flex;gap:12px;margin:14px 0;align-items:flex-start}.demo-shell input[type=checkbox]{margin-top:7px;width:18px;height:18px}.demo-shell select,.demo-shell textarea{font:inherit;color:#f6f0ff;background:#100d1e;border:1px solid #70608a;border-radius:8px;padding:12px;width:100%;margin:8px 0 18px}.demo-shell textarea{min-height:150px;resize:vertical}.demo-shell .small{font-size:14px}.demo-shell .form-actions{display:flex;gap:14px;flex-wrap:wrap}.demo-shell footer{font-size:14px;border-top:1px solid #514267}.demo-shell .notice{padding:14px 0;border-top:1px solid #514267;font-size:14px}@media(max-width:760px){.demo-shell .tiles{grid-template-columns:1fr 1fr}.demo-shell .intro-grid{grid-template-columns:1fr}.demo-shell .intro-grid img{display:none}.demo-shell .metrics{grid-template-columns:1fr}.demo-shell main,.demo-shell>header,.demo-shell>footer{padding:22px}}@media(max-width:480px){.demo-shell .tiles{grid-template-columns:1fr}.demo-shell h1{letter-spacing:-2px}.demo-bar{padding:12px 18px}}

/* Keep runner buttons available on touch screens, including landscape phones. */
@media (pointer:coarse), (max-width:1050px) and (max-height:500px) {
  body.runner-demo .desktop-controls { display:none; }
  body.runner-demo .control-hint { display:none; }
  body.runner-demo .touch-controls { display:flex; gap:10px; flex:1; }
  body.runner-demo .touch-controls button { min-height:50px; flex:1; touch-action:none; background:#172630; border:1px solid #526069; border-radius:3px; color:var(--ink); font:700 12px var(--mono); }
  body.runner-demo .touch-controls button:last-child { background:var(--gold); color:#162011; border-color:var(--gold); }
}
@media (max-width:1050px) and (max-height:500px) and (orientation:landscape) {
  body.runner-demo .arena.playing { height:calc(100svh - 72px); min-height:200px; max-height:none; }
  body.runner-demo .control-strip { min-height:72px; padding:8px 0; gap:10px; flex-wrap:nowrap; }
  body.runner-demo .hud-top { padding:10px 16px; }
  body.runner-demo .score-panel strong { font-size:26px; }
  body.runner-demo .route-panel>strong { font-size:20px; margin:4px 0; }
  body.runner-demo .hud-actions button { min-height:44px; min-width:44px; }
  body.runner-demo .hud-bottom { padding:8px 16px; }
  body.runner-demo .dialog { max-height:100%; overflow-y:auto; padding:18px; }
  body.runner-demo .dialog h2 { font-size:26px; margin:8px 0; }
}

/* Explicit hidden panels and viewport units supported by iOS 14 Safari. */
[hidden]{display:none!important}
.demo-dialog-layer{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(3,9,19,.86);overscroll-behavior:contain}
.demo-dialog-layer .demo-dialog-panel{position:relative;margin:auto;width:100%;max-width:510px;max-height:calc(var(--demo-viewport-height,100vh) - 32px);overflow-y:auto;-webkit-overflow-scrolling:touch;box-sizing:border-box}
.demo-dialog-layer button{min-height:48px;touch-action:manipulation}
.demo-dialog-layer a{display:inline-flex;align-items:center;min-height:44px}
.demo-dialog-layer .close{min-width:48px;min-height:48px}
.demo-dialog-layer .row{display:flex;flex-wrap:wrap;gap:12px}
.demo-dialog-layer .row button{flex:1}
.demo-dialog-layer .check{align-items:center;min-height:48px}
.demo-dialog-layer .check input{width:22px;height:22px;flex:0 0 22px;padding:0}
.wheel-center{height:27%}
@media(max-width:650px){
 .demo-dialog-layer{padding:12px}
 .demo-dialog-layer .demo-dialog-panel{padding:28px 20px;max-height:calc(var(--demo-viewport-height,100vh) - 24px)}
 .demo-dialog-layer .row{flex-direction:column}
 .demo-dialog-layer .row button{width:100%}
 .demo-shell .metrics strong{font-size:34px}
}
/* The playable runner and its buttons share one fixed mobile viewport, on every replay. */
@media(max-width:1050px){
 body.runner-demo .touch-controls{display:flex;flex:1;gap:10px}
 body.runner-demo .touch-controls button{flex:1;min-height:52px;background:#172630;border:1px solid #526069;color:var(--ink);font:700 12px var(--mono);border-radius:4px;touch-action:none}
 body.runner-demo .touch-controls button:last-child{background:var(--gold);color:#162011}
 body.runner-demo .desktop-controls,body.runner-demo .control-hint{display:none}
 body.runner-demo.run-active{overflow:hidden}
 body.runner-demo.run-active #arena{position:fixed;top:0;left:0;right:0;width:100%;height:calc(var(--demo-viewport-height,100vh) - 80px - env(safe-area-inset-bottom,0px));min-height:0;max-height:none;z-index:20;border-radius:0}
 body.runner-demo.run-active .control-strip{position:fixed;bottom:0;left:0;right:0;z-index:21;height:calc(80px + env(safe-area-inset-bottom,0px));min-height:80px;box-sizing:border-box;display:flex;flex-wrap:nowrap;gap:8px;padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px));background:#0c1823;border-top:1px solid #526069}
 body.runner-demo.run-active .motion-toggle{flex:0 0 70px;font-size:7px;min-height:48px;padding:4px}
 body.runner-demo.run-active .modal-shade{padding:12px}
 body.runner-demo.run-active .dialog{max-height:100%;overflow-y:auto;-webkit-overflow-scrolling:touch}
 body.runner-demo.run-active .hud-actions button{min-height:44px;min-width:44px}
}
@media(max-width:1050px) and (max-height:500px){
 body.runner-demo.run-active .hud-top{padding:8px 12px}
 body.runner-demo.run-active .hud-bottom{padding:6px 12px}
 body.runner-demo.run-active .dialog{padding:16px}
 body.runner-demo.run-active .dialog h2{font-size:24px;margin:6px 0}
 body.runner-demo.run-active .result-score strong{font-size:38px}
 body.runner-demo.run-active .result-stats{padding:8px 0;margin:6px 0}
}

.feedback-trap{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}.demo-shell button:disabled{opacity:.65;cursor:wait}#feedback-status{overflow-wrap:anywhere;min-height:1.6em}#feedback{scroll-margin-top:20px}.demo-bar nav{flex-wrap:wrap}.demo-shell button:focus,.demo-shell select:focus,.demo-shell textarea:focus{outline:3px solid #e8d079;outline-offset:3px}@media(max-width:480px){#feedback .form-actions{flex-direction:column}#feedback .form-actions button{width:100%}}
