*{box-sizing:border-box}body{margin:0;background:#0a0719;color:#f4efff;font-family:Arial,sans-serif;overflow:hidden}canvas{position:fixed;inset:0;width:100%;height:100%;touch-action:none}header{position:fixed;top:25px;left:30px;right:30px;display:flex;align-items:center;justify-content:space-between;pointer-events:none}.brand{font-weight:900;font-size:20px;letter-spacing:3px}.brand span{display:block;font-size:8px;letter-spacing:5px;color:#b7a6d8;margin-top:6px}.pill,button,#inventory{background:#151025cc;border:1px solid #ffffff25;backdrop-filter:blur(12px);border-radius:12px;color:white}.pill{padding:14px;font-size:10px;letter-spacing:2px}.pill span{color:#ab83ff;margin-left:20px}button{padding:12px 17px;cursor:pointer;pointer-events:auto}button:hover{background:#65459a}aside{position:fixed;top:112px;left:30px;width:280px;pointer-events:none}small{font-size:9px;letter-spacing:2px;color:#c5a2ef}h1{font-size:32px;line-height:1.12;margin:14px 0}aside p{font-size:12px;color:#c8bade;line-height:1.6}#steps{font-size:11px;color:#8fdcdf}#inventory{position:fixed;bottom:95px;left:50%;transform:translateX(-50%);padding:16px 22px;display:flex;gap:25px;font-size:12px;white-space:nowrap}#gems{color:#6be6ff}#toast{position:fixed;top:88px;left:50%;transform:translateX(-50%);background:#392358e8;padding:12px 22px;border-radius:10px;opacity:0;transition:opacity .3s;pointer-events:none;font-size:13px;text-align:center}#hint{position:fixed;bottom:155px;left:50%;transform:translateX(-50%);font-size:13px;text-shadow:0 2px 8px #000}footer{position:fixed;bottom:23px;left:30px;right:30px;display:flex;justify-content:space-between;align-items:end;color:#b9a9cd;font-size:10px;line-height:1.8}footer button{font-size:10px}#modal{position:fixed;inset:0;background:#070516b5;backdrop-filter:blur(8px);display:grid;place-items:center}section{max-width:480px;padding:38px;background:linear-gradient(145deg,#28203bf2,#100e20f5);border:1px solid #b482ed55;border-radius:24px;box-shadow:0 20px 100px #0008}h2{font-size:38px;margin:18px 0}section p{color:#c9bfd9;font-size:14px;line-height:1.65}.guide{line-height:2.2;font-size:13px;margin:25px 0}.guide b{color:#b18cea;margin-right:12px}.muted{font-size:11px!important;color:#9f92b3!important}#play{width:100%;background:#a780eb;color:#170d2b;font-weight:bold;margin-top:15px}nav{position:fixed;right:25px;bottom:100px;display:flex;gap:8px}nav button{font-size:22px;width:67px;padding:10px}nav small{display:block;font-size:8px;letter-spacing:0;color:#cdbfe0;margin-top:5px}#stick{display:none;position:fixed;bottom:100px;left:25px;width:110px;height:110px;border-radius:50%;border:1px solid #ffffff40;background:#ffffff0d;touch-action:none}#stick i{position:absolute;left:35px;top:35px;width:40px;height:40px;border-radius:50%;background:#b08fe980}@media(max-width:700px){header{top:16px;left:16px;right:16px}.pill{display:none}aside{top:80px;left:16px;width:200px}h1{font-size:23px}aside p{font-size:10px}#steps{font-size:9px}#inventory{bottom:24px;padding:13px;gap:16px;font-size:10px}footer{display:none}#stick{display:block}nav{right:14px;bottom:102px;gap:5px}nav button{width:53px;font-size:20px;padding:9px 4px}#hint{bottom:230px;width:80%;text-align:center}section{margin:16px;padding:26px}h2{font-size:30px}#toast{width:85%;top:64px}}

#tools{position:fixed;right:24px;top:85px;display:flex;gap:6px}#tools button{font-size:12px;padding:10px}#buildTools{position:fixed;right:24px;bottom:195px;display:flex;gap:6px}select{background:#20182f;color:#eee;border:1px solid #7e6993;border-radius:9px;padding:9px;font-size:12px}#editor{position:fixed;inset:0;background:#090517dd;backdrop-filter:blur(12px);z-index:10;display:grid;place-items:center}#editor[hidden]{display:none}#editor section{max-height:95dvh;overflow:auto;width:390px;padding:24px}#editor h2{font-size:24px;margin:10px 0}#heroPreview{position:static;width:100%;height:190px;object-fit:contain;border-radius:12px}#editor label{display:flex;justify-content:space-between;align-items:center;gap:15px;margin:12px 0;font-size:12px}#editor input{width:60px;border:0;background:none}#applyHero{width:100%;background:#8c66ca;margin-top:12px}#inventory{gap:16px}#undo{padding:8px 12px}@media(max-width:700px){#tools{top:70px;right:12px;gap:4px}#tools button{font-size:10px;padding:8px}aside{top:116px;width:190px}aside h1{font-size:19px;margin:6px 0}aside small{display:none}aside p{margin:5px 0}#buildTools{bottom:170px;right:14px;gap:4px}#buildTools select{font-size:10px;padding:7px;max-width:110px}#inventory{gap:10px;padding:12px 10px;font-size:9px}#hint{bottom:218px}nav{bottom:95px}#stick{bottom:95px}#toast{top:220px;pointer-events:none}}
#rooms{position:fixed;inset:0;background:#090517db;backdrop-filter:blur(9px);display:grid;place-items:center;z-index:12}#rooms[hidden],#signals[hidden]{display:none}#rooms section{max-height:92dvh;overflow:auto}#rooms h2{font-size:25px}#rooms button{margin:5px}#rooms label{display:block;font-size:12px;margin:16px 0}#roomCode{display:block;width:100%;margin-top:9px;background:#100c20;color:white;padding:12px;border:1px solid #877295;border-radius:8px;font-size:18px;letter-spacing:3px}#roomInfo{font-size:13px;color:#adedef;line-height:1.7;margin:10px 0}#signals{position:fixed;left:24px;bottom:205px;display:flex;gap:4px}#signals button{padding:8px;font-size:10px}#roundStatus{position:fixed;left:50%;top:70px;transform:translateX(-50%);color:#dcceff;background:#160e25b8;border-radius:8px;font-size:12px;text-align:center;max-width:70%;padding:6px;pointer-events:none}#roundStatus:empty{display:none}@media(max-width:700px){#tools{top:64px;left:12px;right:12px;justify-content:flex-end}#roundStatus{top:98px;width:95%;max-width:95%;font-size:10px}aside{top:140px}#signals{left:14px;bottom:250px}#signals button{padding:7px;font-size:9px}#rooms section{padding:22px}#rooms p{font-size:12px}}
#arenaEditor{position:fixed;inset:0;background:#090717ed;display:grid;place-items:center;z-index:20}#arenaEditor[hidden],#catchPlayer[hidden],#buildTools[hidden]{display:none}#arenaEditor section{width:420px;max-width:96vw;padding:20px;max-height:96dvh;overflow:auto}#arenaEditor h2{font-size:23px;margin:10px 0}#arenaEditor p{font-size:11px;margin:8px 0}#mapEditor{position:static;width:100%;height:43dvh;object-fit:fill;touch-action:none;background:#110c20;border-radius:12px}.mapControls{display:flex;gap:10px}#catchPlayer{position:fixed;right:25px;bottom:180px;background:#a77aef;color:#160b26;font-weight:bold;font-size:16px}#roomResults h3{font-size:15px}#roomResults p{font-size:11px;margin:6px 0}#rooms section{width:460px}#roomResults{border-top:1px solid #766083;margin-top:14px;padding-top:10px}
#heroRoster{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}#heroRoster button{padding:4px;border-radius:9px;overflow:hidden;text-align:center;min-width:0;background:#130f20}#heroRoster img{width:100%;height:76px;object-fit:cover;object-position:top;border-radius:5px}#heroRoster strong{display:block;font-size:9px;padding-top:4px;white-space:normal}#heroRoster small{display:block;font-size:8px;letter-spacing:0;padding:3px;color:#b9a6ce}#heroRoster [data-hero="base"]{grid-column:1/-1;font-size:11px;padding:9px}#heroRoster .selected{border-color:#89ddff;box-shadow:0 0 0 1px #89ddff;background:#233348}#editor label[hidden]{display:none}#heroNote{font-size:10px;color:#baaaca;text-align:center;margin:5px}#editor section{width:480px}#heroPreview{height:230px;touch-action:none}#editor h2{font-size:22px}#editor section{padding:20px}

#seekerBlind{position:fixed;inset:0;background:radial-gradient(circle,#34214e,#090b1a);z-index:90;display:grid;place-items:center;color:#ede0ff;font:bold 25px Arial;text-align:center;pointer-events:none}#seekerBlind[hidden]{display:none}#seekerChoice,#editRoom{max-width:100%;padding:10px;background:#292139;color:white;border:1px solid #75618d;border-radius:10px}
#parkChat{position:fixed;right:18px;top:100px;width:min(350px,calc(100vw - 36px));max-height:60dvh;padding:14px;background:#171224f5;border:1px solid #75618d;border-radius:18px;z-index:75;box-shadow:0 15px 55px #0008}#parkChat[hidden]{display:none}#parkChat header{display:flex;align-items:center;justify-content:space-between}#parkChat button{padding:7px 10px;min-width:0;margin:0}#chatMessages{height:220px;max-height:30dvh;overflow:auto;overscroll-behavior:contain;margin:10px 0}#chatMessages p{font-size:14px;line-height:1.4;margin:8px 0;overflow-wrap:anywhere}#chatMessages strong{display:block;color:#aee7ef;font-size:11px}#chatEmoji{display:flex;flex-wrap:wrap;gap:3px;margin-bottom:8px}#chatForm{display:flex;gap:6px}#chatInput{min-width:0;flex:1;background:#0d0b17;color:white;border:1px solid #75618d;border-radius:9px;padding:10px;font-size:16px}#chatInfo{display:block;color:#cdbade;margin-top:5px}
body{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}button,select{touch-action:manipulation}input,textarea,[contenteditable]{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}button:focus:not(:focus-visible){outline:none}button:focus-visible{outline:2px solid #91deed;outline-offset:2px}#parkChat header{position:static;pointer-events:auto}#mobileMenu{display:none}#chatToggle{position:fixed;right:24px;top:138px;z-index:25}#chatMessages p button{float:right;font-size:12px}#parkChat{overflow:auto;max-height:calc(var(--visible-height,100dvh) - 115px)}
@media(max-width:700px),(pointer:coarse) and (max-height:600px){header{top:max(10px,env(safe-area-inset-top));left:12px;right:12px}.brand{font-size:15px}.brand span{font-size:6px}aside{top:62px;left:12px;width:58%}aside h1{font-size:16px}aside p,aside #steps,aside small{display:none}#mobileMenu{display:block;position:fixed;right:12px;top:62px;z-index:31;min-width:44px;min-height:44px;padding:9px}#chatToggle{right:64px;top:62px;min-height:44px;padding:9px 12px;z-index:31}#tools{display:none;left:auto;right:12px;top:115px;width:210px;padding:8px;background:#171224f2;border:1px solid #75618d;border-radius:14px;z-index:32;grid-template-columns:1fr 1fr}.toolsOpen #tools{display:grid}#tools button{font-size:11px;min-height:44px;padding:8px}#roundStatus{top:112px;max-width:90%;width:auto;font-size:10px}#stick{display:block;left:max(12px,env(safe-area-inset-left));bottom:calc(72px + env(safe-area-inset-bottom));width:100px;height:100px}#stick i{left:30px;top:30px}nav{right:max(12px,env(safe-area-inset-right));bottom:calc(72px + env(safe-area-inset-bottom));gap:6px}nav button{width:52px;min-height:58px;padding:8px 3px}#buildTools{right:12px;bottom:calc(143px + env(safe-area-inset-bottom));max-width:210px;justify-content:flex-end;flex-wrap:wrap;gap:5px}#buildTools select{font-size:12px;min-height:40px;max-width:100px;padding:7px}#undo{min-height:40px}#catchPlayer{right:12px;bottom:calc(235px + env(safe-area-inset-bottom));min-height:44px;font-size:13px}#inventory{bottom:calc(12px + env(safe-area-inset-bottom));max-width:calc(100vw - 20px);gap:9px;font-size:10px;padding:10px}#hint{bottom:calc(290px + env(safe-area-inset-bottom));font-size:11px;max-width:90%;pointer-events:none}#signals{display:none}#toast{top:155px;width:80%;font-size:12px;z-index:40}#parkChat{top:110px;right:10px;width:calc(100vw - 20px);padding:12px;margin:0;max-height:calc(var(--visible-height,100dvh) - 120px)}#chatMessages{height:160px;max-height:calc(var(--visible-height,100dvh) - 290px);min-height:45px}#chatEmoji button{min-width:34px;min-height:38px}#rooms section,#editor section,#modal section{width:calc(100vw - 24px);max-width:460px;max-height:90dvh;overflow:auto;margin:12px;padding:20px}#roomCode,#seekerChoice{font-size:16px}#mapEditor{height:40dvh}#heroRoster img{height:64px}}
@media(max-height:500px) and (orientation:landscape){aside{display:none}#roundStatus{top:12px;max-width:50%}#chatToggle,#mobileMenu{top:58px}#tools{top:105px}#hint{display:none}#parkChat{top:8px;right:70px;width:330px;max-height:calc(var(--visible-height,100dvh) - 16px)}#chatMessages{height:90px;max-height:110px}#catchPlayer{bottom:210px}}
/* iOS: native controls below 16px trigger page zoom even with viewport limits. */
html,body{width:100%;height:100%;overscroll-behavior:none;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
input,textarea,[contenteditable="true"],[contenteditable="true"] *{-webkit-user-select:text;user-select:text;-webkit-touch-callout:default}
#world,#stick,#stick *,nav,nav *,#tools,#tools *,#buildTools button,#catchPlayer{touch-action:none}
img{-webkit-user-drag:none}
@media(pointer:coarse),(max-width:700px){
 input,select,textarea,#buildTools select,#editor select,#rooms select{font-size:16px!important}
 #buildTools{max-width:250px;gap:5px}
 #buildTools select{max-width:125px;min-width:0;padding:7px 4px}
 #buildTools #undo{padding:7px 12px}
}
#botPanel{border:1px solid #65527b;border-radius:12px;padding:12px;margin:12px 0}#botPanel[hidden]{display:none}#botPanel h3{font-size:15px;margin:0 0 8px}#botPanel p{font-size:12px}#botCount{font-size:16px;min-width:65px}#botPanel button{margin:8px 0}
#constructionRule{position:fixed;left:12px;bottom:56px;font-size:11px;color:#c1dbef;pointer-events:none}#constructionVotes{position:fixed;right:12px;top:170px;width:250px;max-height:35dvh;overflow:auto;background:#171224ee;border:1px solid #88ddea;border-radius:12px;padding:10px;z-index:35;font-size:12px}#constructionVotes[hidden]{display:none}#constructionVotes div{display:flex;align-items:center;gap:5px;margin-top:7px}#constructionVotes span{flex:1}#constructionVotes button{padding:8px;min-width:36px}#cyclePart{font-size:12px;min-height:40px;touch-action:none}@media(max-width:700px){#buildTools{max-width:260px;bottom:calc(142px + env(safe-area-inset-bottom))}#constructionRule{bottom:calc(50px + env(safe-area-inset-bottom));font-size:10px}#constructionVotes{top:145px;width:220px;max-height:25dvh}}

#creatorStudio{position:fixed;inset:0;z-index:95;background:#090918df;overflow:auto;overscroll-behavior:contain;padding:20px;touch-action:pan-y}#creatorStudio[hidden]{display:none}#creatorStudio section{position:relative;max-width:640px;margin:auto;padding:24px;background:#202037;border:1px solid #79618f;border-radius:22px;color:#f5edf9}#creatorStudio p{line-height:1.5;color:#c9c5dc}#creatorStudio button{margin:5px;padding:12px;touch-action:manipulation}#creatorStudio input,#creatorStudio select,#creatorStudio textarea{box-sizing:border-box;font-size:16px;max-width:100%;padding:10px;border-radius:10px;color:#fff;background:#141428;border:1px solid #65567c}#creatorStudio input:not([type=color]),#creatorStudio textarea{width:100%}#creatorStudio textarea{min-height:90px;display:block;margin:10px 0}#creatorStudio label{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 0}#creatorStudio input[type=range]{max-width:60%}#creatorStudio input[type=color]{width:60px;height:40px;padding:3px}#creatorStudio a{color:#9ee7f7}#creatorTabs{display:flex;flex-wrap:wrap}#costumePreview{position:static;display:block;width:100%;max-width:360px;height:auto;margin:auto;touch-action:manipulation;border-radius:18px}#creatorStudio .closeCreator{float:right}#creatorStudio .costumeRow,#creatorStudio .ruleRow{padding:12px 0;border-top:1px solid #504565}#creatorStudio .costumeRow i{display:inline-block;width:24px;height:24px;border-radius:6px}#creatorStudio .costumeRow input{max-width:100px}#creatorStudio button:disabled{opacity:.45}#creatorAccount{font-size:13px;overflow-wrap:anywhere}@media(max-width:600px){#creatorStudio{padding:10px}#creatorStudio section{padding:15px}#creatorTabs button{font-size:12px;padding:9px;margin:3px}#creatorStudio .ruleRow select{width:100%;margin:4px 0}#tools{max-width:calc(100vw - 20px);flex-wrap:wrap}}
#desktopActions{position:fixed;bottom:90px;left:50%;transform:translateX(-50%);z-index:12;display:flex;gap:6px;align-items:center;padding:8px;border:1px solid #ffffff30;border-radius:14px;background:#10172ce8;max-width:95vw}#desktopActions[hidden]{display:none}#desktopActions button{white-space:nowrap}#desktopActions button[aria-pressed="true"]{background:#286a81;border-color:#8deaff;color:white}#desktopActions span{font-size:11px;max-width:180px;color:#c5dfef}@media(pointer:coarse){#desktopActions{display:none}}

#desktopActions button[hidden]{display:none}
#cameraPad,#cycleMaterial{display:none}
.touchControls #cameraPad{display:flex;position:fixed;right:max(12px,env(safe-area-inset-right));bottom:calc(144px + env(safe-area-inset-bottom));width:112px;height:112px;flex-direction:column;align-items:center;justify-content:center;gap:3px;border:1px solid #addef34d;border-radius:28px;background:#152238bd;color:#bdeefa;z-index:14;touch-action:none;user-select:none}
#cameraPad[hidden]{display:none!important}#cameraPad span{font-size:22px;pointer-events:none}#cameraPad small{font-size:9px;letter-spacing:1px;pointer-events:none}#cameraPad div{display:flex;gap:4px}#cameraPad button{width:44px;height:44px;padding:0;font-size:21px;touch-action:none;background:#18283b;border-radius:13px}
.touchControls nav{z-index:14;right:max(12px,env(safe-area-inset-right));bottom:calc(72px + env(safe-area-inset-bottom));gap:6px}.touchControls nav button{width:52px;min-height:58px;padding:7px 2px}.touchControls #stick{display:block}
.touchControls #buildTools{right:136px;bottom:calc(144px + env(safe-area-inset-bottom));width:146px;max-width:146px;display:grid;grid-template-columns:1fr 44px;gap:5px;z-index:14}.touchControls #buildTools[hidden]{display:none}.touchControls #buildTools select{display:none}.touchControls #cyclePart{grid-column:1/-1;grid-row:1;min-height:44px;padding:6px;font-size:12px}.touchControls #cycleMaterial{display:block;grid-column:1;grid-row:2;min-height:44px;padding:6px;font-size:11px}.touchControls #undo{grid-column:2;grid-row:2;width:44px;height:44px;padding:0;font-size:20px}.touchControls #desktopActions{display:none}
@media(max-height:450px) and (orientation:landscape){.touchControls #cameraPad{bottom:calc(112px + env(safe-area-inset-bottom));height:104px}.touchControls nav,.touchControls #stick{bottom:calc(42px + env(safe-area-inset-bottom))}.touchControls #buildTools{bottom:calc(112px + env(safe-area-inset-bottom))}}

nav[hidden]{display:none!important}

/* Primary entry choices: solo journey and the shared online park. */
#play,#onlinePlay{width:100%;min-height:54px;margin-top:12px;border-radius:16px;font-weight:800;letter-spacing:.02em;transition:transform .2s,box-shadow .2s,background .2s}
#play{background:linear-gradient(135deg,#d8b8ff,#8d6ae8 55%,#6de7ff);border-color:#f2e6ff9c;color:#170d2b;box-shadow:0 12px 34px #8d6ae84a}
#onlinePlay{background:linear-gradient(135deg,#153d50e8,#33235de8);border-color:#79e8ff8a;color:#c8f7ff;box-shadow:inset 0 0 24px #51ddff12,0 10px 30px #05031166}
#play:hover,#onlinePlay:hover{transform:translateY(-2px);box-shadow:0 15px 38px #8d6ae85c}
.portalArrival #onlinePlay{display:none}
/* Thumb-sized controls with separate touch ownership. */
.touchControls #stick{width:132px;height:132px;left:max(14px,env(safe-area-inset-left));bottom:calc(65px + env(safe-area-inset-bottom));border:1px solid #b4d6f354;background:radial-gradient(circle,#87c4e51f,#1420368c);z-index:15;touch-action:none}
.touchControls #stick i{width:48px;height:48px;left:41px;top:41px;background:#aab7edbd;border:1px solid #dae8ff80;box-shadow:0 3px 18px #080d2560;pointer-events:none}.touchControls #stick.engaged{border-color:#b6ecffb0}
.touchControls nav{gap:8px;align-items:flex-end;bottom:calc(66px + env(safe-area-inset-bottom))}.touchControls nav button{width:62px;height:66px;border-radius:20px;font-size:25px;background:#16243bdc;touch-action:none}.touchControls nav small{font-size:10px}.touchControls nav [data-action=use]{width:48px;height:50px;min-height:50px;font-size:18px;border-radius:15px;background:#26314b}.touchControls nav [data-action=use] small{font-size:8px}.touchControls nav [data-action=build]{width:70px;height:72px;border-color:#a8dafb80;background:#344c71e8}.touchControls nav [data-action=jump]{border-color:#c3b5f980}
.touchControls #cameraPad{width:126px;height:126px;bottom:calc(154px + env(safe-area-inset-bottom));border-radius:34px;gap:5px;background:#18243ab0}.touchControls #cameraPad span{font-size:26px}.touchControls #buildTools{right:150px;bottom:calc(167px + env(safe-area-inset-bottom));width:136px;max-width:136px}.touchControls #hint{display:none}.touchControls #constructionRule{font-size:9px;bottom:calc(47px + env(safe-area-inset-bottom))}.touchControls #inventory{font-size:9px;padding:8px;gap:8px}
@media(max-height:450px) and (orientation:landscape){.touchControls #stick{bottom:calc(42px + env(safe-area-inset-bottom));width:116px;height:116px}.touchControls #stick i{left:33px;top:33px}.touchControls nav{bottom:calc(42px + env(safe-area-inset-bottom))}.touchControls #cameraPad{bottom:calc(126px + env(safe-area-inset-bottom));height:116px}.touchControls #buildTools{bottom:calc(138px + env(safe-area-inset-bottom))}}

/* Keep the document from rubber-banding; dialogs retain their own scrolling. */
html,body{overscroll-behavior:none;width:100%;height:100%;overflow:hidden}
body{position:fixed;inset:0}
html.telegramGame body{height:var(--game-viewport-height,100%);transform:translateZ(0)}
html.telegramGame header{top:max(10px,var(--game-safe-top,0px))}
/* Lower the workshop/tools disclosure and keep zoom only on the camera pad. */
@media(max-width:700px),(pointer:coarse) and (max-height:600px){
 #mobileMenu{top:82px}
 #tools{top:135px}
 #tools #zoomIn,#tools #zoomOut{display:none}
}
.touchControls #tools #zoomIn,.touchControls #tools #zoomOut{display:none}
@media(max-height:500px) and (orientation:landscape){
 #mobileMenu{top:78px}
 #tools{top:125px;max-height:calc(100dvh - 137px);overflow-y:auto}
}
/* Lobby and quiet left-hand chat HUD. */
#modal{z-index:110;background:radial-gradient(ellipse at 80% 15%,#3b81ad30,transparent 60%),linear-gradient(115deg,#090d20ed,#10172b94);padding:20px;overflow:auto}
#modal .gameLobby{width:min(820px,100%);max-width:820px;max-height:calc(100dvh - 40px);overflow:auto;padding:32px;background:linear-gradient(140deg,#172942ed,#17162be8);border:1px solid #a8cfff35;border-radius:26px}
.gameLobby h2{font-size:clamp(26px,4vw,42px);letter-spacing:-1px;margin:14px 0}.gameLobby>p{max-width:560px;margin-bottom:22px}
.lobbyChoices{display:grid;grid-template-columns:1fr 1fr;gap:16px}.modeCard{display:flex;flex-direction:column;padding:23px;border:1px solid #9dc8ff45;border-radius:20px;background:radial-gradient(ellipse at top right,#519ee64a,transparent 80%),#15253d}.modeCard.solo{background:radial-gradient(ellipse at top right,#b776e647,transparent 80%),#221c36}.modeCard h3{font-size:25px;margin:16px 0 4px}.modeCard p{font-size:13px;line-height:1.6;flex:1}.modeCard small{font-size:9px;letter-spacing:1.4px;color:#b6e6ff}
#modal #onlinePlay{background:#d7f45c;color:#17230a;border:0;box-shadow:0 6px 25px #d7f41b20}#modal #play{background:#cbb9ff;color:#22183b;border:0;box-shadow:none}
.lobbySecondary{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}.lobbySecondary button{font-size:12px}.lobbySecondary button[hidden]{display:none}.lobbyHelp{margin-top:20px;border-top:1px solid #ffffff1c;padding-top:15px;color:#c0cee1;font-size:12px}.lobbyHelp summary{cursor:pointer;padding:5px}.lobbyHelp .guide{margin:12px 0}.arrivalLobby .online{display:none}.arrivalLobby .lobbyChoices{grid-template-columns:1fr}.arrivalLobby .modeCard h3,.arrivalLobby .modeCard p,.arrivalLobby .modeCard small{display:none}
body>header{top:max(12px,env(safe-area-inset-top));left:18px;right:18px}.brand{font-size:12px;letter-spacing:2px}.brand span{font-size:6px;letter-spacing:2px;margin-top:3px}body>header .pill{font-size:8px;padding:8px;max-width:50%;letter-spacing:.5px}body>aside{top:51px;left:18px;width:280px}body>aside h1{font-size:13px;margin:0;line-height:1.3}body>aside small,body>aside p,body>aside #steps{display:none}
#parkChat{position:fixed;left:18px;right:auto;top:79px;width:310px;max-width:calc(100vw - 90px);max-height:36dvh;margin:0;padding:9px 10px;background:linear-gradient(90deg,#10182942,#10182908);border:0;border-radius:8px;box-shadow:none;z-index:33;overflow:hidden;transition:background .2s}
#parkChat header{position:static;font-size:10px;color:#c6d9e8;pointer-events:auto}#parkChat header strong{font-weight:500}#chatMessages{height:120px;max-height:22dvh;margin:4px 0;overflow:auto;scrollbar-width:thin;text-shadow:0 1px 3px #000,0 1px 7px #000}#chatMessages p{font-size:12px;line-height:1.45;margin:5px 0;color:#fff}#chatMessages strong{display:inline;font-size:11px;color:#9cdeff}#chatMessages p button{display:none}#chatToggle{position:static;display:block;min-height:28px;padding:4px 0;border:0;background:transparent;box-shadow:none;backdrop-filter:none;color:#d5e3ed;font-size:11px}
#parkChat:not(.composing) #chatForm,#parkChat:not(.composing) #chatEmoji,#parkChat:not(.composing) #closeChat,#parkChat:not(.composing) #chatInfo,#parkChat:not(.composing) #chatInfo+div{display:none}#parkChat.composing{background:#101b2def;max-height:calc(var(--visible-height,100dvh) - 95px);overflow:auto;border:1px solid #a0c9e647;box-shadow:0 12px 45px #0005}#parkChat.composing #chatToggle{display:none}#parkChat.composing #chatMessages p button{display:block}#parkChat.composing #chatMessages{height:150px;min-height:40px}#parkChat.composing #chatForm{display:flex}#parkChat.composing #chatEmoji{display:flex}
.lobbyOpen #parkChat{display:none!important}
@media(max-width:700px){#modal{padding:12px}#modal .gameLobby{width:100%;margin:0;padding:20px;max-height:calc(100dvh - 24px)}.lobbyChoices{gap:10px}.modeCard{padding:14px}.modeCard h3{font-size:20px}.modeCard p{font-size:12px}.modeCard small{font-size:8px;letter-spacing:.5px}#modal #play,#modal #onlinePlay{padding:12px 7px;font-size:12px}.gameLobby>p{font-size:13px}.brand{font-size:10px}body>aside{left:12px;top:49px;width:65%}body>aside h1{font-size:11px}#parkChat{left:8px;top:70px;width:245px;max-width:calc(100vw - 78px)}#chatMessages{height:95px;max-height:18dvh}#chatMessages p{font-size:11px}#parkChat.composing{width:320px;max-width:calc(100vw - 24px)}#roundStatus{top:210px;font-size:10px;pointer-events:none}}
@media(max-width:360px){.lobbyChoices{grid-template-columns:1fr}.modeCard p{margin:5px 0}.modeCard h3{margin-top:8px}}
@media(max-height:500px) and (orientation:landscape){#parkChat{top:45px;width:240px}#chatMessages{height:70px}#modal .gameLobby{padding:18px}.gameLobby h2{font-size:25px}.gameLobby>p{margin:5px 0 12px}.modeCard{padding:12px}.modeCard h3{margin:8px 0}.lobbyHelp{margin-top:12px}}
/* Modal windows own the screen; game controls cannot cover their actions. */
body:has(#rooms:not([hidden]),#editor:not([hidden]),#arenaEditor:not([hidden]),#creatorStudio:not([hidden]),#glbWardrobe:not([hidden]),#profilePanel:not([hidden]),#companionPanel:not([hidden])),body.lobbyOpen{--dialog-open:1}
body:has(#rooms:not([hidden]),#editor:not([hidden]),#arenaEditor:not([hidden]),#creatorStudio:not([hidden]),#glbWardrobe:not([hidden]),#profilePanel:not([hidden]),#companionPanel:not([hidden])) :is(#stick,nav,#cameraPad,#buildTools,#desktopActions,#mobileMenu,#tools,#catchPlayer,#signals),body.lobbyOpen :is(#stick,nav,#cameraPad,#buildTools,#desktopActions,#mobileMenu,#tools,#catchPlayer,#signals){display:none!important;pointer-events:none!important}
#rooms{z-index:115;padding:12px;padding-top:calc(var(--ui-safe-top,env(safe-area-inset-top,0px)) + 12px);padding-bottom:calc(env(safe-area-inset-bottom,0px) + 12px)}
#rooms section{margin:0;max-height:calc(var(--visible-height,100dvh) - var(--ui-safe-top,env(safe-area-inset-top,0px)) - env(safe-area-inset-bottom,0px) - 24px);max-width:100%;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}
#roomBackTop{display:block;position:sticky;top:0;z-index:2;background:#263049;border-color:#a5c7ea70;min-height:44px;margin:0 0 18px!important}
#closeRooms{position:sticky;bottom:0;z-index:2;min-height:48px;background:#263049;border-color:#a5c7ea70}
html.telegramGame{--ui-safe-top:max(96px,var(--game-safe-top,0px))}
html.telegramGame body>header{top:calc(var(--ui-safe-top) + 8px)}
html.telegramGame body>aside{top:calc(var(--ui-safe-top) + 52px)}
html.telegramGame #mobileMenu{top:calc(var(--ui-safe-top) + 52px)}
html.telegramGame #tools{top:calc(var(--ui-safe-top) + 104px)}
html.telegramGame #parkChat{top:calc(var(--ui-safe-top) + 76px)}
html.telegramGame #modal{padding-top:calc(var(--ui-safe-top) + 12px)}
html.telegramGame #modal .gameLobby{max-height:calc(100dvh - var(--ui-safe-top) - 36px)}

/* Clear wardrobe selection and distinct primary actions. */
#glbWardrobe #glbEquip{background:linear-gradient(135deg,#9df6d8,#45d4d8);color:#082f35;border:1px solid #bdffea;font-weight:800;box-shadow:0 4px 20px #40d7c32b;min-height:48px}
#glbWardrobe #glbCompanion{background:linear-gradient(135deg,#9462e4,#6744bb);color:#fff;border:1px solid #c7a3ff;font-weight:750;min-height:48px;box-shadow:0 4px 20px #9262e42b}
#glbWardrobe :is(#glbEquip,#glbCompanion):disabled{opacity:.4;box-shadow:none;cursor:wait}
#glbWardrobe [data-model][aria-pressed="true"]{background:#343866;color:#d9fff3;border:2px solid #8cebd3;box-shadow:0 0 0 3px #8cebd318,0 0 18px #8cebd320;font-weight:800}
#glbWardrobe button:focus-visible{outline:3px solid #fff;outline-offset:3px}
#fpsBadge{position:fixed;top:calc(var(--ui-safe-top,env(safe-area-inset-top,0px)) + 10px);left:50%;transform:translateX(-50%);z-index:140;pointer-events:none;padding:4px 8px;border:1px solid #c5d9f120;border-radius:7px;background:#0b142b8c;color:#b0efda;font:600 10px/1.2 ui-monospace,monospace;font-variant-numeric:tabular-nums;letter-spacing:.3px;min-width:54px;text-align:center}
#fpsBadge[data-quality="medium"]{color:#f5dfa4}#fpsBadge[data-quality="low"]{color:#ffb7b7}
