html:not(.development){
  --ui-top:max(8px,env(safe-area-inset-top));
  --ui-right:max(12px,env(safe-area-inset-right));
  --ui-bottom:max(8px,env(safe-area-inset-bottom));
  --ui-left:max(12px,env(safe-area-inset-left));
  --rotate-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 150' fill='none' stroke='%23fff7dc' stroke-width='6' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='17' y='16' width='44' height='80' rx='8'/%3E%3Cpath d='M34 85h10M76 38a39 39 0 0 1 51 30m-14-7 14 10 9-16'/%3E%3Crect x='61' y='93' width='82' height='43' rx='8'/%3E%3Cpath d='M132 111v8'/%3E%3C/svg%3E");
}
html:not(.development),html:not(.development) body{margin:0;overflow:hidden;overscroll-behavior:none}
html:not(.development) body>main{position:fixed;inset:0;width:100%;height:100%;height:100dvh;max-width:none;margin:0;padding:0;box-sizing:border-box}
html:not(.development) :is(.plaza-page,.race-page) main>.stage,
html:not(.development) .replay-page main>.screen{position:absolute;inset:0;border-radius:0;box-shadow:none}
html:not(.development) :is(.stage,.screen)>canvas#stage{width:100%;height:100%;aspect-ratio:auto;max-height:none;display:block}
html:not(.development) :is(.development-only,.plaza-page #bubbles span:not(.action-bubble),.race-page :is(.brand,#labels,#shot,#board,#notice,#offline,#recon,.impact-controls,#impact-badge)){display:none!important}
html:not(.development) :is(.plaza-page,.race-page)[data-ready="true"] main>header #status{display:none}
html:not(.development) :is(.plaza-page,.race-page) main>header{position:absolute;z-index:3;inset:var(--ui-top) var(--ui-right) auto auto;margin:0;padding:0;pointer-events:none}
html:not(.development) .race-page :is(.controls button,#skip-intro){pointer-events:auto;min-height:44px}
html:not(.development) .race-page #skip-intro{position:absolute;z-index:4;top:var(--ui-top);left:var(--ui-left)}
html:not(.development) .race-page #celebration{top:var(--ui-top)}
html:not(.development) .plaza-page #audio-panel{position:fixed;inset:var(--ui-top) auto auto var(--ui-left);padding:0;max-width:calc(100vw - var(--ui-left) - var(--ui-right))}
html:not(.development) .plaza-page #race-countdown{top:var(--ui-top);right:var(--ui-right)}
html:not(.development) .plaza-page #garage-open{position:absolute;z-index:5;top:auto;bottom:var(--ui-bottom);right:var(--ui-right);margin:0}
html:not(.development) .plaza-page #save-controls{position:absolute;z-index:4;bottom:var(--ui-bottom);left:var(--ui-left);max-width:calc(100% - 118px);padding:0}
html:not(.development) .plaza-page #save-controls button{min-height:44px}
html:not(.development) .plaza-page #save-status:empty{display:none}
html:not(.development) .plaza-page #race-controls{position:absolute;z-index:4;inset:auto var(--ui-right) calc(var(--ui-bottom) + 52px) auto;padding:0;pointer-events:none}
html:not(.development) .plaza-page #race-feedback:not(:empty){background:#17324bef;padding:.3em .6em;border-radius:8px}
html:not(.development) .plaza-page #drawing-import{position:absolute;z-index:24;left:var(--ui-left);top:calc(var(--ui-top) + 49px);width:max-content;max-width:calc(100% - var(--ui-left) - var(--ui-right));box-sizing:border-box;background:#243a54;border-radius:8px}
html:not(.development) .plaza-page #drawing-import summary{min-height:44px;box-sizing:border-box;padding:10px;cursor:pointer}
html:not(.development) .plaza-page #drawing-import[open]{max-height:calc(100dvh - var(--ui-top) - var(--ui-bottom) - 49px);overflow:auto;padding:0 10px}
html:not(.development) .plaza-page main[inert] #drawing-import{display:none}
html:not(.development) .plaza-page #garage{padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
html:not(.development) .plaza-page #opening-title:not([hidden]){position:absolute;inset:0;z-index:7;display:grid;place-content:center;text-align:center;pointer-events:none;color:#fff7dc;text-shadow:0 3px 5px #142132,0 0 24px #142132;font-size:clamp(1.55rem,5.5vw,4.5rem);font-weight:900;line-height:1.25;animation:opening-title 3s linear both}
#opening-title span{font-size:.67em;display:block}
@keyframes opening-title{0%,66.666%{opacity:1}100%{opacity:0}}

html:not(.development) .replay-page header>div{display:none}
html:not(.development) .replay-page header{position:absolute;z-index:3;top:var(--ui-top);right:var(--ui-right);margin:0}
html:not(.development) .replay-page .caption{left:var(--ui-left);bottom:calc(var(--ui-bottom) + 48px)}
html:not(.development) .replay-page .timeline{position:absolute;inset:auto var(--ui-right) var(--ui-bottom) var(--ui-left);padding:6px 10px;background:#fff8e8e8;border-radius:10px}
html:not(.development) .replay-page .timeline ol{margin-top:4px}
@media (orientation:portrait){
  html:not(.development) :is(.race-page,.replay-page,.plaza-page:has(main[inert]))::before,
  html:not(.development) .plaza-page main::before,
  html:not(.development) .plaza-page :is(#garage,#garage-replay-screen,#custom-editor:not([data-photo]),#garage-replay-confirm,#vehicle-save-confirm,#vehicle-delete-confirm)[open]::after{
    content:"";position:fixed;inset:0;z-index:23;background:#172b40 var(--rotate-icon) center / min(39vw,190px) no-repeat;
  }
  html:not(.development) .plaza-page :is(#garage,#garage-replay-screen,#custom-editor:not([data-photo]),#garage-replay-confirm,#vehicle-save-confirm,#vehicle-delete-confirm)[open]>*{visibility:hidden}
  html:not(.development) .plaza-page:has(#custom-editor[data-photo][open]) :is(#vehicle-save-confirm,#vehicle-delete-confirm)[open]::after{display:none}
  html:not(.development) .plaza-page:has(#custom-editor[data-photo][open]) :is(#vehicle-save-confirm,#vehicle-delete-confirm)[open]>*{visibility:visible}
  html:not(.development) .plaza-page #audio-panel{display:none}
  html:not(.development) .plaza-page #drawing-import{top:auto;bottom:var(--ui-bottom)}
  html:not(.development) .plaza-page #drawing-import[open]{max-height:calc(100dvh - var(--ui-top) - var(--ui-bottom))}
}
