:root{font-family:ui-rounded,'Arial Rounded MT Bold',system-ui,sans-serif;color:#21394b;background:#dcf1e9;font-synthesis:none}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 10% 10%,#fff3be 0,transparent 45%),linear-gradient(140deg,#ddf5ed,#a9d7d5);min-height:100dvh}button,input{font:inherit;border:3px solid #21394b;border-radius:14px;padding:12px 18px}button{cursor:pointer;font-weight:900;background:#ffda61;color:#21394b;box-shadow:0 4px 0 #21394b;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}button:active{transform:translateY(3px);box-shadow:0 1px 0 #21394b}button:disabled{opacity:.45;cursor:default}button:focus-visible,input:focus-visible{outline:4px solid #a953bb;outline-offset:3px}[hidden]{display:none!important}main{max-width:1300px;margin:auto;padding:24px max(24px,env(safe-area-inset-right)) 20px max(24px,env(safe-area-inset-left))}header{display:flex;justify-content:space-between;align-items:center;border-bottom:2px solid #21394b33;padding-bottom:18px}header b{font-size:40px;font-weight:1000;letter-spacing:-2px;color:#ed9939;text-shadow:2px 2px #21394b}header em{font-style:normal;color:#3bb1d5}header small{display:block;color:#21394b;font-size:10px;letter-spacing:5px;text-shadow:none}header>span{font-size:10px;font-weight:900;text-align:right;line-height:1.6}h1{font-size:clamp(32px,5vw,64px);letter-spacing:-2px;line-height:1.02;margin:10px 0 16px}h2{font-size:26px}p{line-height:1.5}.eyebrow{font-size:11px;font-weight:900;letter-spacing:2px;color:#7a477e}#wardrobe{padding-top:24px}#character-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin-top:24px}.character-card{display:flex;align-items:center;flex-direction:column;padding:10px 5px 15px;background:linear-gradient(#fffdf1,#e5efdf);border-color:#73998e;box-shadow:0 5px #73998e;border-radius:22px;overflow:hidden}.character-card[aria-pressed=true]{background:linear-gradient(#fff5ba,#ffda75);border-color:#854a90;box-shadow:0 5px #854a90;transform:translateY(-4px)}.character-card canvas{width:100%;max-width:160px;height:auto;background:transparent}.character-card strong{font-size:16px}.character-card span{font-size:10px;margin-top:5px;min-height:24px}#choice{font-size:13px;font-weight:800;color:#754c88}#lobby{display:flex;align-items:center;gap:20px;flex-wrap:wrap;border-top:2px solid #21394b22;margin-top:20px;padding:12px 0}#lobby h2{margin:10px 0}#lobby>p{font-size:13px}#lobby .howto{flex-basis:100%;margin:5px 0}.join-row{display:flex;gap:8px}input{width:155px;background:#fffaf0;text-transform:uppercase}#status,footer{font-size:12px;color:#4c706a}footer{margin-top:20px;font-weight:800}footer small{font-weight:400}body.playing{overflow:hidden;background:#203d51}body.playing main{padding:0;max-width:none}body.playing header,body.playing footer,body.playing>#status,body.playing main>#status{display:none}#game{height:100dvh;display:grid;grid-template-rows:52px 30px minmax(0,1fr) 74px;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);background:#203d51;color:#fff5d9}.hud{display:flex;align-items:center;gap:18px;padding:5px 18px;background:#203d51}.brand-mini{font-weight:1000;color:#ffce59;font-size:18px;letter-spacing:-.8px}.brand-mini span{color:#72d7ed}.brand-mini small{display:block;font-size:8px;letter-spacing:2px;color:#b4d8d5}#timer{font-size:22px;color:#ffdc71;white-space:nowrap}#team{margin-left:auto;font-size:13px;font-weight:900}#menu{font-size:20px;padding:2px 12px;background:#e7f3e4;box-shadow:none;border-width:2px}.scoreline{display:flex;align-items:center;gap:8px;padding:0 18px 5px;background:#203d51}#scores{display:flex;gap:6px;overflow:auto;white-space:nowrap;scrollbar-width:none;flex:1}#scores span{font-size:11px;padding:3px 8px;border-radius:6px;background:#36576a;color:#fff4d0}#start{font-size:10px;padding:3px 10px;border-width:2px;box-shadow:none;white-space:nowrap}#stage{position:relative;min-height:0;overflow:hidden;background:#75c4dd}#arena{display:block;width:100%;height:100%;touch-action:none}#camera-note{position:absolute;top:10px;left:14px;font-size:9px;font-weight:900;letter-spacing:1px;background:#234557a8;border:1px solid #e2f3d255;padding:5px 8px;border-radius:20px;pointer-events:none}#map{position:absolute;top:10px;right:12px;width:120px;height:56px;border:2px solid #fff2c0;border-radius:9px;background:#203d51cc;pointer-events:none}#controls{display:flex;align-items:center;gap:12px;padding:8px 18px;background:#203d51}#controls>div{display:flex;gap:10px}#controls button{height:52px;min-width:64px;padding:8px 18px;border:2px solid #102b3b;box-shadow:0 3px #102b3b;font-size:15px}#controls [data-key=action]{background:#ffb96c}#controls [data-key=jump]{background:#92dfdc}#roundhint{flex:1;font-size:11px;line-height:1.3;color:#c1d9d8;margin:0;text-align:center}#game-menu{position:fixed;z-index:5;top:50%;left:50%;transform:translate(-50%,-50%);width:min(420px,94vw);max-height:90dvh;overflow:auto;padding:24px;background:#fff4ce;border:4px solid #21394b;border-radius:24px;color:#21394b;box-shadow:0 0 0 100vmax #102b3b99}#close-menu{float:right;padding:4px 10px;box-shadow:none}.bar,.preferences{display:flex;flex-wrap:wrap;gap:10px;margin:18px 0}.bar button,.preferences button{padding:10px;font-size:12px}.preferences button{background:#dcf1e8}#debug{font-size:10px}#results{position:absolute;z-index:3;top:50%;left:50%;transform:translate(-50%,-50%);width:min(480px,92%);max-height:95%;overflow:auto;background:#fff4ce;border:4px solid #21394b;border-radius:24px;box-shadow:0 8px #21394b;color:#21394b;padding:22px;text-align:center}#results h2{color:#8d468b;margin:8px 0}#results p{font-size:12px}#ranking{text-align:left;padding-left:25px;font-size:12px}#ranking li{margin:7px 0}#mvp{background:#ffdc73;border-radius:12px;padding:12px;font-size:20px}#again{width:100%}body.wardrobe-open{overflow:auto}body.wardrobe-open main{padding:20px}body.wardrobe-open #game{display:none}body.wardrobe-open #wardrobe{max-width:1200px;margin:auto}body.wardrobe-open #status{display:block}.urgent{color:#ff8c92!important}.target-hit{color:#ffe078}.reduced *{animation:none!important;scroll-behavior:auto!important}@media(max-width:700px){main{padding:16px}header b{font-size:32px}#character-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.character-card strong{font-size:13px}.character-card span{font-size:9px}.character-card canvas{max-width:120px}#lobby{gap:12px}#lobby h2{flex-basis:100%}.hud{gap:10px;padding:5px 10px}.brand-mini{font-size:14px}#timer{font-size:17px}#team{font-size:10px;max-width:110px}.scoreline{padding:0 10px 5px}#controls{padding:8px 10px;gap:8px}#controls button{min-width:50px;padding:8px 12px;font-size:12px}#roundhint{display:none}#controls>div{margin-right:auto;gap:8px}#game{grid-template-rows:50px 30px minmax(0,1fr) 80px}#map{width:105px;height:49px}#results{padding:12px}#results h2{font-size:23px}}@media(max-height:500px) and (orientation:landscape){#game{grid-template-rows:38px 24px minmax(0,1fr) 60px}.hud{padding:3px 12px}.brand-mini{font-size:14px}.brand-mini small{font-size:7px}#timer{font-size:16px}#team{font-size:11px}#controls{padding:5px 12px}#controls button{height:46px;min-width:60px;padding:6px 14px}#roundhint{font-size:10px}#results{padding:10px;max-height:98%}#results h2{font-size:20px}#results p{margin:5px}#mvp{margin:6px;padding:6px;font-size:16px}#ranking{font-size:10px;margin:5px}#ranking li{margin:3px}#map{width:90px;height:42px}}

@media(max-width:700px){.brand-mini{white-space:nowrap;flex-shrink:0}.brand-mini small{font-size:6px;letter-spacing:1px}.hud #timer{font-size:15px}.hud #team{max-width:90px}}

.mode-label{display:block;font-weight:800;margin:12px 0}select{font:inherit;font-weight:800;color:#203d51;background:#fff4d1;border:2px solid #203d51;border-radius:10px;padding:8px;max-width:100%}.sandbox #game{grid-template-rows:52px 44px minmax(0,1fr) 74px}#sandbox-tools{display:flex;align-items:center;gap:8px}#sandbox-tools select,#sandbox-tools button{font-size:13px;padding:6px 10px;min-height:34px}#toy-count{font-size:12px}#toy-menu{position:fixed;z-index:30;inset:50% auto auto 50%;transform:translate(-50%,-50%);width:min(390px,90vw);max-height:85dvh;overflow:auto;padding:20px;border:4px solid #203d51;border-radius:22px;background:#fff2d4;color:#203d51;box-shadow:0 0 0 100vmax #102838aa}#toy-menu button{margin:4px}#close-toys{float:right}#toy-menu p{font-size:14px}.sandbox .scoreline{justify-content:center}@media(max-width:600px){.sandbox #game{grid-template-rows:50px 44px minmax(0,1fr) 80px}}@media(max-height:500px) and (orientation:landscape){.sandbox #game{grid-template-rows:38px 38px minmax(0,1fr) 60px}}

#grab{background:#bded88}#drop{background:#edd6ff}.sandbox #controls{gap:6px}.sandbox #controls button{padding:8px 10px;min-width:48px}.sandbox #controls>div{gap:6px}@media(max-width:400px){#sandbox-tools{gap:4px}#sandbox-tools select,#sandbox-tools button{font-size:11px;padding:6px}.sandbox #controls{padding-inline:6px}.sandbox #controls button{font-size:11px;padding-inline:8px}#toy-count{font-size:10px}}

#special{background:#d5a0ff!important;font-size:10px!important}#special:disabled{opacity:.8}#controls{flex-wrap:wrap}#controls #drop{height:34px;font-size:10px;min-width:44px;padding:4px}body.playing #game{grid-template-rows:52px 44px minmax(0,1fr) 104px}@media(max-width:600px){#controls{gap:4px;padding:5px}#controls button{padding:6px;min-width:44px;font-size:11px}#controls>div{gap:4px}#special{order:5;height:30px!important}#drop{order:6}}

#special.ready{background:#ffe25e;color:#263d51;box-shadow:0 0 0 3px #fff2ab,0 0 18px #ffdc6680;font-weight:1000}#special.ready:active{transform:scale(.96)}

/* Toybox controls remain visible; large pictures are the first interaction. */
body.toybox-active #game{grid-template-rows:40px 36px minmax(0,1fr) 70px 86px}body.toybox-edit #game{grid-template-rows:40px 0px minmax(0,1fr) 0px 172px}body.toybox-edit .scoreline,body.toybox-edit #controls{visibility:hidden;overflow:hidden;padding:0}#toybox{grid-row:5;background:#203d51;padding:4px 8px;color:#fff1c5;min-height:0;position:relative}.box-actions{display:flex;justify-content:center;gap:5px}.box-actions button{min-height:38px;padding:5px 9px;font-size:12px;border-width:2px;box-shadow:0 2px #102b3b}.box-actions [data-box=play]{background:#b8ee8b}.box-actions [data-box=retry]{background:#ffda61}.box-actions [data-box=remix]{background:#c9b5f2}#box-drawer{display:flex;justify-content:center;gap:5px;overflow-x:auto;padding:6px 2px;scrollbar-width:thin}#box-drawer button{flex:0 0 68px;padding:1px 3px 3px;background:#fdf3d5;border-width:2px;border-radius:13px;box-shadow:none}#box-drawer button[aria-pressed=true]{background:#ffe16a;border-color:#c46cac}#box-drawer canvas{display:block;width:60px;height:50px}#box-drawer span{font-size:10px}.box-help{display:flex;justify-content:center;align-items:center;gap:12px;height:32px}.box-help button{padding:2px 12px;min-height:30px;border-width:1px;box-shadow:none}.box-help span{font-size:12px;font-weight:800;text-align:center;flex:1}#box-vote{position:absolute;bottom:100%;left:5%;width:90%;background:#fff1ca;color:#203d51;border:3px solid #203d51;padding:10px;border-radius:14px;z-index:10;text-align:center}#box-vote button{font-size:12px;padding:9px;margin:4px}body.toybox-active #toys{display:none}body.toybox-edit #camera-note{display:none}@media(max-width:550px){body.toybox-active #game{grid-template-rows:40px 36px minmax(0,1fr) 104px 86px}#box-drawer{justify-content:flex-start}#box-drawer{gap:4px}#box-drawer button{flex-basis:48px;padding-inline:1px}#box-drawer canvas{width:42px;height:43px}.box-actions{gap:3px}.box-actions button{font-size:10px;padding:4px 6px;min-height:38px}body.toybox-edit #game{grid-template-rows:40px 0 minmax(0,1fr) 0 164px}}@media(max-height:500px) and (orientation:landscape){body.toybox-active #game{grid-template-rows:30px 32px minmax(0,1fr) 50px 65px}body.toybox-edit #game{grid-template-rows:30px 0 minmax(0,1fr) 0 154px}#box-drawer{padding:3px}#box-drawer button{flex-basis:66px}#box-drawer canvas{width:48px;height:38px;margin:auto}.box-actions button{min-height:38px}.box-help{height:40px}.box-help button{min-height:38px}body.toybox-active #controls{flex-wrap:nowrap;padding:3px}body.toybox-active #controls button{height:40px!important;font-size:10px!important}}
body.toybox-active:not(.toybox-edit) .box-help{height:18px}body.toybox-active:not(.toybox-edit) .box-help button{display:none}
/* Room travel is always reachable without reopening the lobby. */
#session-bar{grid-row:6;display:flex;align-items:center;justify-content:center;gap:10px;background:#132f42;color:#fff1c5;padding:4px 8px;position:relative;min-height:48px}#session-switch{min-height:40px;font-size:12px;padding:5px 12px;border-width:2px;box-shadow:none;background:#a9e5e2}#session-hint{font-size:11px;max-width:300px}#session-vote{position:absolute;bottom:100%;left:5%;width:90%;z-index:20;border:3px solid #203d51;border-radius:16px;background:#fff1ca;color:#203d51;padding:14px;text-align:center}#session-vote strong,#session-vote span{display:block;margin:4px}#session-vote button{min-height:44px;font-size:12px;margin:5px;padding:8px}
body.lab-session #game{grid-template-rows:40px 36px minmax(0,1fr) 104px 0px 48px}body.lab-session.toybox-active #game{grid-template-rows:40px 36px minmax(0,1fr) 104px 70px 48px}body.lab-session.toybox-edit #game{grid-template-rows:40px 0px minmax(0,1fr) 0px 164px 48px}@media(max-height:500px) and (orientation:landscape){body.lab-session #game{grid-template-rows:30px 30px minmax(0,1fr) 46px 0px 44px}body.lab-session.toybox-active #game{grid-template-rows:30px 30px minmax(0,1fr) 46px 58px 44px}body.lab-session.toybox-edit #game{grid-template-rows:30px 0px minmax(0,1fr) 0px 135px 44px}#session-bar{min-height:44px}body.lab-session #box-drawer canvas{height:30px;width:38px}body.lab-session .box-help{height:26px}body.lab-session .box-help button{min-height:25px}body.lab-session .box-actions button{min-height:36px}}@media(max-width:550px){#session-hint{font-size:9px;max-width:160px}#session-switch{font-size:10px;padding:4px 8px}}

/* Live toy drawer overlays scenery, never the movement buttons. */
#toybox.drawer-open #box-drawer{position:absolute;bottom:100%;left:0;right:0;z-index:4;background:#203d51f5;border-top:3px solid #ffda61;padding:8px;justify-content:flex-start;touch-action:pan-x}
#toybox button{touch-action:manipulation;min-width:44px;min-height:44px}
#toybox .box-actions{overflow-x:auto;justify-content:flex-start}
#toybox .box-actions button{flex-shrink:0}
#toybox.drawer-open #box-drawer button{flex-basis:60px}
#toybox.drawer-open #box-drawer canvas{width:52px;height:44px}
#toybox.drawer-open #box-drawer{bottom:calc(100% + 70px)}
body.lab-session #toybox.drawer-open #box-drawer{bottom:calc(100% + 104px)}
@media(max-width:550px){#toybox.drawer-open #box-drawer{bottom:calc(100% + 104px)}}
@media(max-height:500px) and (orientation:landscape){#toybox.drawer-open #box-drawer{bottom:calc(100% + 50px)}body.lab-session #toybox.drawer-open #box-drawer{bottom:calc(100% + 46px)}}

@media(max-height:500px) and (orientation:landscape){body.lab-session.toybox-active:not(.toybox-edit) #game{grid-template-rows:30px 30px minmax(0,1fr) 46px 72px 44px}body.lab-session.toybox-active:not(.toybox-edit) .box-help{height:20px;font-size:10px}}

/* 09RC1: presentation only; reserve the arena for the actual action. */
#opening-hint{font-size:11px;color:#fff3b3;max-width:420px;line-height:1.2;pointer-events:none}
#team{background:linear-gradient(90deg,#ffe07830 var(--progress,0%),transparent var(--progress,0%));border-radius:5px;padding:3px 5px}
#timer.urgent{animation:countdown-breathe 1s ease-in-out infinite}
#results:not([hidden]) #mvp{animation:mvp-reveal .35s ease-out}
@keyframes countdown-breathe{50%{color:#ffe078}}
@keyframes mvp-reveal{from{opacity:.4;transform:translateY(6px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){#timer.urgent,#results:not([hidden]) #mvp{animation:none}}
@media(max-width:700px){#opening-hint{font-size:12px;max-width:190px}#scores:not([hidden])~#start{font-size:10px}}

/* 10C1: one shared experiment, outside the action and movement controls. */
body.chain-active.lab-session.toybox-active #game{grid-template-rows:40px 96px minmax(0,1fr) 104px 70px 48px}
body.chain-active.lab-session.toybox-edit #game{grid-template-rows:40px 96px minmax(0,1fr) 0px 164px 48px}
body.chain-active .scoreline{visibility:visible;overflow:hidden;flex-wrap:wrap;gap:2px;padding:3px 8px;align-content:center}
body.chain-active #opening-hint,body.chain-active #toy-count{display:none}
body.chain-active #sandbox-tools{height:28px}body.chain-active #sandbox-tools select{min-height:26px;font-size:11px;padding:2px 6px}
#chain-challenge{width:100%;display:grid;grid-template-columns:100px 1fr auto;align-items:center;gap:2px 8px;padding:3px 6px;border:1px solid #78977c;border-radius:10px;background:#294e54;color:#fff1bf}
#chain-challenge canvas{width:100px;height:36px}.chain-copy,.chain-result{display:flex;flex-direction:column}.chain-copy strong{font-size:13px;color:#ffdd71}.chain-copy span{font-size:10px}.chain-result{text-align:right}.chain-result strong{font-size:18px}.chain-result span{font-size:9px;color:#d1e9d0}
#chain-next{grid-column:1/-1;font-size:10px;text-align:center;line-height:1.2;min-height:13px}#chain-challenge.chain-won{border-color:#ffe275;background:#365d46}
@media(max-width:400px){#chain-challenge{grid-template-columns:72px 1fr auto;gap:2px 4px}#chain-challenge canvas{width:72px;height:28px}.chain-copy strong{font-size:11px}.chain-copy span{font-size:9px}.chain-result strong{font-size:16px}}
@media(max-height:500px) and (orientation:landscape){
body.chain-active.lab-session.toybox-active:not(.toybox-edit) #game{grid-template-rows:30px 60px minmax(0,1fr) 46px 72px 44px}
body.chain-active.lab-session.toybox-edit #game{grid-template-rows:30px 60px minmax(0,1fr) 0px 135px 44px}
body.chain-active .scoreline{flex-wrap:nowrap}body.chain-active #sandbox-tools{max-width:110px;flex-shrink:0}
#chain-challenge{width:auto;flex:1;grid-template-columns:90px 1fr auto;padding:2px 6px}#chain-challenge canvas{width:90px;height:30px}#chain-next{font-size:10px}
}


/* 10C2: personal records share the existing compact challenge strip. */
#chain-rivals{grid-column:1/-1;text-align:center;font-size:10px;color:#ffe078;line-height:1.2}
#chain-challenge{row-gap:1px}
@media(max-height:500px) and (orientation:landscape){#chain-rivals{grid-column:2;grid-row:2}#chain-next{grid-column:1/-1;font-size:9px}#chain-challenge canvas{grid-row:1/3}}

/* 10C3: share the footer row and return vertical space to the playfield. */
@media(min-width:700px){
body.chain-active.lab-session.toybox-active:not(.toybox-edit) #game{grid-template-rows:40px 70px minmax(0,1fr) 70px 64px 0px}
body.chain-active.lab-session.toybox-active:not(.toybox-edit) #toybox{grid-column:1;grid-row:5;padding-right:180px}
body.chain-active.lab-session.toybox-active:not(.toybox-edit) #session-bar{grid-column:1;grid-row:5;justify-self:end;align-self:start;width:172px;min-height:52px;background:transparent}
body.chain-active.lab-session.toybox-active:not(.toybox-edit) #session-hint{display:none}
body.chain-active.lab-session.toybox-active:not(.toybox-edit) #session-vote{width:min(600px,90vw);left:auto;right:8px}
body.chain-active.lab-session.toybox-active:not(.toybox-edit) .scoreline{flex-wrap:nowrap}
body.chain-active.lab-session.toybox-active:not(.toybox-edit) #chain-challenge{width:auto;flex:1}
body.chain-active.lab-session.toybox-active:not(.toybox-edit) #toybox.drawer-open #box-drawer{bottom:calc(100% + 70px)}
}
@media(max-height:500px) and (orientation:landscape) and (min-width:700px){
body.chain-active.lab-session.toybox-active:not(.toybox-edit) #game{grid-template-rows:30px 60px minmax(0,1fr) 46px 64px 0px}
body.chain-active.lab-session.toybox-active:not(.toybox-edit) #toybox.drawer-open #box-drawer{bottom:calc(100% + 46px)}
}

@media(min-width:700px){body.chain-active:not(.toybox-edit) #chain-rivals{grid-column:2;grid-row:2}body.chain-active:not(.toybox-edit) #chain-challenge canvas{grid-row:1/3}}

/* 10C5: tool choices live beside the action button, on demand. */
#controls{position:relative}
#controls #tool-toggle{min-width:48px;width:54px;padding:4px;font-size:9px;background:#fff0bf;flex-shrink:0}
#controls #tool-choices{position:absolute;bottom:calc(100% + 6px);right:8px;z-index:8;display:flex;gap:6px;margin:0;padding:8px;background:#203d5bf5;border:2px solid #ffda61;border-radius:14px}
#controls #tool-choices button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:64px!important;min-width:76px;font-size:12px!important;background:#fff1c5}
#tool-choices button span{font-size:24px}
#tool-choices button[aria-pressed=true]{outline:3px solid #ffcf51}
body.chain-active #sandbox-tools{display:none}
@media(max-width:699px) and (orientation:portrait){
body.chain-active.lab-session.toybox-active #game{grid-template-rows:40px 70px minmax(0,1fr) 104px 70px 48px}
body.chain-active.lab-session.toybox-edit #game{grid-template-rows:40px 70px minmax(0,1fr) 0px 164px 48px}
body.chain-active #controls{column-gap:4px}
body.chain-active #controls>div:not(#tool-choices){gap:4px;margin-right:0}
body.chain-active #controls button{min-width:44px;padding-inline:5px}
}

/* 10C6: one prominent Mayhem/SPECIAL control, replacing the crew map. */
#stage #special{position:absolute;top:8px;right:8px;z-index:4;width:126px;min-height:58px;padding:5px 7px!important;border:2px solid #ffdb72;border-radius:14px;box-shadow:0 3px 0 #132f42;background:#243d55!important;color:#fff4d1;overflow:hidden;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;opacity:1}
#stage #special .mayhem-fill{position:absolute;inset:0 auto 0 0;width:var(--charge,0%);background:#b578d8;transition:width .15s linear;pointer-events:none}
#stage #special strong,#stage #special .mayhem-detail{position:relative;z-index:1;pointer-events:none}
#stage #special strong{font-size:15px;letter-spacing:.5px}#stage #special .mayhem-detail{font-size:12px;font-weight:900}
#stage #special.ready{background:#ffe269!important;color:#21394b;animation:special-pulse 1.4s ease-in-out infinite}
#stage #special.ready .mayhem-fill{background:#ffe269}
@keyframes special-pulse{50%{box-shadow:0 0 0 4px #fff2a580,0 0 18px #ffd44c;filter:brightness(1.12)}}
#camera-note{max-width:calc(100% - 150px);font-size:8px}
#camera-home{position:absolute;top:39px;left:12px;z-index:4;min-height:44px;padding:5px 9px;font-size:11px;box-shadow:none}
body.reduced #stage #special.ready{animation:none}
@media(prefers-reduced-motion:reduce){#stage #special.ready{animation:none}#stage #special .mayhem-fill{transition:none}}
@media(max-height:500px) and (orientation:landscape){#stage #special{min-height:48px;width:120px;top:5px}#stage #special strong{font-size:13px}#stage #special .mayhem-detail{font-size:10px}}


/* Touch control prototype: fixed places, separate choosing from using.
   Movement stays left; grab/throw and equipped action never trade places. */
@media (max-width:699px), (pointer:coarse) {
 body.playing:not(.toybox-edit) #controls{display:grid;grid-template-columns:52px 52px minmax(12px,1fr) 64px 64px;grid-template-rows:48px 48px;gap:8px;padding:6px 8px;height:116px;align-items:stretch;justify-content:normal;flex-wrap:nowrap}
 body.playing:not(.toybox-edit) #game{grid-template-rows:40px 44px minmax(0,1fr) 116px}
 body.lab-session.toybox-active:not(.toybox-edit) #game{grid-template-rows:40px 36px minmax(0,1fr) 116px 76px 44px}
 body.chain-active.lab-session.toybox-active:not(.toybox-edit) #game{grid-template-rows:40px 70px minmax(0,1fr) 116px 76px 44px}
 #controls #roundhint{display:none}
 body.playing #controls #move-controls{grid-column:1/3;grid-row:2;display:flex;gap:8px;margin:0;align-items:stretch}
 body.playing #controls #move-controls button{width:52px;min-width:52px}
 body.playing #controls button{margin:0;min-width:0;min-height:48px;height:48px!important;padding:4px!important;font-size:12px!important;border-width:2px;box-shadow:0 2px #102b3b}
 body.playing #controls #tool-toggle{grid-column:1/3;grid-row:1;width:112px;min-width:112px;font-size:11px!important;background:#fff1c5}
 body.playing #controls #grab{grid-column:4;grid-row:1;background:#bded88}
 body.playing #controls #drop{grid-column:4;grid-row:2;background:#edd6ff}
 body.playing #controls [data-key=jump]{grid-column:5;grid-row:1;background:#9cdddd}
 body.playing #controls [data-key=action]{grid-column:5;grid-row:2;background:#ffbe74}
 body.playing #controls #tool-choices{left:8px;right:auto;bottom:calc(100% + 8px);max-width:calc(100vw - 16px);margin:0;z-index:20;gap:8px}
 body.playing #controls #tool-choices button{min-width:72px;min-height:64px;height:64px!important}
 body.playing #toybox .box-actions{gap:8px;justify-content:flex-start;overflow-x:auto;padding:2px 0 4px}
 body.playing #toybox .box-actions button{flex-shrink:0;min-height:44px;padding:5px 8px;font-size:11px}
 body.playing #toybox .box-help{height:24px}
 body.playing.chain-active.lab-session.toybox-active #toybox.drawer-open #box-drawer{bottom:calc(100% + 116px);max-width:calc(100vw - 16px)}
 body.playing #box-drawer button{min-width:52px;min-height:64px}
}
/* Landscape keeps one 48px action row, leaving room to see the experiment. */
@media (max-height:500px) and (orientation:landscape) and (min-width:540px) {
 body.playing:not(.toybox-edit) #controls{grid-template-columns:112px 96px minmax(0,1fr) 64px 64px 64px 64px;grid-template-rows:48px;gap:8px;padding:4px 8px;height:56px}
 body.lab-session.toybox-active:not(.toybox-edit) #game,body.chain-active.lab-session.toybox-active:not(.toybox-edit) #game{grid-template-rows:30px 50px minmax(0,1fr) 56px 52px 44px}
 body.playing #controls #move-controls{grid-column:1;grid-row:1}
 body.playing #controls #tool-toggle{grid-column:2;grid-row:1;width:96px;min-width:96px}
 body.playing #controls #grab{grid-column:4;grid-row:1}
 body.playing #controls #drop{grid-column:5;grid-row:1}
 body.playing #controls [data-key=action]{grid-column:6;grid-row:1}
 body.playing #controls [data-key=jump]{grid-column:7;grid-row:1}
 body.playing #toybox .box-help{display:none}
 body.playing.chain-active.lab-session.toybox-active #toybox.drawer-open #box-drawer{bottom:calc(100% + 56px)}
}

#startup-panel{background:#fff3c8;border:2px solid #21394b;border-radius:14px;padding:12px;margin:16px 0}#startup-panel p{margin:0 0 8px}#startup-panel button{min-height:44px}body.playing #startup-panel{display:none}

/* Short landscape: reserve the next instruction instead of clipping a third row. */
@media (max-height:500px) and (orientation:landscape) and (min-width:540px) {
 body.chain-active.lab-session.toybox-active:not(.toybox-edit) #game{grid-template-rows:30px 66px minmax(0,1fr) 56px 52px 44px}
 body.chain-active.lab-session.toybox-edit #game{grid-template-rows:30px 66px minmax(0,1fr) 0px 135px 44px}
 body.chain-active .scoreline{padding:3px 8px;align-content:stretch;align-items:stretch;min-width:0}
 body.chain-active #chain-challenge{min-width:0;width:100%;grid-template-columns:72px minmax(0,1fr) auto;grid-template-rows:14px 12px auto;gap:1px 6px;padding:2px 6px;align-items:center}
 body.chain-active #chain-challenge canvas{grid-column:1;grid-row:1/3;width:72px;height:26px}
 body.chain-active #chain-challenge .chain-copy{grid-column:2;grid-row:1;min-width:0}
 body.chain-active #chain-challenge .chain-copy strong{font-size:11px;line-height:14px}
 body.chain-active #chain-help{display:none}
 body.chain-active #chain-challenge .chain-result{grid-column:3;grid-row:1/3;line-height:1}
 body.chain-active #chain-rivals{grid-column:2;grid-row:2;font-size:10px;line-height:12px;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 body.chain-active #chain-next{grid-column:1/-1;grid-row:3;font-size:11px;line-height:13px;min-height:13px;white-space:normal;overflow-wrap:anywhere;text-align:center}
}

/* Keep every utility entry visible; infrequent world commands live in one panel. */
body.playing #toybox .box-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.45fr);gap:8px;overflow:visible}
body.playing #toybox .box-actions button{min-width:0;min-height:44px;white-space:normal;overflow-wrap:anywhere;font-size:11px;padding:4px}
body.playing.toybox-edit #toybox .box-actions{grid-template-columns:repeat(4,minmax(0,1fr))}
#box-options{position:absolute;bottom:100%;right:8px;width:min(320px,calc(100vw - 32px));max-height:min(320px,55dvh);overflow-y:auto;background:#203d51;border:2px solid #ffe078;border-radius:14px;padding:8px;z-index:25;box-shadow:0 4px 14px #102b3baa}
#box-options button{touch-action:pan-y;display:block;width:100%;min-height:44px;margin:0 0 8px;font-size:13px;padding:8px;white-space:normal}
#box-options p{font-size:12px;line-height:1.35;margin:4px;color:#fff1c5}
#box-options[hidden]{display:none}
@media (max-width:699px), (pointer:coarse){
 #stage #special{top:auto;bottom:8px;right:8px;width:120px;min-height:48px;padding:4px 6px}
 #stage #special strong{font-size:13px}
 #stage #special .mayhem-detail{font-size:10px}
 body.playing #toybox .box-help span{font-size:10px;line-height:12px}
}
/* Isolated delivery prototype: retain the shared controls without lab utilities. */
.delivery-race #timer{font-size:clamp(12px,1.7vw,20px);white-space:normal;line-height:1.1}
.delivery-race #opening-hint{white-space:normal;line-height:1.2;font-size:12px}
.delivery-race #grab{font-size:12px;line-height:1.05}
.delivery-race #results #ranking{display:none}
@media(max-width:700px){.delivery-race .brand-mini{display:none}.delivery-race .hud #timer{font-size:14px;flex:1}.delivery-race .hud #team{max-width:116px;font-size:10px}.delivery-race #opening-hint{font-size:10px}.delivery-race #grab{font-size:10px;padding:4px}}

/* Finished delivery rounds reclaim the hidden controls' grid tracks. Keep the
   winner, replay target and every player's ready count together in landscape. */
@media(max-height:500px) and (orientation:landscape){
 body.playing.delivery-complete #game{grid-template-rows:38px 0px minmax(0,1fr) 0px}
 body.playing.delivery-complete .scoreline{display:none}
 body.playing.delivery-complete #stage{grid-row:3}
 .delivery-race #results{display:grid;gap:8px;width:min(560px,calc(100% - 24px));max-height:calc(100% - 16px);padding:14px;overflow:auto}
 .delivery-race #results .eyebrow{font-size:10px;line-height:1.2}
 .delivery-race #results h2{font-size:22px;line-height:1.15;margin:0}
 .delivery-race #results #resultsummary{display:none}
 .delivery-race #results #mvp{display:block;margin:0;padding:3px 6px;font-size:12px;line-height:1.3;animation:none}
 .delivery-race #results #again{min-height:48px;line-height:1.2;padding:10px 14px;font-size:14px}
 .delivery-race #results #replayhint{margin:0;font-size:12px;line-height:1.4;overflow-wrap:anywhere}
}

/* Running courier keeps a single control row on short/coarse landscape phones. */
@media(max-height:500px) and (orientation:landscape) and (min-width:540px){
 body.playing.delivery-race:not(.delivery-complete) #game{grid-template-rows:34px 38px minmax(0,1fr) 56px}
 body.playing.delivery-race:not(.delivery-complete) #controls{height:56px;min-height:56px;padding:4px 8px;flex-wrap:nowrap}
}

/* The world is chosen once by a room's creator, never by a joining guest. */
#lobby .delivery-world-choice{flex-basis:100%;max-width:460px;display:flex;flex-direction:column;gap:8px;margin:4px 0}
#delivery-level{width:100%;min-height:48px;font-size:16px}
#delivery-level:focus-visible{outline:4px solid #a953bb;outline-offset:3px}
#lobby #delivery-level-detail{flex-basis:100%;max-width:680px;margin:0 0 8px;line-height:1.5}

/* Touch study 2026-11-05: superseded by the race-only control layout below.
   One horizontal stick, a reachable right-thumb jump, and explicit secondary
   actions. Lab/Mayhem retain their original nodes, labels, and geometry. */
#touch-tools,#race-stick,#race-control-settings{display:none}
body.delivery-race.playing{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
body.touch-controls-v2.playing .hud{display:grid;grid-template-columns:minmax(0,1fr) auto 48px;gap:8px;padding:4px 8px;align-items:center;min-width:0;background:#152634}
body.touch-controls-v2.playing .hud .brand-mini{display:none}
body.touch-controls-v2.playing .scoreline{display:flex;flex-wrap:wrap;gap:2px;padding:2px 10px;align-content:center;align-items:center;min-width:0;background:#1b3040;border-top:1px solid #ffffff12}
body.touch-controls-v2.playing .scoreline #team{display:block;order:0;flex-basis:100%;max-width:none;margin:0;padding:0;font-size:11px;line-height:12px;letter-spacing:.3px;color:#f2ca63}
body.touch-controls-v2.playing .scoreline #opening-hint{order:1;flex-basis:100%;max-width:none;font-size:11px;line-height:13px;color:#e8f0f4}
body.touch-controls-v2.playing .hud #timer{font-size:13px;line-height:1.2;white-space:normal;min-width:0;color:#fff}
body.touch-controls-v2.playing #menu{width:48px;height:48px;padding:0;font-size:22px;grid-column:3;background:#293e50;color:#fff;border:1px solid #8297a7;border-radius:8px}
body.touch-controls-v2.playing #touch-tools{position:relative;display:flex;align-items:center;gap:8px;grid-column:2;grid-row:1}
body.touch-controls-v2.playing #touch-tools #tool-toggle,body.touch-controls-v2.playing #touch-tools #drop{min-height:48px;padding:4px;font-size:11px;border:1px solid #8297a7;border-radius:8px;box-shadow:none;color:#fff;background:#293e50}
body.touch-controls-v2.playing #touch-tools #tool-toggle{width:88px}
body.touch-controls-v2.playing #touch-tools #drop{width:56px}
body.touch-controls-v2.playing #touch-tools #tool-choices{position:fixed;z-index:40;top:calc(env(safe-area-inset-top) + 60px);bottom:auto;left:auto;right:max(8px,env(safe-area-inset-right));display:flex;gap:8px;padding:8px;width:max-content;max-width:calc(100vw - 16px);margin:0;border:1px solid #8297a7;border-radius:12px;background:#152634;box-shadow:0 6px 20px #0008}
body.touch-controls-v2.playing #touch-tools #tool-choices button{width:76px;min-width:76px;min-height:72px;padding:6px;font-size:13px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;box-shadow:none;border:1px solid #8297a7;border-radius:8px;background:#293e50;color:#fff}
body.touch-controls-v2.playing #touch-tools #tool-choices button[aria-pressed=true]{outline:2px solid #f2ca63;outline-offset:1px}
body.touch-controls-v2.playing:not(.toybox-edit):not(.delivery-complete) #game{grid-template-rows:56px 40px minmax(0,1fr) 140px;background:#152634}
body.touch-controls-v2.playing:not(.toybox-edit) #controls{position:relative;display:grid;grid-template-columns:136px minmax(8px,1fr) 64px 76px;grid-template-rows:56px 60px;gap:8px;padding:8px;height:140px;min-height:140px;align-items:center;justify-content:normal;flex-wrap:nowrap;background:#152634;border-top:1px solid #6d829566}
body.touch-controls-v2.playing #controls #roundhint{display:none}
body.touch-controls-v2.playing #controls button{margin:0;min-width:0;min-height:56px;height:56px!important;padding:4px!important;font-size:15px!important;font-weight:800;letter-spacing:.4px;border:1px solid #91a8b9;border-radius:10px;box-shadow:none;line-height:1.1;color:#fff;background:#2b4356;transform:none}
body.touch-controls-v2.playing #controls #move-controls{grid-column:1;grid-row:1/3;display:grid;grid-template-columns:1fr;gap:8px;margin:0;width:100%;height:120px;align-self:center;align-items:center;position:relative}
body.touch-controls-v2.playing #controls #move-controls>button{display:none;width:100%;min-width:0;height:72px!important;font-size:24px!important;border-radius:10px;background:#2b4356}
body.touch-controls-v2.playing #controls #race-stick{display:flex;position:relative;flex-direction:column;align-items:center;justify-content:center;width:100%;height:120px;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;border:1px solid #647b8e;border-radius:18px;background:#203747;cursor:ew-resize;outline-offset:3px}
#race-stick:focus-visible{outline:3px solid #f2ca63}
#race-stick .stick-track{position:relative;display:flex;align-items:center;justify-content:space-between;width:100%;height:64px;padding:0 9px;pointer-events:none}
#race-stick .stick-track:before{content:"";position:absolute;left:16px;right:16px;top:29px;height:6px;border-radius:3px;background:#0f202c}
#race-stick .stick-thumb{position:absolute;left:calc(50% - 25px);top:7px;width:50px;height:50px;border:2px solid #d7e5ee;border-radius:50%;background:#5a778b;transform:translateX(var(--stick-offset,0px));box-shadow:0 2px 6px #0005;z-index:1}
#race-stick .stick-thumb:after{content:"";position:absolute;inset:17px;border:1px solid #e8f0f4;border-radius:50%}
#race-stick .stick-arrow{position:relative;color:#c3d4df;font-size:28px;line-height:1;font-weight:600}
#race-stick .stick-caption{font-size:10px;font-weight:800;letter-spacing:1.5px;color:#c3d4df;pointer-events:none}
#race-stick.steering{border-color:#f2ca63!important}
#race-stick.steering .stick-thumb{background:#f2ca63;border-color:#fff1b8}
#race-stick.steering .stick-thumb:after{border-color:#152634}
body.touch-controls-v2.playing.race-arrows #controls #move-controls{grid-template-columns:1fr 1fr}
body.touch-controls-v2.playing.race-arrows #controls #move-controls>button{display:block}
body.touch-controls-v2.playing.race-arrows #controls #race-stick{display:none}
body.touch-controls-v2.playing #controls #grab{grid-column:3/5;grid-row:1;width:100%;min-height:56px;height:56px!important;border-radius:10px;background:#2b4356;font-size:16px!important}
body.touch-controls-v2.playing #controls [data-key=action]{grid-column:3;grid-row:2;justify-self:center;width:64px;height:60px!important;min-height:60px;border-radius:10px;background:#2b4356}
body.touch-controls-v2.playing #controls [data-key=jump]{grid-column:4;grid-row:2;width:76px;height:60px!important;min-height:60px;border-radius:10px;background:#f2ca63;color:#152634;border-color:#ffe29a;font-size:16px!important}
body.touch-controls-v2.playing #controls button.held,body.touch-controls-v2.playing #controls button:active{background:#52748e;box-shadow:inset 0 0 0 2px #e5f3ff;filter:none;transform:none}
body.touch-controls-v2.playing #controls [data-key=jump].held{background:#ffe29a;color:#152634}
body.touch-controls-v2.playing #controls button:disabled{opacity:.4;box-shadow:none}
body.touch-controls-v2.playing #stage #special{top:8px;bottom:auto;right:8px;min-height:48px;width:112px;border:1px solid #91a8b9;border-radius:8px;box-shadow:none;background:#203747!important}
body.touch-controls-v2.playing #stage #special.ready{background:#f2ca63!important;color:#152634}
body.touch-controls-v2 #race-control-settings{display:grid;grid-template-columns:1fr auto;align-items:center;gap:8px;padding:12px 0;border-bottom:1px solid #21394b33}
#race-control-settings label{font-size:13px;font-weight:800}
#race-control-settings select{min-height:48px;font-size:14px;border-radius:8px}
#race-control-settings p{grid-column:1/-1;margin:0;font-size:12px;line-height:1.5}
body.touch-controls-v2.toybox-edit #touch-tools,body.touch-controls-v2.delivery-complete #touch-tools{display:none}
@media(max-width:359px){
 body.touch-controls-v2.playing:not(.toybox-edit) #controls{grid-template-columns:112px minmax(8px,1fr) 60px 72px}
 body.touch-controls-v2.playing #controls [data-key=jump]{width:72px}
 body.touch-controls-v2.playing #controls [data-key=action]{width:60px}
 body.touch-controls-v2.playing .hud{gap:6px}
 body.touch-controls-v2.playing .hud #timer{font-size:11px}
 body.touch-controls-v2.playing .scoreline #opening-hint{font-size:10px}
}
@media(max-height:500px) and (orientation:landscape) and (min-width:540px){
 body.touch-controls-v2.playing:not(.toybox-edit):not(.delivery-complete) #game{grid-template-rows:56px 30px minmax(0,1fr) 80px}
 body.touch-controls-v2.playing:not(.toybox-edit) #controls{grid-template-columns:minmax(104px,152px) minmax(8px,1fr) 72px 60px 72px;grid-template-rows:64px;gap:8px;padding:8px;height:80px;min-height:80px}
 body.touch-controls-v2.playing #controls #move-controls{grid-column:1;grid-row:1;width:100%;height:64px}
 body.touch-controls-v2.playing #controls #race-stick{height:64px;border-radius:14px}
 body.touch-controls-v2.playing #controls #race-stick .stick-caption{position:absolute;bottom:2px;font-size:8px}
 body.touch-controls-v2.playing #controls #race-stick .stick-track{height:58px;margin-bottom:6px}
 body.touch-controls-v2.playing #controls #race-stick .stick-thumb{top:7px;width:44px;height:44px;left:calc(50% - 22px)}
 body.touch-controls-v2.playing #controls #race-stick .stick-thumb:after{inset:14px}
 body.touch-controls-v2.playing #controls #move-controls>button{height:64px!important}
 body.touch-controls-v2.playing #controls #grab{grid-column:3;grid-row:1;width:72px;height:64px!important;font-size:14px!important}
 body.touch-controls-v2.playing #controls [data-key=action]{grid-column:4;grid-row:1;width:60px;height:64px!important;font-size:13px!important}
 body.touch-controls-v2.playing #controls [data-key=jump]{grid-column:5;grid-row:1;width:72px;height:64px!important}
}

/* Short race stages reserve the top-left strip for objective tracking. */
@media (orientation:landscape){body.delivery-race #camera-note{display:none}}


/* Directional race controls: one stable left-thumb zone, just two right actions.
   Classic stick and arrows retain the separate Jump layout above. */
#race-stick .stick-up-label,#race-stick .stick-down-label{display:none;pointer-events:none}
body.touch-controls-v2.playing.race-directional:not(.toybox-edit) #controls{grid-template-columns:136px minmax(8px,1fr) 76px 76px}
body.touch-controls-v2.playing.race-directional #controls [data-key=jump]{display:none}
body.touch-controls-v2.playing.race-directional #controls [data-key=action]{grid-column:3;grid-row:1/3;width:76px;height:76px!important;min-height:76px;font-size:15px!important}
body.touch-controls-v2.playing.race-directional #controls #grab{grid-column:4;grid-row:1/3;width:76px;height:76px!important;min-height:76px;background:#f2ca63;color:#152634;border-color:#ffe29a;font-size:15px!important}
body.touch-controls-v2.playing.race-directional #controls #race-stick{--stick-travel:28px;cursor:grab;border-radius:24px;overflow:hidden}
body.touch-controls-v2.playing.race-directional #controls #race-stick .stick-track{height:100%;margin:0;padding:0}
body.touch-controls-v2.playing.race-directional #controls #race-stick .stick-track:before{left:50%;right:auto;top:50%;width:calc(var(--stick-size,48px) + var(--stick-travel) + var(--stick-travel));height:calc(var(--stick-size,48px) + var(--stick-travel) + var(--stick-travel));transform:translate(-50%,-50%);border:1px solid #647b8e;border-radius:50%;background:#152634}
body.touch-controls-v2.playing.race-directional #controls #race-stick .stick-thumb{left:calc(50% - 24px);top:calc(50% - 24px);width:48px;height:48px;transform:translate(var(--stick-offset,0px),var(--stick-offset-y,0px));pointer-events:auto;touch-action:none;cursor:grab}
body.touch-controls-v2.playing.race-directional #controls #race-stick .stick-thumb:after{inset:16px}
body.touch-controls-v2.playing.race-directional #controls #race-stick .stick-arrow{display:none}
body.touch-controls-v2.playing.race-directional #controls #race-stick.steering,body.touch-controls-v2.playing.race-directional #controls #race-stick.steering .stick-thumb{cursor:grabbing}
body.touch-controls-v2.playing.race-directional #controls #race-stick .stick-caption{display:none}
body.touch-controls-v2.playing.race-directional #controls #race-stick .stick-up-label,body.touch-controls-v2.playing.race-directional #controls #race-stick .stick-down-label{display:block;position:absolute;left:0;right:0;text-align:center;font-size:10px;line-height:16px;font-weight:800;letter-spacing:.5px;color:#d7e5ee;z-index:2}
body.touch-controls-v2.playing.race-directional #controls #race-stick .stick-up-label{top:4px}
body.touch-controls-v2.playing.race-directional #controls #race-stick .stick-down-label{bottom:4px}
body.touch-controls-v2.playing.race-directional #controls #race-stick.stick-up .stick-up-label,body.touch-controls-v2.playing.race-directional #controls #race-stick.stick-down .stick-down-label{color:#ffe29a}
body.touch-controls-v2.playing.race-directional #controls #grab:active{background:#ffe29a;color:#152634}
@media(max-width:359px){
 body.touch-controls-v2.playing.race-directional #controls #race-stick{--stick-travel:24px}
 body.touch-controls-v2.playing.race-directional:not(.toybox-edit) #controls{grid-template-columns:112px minmax(8px,1fr) 72px 72px}
 body.touch-controls-v2.playing.race-directional #controls #grab,body.touch-controls-v2.playing.race-directional #controls [data-key=action]{width:72px;font-size:14px!important}
}
@media(max-height:500px) and (orientation:landscape) and (min-width:540px){
 body.touch-controls-v2.playing.race-directional:not(.toybox-edit):not(.delivery-complete) #game{grid-template-rows:56px 30px minmax(0,1fr) 112px}
 body.touch-controls-v2.playing.race-directional:not(.toybox-edit) #controls{grid-template-columns:136px minmax(8px,1fr) 76px 76px;grid-template-rows:96px;height:112px;min-height:112px}
 body.touch-controls-v2.playing.race-directional #controls #move-controls,body.touch-controls-v2.playing.race-directional #controls #race-stick{height:96px}
 body.touch-controls-v2.playing.race-directional #controls #grab,body.touch-controls-v2.playing.race-directional #controls [data-key=action]{grid-row:1;height:76px!important}
 body.touch-controls-v2.playing.race-directional #controls #race-stick{--stick-travel:20px}
}

/* Classic keeps a separate Jump while down on its stick still ducks. */
body.touch-controls-v2.playing.race-classic #controls #race-stick .stick-down-label{display:block;position:absolute;bottom:3px;left:0;right:0;text-align:center;font-size:9px;font-weight:800;color:#d7e5ee}
body.touch-controls-v2.playing.race-classic #controls #race-stick .stick-caption{visibility:hidden}
body.touch-controls-v2.playing.race-classic #controls #race-stick.stick-down .stick-down-label{color:#ffe29a}

/* The arrow alternative also has a held Duck target, inside the same zone. */
#move-controls [data-key=duck]{display:none}
body.touch-controls-v2.playing.race-arrows #controls #move-controls{grid-template-rows:56px 56px}
body.touch-controls-v2.playing.race-arrows #controls #move-controls>button{height:56px!important;min-height:56px}
body.touch-controls-v2.playing.race-arrows #controls #move-controls [data-key=left]{grid-column:1;grid-row:1}
body.touch-controls-v2.playing.race-arrows #controls #move-controls [data-key=right]{grid-column:2;grid-row:1}
body.touch-controls-v2.playing.race-arrows #controls #move-controls [data-key=duck]{display:block;grid-column:1/3;grid-row:2;font-size:13px!important}
@media(max-height:500px) and (orientation:landscape) and (min-width:540px){
 body.touch-controls-v2.playing.race-arrows:not(.toybox-edit):not(.delivery-complete) #game{grid-template-rows:56px 30px minmax(0,1fr) 112px}
 body.touch-controls-v2.playing.race-arrows:not(.toybox-edit) #controls{grid-template-rows:96px;height:112px;min-height:112px}
 body.touch-controls-v2.playing.race-arrows #controls #move-controls{grid-template-rows:44px 44px;height:96px}
 body.touch-controls-v2.playing.race-arrows #controls #move-controls>button{height:44px!important;min-height:44px}
}

/* Optional Steady grip. Standard geometry and full-speed commands stay unchanged.
   112 x 120 / 64 px grip and 136 x 104 / 56 px grip both leave 22 px
   circular travel with a 2 px inset; the 12/18 px diagonal needs 21.64 px. */
#race-thumb-feel-setting{display:grid;grid-template-columns:1fr auto;align-items:center;gap:8px;grid-column:1/-1}
body.touch-controls-v2.playing.race-directional.race-steady-thumb #controls #race-stick{--stick-size:64px;--stick-travel:26px}
body.touch-controls-v2.playing.race-directional.race-steady-thumb #controls #race-stick .stick-thumb{left:calc(50% - 32px);top:calc(50% - 32px);width:64px;height:64px}
body.touch-controls-v2.playing.race-directional.race-steady-thumb #controls #race-stick .stick-thumb:after{inset:23px}
@media(max-width:359px){
 body.touch-controls-v2.playing.race-directional.race-steady-thumb #controls #race-stick{--stick-travel:22px}
}
@media(max-height:500px) and (orientation:landscape) and (min-width:540px){
 body.touch-controls-v2.playing.race-directional.race-steady-thumb:not(.toybox-edit):not(.delivery-complete) #game{grid-template-rows:56px 30px minmax(0,1fr) 120px}
 body.touch-controls-v2.playing.race-directional.race-steady-thumb:not(.toybox-edit) #controls{grid-template-rows:104px;height:120px;min-height:120px}
 body.touch-controls-v2.playing.race-directional.race-steady-thumb #controls #move-controls,body.touch-controls-v2.playing.race-directional.race-steady-thumb #controls #race-stick{height:104px}
 body.touch-controls-v2.playing.race-directional.race-steady-thumb #controls #race-stick{--stick-size:56px;--stick-travel:22px}
 body.touch-controls-v2.playing.race-directional.race-steady-thumb #controls #race-stick .stick-thumb{left:calc(50% - 28px);top:calc(50% - 28px);width:56px;height:56px}
 body.touch-controls-v2.playing.race-directional.race-steady-thumb #controls #race-stick .stick-thumb:after{inset:19px}
}

/* Rival choice is a large, labelled select in the lobby and solo results. */
.race-difficulty-choice{flex-basis:100%}
#race-difficulty,#race-next-difficulty{min-height:48px;font-size:16px;padding:8px;border:2px solid #21394b;border-radius:8px;background:#fffaf0;color:#21394b;max-width:100%}
#race-difficulty:focus-visible,#race-next-difficulty:focus-visible{outline:4px solid #a953bb;outline-offset:3px}
#race-difficulty-detail{flex-basis:100%;margin:0;font-size:13px}
#race-result-difficulty{display:grid;grid-template-columns:1fr auto;align-items:center;gap:8px;text-align:left;margin:12px 0}
#race-result-difficulty label{font-weight:800;font-size:13px}
#race-next-difficulty-detail{grid-column:1/-1;font-size:12px;margin:0}

/* Isolated auto-running family race. The delivery and toybox layouts above are unchanged. */
body.chaos-race{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:#edf4eb;color:#243e4d}
body.chaos-race main{max-width:none;padding:0}
body.chaos-race [hidden]{display:none!important}
body.chaos-race button{touch-action:manipulation;border:1px solid #76918f;box-shadow:none;border-radius:12px;min-height:48px;font-family:inherit;font-weight:800;cursor:pointer;transition:none;transform:none}
body.chaos-race button:focus-visible,body.chaos-race a:focus-visible,body.chaos-race input:focus-visible,body.chaos-race select:focus-visible{outline:3px solid #bf98ee;outline-offset:3px}
body.chaos-race button:disabled{opacity:.45;cursor:default}
body.chaos-race button.held{box-shadow:inset 0 0 0 3px #fff5c4;filter:brightness(1.12)}
.race-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important}
.race-icon{display:block;width:28px;height:28px;flex:none;pointer-events:none}
.race-shell{max-width:1000px;margin:auto;padding:24px max(20px,env(safe-area-inset-right)) 30px max(20px,env(safe-area-inset-left))}
body.chaos-race .race-brand{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin:0 0 24px;padding-bottom:14px;border-bottom:1px solid #cadbd1}
body.chaos-race .race-brand b{font-size:25px;letter-spacing:-1.2px;color:#243e4d}
body.chaos-race .race-brand em{color:#9a648d;font-style:normal}
body.chaos-race h1{font-size:clamp(22px,4vw,36px);letter-spacing:-1.2px;line-height:1.05;margin:0;color:#243e4d}
.race-choose-heading{font-size:13px;letter-spacing:.2px;margin:0 0 14px;font-weight:600;color:#607971}
#race-character-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
body.chaos-race .race-character{min-width:0;display:flex;flex-direction:column;align-items:center;padding:8px 4px 14px;background:#f7f8ee;border:2px solid #c4d6ca;border-radius:18px;color:#243e4d;overflow:hidden}
body.chaos-race .race-character[aria-pressed=true]{background:#fff2bf;border-color:#9a648d;box-shadow:0 0 0 2px #9a648d}
.race-character canvas{display:block;width:100%;height:auto;max-width:150px}
.race-character strong{font-size:14px;line-height:20px}
.race-lobby-actions{display:grid;grid-template-columns:1fr 1fr;gap:25px;border-top:1px solid #cddfd3;padding-top:22px;margin-top:26px}
.race-lobby-actions>div{display:flex;flex-wrap:wrap;align-content:start;align-items:center;gap:8px}
.race-lobby-actions label{width:100%;font-size:11px;letter-spacing:.7px;font-weight:800;text-transform:uppercase;margin-bottom:3px}
body.chaos-race select,body.chaos-race input{min-height:48px;padding:8px 10px;border:1px solid #9bb5a7;border-radius:10px;background:#fcfcf5;font-size:16px;color:#243e4d}
#race-course{flex:1;min-width:140px}
body.chaos-race #create{background:#243e4d;color:#fff6d7;flex:1;font-size:13px;padding:12px}
.race-join-row{display:flex;gap:8px;width:100%}
#race-code{min-width:0;flex:1;letter-spacing:2px;font-weight:800;width:auto}
body.chaos-race #join{background:#e4eacb;color:#243e4d;font-size:12px;padding:12px 20px}
#race-lobby-status{font-size:12px;color:#617b73;line-height:1.5;margin:16px 0 0}
#race-lobby-status:empty{display:none}
.race-how{margin-top:16px;font-size:12px;color:#617b73}
.race-how summary{cursor:pointer;font-weight:700;padding:10px 0}
.race-how p{line-height:1.8;margin:4px 0}
.race-practice-link{font-size:12px;color:#6d7773;display:inline-block;margin-top:12px;padding:8px 0}
/* The arena owns the measured visible viewport. Safe areas protect controls. */
html.chaos-racing{overflow:hidden;overscroll-behavior:none;height:100%}
body.chaos-racing{position:fixed;inset:0;width:100%;height:100%;min-height:0;overflow:hidden;overscroll-behavior:none;background:#182f3b}
#race-game{position:fixed;left:var(--race-viewport-left,0px);top:var(--race-viewport-top,0px);width:var(--race-viewport-width,100vw);height:100vh;height:var(--race-viewport-height,100dvh);overflow:hidden;isolation:isolate;background:#182f3b;color:#f7f4de;--race-safe-left:max(12px,env(safe-area-inset-left));--race-safe-right:max(12px,env(safe-area-inset-right));--race-safe-top:max(8px,env(safe-area-inset-top));--race-safe-bottom:max(10px,env(safe-area-inset-bottom))}
#race-stage{position:absolute;inset:0;z-index:0;min-width:0;min-height:0;overflow:hidden;background:#a9dfe7}
#race-arena{width:100%;height:100%;display:block;touch-action:none}
.race-topbar{position:absolute;z-index:3;top:var(--race-safe-top);left:var(--race-safe-left);right:var(--race-safe-right);display:grid;grid-template-columns:minmax(0,1fr) minmax(56px,110px) 48px 44px;gap:8px;align-items:center;pointer-events:none}
.race-identity{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;align-items:center;min-width:0;width:168px;max-width:100%;height:48px;justify-self:start;padding:7px 10px;border:1px solid #e5f6ea44;border-radius:14px;background:#183a49d9;box-shadow:0 3px 10px #102a3420}
#race-position{font-size:23px;letter-spacing:-1px;line-height:1;font-weight:850;white-space:nowrap;font-variant-numeric:tabular-nums}
.race-progress-wrap{min-width:0;display:flex;flex-direction:column;justify-content:center;gap:1px}
.race-finish-label{display:flex;align-items:center;justify-content:space-between;gap:4px;color:#fff4ce;white-space:nowrap;line-height:12px;font-variant-numeric:tabular-nums}
.race-finish-label b{font-size:13px}
.race-finish-label span{display:flex;align-items:center;gap:2px;font-size:9px;letter-spacing:.3px}
.near-finish .race-finish-label{color:#ffe475}
.near-finish #race-progress i{background:#ffe475}
#race-progress{height:7px;flex-shrink:0;background:#dcecdf33;border-radius:4px;overflow:hidden}
#race-progress i{display:block;height:100%;width:0;background:#f4e5b4;border-radius:4px}
#race-course-name{font-size:9px;line-height:1.1;color:#a5ffe2;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
#race-course-name.is-boosting{display:block}
#race-course-name:before{content:'»';font-size:15px;line-height:8px;display:inline-block;margin-right:4px;vertical-align:-1px}
#race-charge{min-width:0;grid-column:2;background:#183a49d9;border:1px solid #e5f6ea44;border-radius:12px;padding:7px 9px;height:44px}
.race-charge-label{display:flex;justify-content:space-between;align-items:center;gap:5px;margin-bottom:4px;line-height:1;font-size:10px;color:#d4c0f4}
.race-charge-label .race-icon{width:14px;height:14px;stroke-width:2.8}
#race-charge-value{font-variant-numeric:tabular-nums}
#race-charge-track{height:4px;background:#d4c0f433;border-radius:4px;overflow:hidden}
#race-charge-track i{display:block;height:100%;background:#c6a8ef;border-radius:4px}
#race-charge.charged .race-charge-label{color:#f5d27c}
#race-charge.charged #race-charge-track i{background:#f5d27c}
body.chaos-race #race-special{grid-column:3;display:grid;place-items:center;width:48px;height:48px;min-height:48px;padding:7px;background:#f5d27c;color:#243e4d;border:2px solid #ffe9a7;pointer-events:auto;box-shadow:0 3px 0 #664a3166}
body.chaos-race #race-menu-open{grid-column:4;display:grid;place-items:center;min-height:44px;width:44px;height:44px;padding:8px;background:#203e4cc9;color:#fff4ce;border-color:#d2e7dc66;pointer-events:auto}
#race-menu-open .race-icon{width:23px;height:23px}
#race-countdown{position:absolute;top:26%;left:76%;right:3%;display:flex;justify-content:center;align-items:center;text-align:center;color:#203c4a;pointer-events:none;text-shadow:0 2px 0 #fff9df}
#race-countdown strong{font-size:76px;line-height:1;font-weight:900;font-variant-numeric:tabular-nums}
#race-stage-message{position:absolute;top:26%;left:50%;transform:translateX(-50%);max-width:75%;padding:8px 12px;border:1px solid #ecf3ce66;border-radius:10px;background:#1a3343e8;color:#fff3c5;font-size:12px;text-align:center;margin:0;pointer-events:none}
#race-portrait-hint{position:absolute;z-index:8;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:26px;padding:24px;background:#183442f5;text-align:center;color:#fff5d5}
body.chaos-race #race-portrait-leave{display:grid;place-items:center;background:#f5df9d;min-height:48px;width:56px;height:48px;padding:8px}
#race-actions{position:absolute;z-index:4;left:var(--race-safe-left);right:var(--race-safe-right);bottom:var(--race-safe-bottom);display:flex;justify-content:space-between;gap:24px;align-items:flex-end;pointer-events:none;user-select:none;-webkit-user-select:none}
#race-right-actions{display:flex;align-items:flex-end;gap:22px;flex:none}
body.race-jump-right #race-actions{flex-direction:row-reverse}
body.race-jump-right #race-right-actions{flex-direction:row-reverse}
#race-held-item{position:relative;flex:none}
#race-item-symbol{display:grid;place-items:center;pointer-events:none}
#race-item-symbol .race-icon{width:44px;height:44px;stroke-width:1.6}
.race-pie-symbol,.race-balloon-symbol,.race-speed-symbol{display:none}
#race-item-symbol[data-item=pie] .race-pie-symbol,#race-item-symbol[data-item=balloon] .race-balloon-symbol,#race-item-symbol[data-item=speed] .race-speed-symbol{display:block}
body.chaos-race #race-item{width:80px;height:74px;padding:6px 8px 12px;background:#214c5aef;border:2px solid #d5e6dfb3;border-radius:22px;color:#fff4ca;min-width:56px;min-height:56px;display:grid;place-items:center;touch-action:none;pointer-events:auto;box-shadow:0 4px 0 #15303c66;position:relative}
.race-item-directions{position:absolute;bottom:1px;left:0;right:0;font:700 18px/14px system-ui;letter-spacing:12px;padding-left:12px;color:#ebead8;pointer-events:none}
#race-item-aim{position:absolute;bottom:calc(100% + 7px);left:50%;transform:translateX(-50%);display:grid;place-items:center;width:64px;height:32px;border:2px solid #f9e4ac;border-radius:12px;background:#203e4cf2;color:#fff0bc;font:800 27px/1 system-ui;pointer-events:none}
#race-held-item[data-aim=cancel] #race-item-aim{color:#ffd7d2;border-color:#f3aea7}
#race-held-item[data-aim=cancel] #race-item{border-color:#f3aea7}
#race-held-item[data-aim=front] #race-item,#race-held-item[data-aim=back] #race-item{border-color:#ffe29b}
body.chaos-race #race-jump{width:112px;height:84px;border-radius:27px;background:#def0e6f2;border:2px solid #f6fff2;color:#203b48;display:grid;place-items:center;padding:10px;min-height:64px;touch-action:none;pointer-events:auto;box-shadow:0 4px 0 #36594e66}
#race-jump .race-icon{width:40px;height:40px;stroke-width:2.8}
body.chaos-race #race-burst{position:relative;flex:none;width:84px;height:84px;min-width:56px;min-height:56px;display:grid;place-items:center;padding:15px;border:0;border-radius:50%;background:#243e4df5;color:#ffda88;pointer-events:auto;touch-action:none;box-shadow:0 4px 0 #15303c66}
#race-burst>.race-icon{width:34px;height:34px;stroke-width:2.4}
.race-burst-ring{position:absolute;inset:0;width:100%;height:100%;fill:none;stroke-width:4;pointer-events:none;transform:rotate(-90deg)}
.race-burst-track{stroke:#ffda8833}
#race-burst-progress{stroke:#ffda88;stroke-dasharray:100 100;stroke-linecap:round}
#race-burst-time{position:absolute;bottom:9px;left:0;right:0;font-size:10px;line-height:12px;font-variant-numeric:tabular-nums;text-align:center}
body.chaos-race #race-burst.is-recharging{opacity:1;color:#f4e3bb}
#race-burst.is-recharging>.race-icon{width:26px;height:26px;transform:translateY(-6px);opacity:.75}
body.chaos-race #race-burst.is-bursting{background:#f9d57e;color:#263e4c}
#race-burst.is-bursting #race-burst-progress{stroke:#785827}
body.chaos-race [data-race-action].held{filter:brightness(1.12)}

.race-modal{position:fixed;z-index:50;left:calc(var(--race-viewport-left,0px) + var(--race-viewport-width,100vw) / 2);top:calc(var(--race-viewport-top,0px) + var(--race-viewport-height,100dvh) / 2);transform:translate(-50%,-50%);width:min(430px,calc(var(--race-viewport-width,100vw) - 28px));max-height:calc(var(--race-viewport-height,100dvh) - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain;padding:24px;border:2px solid #718e83;border-radius:20px;background:#f7f5e5;color:#243e4d;box-shadow:0 12px 45px #071b3966}
.race-modal h2{font-size:25px;letter-spacing:-.6px;margin:7px 0 12px;line-height:1.1}
.race-modal p{font-size:12px;line-height:1.5}
body.chaos-race .race-modal-close{float:right;display:grid;place-items:center;width:44px;min-height:44px;padding:8px;background:transparent;border:0;margin:-10px -10px 0 0}
.race-code-share{display:flex;gap:12px;align-items:center;margin:16px 0}
.race-code-share strong{font-size:24px;letter-spacing:4px}
body.chaos-race .race-code-share button{font-size:11px;background:#e4eacb;padding:8px 12px}
#race-roster{display:grid;grid-template-columns:1fr 1fr;list-style:none;margin:12px 0;padding:0;gap:7px;font-size:11px}
#race-roster li{padding:9px;background:#e7eddc;border-radius:8px}
#race-menu-notice{color:#927148;font-size:11px}
.race-menu-options{display:flex;gap:8px}
.race-menu-options button{flex:1;background:#e2e6d4;font-size:11px;padding:8px}
#race-final-ranking{list-style:decimal;margin:12px 0 20px;padding-left:25px;font-size:13px}
#race-final-ranking li{padding:9px 8px;border-bottom:1px solid #d6dfce}
#race-final-ranking li.is-you{background:#fff0b7;border-radius:6px}
#race-final-ranking li span{float:right;font-size:11px;color:#6e7e76}
body.chaos-race #race-replay{width:100%;background:#263f4c;color:#fff2cf;padding:12px;font-size:13px}
body.chaos-race .race-quiet-button{background:transparent;border-color:#aebfaf;width:100%;font-size:12px;padding:10px}
.race-rotation-modal{text-align:center;min-height:190px}
.race-rotation-glyph{width:128px;height:128px;color:#b8a0d4;margin:auto;flex:none}
.race-rotation-glyph svg{width:100%;height:100%;display:block}
.race-phone-outline{transform-origin:64px 64px;animation:race-phone-turn 2.8s ease-in-out infinite}
.race-rotation-arrow{opacity:.55}
@keyframes race-phone-turn{0%,15%{transform:rotate(0deg)}55%,85%{transform:rotate(90deg)}100%{transform:rotate(0deg)}}
@media(max-width:600px){.race-shell{padding:18px 16px 24px}body.chaos-race .race-brand{margin-bottom:24px}#race-character-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.race-character canvas{max-width:110px}body.chaos-race .race-character{padding-bottom:10px}.race-character strong{font-size:13px}.race-lobby-actions{grid-template-columns:1fr;gap:18px;padding-top:17px}}
@media(orientation:landscape) and (max-height:540px){#race-game{--race-safe-top:max(5px,env(safe-area-inset-top));--race-safe-bottom:max(8px,env(safe-area-inset-bottom))}body.chaos-race #race-jump{height:74px;width:104px;border-radius:24px}body.chaos-race #race-item{height:64px;width:72px}body.chaos-race #race-burst{width:74px;height:74px}#race-countdown strong{font-size:64px}.race-modal{width:min(520px,calc(var(--race-viewport-width,100vw) - 28px));padding:16px 20px}#race-final-ranking{columns:2;column-gap:30px;margin:8px 0 12px;font-size:12px}#race-final-ranking li{break-inside:avoid;padding:6px 4px}.race-modal h2{font-size:21px;margin:4px 0 8px}.race-modal p{margin:7px 0;font-size:11px}}
@media(orientation:landscape) and (max-height:320px){body.chaos-race #race-jump{width:92px;height:64px}body.chaos-race #race-item{width:64px;height:56px}body.chaos-race #race-burst{width:64px;height:64px}#race-right-actions{gap:18px}#race-item-symbol .race-icon{width:36px;height:36px}#race-countdown{top:29%;left:76%;right:3%}#race-countdown strong{font-size:50px}}
@media(max-width:650px){.race-menu-options{flex-wrap:wrap}.race-menu-options button{min-width:110px}}
#race-modal-backdrop{position:fixed;z-index:49;inset:0;background:#102733ad;touch-action:none}
body.chaos-racing.race-portrait-blocked .race-topbar,body.chaos-racing.race-portrait-blocked #race-actions{visibility:hidden}
/* These classes use measured visible dimensions, not the taller layout viewport. */
body.race-compact-view #race-game{--race-safe-top:max(5px,env(safe-area-inset-top));--race-safe-bottom:max(8px,env(safe-area-inset-bottom))}
body.chaos-race.race-compact-view #race-jump{height:74px;width:104px;border-radius:24px}
body.chaos-race.race-compact-view #race-item{height:64px;width:72px}
body.chaos-race.race-compact-view #race-burst{width:74px;height:74px}
body.race-short-view #race-course-name:not(.is-boosting){display:none}
body.chaos-race.race-short-view #race-jump{width:92px;height:64px}
body.chaos-race.race-short-view #race-item{width:64px;height:56px}
body.chaos-race.race-short-view #race-burst{width:64px;height:64px}
body.race-short-view #race-right-actions{gap:18px}
body.race-short-view #race-item-symbol .race-icon{width:36px;height:36px}
body.race-short-view #race-burst-time{bottom:6px;font-size:9px}
body.race-short-view #race-countdown{top:29%;left:76%;right:3%}
body.race-short-view #race-countdown strong{font-size:50px}
body.race-low-view #race-countdown{top:23%}
body.race-small-view .race-topbar{grid-template-columns:minmax(0,1fr) 64px 48px 44px;gap:5px}
body.race-small-view .race-identity{padding:6px;gap:5px}
body.race-small-view #race-position{font-size:20px}
body.race-small-view #race-charge{padding-inline:7px}
body.race-small-view #race-actions{gap:12px}
body.race-small-view #race-right-actions{gap:18px}
body.race-zoomed-view #race-actions{gap:8px}
body.race-zoomed-view #race-right-actions{gap:10px}
body.chaos-race.race-zoomed-view #race-item,body.chaos-race.race-zoomed-view #race-burst{width:56px;min-width:56px;height:56px}
body.chaos-race.race-zoomed-view #race-jump{width:64px}
body.race-reduced-motion .race-phone-outline{animation:none;transform:rotate(90deg)}
@media(prefers-reduced-motion:reduce){body.chaos-race *{scroll-behavior:auto!important}.race-phone-outline{animation:none;transform:rotate(90deg)}}

/* Landscape lobby keeps the artwork and primary race action above the fold
   on a typical phone. Very short windows still scroll normally. */
@media(orientation:landscape) and (max-height:540px){
 .race-shell{padding:12px max(24px,env(safe-area-inset-right)) 14px max(24px,env(safe-area-inset-left))}
 body.chaos-race .race-brand{margin-bottom:14px;padding-bottom:10px}
 body.chaos-race .race-brand b{font-size:19px}
 body.chaos-race h1{font-size:23px}
 .race-choose-heading{font-size:11px;margin-bottom:8px}
 #race-character-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:10px}
 .race-character canvas{max-width:92px}
 body.chaos-race .race-character{padding:4px 4px 8px}
 .race-character strong{font-size:13px}
 .race-lobby-actions{grid-template-columns:1fr 1fr;gap:20px;margin-top:14px;padding-top:14px}
 .race-lobby-actions label{font-size:10px}
 .race-practice-link{margin-top:4px;font-size:11px}
}

/* Race visual direction: warm illustrated cards inside a midnight-teal arcade.
   Presentation only. Existing artwork, semantics and viewport geometry are intact. */
body.chaos-race{
 --race-ink:#173b43;--race-cream:#fff5dc;--race-gold:#f4cc70;
 color:var(--race-cream);background-color:#122f36;
 background-image:radial-gradient(ellipse at 12% 0%,#3c69614d,transparent 55%),radial-gradient(ellipse at 100% 90%,#d8a95612,transparent 55%),linear-gradient(135deg,#183c42,#102a32);
}
body.chaos-race .race-shell{max-width:1120px;padding-top:36px;padding-bottom:32px}
body.chaos-race .race-brand{position:relative;align-items:center;border-bottom:1px solid #d5e9d424;padding-bottom:22px;margin-bottom:26px}
body.chaos-race .race-brand b{font-size:18px;letter-spacing:1.3px;color:#f5e6c5;text-shadow:none;font-weight:850}
body.chaos-race .race-brand em{color:#92c7bb}
body.chaos-race .race-brand h1{color:#fff2d1;font-size:clamp(26px,4vw,44px);font-weight:900;letter-spacing:-1.7px;line-height:1.08;text-shadow:0 3px 0 #081c244d}
body.chaos-race .race-choose-heading{color:#c5d7cb;font-weight:750;letter-spacing:1.6px;text-transform:uppercase;font-size:11px;margin-bottom:16px}
body.chaos-race #race-character-grid{gap:13px}
body.chaos-race .race-character{
 position:relative;isolation:isolate;padding:11px 5px 14px;border:2px solid #ecdfbf;
 border-radius:20px;color:var(--race-ink);
 background:radial-gradient(ellipse at 50% 42%,#fffdf5 0%,#f8f0d9 62%,#e5dabb 100%);
 box-shadow:0 5px 0 #081e28,0 12px 24px #031a2829;
}
body.chaos-race .race-character::before{
 content:'';position:absolute;z-index:-1;width:75%;aspect-ratio:1;border-radius:50%;top:12%;left:12.5%;
 background:var(--racer-color,#e2cb9c);opacity:.18;
}
body.chaos-race .race-character::after{content:'';position:absolute;left:22%;right:22%;bottom:0;height:4px;background:var(--racer-color,#e2cb9c);border-radius:4px 4px 0 0}
body.chaos-race .race-character canvas{position:relative;filter:drop-shadow(0 5px 3px #4a3c2424)}
body.chaos-race .race-character strong{font-size:14px;font-weight:850;letter-spacing:.1px;line-height:22px}
body.chaos-race .race-character[aria-pressed=true]{background:radial-gradient(ellipse at 50% 40%,#fff9e6,#f8df9a);border-color:#ffdb7c;box-shadow:0 0 0 3px #eec46c45,0 5px 0 #816032,0 12px 28px #041b2840}
body.chaos-race .race-character[aria-pressed=true]::before{opacity:.3}
body.chaos-race .race-character[aria-pressed=true]::after{left:0;right:0;height:5px;background:#c3913e;border-radius:0}
body.chaos-race .race-lobby-actions{gap:24px;border:1px solid #d0e8d425;background:linear-gradient(120deg,#3b615336,#20454e26);border-radius:18px;padding:20px;margin-top:28px;box-shadow:inset 0 1px 0 #e4f0cf0a}
body.chaos-race .race-lobby-actions>div{gap:9px}
body.chaos-race .race-lobby-actions label{color:#c7d6c7;letter-spacing:1.3px;font-size:10px;margin-bottom:3px}
body.chaos-race #race-course,body.chaos-race #race-code{color:#203e43;background:#fff5de;border:1px solid #e1d5b6;border-radius:10px;box-shadow:inset 0 2px 3px #314c3710}
body.chaos-race #race-code::placeholder{color:#6f7d71;font-size:12px;letter-spacing:1.6px;opacity:1}
body.chaos-race #create{color:#283b37;background:linear-gradient(#ffdc83,#efc366);border:1px solid #ffe4a0;box-shadow:0 3px 0 #886335;font-size:13px;letter-spacing:.5px;border-radius:10px}
body.chaos-race #join{color:#edf1d6;background:#375c59;border:1px solid #739086;box-shadow:0 3px 0 #0d2930;border-radius:10px;letter-spacing:.8px}
body.chaos-race #race-lobby-status{color:#d8dfc9}
body.chaos-race .race-practice-link{color:#afc8bd;text-decoration-color:#afc8bd66;text-underline-offset:4px;font-weight:600;margin-top:16px}
body.chaos-race #startup-panel{color:#e8ddba;font-size:12px}
body.chaos-race #race-lobby button:focus-visible,body.chaos-race #race-lobby a:focus-visible,body.chaos-race #race-lobby input:focus-visible,body.chaos-race #race-lobby select:focus-visible{outline:3px solid #e8bafb;outline-offset:5px}
@media(hover:hover){
 body.chaos-race .race-character:not(:disabled):hover{border-color:#ffe6a7;filter:brightness(1.035)}
 body.chaos-race #create:not(:disabled):hover{background:linear-gradient(#ffe7a2,#f7cf7b)}
 body.chaos-race #join:not(:disabled):hover{background:#436e66}
 body.chaos-race .race-practice-link:hover{color:#fff0c9}
}
body.chaos-race #create:not(:disabled):active,body.chaos-race #join:not(:disabled):active{box-shadow:inset 0 2px 4px #0b263533}
@media(max-width:600px){
 body.chaos-race .race-shell{padding:24px max(16px,env(safe-area-inset-right)) 24px max(16px,env(safe-area-inset-left))}
 body.chaos-race .race-brand{gap:12px;align-items:flex-start;margin-bottom:22px;padding-bottom:20px}
 body.chaos-race .race-brand b{font-size:14px;letter-spacing:1px}
 body.chaos-race .race-brand h1{width:100%;font-size:32px;letter-spacing:-1.1px}
 body.chaos-race #race-character-grid{gap:12px 10px}
 body.chaos-race .race-character{border-radius:16px;padding:6px 4px 10px}
 body.chaos-race .race-character strong{font-size:13px}
 body.chaos-race .race-lobby-actions{padding:16px;gap:20px;margin-top:24px}
 body.chaos-race #race-course{min-width:125px}
}
/* Preserve the compact six-card lobby and action visibility on landscape phones. */
@media(orientation:landscape) and (max-height:540px){
 body.chaos-race .race-shell{padding:12px max(24px,env(safe-area-inset-right)) 14px max(24px,env(safe-area-inset-left))}
 body.chaos-race .race-brand{align-items:center;gap:12px;margin-bottom:12px;padding-bottom:10px}
 body.chaos-race .race-brand b{font-size:14px;letter-spacing:1px}
 body.chaos-race .race-brand h1{font-size:24px;width:auto;letter-spacing:-.8px}
 body.chaos-race .race-choose-heading{font-size:10px;margin-bottom:8px}
 body.chaos-race #race-character-grid{gap:10px}
 body.chaos-race .race-character{padding:4px 4px 8px;border-radius:14px}
 body.chaos-race .race-character strong{font-size:12px;line-height:18px}
 body.chaos-race .race-lobby-actions{gap:20px;margin-top:14px;padding:10px 12px;border-radius:13px}
 body.chaos-race .race-lobby-actions label{font-size:9px;margin-bottom:0}
 body.chaos-race .race-practice-link{margin-top:4px;font-size:11px}
}
@media(orientation:landscape) and (max-height:320px){
 body.chaos-race .race-shell{padding-top:8px}
 body.chaos-race .race-brand{padding-bottom:7px;margin-bottom:8px}
 body.chaos-race .race-character canvas{max-width:68px}
 body.chaos-race .race-lobby-actions{margin-top:10px;padding:8px 10px}
}

/* Flexible tracks must not let a room field force JOIN outside the viewport.
   Short narrow landscape screens scroll vertically, never shrink touch targets. */
body.chaos-race .race-lobby-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
body.chaos-race .race-lobby-actions>div,body.chaos-race .race-join-row{min-width:0;max-width:100%}
body.chaos-race #race-code{min-width:0;width:0}
@media(max-width:600px){
 body.chaos-race .race-lobby-actions{grid-template-columns:minmax(0,1fr)}
}


#race-item[data-item=speed] .race-item-directions{visibility:hidden}
#race-item[data-item=speed]{background:#fff0b5;color:#294f60}

/* Six worlds: image-first choices, no reading required to recognize a setting.
   Tight landscape phones scroll the lobby, never crop a start/join control. */
body.chaos-race .race-world-heading{margin-top:24px;margin-bottom:10px}
#race-world-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}
body.chaos-race .race-world{position:relative;isolation:isolate;display:block;padding:0;min-width:0;height:126px;border:2px solid #547571;border-radius:17px;background:#294e56;overflow:hidden;box-shadow:0 4px 0 #071f28;text-align:left;color:#fff7dd;transition:border-color .15s,box-shadow .15s}
.race-world img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:50% 60%;z-index:-2;pointer-events:none}
.race-world::before{content:'';position:absolute;inset:0;z-index:-1;background:linear-gradient(0deg,#071c2cf0,transparent 72%);pointer-events:none}
.race-world strong{position:absolute;left:13px;right:25px;bottom:10px;font-size:15px;font-weight:850;text-shadow:0 2px 4px #071e2e}
.race-world-check{position:absolute;right:8px;top:8px;display:none;width:23px;height:23px;border-radius:50%;background:#ffe099;color:#173e46;font-size:16px;font-weight:900;text-align:center;line-height:23px;box-shadow:0 2px 5px #0a2b3c70}
body.chaos-race .race-world[aria-pressed=true]{border-color:#ffdc7d;box-shadow:0 0 0 2px #ffdf8429,0 4px 0 #8a693e}
.race-world[aria-pressed=true] .race-world-check{display:block}
body.chaos-race .race-lobby-actions{margin-top:18px}
@media(hover:hover){body.chaos-race .race-world:hover{border-color:#f4d58b}}
@media(max-width:600px){#race-world-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}body.chaos-race .race-world{height:108px;border-radius:13px}.race-world strong{font-size:13px;left:10px;bottom:9px}}
@media(orientation:landscape) and (max-height:540px){body.chaos-race .race-world-heading{margin-top:15px;margin-bottom:8px}#race-world-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:9px}body.chaos-race .race-world{height:86px;border-radius:11px}.race-world strong{font-size:11px;line-height:1.16;left:8px;right:8px;bottom:7px}.race-world-check{right:5px;top:5px;width:19px;height:19px;line-height:19px;font-size:13px}body.chaos-race .race-lobby-actions{margin-top:12px}}

.race-setup{display:contents}
@media(orientation:landscape) and (max-height:540px){
 body.chaos-race .race-brand{min-height:34px;padding-bottom:8px;margin-bottom:10px}
 body.chaos-race .race-brand h1{margin:0;font-size:23px}
 body.chaos-race .race-brand .ce-return{min-height:32px;padding:7px 10px;font-size:10px}
 .race-setup{display:grid;grid-template-columns:1fr 1.2fr;gap:20px}
 body.chaos-race .race-world-heading{margin:0 0 8px}
 body.chaos-race #race-character-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
 body.chaos-race .race-character{padding:1px 3px 3px;border-radius:11px}
 body.chaos-race .race-character canvas{max-width:72px}
 body.chaos-race .race-character strong{font-size:10px;line-height:13px}
 #race-world-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
 body.chaos-race .race-world{height:87px}
 body.chaos-race .race-lobby-actions{padding:8px 10px;margin-top:12px;align-items:center}
 body.chaos-race .race-lobby-actions label{display:none}
 body.chaos-race .race-lobby-actions #create{width:100%;min-height:40px}
 body.chaos-race .race-lobby-actions #race-code,body.chaos-race .race-lobby-actions #join{min-height:40px}
 body.chaos-race .race-controls-open{height:40px;min-height:40px;margin:10px 10px 0 0;padding:5px 13px;display:inline-flex;vertical-align:middle}
 body.chaos-race .race-controls-open .race-icon{width:23px;height:23px}
}
@media(orientation:landscape) and (max-height:340px){
 body.chaos-race .race-shell{padding-top:8px}
 body.chaos-race .race-brand{padding-bottom:5px;margin-bottom:6px}
 body.chaos-race .race-character canvas{max-width:55px}
 body.chaos-race .race-world{height:71px}
 body.chaos-race .race-lobby-actions{margin-top:8px;padding:6px 8px}
 .race-setup{gap:14px}
}

/* Keep the game scale independent of Safari toolbar expansion/collapse.
   svh follows device orientation, but not retracting browser chrome. */
#race-camera-height{position:absolute;top:0;left:0;width:0;height:100%;height:100svh;visibility:hidden;pointer-events:none}
#race-game{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}

/* Earned special: an inked comic ticket; its rectangular thumb target is unchanged. */
body.chaos-race #race-actions{--special-bottom:100px;--special-height:64px;--special-width:168px}
body.chaos-race #race-actions #race-special{position:absolute;right:0;left:auto;bottom:var(--special-bottom);width:var(--special-width);height:var(--special-height);min-height:var(--special-height);display:flex;gap:9px;align-items:center;justify-content:center;padding:8px 15px 8px 9px;border-radius:18px 11px 18px 11px;border:3px solid #254653;background:linear-gradient(160deg,#fff4bc 0%,#ffd75d 48%,#f3aa3c 100%);color:#193d4a;box-shadow:inset 0 0 0 2px #fff1b4,inset 0 -5px 0 #d5913266,0 4px 0 #193e4a,0 6px 12px #132e3b35;pointer-events:auto;touch-action:none}
body.chaos-race #race-special .race-icon{width:34px;height:34px;flex:none;padding:6px;border-radius:0;background:#234956;color:#fff0b1;clip-path:polygon(50% 0,61% 20%,82% 9%,80% 32%,100% 40%,82% 55%,94% 77%,68% 76%,56% 100%,43% 80%,20% 94%,22% 69%,0 59%,19% 43%,7% 20%,33% 23%);transform:rotate(-8deg)}
#race-special span{display:grid;gap:4px;text-align:left}#race-special b{font-size:11px;letter-spacing:1px}#race-special small{font-size:10px;max-width:104px;line-height:1.1;font-weight:800}
.race-special-ready-mark{position:absolute;right:-5px;top:-6px;display:grid;place-items:center;width:22px;height:22px;border:2px solid #fff2b7;border-radius:7px 4px 7px 4px;background:#285d59;color:#fff4c4;font:bold 13px sans-serif;font-style:normal}
body.chaos-race #race-actions #race-special:active{transform:translateY(2px);box-shadow:inset 0 1px 4px #91662255,0 1px 0 #a97927}
body.chaos-race #race-actions #race-special:focus-visible{outline:3px solid white;outline-offset:4px}
body.chaos-race.race-jump-right #race-actions #race-special,body.race-jump-right #race-special-tip{left:0;right:auto}
#race-special-tip{position:absolute;right:0;bottom:calc(var(--special-bottom) + var(--special-height) + 16px);width:190px;padding:11px 40px 11px 12px;border:2px solid #ffe399;border-radius:14px;background:#193f4deb;color:#fff5cc;box-shadow:0 4px 10px #102e3d33;text-align:left;font:bold 12px/1.3 sans-serif;pointer-events:none}
#race-special-tip .race-special-tip-arrow{position:absolute;bottom:-30px;right:54px;color:#fff0a8;font:bold 30px sans-serif;text-shadow:0 2px #19404e}
#race-special-tip-close{position:absolute;right:0;top:0;width:40px;height:40px;min-width:40px;min-height:40px;margin:0;padding:0;border:0;border-radius:12px;background:transparent;color:#fff5cc;font:24px sans-serif;pointer-events:auto;touch-action:manipulation}
@media(max-height:540px){body.chaos-race #race-actions{--special-bottom:88px;--special-height:60px;--special-width:160px}}
@media(max-height:320px){body.chaos-race #race-actions{--special-bottom:76px;--special-height:56px;--special-width:152px}#race-special-tip{width:180px;padding-top:8px;padding-bottom:8px}}

/* A local-player journey, sharing the existing HUD footprint and no input area. */
body.chaos-race .race-topbar,body.chaos-race.race-small-view .race-topbar{grid-template-columns:minmax(68px,1fr) auto minmax(68px,1fr);gap:8px}
body.chaos-race .race-identity{grid-column:2;grid-row:1;justify-self:center;position:relative;width:320px;height:56px;padding:6px 12px;gap:10px}
body.chaos-race .race-progress-wrap{gap:8px;padding-right:12px}
body.chaos-race .race-finish-label{line-height:14px;gap:8px}
body.chaos-race .race-finish-label b{font-size:12px;letter-spacing:.1px}
body.chaos-race .race-finish-label span{font-size:10px}
body.chaos-race #race-progress{position:relative;height:10px;overflow:visible;margin:0 5px 3px 13px;background:#6e8791;border:1px solid #aec3c4;border-radius:8px}
body.chaos-race #race-progress i{background:#89e6cc;border-radius:8px}
#race-progress-marker{position:absolute;left:0;top:50%;transform:translate(-50%,-50%);display:flex;align-items:center;gap:1px;padding:2px 4px;border:2px solid #fff3c5;border-radius:12px;background:#244e60;color:#fff9df;box-shadow:0 1px 3px #102c46;font:900 8px system-ui;z-index:2;pointer-events:none}
.race-progress-flag{position:absolute;right:-12px;bottom:0;font-size:24px;line-height:22px;color:#fff6d4;text-shadow:1px 1px #183a49;pointer-events:none}
.race-progress-half{position:absolute;left:50%;top:1px;height:6px;border-left:2px solid #183a49;pointer-events:none}
body.chaos-race .milestone .race-finish-label b{color:#ffe080}
body.chaos-race .near-finish #race-progress i{background:#ffe080}
@media(max-height:320px){body.chaos-race .race-identity{height:48px;width:300px;padding:4px 9px;gap:8px}body.chaos-race .race-progress-wrap{gap:6px}body.chaos-race .race-finish-label b{font-size:11px}body.chaos-race #race-course-name{position:absolute;left:6px;top:52px;background:#183a49e8;border-radius:6px;padding:2px 5px}}
@media(max-width:580px){body.chaos-race .race-identity{width:290px}body.chaos-race .race-topbar{gap:5px}body.chaos-race .race-finish-label span{font-size:9px}}

body.chaos-race #race-course-name{position:absolute;left:6px;top:62px;background:#183a49e8;border-radius:6px;padding:2px 5px}
@media(max-height:320px){body.chaos-race #race-course-name{top:52px}}
body.chaos-race #race-menu-open{grid-column:3;grid-row:1;justify-self:end}
body.chaos-race #race-charge{grid-column:1;grid-row:1;justify-self:start;width:68px}

/* Special power badge: one brief ready entrance, then a steady thumb target. */
body.chaos-race #race-actions #race-special{isolation:isolate;overflow:hidden;border-radius:22px 16px 22px 16px;border-color:#283f59;background:linear-gradient(145deg,#fff4b5 0 10%,#ffd45d 45%,#efa33d 100%);box-shadow:inset 0 0 0 2px #fff9d5,inset 0 -6px #ce872d66,0 4px #223c56,0 7px 12px #18344944;animation:race-special-arrive .48s cubic-bezier(.2,.8,.3,1) 1}
body.chaos-race #race-actions #race-special::before{content:'';position:absolute;inset:4px;z-index:-1;border:1px dashed #a46c2f;border-radius:16px 10px 16px 10px;pointer-events:none}
body.chaos-race #race-actions #race-special::after{content:'';position:absolute;top:-10px;bottom:-10px;left:-45%;width:24%;background:linear-gradient(90deg,transparent,#fffbd9aa,transparent);transform:skewX(-20deg);animation:race-special-shine .85s ease-out 1;pointer-events:none}
body.chaos-race #race-special .race-icon{width:38px;height:38px;padding:5px;background:#354d73;color:#fff5c4;filter:drop-shadow(0 2px #fff4bb);transform:rotate(-8deg)}
body.chaos-race #race-special b{font-size:16px;line-height:1;letter-spacing:.6px;text-shadow:0 1px #fff4bb}
body.chaos-race #race-special small{font-size:10px;line-height:1.1;max-width:91px;color:#233f53}
body.chaos-race .race-special-ready-mark{right:5px;top:4px;width:15px;height:15px;border:0;border-radius:0;background:transparent;color:#74512d;font-size:13px;box-shadow:none}
body.chaos-race #race-charge{border:2px solid #365467;border-radius:14px;background:#e8f1dc;color:#294a5e;box-shadow:0 3px #1e3f5033}
body.chaos-race #race-charge.charged{border-color:#ffe8a0;background:#30476c;color:#fff1b5;box-shadow:inset 0 0 0 1px #7185a3,0 3px #1e3f50}
body.chaos-race #race-charge.charged #race-charge-track i{background:#ffda72}
@keyframes race-special-arrive{from{transform:translateY(4px) scale(.96);filter:brightness(1.18)}to{transform:translateY(0) scale(1);filter:brightness(1)}}
@keyframes race-special-shine{from{left:-45%}to{left:135%}}
body.chaos-race.race-reduced-motion #race-actions #race-special,body.chaos-race.race-reduced-motion #race-actions #race-special::after{animation:none}
@media(prefers-reduced-motion:reduce){body.chaos-race #race-actions #race-special,body.chaos-race #race-actions #race-special::after{animation:none}}

/* Jungle pickup identity stays visible before firing, without enlarging controls. */
#race-jungle-symbol{width:60px;height:40px;line-height:0}
#race-jungle-symbol svg{display:block;width:100%;height:100%;overflow:visible}
#race-held-item[data-jungle=true] #race-item-symbol{position:absolute;top:2px;left:50%;transform:translateX(-50%)}
#race-item-caption{position:absolute;bottom:17px;left:2px;right:2px;text-align:center;font:800 10px/11px system-ui;letter-spacing:.3px;color:#fff4cd;pointer-events:none;white-space:nowrap}
#race-held-item[data-jungle=true] .race-item-directions{bottom:4px;left:1px;right:1px;padding:0;letter-spacing:.25px;font:800 9px/10px system-ui;color:#c7f0ce}
#race-held-item[data-jungle=true] #race-item{background:linear-gradient(155deg,#2c5e49,#153e38);border-color:#c6dbac}
@media(orientation:landscape) and (max-height:540px){#race-jungle-symbol{width:48px;height:32px}#race-held-item[data-jungle=true] #race-item-symbol{top:1px}}
body.race-compact-view #race-jungle-symbol{width:48px;height:32px}
@media(orientation:landscape) and (max-height:320px){#race-jungle-symbol{width:39px;height:26px}#race-item-caption{font-size:9px;bottom:15px}#race-held-item[data-jungle=true] .race-item-directions{font-size:8px;bottom:3px}}
body.race-short-view #race-jungle-symbol{width:39px;height:26px}

/* Bound every stored-item SVG, including charging blasters, to the button. */
#race-blaster-symbol{width:44px;height:44px;line-height:0}
#race-blaster-symbol svg{display:block;width:100%;height:100%}
@media(orientation:landscape) and (max-height:320px){#race-blaster-symbol{width:36px;height:36px}}
body.race-short-view #race-blaster-symbol{width:36px;height:36px}

/* City film keeps Leave/Menu available; race controls return for countdown. */
body.city-story-active #race-game:not([hidden]) .race-identity,
body.city-story-active #race-game:not([hidden]) #race-charge,
body.city-story-active #race-game:not([hidden]) #race-actions { visibility:hidden; }
#city-story-status { color:#f6d99b; font-size:13px; margin:8px 0; }
#city-story-retry { margin:4px 0; }

/* Ring Rush: readable equipment case and championship-special panels only. */
body[data-race-world="wrestling"] #race-item {background:linear-gradient(135deg,#617c91,#203a56 40%,#112b43);border:2px solid #e6c67e;box-shadow:inset 0 0 0 3px #243c54,inset 0 1px 9px #aec3cc80,0 4px 12px #071b35a0;border-radius:14px;}
body[data-race-world="wrestling"] #race-item-caption {color:#fff0bf;text-shadow:0 1px 2px #000;font-weight:900;letter-spacing:.035em;}
body[data-race-world="wrestling"] #race-item-directions {color:#bdeefa;}
body[data-race-world="wrestling"] #race-special {background:linear-gradient(135deg,#f4dda1,#b48a38 45%,#ebc86b);border:2px solid #fff0bf;box-shadow:inset 0 0 0 4px #755328,0 3px 12px #091b32aa;color:#18314c;border-radius:18px;}
body[data-race-world="wrestling"] #race-charge {border-color:#b9a16c;background:linear-gradient(#253f58,#10283f);}

/* Ring Rush mobile HUD: fixed rows/columns, never overlapping absolute captions. */
body.chaos-race[data-race-world="wrestling"] #race-held-item #race-item{width:116px;height:64px;min-width:116px;min-height:64px;box-sizing:border-box;padding:7px 6px;display:grid;grid-template-columns:36px minmax(0,1fr);grid-template-rows:28px 16px;column-gap:5px;row-gap:2px;border-radius:14px;border:2px solid #e7c77c;background:linear-gradient(135deg,#35516a,#152d45);box-shadow:inset 0 0 0 2px #5e7284,0 3px 6px #10243680;}
body.chaos-race[data-race-world="wrestling"] #race-held-item #race-item-symbol{position:static;transform:none;grid-column:1;grid-row:1 / 3;align-self:center;justify-self:center;width:36px;height:36px;}
body.chaos-race[data-race-world="wrestling"] #race-jungle-symbol{width:36px;height:36px;}
body.chaos-race[data-race-world="wrestling"] #race-jungle-symbol svg{width:36px;height:36px;overflow:hidden;}
body.chaos-race[data-race-world="wrestling"] #race-held-item #race-item-caption{position:static;grid-column:2;grid-row:1;align-self:center;text-align:left;white-space:normal;overflow-wrap:normal;font:800 10px/12px system-ui;letter-spacing:0;color:#fff1c5;max-width:100%;text-shadow:none;}
body.chaos-race[data-race-world="wrestling"] #race-held-item #race-item-directions{position:static;grid-column:2;grid-row:2;align-self:center;text-align:left;white-space:nowrap;padding:0;font:750 9px/12px system-ui;letter-spacing:0;visibility:visible;color:#b8f0f3;}
body.chaos-race[data-race-world="wrestling"] #race-actions #race-special{width:136px;height:56px;min-height:56px;padding:6px 10px;gap:7px;border:2px solid #e9c96c;border-radius:28px 14px 14px 28px;background:linear-gradient(135deg,#35506e,#132b46);color:#ffe5a0;box-shadow:inset 0 0 0 3px #6a5937,0 3px 8px #10253688;animation:none;}
body.chaos-race[data-race-world="wrestling"] #race-actions #race-special::before,body.chaos-race[data-race-world="wrestling"] #race-actions #race-special::after,body.chaos-race[data-race-world="wrestling"] .race-special-ready-mark{display:none;}
body.chaos-race[data-race-world="wrestling"] #race-special .race-icon{width:34px;height:34px;padding:7px;box-sizing:border-box;background:linear-gradient(#ffe8a0,#c99b3f);color:#1b3450;clip-path:none;transform:none;filter:none;border:1px solid #fff2bf;border-radius:50%;}
body.chaos-race[data-race-world="wrestling"] #race-special b{font:900 12px/14px system-ui;letter-spacing:.5px;text-shadow:none;color:#ffe5a0;}
body.chaos-race[data-race-world="wrestling"] #race-special small{font:700 9px/11px system-ui;color:#e8f0f0;max-width:78px;}
body.chaos-race[data-race-world="wrestling"] #race-special span{gap:3px;}
#arena-ready-glow{position:absolute;inset:0;z-index:3;pointer-events:none;opacity:0;background:linear-gradient(90deg,#ffd66b40,transparent 9%,transparent 91%,#ffd66b40),linear-gradient(#ffe6a340,transparent 10%,transparent 90%,#ffe6a340);box-shadow:inset 0 0 18px #ffd66b66;transition:opacity .3s ease;}
#arena-ready-glow.is-ready{opacity:1;}
#arena-ready-note{position:absolute;top:62px;left:14px;z-index:7;pointer-events:none;padding:6px 9px;border:1px solid #e9cc7b;border-radius:8px;background:#142b45ed;color:#ffe5a0;font:850 11px/14px system-ui;letter-spacing:.5px;}
body.race-reduced-motion #arena-ready-glow{display:none;}
@media(prefers-reduced-motion:reduce){#arena-ready-glow{display:none;}}
@media(max-height:320px){body.chaos-race[data-race-world="wrestling"] #race-held-item #race-item{height:58px;min-height:58px;padding-top:4px;padding-bottom:4px;}#arena-ready-note{top:55px;padding:4px 7px;}}

/* Circuit setup and results use independent panels; approved race controls stay untouched. */
body.chaos-race .race-format{border:1px solid #78938d;border-radius:14px;background:#163e42;color:#fff4d6;display:flex;gap:10px 20px;flex-wrap:wrap;align-items:center;padding:10px 16px;margin:16px 0}
body.chaos-race .race-format legend{font-weight:800;padding:0 7px}
body.chaos-race .race-format label{display:flex;align-items:center;gap:8px;min-height:36px;font-size:15px;font-weight:750;cursor:pointer}
body.chaos-race .race-format input{width:20px;height:20px;margin:0;accent-color:#ffd66e}
body.chaos-race #race-format-help{flex-basis:100%;margin:0;font-size:13px;color:#dce6dc}
body.chaos-race #race-host{width:100%;margin-top:8px;background:#274951;color:#fff1c8;border:2px solid #bdac70;font-size:13px;min-height:42px}
body.chaos-race #race-waiting{width:min(560px,calc(100vw - 30px));max-height:calc(100dvh - 24px);overflow:auto;text-align:center}
body.chaos-race #race-waiting p{font-size:14px;line-height:1.4;margin:9px 0}
body.chaos-race #race-waiting .race-code-share{justify-content:center;gap:14px;flex-wrap:wrap}
body.chaos-race #race-waiting-code{font-size:30px;letter-spacing:5px;color:#ffdf88;user-select:all;white-space:nowrap}
body.chaos-race #race-waiting-roster{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;padding:0;list-style:none;text-align:left}
body.chaos-race #race-waiting-roster li{background:#24394c;border-radius:8px;padding:8px;font-size:13px;overflow-wrap:anywhere}
body.chaos-race #race-waiting .race-waiting-fine,body.chaos-race .race-scoring-note{font-size:11px;color:#bdcbd1}
body.chaos-race #race-results{width:min(680px,calc(100vw - 24px));max-height:calc(100dvh - 20px);overflow:auto;padding:20px}
body.chaos-race .race-podium{display:flex;justify-content:center;align-items:flex-end;gap:8px;margin:8px auto 16px;max-width:470px;flex-wrap:wrap}
body.chaos-race .race-podium-seat{position:relative;flex:1 1 90px;max-width:145px;min-width:0;border-radius:12px 12px 4px 4px;border:1px solid #8296aa;background:linear-gradient(#304b62,#203344);padding:4px 5px 10px;display:flex;flex-direction:column;align-items:center;min-height:122px}
body.chaos-race .race-podium-seat.place-1{border:2px solid #e0bd59;background:linear-gradient(#746333,#383c35);min-height:150px}
body.chaos-race .race-podium-seat.place-3{min-height:110px}
body.chaos-race .race-podium-seat canvas{width:90px;height:75px;max-width:100%;object-fit:contain}
body.chaos-race .race-podium-seat b{font-size:12px;overflow-wrap:anywhere;text-align:center;color:#fff4d6}
body.chaos-race .race-medal{font-weight:900;font-size:23px;line-height:28px;color:#ffdf81}
body.chaos-race .race-podium.is-championship{padding-top:8px}
body.chaos-race #race-circuit-results{border-top:1px solid #536475;padding-top:12px;margin-top:16px}
body.chaos-race #race-circuit-heading{margin:0;font-size:20px;color:#ffdf88}
body.chaos-race #race-circuit-next{margin:6px 0 10px;color:#d9e8dc;font-size:14px}
body.chaos-race #race-circuit-ranking{list-style:none;margin:0;padding:0;display:grid;gap:5px;text-align:left}
body.chaos-race #race-circuit-ranking li{display:grid;grid-template-columns:minmax(0,1fr) auto 30px;gap:3px 10px;background:#203547;padding:9px 12px;border:1px solid #415b6c;border-radius:9px;font-size:14px}
body.chaos-race #race-circuit-ranking li.is-you{border-color:#f5cf68;background:#3b4439}
body.chaos-race #race-circuit-ranking strong{overflow-wrap:anywhere}
body.chaos-race #race-circuit-ranking small{grid-column:1/-1;color:#c2d1d5;font-size:11px;line-height:1.4}
body.chaos-race .circuit-movement{text-align:right;color:#ffe59c}
body.chaos-race #race-replay{margin-top:15px}
@media(orientation:landscape) and (max-height:540px){body.chaos-race .race-format{margin:6px 0;padding:4px 12px;gap:4px 15px}body.chaos-race .race-format label{font-size:13px;min-height:30px}body.chaos-race #race-format-help{font-size:11px}body.chaos-race #race-waiting{padding:14px 20px}body.chaos-race #race-waiting h2{font-size:23px;margin:0}body.chaos-race #race-results{padding:12px 18px}body.chaos-race .race-podium-seat{min-height:96px}body.chaos-race .race-podium-seat.place-1{min-height:116px}body.chaos-race .race-podium-seat.place-3{min-height:86px}body.chaos-race .race-podium-seat canvas{width:70px;height:58px}body.chaos-race .race-podium{margin:5px auto 10px}}
@media(max-width:480px){body.chaos-race #race-waiting-roster{grid-template-columns:1fr}body.chaos-race #race-circuit-ranking li{font-size:12px;padding:8px;gap:3px 5px}body.chaos-race .race-podium-seat{flex-basis:70px}}
body.chaos-race #race-waiting,body.chaos-race #race-results{background:linear-gradient(155deg,#182d3e,#102331);color:#f5f1df;border-color:#8d9f98}
body.chaos-race #race-waiting h2,body.chaos-race #race-results h2,body.chaos-race #race-round-heading{color:#ffdf88}
body.chaos-race #race-waiting-roster li{color:#e9f0e9}
body.chaos-race #race-final-ranking li{color:#f2f2e6;border-color:#4b6170}
body.chaos-race #race-final-ranking li.is-you{background:#364b42}
body.chaos-race #race-final-ranking li span{color:#c3d2d6}
body.chaos-race #race-waiting .race-quiet-button,body.chaos-race #race-results .race-quiet-button{color:#c9dce0}

/* Persistent race crew setup: separate from gameplay HUD. */
body.chaos-race .race-party-panel{border:1px solid #80978d;border-radius:12px;background:#1d3945;margin:16px 0;padding:14px;text-align:left}
body.chaos-race .race-party-panel h3{margin:0 0 8px;color:#ffe19a;font-size:18px}
body.chaos-race .race-party-panel p{font-size:13px;line-height:1.45;overflow-wrap:anywhere}
body.chaos-race .race-party-panel button{width:100%;min-height:44px;margin:6px 0;white-space:normal;line-height:1.3;padding:10px 12px}
body.chaos-race .race-party-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:12px 0}
body.chaos-race .race-party-fields label{display:flex;flex-direction:column;gap:5px;font-size:13px;color:#f4edda;font-weight:750}
body.chaos-race .race-party-fields select{box-sizing:border-box;width:100%;min-width:0;min-height:44px;padding:8px;background:#f5efd9;color:#173744;border:1px solid #c1bf9f;border-radius:8px;font-size:14px}
body.chaos-race #race-party-proposal{border-top:1px solid #69818a;margin-top:10px;padding-top:6px}
body.chaos-race #race-party-ready-names{background:#132c3b;padding:9px;border-radius:8px;color:#deecd6}
body.chaos-race .race-party-panel .race-party-fine{font-size:11px;color:#bacbd0;margin-bottom:0}
body.chaos-race #race-party-status:empty{display:none}
@media(max-width:480px){body.chaos-race .race-party-fields{grid-template-columns:1fr}body.chaos-race .race-party-panel{padding:10px}}

/* Shared six-world pickup layout: artwork, name and action have separate cells.
   Keep each world's existing art and palette; never stack absolute text on art. */
body.chaos-race[data-race-world] #race-held-item #race-item{width:136px;min-width:136px;height:66px;min-height:66px;box-sizing:border-box;padding:6px;display:grid;grid-template-columns:36px minmax(0,1fr);grid-template-rows:26px 22px;column-gap:6px;row-gap:2px;align-items:center;justify-items:stretch;overflow:hidden;}
body.chaos-race[data-race-world] #race-held-item #race-item-symbol{position:static;inset:auto;transform:none;grid-column:1;grid-row:1 / 3;align-self:center;justify-self:center;width:36px;height:36px;min-width:0;overflow:hidden;}
body.chaos-race[data-race-world] #race-held-item #race-jungle-symbol,body.chaos-race[data-race-world] #race-held-item #race-blaster-symbol{width:36px;height:36px;max-width:100%;max-height:100%;line-height:0;}
body.chaos-race[data-race-world] #race-held-item #race-item-symbol svg,body.chaos-race[data-race-world] #race-held-item #race-item-symbol .race-icon{display:block;width:36px;height:36px;max-width:100%;max-height:100%;overflow:hidden;}
body.chaos-race[data-race-world] #race-held-item #race-item-caption{position:static;inset:auto;transform:none;grid-column:2;grid-row:1;min-width:0;max-width:100%;align-self:center;text-align:left;white-space:normal;overflow-wrap:anywhere;overflow:hidden;font:800 10px/12px system-ui;letter-spacing:0;text-shadow:none;}
body.chaos-race[data-race-world] #race-held-item #race-item-directions{position:static;inset:auto;transform:none;grid-column:2;grid-row:2;min-width:0;max-width:100%;align-self:center;text-align:left;white-space:normal;overflow-wrap:anywhere;overflow:hidden;padding:0;font:750 9px/10px system-ui;letter-spacing:0;visibility:visible;}
@media(orientation:landscape) and (max-height:320px){body.chaos-race[data-race-world] #race-held-item #race-item{height:60px;min-height:60px;padding-top:3px;padding-bottom:3px;}}
body.chaos-race.race-short-view[data-race-world] #race-held-item #race-item{height:60px;min-height:60px;padding-top:3px;padding-bottom:3px;}

/* Riot Run setup: native radios styled as game options, not a second control system. */
body.chaos-race .race-format{
 min-inline-size:0;border:0;border-radius:0;background:transparent;
 display:grid;grid-template-columns:repeat(2,minmax(0,210px));gap:8px 10px;
 align-items:stretch;padding:0;margin:14px 0 19px;
}
body.chaos-race .race-format legend{
 float:left;grid-column:1/-1;width:100%;padding:0;margin:0 0 1px;color:#d3e6e3;
 font-size:12px;font-weight:850;line-height:16px;letter-spacing:.075em;text-transform:uppercase;
}
body.chaos-race .race-format label{
 position:relative;isolation:isolate;box-sizing:border-box;min-width:0;min-height:44px;
 padding:8px 28px 8px 12px;display:flex;align-items:center;gap:9px;
 border:1px solid #457075;border-radius:11px;background:linear-gradient(180deg,#245256,#183e45);
 color:#ecf1e8;box-shadow:inset 0 1px #ffffff10,0 2px #081f2b66;
 font-size:14px;font-weight:800;line-height:1.18;text-wrap:balance;
}
@supports selector(label:has(input:checked)){
 body.chaos-race .race-format input{
  position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:inherit;
 }
 body.chaos-race .race-format label:has(input:checked){
  border-color:#efc46d;background:linear-gradient(180deg,#334c48,#263f43);color:#fff2c8;
  box-shadow:inset 0 0 0 1px #efc46d4d,0 2px #081f2b66;
 }
 body.chaos-race .race-format label:has(input:checked)::after{
  content:'';position:absolute;right:13px;top:50%;width:8px;height:4px;
  border:solid #f6d58f;border-width:0 0 2px 2px;transform:translateY(-65%) rotate(-45deg);
  pointer-events:none;
 }
 body.chaos-race .race-format label:has(input:focus-visible){outline:2px solid #adf3f1;outline-offset:2px;z-index:1}
 body.chaos-race .race-format label:has(input:disabled){opacity:.63;cursor:not-allowed}
 @media(hover:hover){body.chaos-race .race-format label:has(input:not(:checked):not(:disabled)):hover{
  background:linear-gradient(180deg,#2b6064,#214750);border-color:#83aaa7;
 }}
}
body.chaos-race #race-format-help{
 grid-column:1/-1;color:#c4d4cf;font-size:12px;line-height:1.35;margin:0;
}
body.chaos-race .race-brand h1::after{
 content:'';display:block;width:30px;height:2px;margin-top:5px;border-radius:2px;
 background:#70d7df;opacity:.8;
}
body.chaos-race #race-character-grid .race-character:not([aria-pressed=true]){
 background:linear-gradient(155deg,#edf0e4,#d8e3db);border-color:#94aaa3;
}
body.chaos-race #race-character-grid .race-character:focus-visible,
body.chaos-race #race-world-grid .race-world:focus-visible{outline:2px solid #adf3f1;outline-offset:2px;z-index:1}
@media(max-width:380px){
 body.chaos-race .race-format{column-gap:8px}
 body.chaos-race .race-format label{padding-left:9px;font-size:13px}
 body.chaos-race .race-format label:has(input:checked)::after{right:10px}
}
@media(orientation:landscape) and (max-height:540px){
 body.chaos-race .race-format{gap:4px 8px;margin:5px 0 10px;grid-template-columns:repeat(2,minmax(0,145px))}
 body.chaos-race .race-format legend{font-size:10px;line-height:12px}
 body.chaos-race .race-format label{min-height:40px;padding-top:5px;padding-bottom:5px;font-size:12px}
 body.chaos-race #race-format-help{font-size:11px}
 body.chaos-race .race-brand h1::after{margin-top:3px}
}

@media(forced-colors:active){
 body.chaos-race .race-format input{position:static;width:18px;height:18px;opacity:1;flex:none;}
 body.chaos-race .race-format label:has(input:checked)::after{display:none;}
 body.chaos-race .race-format label:has(input:focus-visible){outline-color:Highlight;}
}
/* Option B only. Append after the picker polish. Color-only; assets and play untouched. */
body.chaos-race:has(#race-lobby:not([hidden])) {
 background-color: #111c33;
 background-image: radial-gradient(ellipse at 100% 90%, #52478440, transparent 58%),
                   linear-gradient(135deg, #111c33, #27284f);
}
body.chaos-race #race-lobby .race-brand { border-bottom-color: #9baacb36; }
body.chaos-race #race-lobby .race-lobby-actions {
 border-color: #9baacb45;
 background: linear-gradient(120deg, #232c4b66, #1c26464d);
}

/* Riot Run lobby: one primary action, with setup and multiplayer on demand. */
body.chaos-race .race-start-layout{display:grid;gap:16px}
body.chaos-race .race-start-card{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:16px;align-items:center;padding:14px 16px;border:1px solid #9baacb45;border-radius:16px;background:#172840;color:#fff3ce}
body.chaos-race .race-start-kicker{font-size:10px;font-weight:800;letter-spacing:.13em;text-transform:uppercase;color:#c2cfdf}
body.chaos-race #race-selected-track{grid-column:1;font-size:clamp(17px,3vw,27px);line-height:1.15}
body.chaos-race .race-start-card #create{grid-column:2;grid-row:1/span 2;min-height:48px;margin:0;white-space:normal}
body.chaos-race .race-start-card #city-story-status{grid-column:1/-1;margin:8px 0 0}
body.chaos-race .race-start-card #city-story-retry{grid-column:1/-1;margin-top:8px}
body.chaos-race .race-lobby-options{display:grid;gap:8px;margin-top:10px}
body.chaos-race .race-lobby-options details{border:1px solid #9baacb45;border-radius:12px;background:#172840a8;padding:0 12px;color:#e5edf8}
body.chaos-race .race-lobby-options summary{display:flex;align-items:center;justify-content:space-between;min-height:44px;gap:12px;list-style:none;cursor:pointer;font-size:14px;font-weight:750}
body.chaos-race .race-lobby-options summary::-webkit-details-marker{display:none}
body.chaos-race .race-lobby-options summary::after{content:'';width:7px;height:7px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg);margin:0 3px 4px 0}
body.chaos-race .race-lobby-options details[open]>summary::after{transform:rotate(225deg);margin-bottom:-4px}
body.chaos-race .race-lobby-options summary:focus-visible{outline:2px solid #adf3f1;outline-offset:2px;border-radius:5px}
body.chaos-race .race-lobby-options details[open]{padding-bottom:12px}
body.chaos-race #race-change-options .race-format{margin:0 0 10px}
body.chaos-race #race-change-options .race-options-done{margin-top:10px;min-height:44px}
body.chaos-race #race-change-options .race-practice-link{display:inline-flex;align-items:center;min-height:44px;margin:10px 0 0 12px}
body.chaos-race #race-friends-options .race-lobby-actions{margin:0;padding:10px 0 0;border:0;border-top:1px solid #9baacb36;border-radius:0;background:none;box-shadow:none}
body.chaos-race #race-friends-options #race-host,body.chaos-race #race-friends-options #join,body.chaos-race #race-friends-options #race-code{min-height:44px}
@media(orientation:landscape) and (max-height:540px){
 body.chaos-race .race-start-layout{grid-template-columns:minmax(0,1fr) minmax(160px,.55fr);align-items:start;gap:12px}
 body.chaos-race .race-start-card{grid-template-columns:minmax(0,1fr);gap:5px;padding:12px}
 body.chaos-race .race-start-card #create{grid-column:1;grid-row:auto;width:100%;margin-top:5px}
 body.chaos-race .race-start-layout #race-character-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
 body.chaos-race .race-start-layout .race-character strong{overflow-wrap:anywhere}
 body.chaos-race .race-lobby-options{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
 body.chaos-race .race-lobby-options>details[open]{grid-column:1/-1}
 body.chaos-race .race-lobby-options:has(>details[open])>details:not([open]){grid-column:1/-1}
}
@media(orientation:landscape) and (max-width:670px){
 body.chaos-race .race-start-layout #race-character-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
body.chaos-race #race-lobby #startup-panel[hidden],
body.chaos-race #race-lobby #startup-retry[hidden],
body.chaos-race #race-lobby #race-world-choices[hidden]{display:none!important}
body.chaos-race #race-lobby #startup-panel:not([hidden]){background:#172840;border:1px solid #9baacb45;color:#f1e7c8}
