@import url('ui-fonts.css?v=0.35.0');

:root{--ui-display:Launch,sans-serif;--ui-text:Nunito,sans-serif;--ui-panel:#1c2e5a;--ui-edge:#7196cf;--ui-text-color:#f5f2df;--ui-highlight:#baff38}
:root :is(body[data-ui=studio]){--ui-display:Manrope,sans-serif;--ui-text:Inter,sans-serif;--ui-panel:#191f2b;--ui-edge:#465570}
:root :is(:is(.players-panel,.broadcast-ui,.market-terminal,.news-reader)){font-family:var(--ui-text);font-size:15px;line-height:1.5;color:var(--ui-text-color)}
:root :is(:is(.players-panel,.market-terminal,.news-reader) :is(h1,h2,h3)){font-family:var(--ui-display);line-height:1.2;letter-spacing:0}
:root :is(:is(.players-panel,.market-terminal,.news-reader) h2){font-size:24px}
:root :is(:is(.players-panel,.market-terminal,.news-reader) :is(button,select,input)){font-family:var(--ui-text);font-size:14px;line-height:1.4;min-height:44px;border-radius:10px}
:root :is(:is(.players-panel,.market-terminal,.news-reader) button){font-weight:800}
:root :is(:is(.players-panel,.market-terminal,.news-reader)){background:var(--ui-panel);border:2px solid var(--ui-edge);border-radius:18px;box-shadow:0 12px 35px #08112b70}
:root :is(.players-toggle){font:900 12px/1.4 var(--ui-text);border:2px solid #293b66;border-radius:12px;background:#7de7ff;color:#152350;box-shadow:0 4px 0 #123858}
:root :is(.players-toggle[data-state=connected]){background:#baff38;color:#19352a;border-color:#345949}
:root :is(.players-toggle[data-state=full],.players-toggle[data-state=reconnecting]){background:#ffe369;color:#332b16;border-color:#8b7445}
:root :is(.players-panel p){font:600 14px/1.6 var(--ui-text);color:#d4e1f5}
:root :is(.players-panel summary){font:800 14px/1.5 var(--ui-text)}
:root :is(.players-panel button){background:#304d7f;border:1px solid #7293c6}
:root :is(.players-panel li button:disabled){opacity:.85;color:#e7efff}
:root :is(.broadcast-banner,.broadcast-countdown,.broadcast-panel){border-radius:14px;background:var(--ui-panel);font-family:var(--ui-text);box-shadow:0 6px 20px #08112b55}
:root :is(.broadcast-banner strong,.broadcast-banner summary){font-family:var(--ui-text);font-weight:900}
:root :is(.broadcast-banner p){font:600 15px/1.5 var(--ui-text)}
:root :is(.broadcast-ui :is(button,input,select,textarea)){font:700 14px/1.4 var(--ui-text);border-radius:9px;min-height:44px}
:root :is(.market-terminal header){background:var(--ui-panel)}
:root :is(.market-terminal :is(p,label,.market-small,.market-eyebrow)){font-family:var(--ui-text);font-size:14px;line-height:1.5}
:root :is(.market-terminal .paper-table){overflow-x:auto;max-width:100%}
:root :is(.market-terminal :is(table,.paper-table table)){font:600 13px/1.5 var(--ui-text);font-variant-numeric:tabular-nums}
:root :is(.market-terminal header button){font-size:13px;flex-shrink:0}
:root :is(.market-terminal .market-layout>*){min-width:0}
:root :is(.market-terminal .paper-stats){flex-wrap:wrap}
:root :is(.market-toggle){font:900 18px/1 var(--ui-text);border-radius:12px}
:root :is(.news-reader :is(p,a,small,button)){font-family:var(--ui-text);line-height:1.5}
:root :is(.character-page){background:#152350}













:root :is(body[data-ui=studio]){font-family:var(--ui-text)}
:root :is(body[data-ui=studio] :is(.asset-studio,.object-creator)){font:14px/1.5 var(--ui-text)}
:root :is(body[data-ui=studio] :is(.asset-studio,.object-creator) :is(button,input,select,textarea)){font-family:var(--ui-text);font-size:14px;min-height:44px}
:root :is(body[data-ui=studio] :is(.asset-studio,.object-creator) h2){font:800 22px/1.25 var(--ui-display)}
:root :is(body[data-ui=studio]>header .brand img){max-width:210px;height:auto}
:root :is(body[data-ui=studio] :is(.account,.roadmap,.checklist)){border-radius:14px}
:root :is(.home-header){font-family:var(--ui-text)}
:root :is(.home-header img){width:210px;height:auto}
:root :is(.districts){font:600 16px/1.6 var(--ui-text)}
:root :is(.districts h1){font:clamp(36px,7vw,68px)/1.03 var(--ui-display)}
:root :is(.districts :is(h2,h3)){font-family:var(--ui-display);letter-spacing:0}
:root :is(.districts :is(.project-card,.telegram-main-entry)){border-radius:18px;overflow:hidden;background:#20345c;border:2px solid #6987bf}
:root :is(.districts .project-card span,.telegram-main-entry strong){font:900 14px/1.5 var(--ui-text)}
@media(max-width:700px){
:root :is(.players-toggle){font-size:11px;max-width:220px}
:root :is(.players-panel){padding:14px;max-height:60dvh}
:root :is(:is(.players-panel,.market-terminal,.news-reader) h2){font-size:21px}









:root :is(.market-terminal){padding:14px;max-width:calc(100vw - 16px)}
:root :is(.market-terminal header){align-items:start}
:root :is(.market-terminal header button){max-width:88px}
:root :is(.districts .telegram-main-entry){display:flex;flex-direction:column}
:root :is(.home-header img){width:170px}
}

/* Published Studio worlds use player typography; editing stays in Inter/Manrope. */
:root body.studio-shell.public{--ui-display:Launch,sans-serif;--ui-text:Nunito,sans-serif;--ui-panel:#1c2e5a}
:root body.studio-shell.public :is(.topbar,.project-help,.project-actions){font-family:var(--ui-text)}

/* Compact chat: identity/settings share one header; reactions are an optional tray. */
:root #plazaChat{width:380px;max-height:min(540px,72dvh);overflow:visible}
:root #plazaChat:has(#chatForm:not([hidden])){height:min(540px,72dvh)}
:root #plazaChat .chat-heading{gap:6px;padding:4px 8px;border-radius:16px 16px 0 0;flex:none;min-height:52px}
:root #plazaChat .chat-heading h2{font:20px Launch,sans-serif;margin:0;flex:none}
:root #plazaChat #chatIdentity{margin:0 0 0 auto;min-width:0;font:800 12px/1.3 Nunito,sans-serif}
:root #plazaChat #chatDisplayName{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:160px}
:root #plazaChat #chatClose{padding:0;width:44px;flex:none;min-height:44px}
:root #plazaChat .chat-options{position:relative;margin-left:auto;flex:none}
:root #plazaChat:has(#chatIdentity:not([hidden])) .chat-options{margin-left:0}
:root #plazaChat .chat-options>summary{display:grid;place-items:center;list-style:none;width:44px;height:44px;cursor:pointer;font:900 24px Nunito}
:root #plazaChat .chat-options>summary::-webkit-details-marker{display:none}
:root #plazaChat .chat-options-content{position:absolute;right:0;top:46px;z-index:4;width:210px;padding:8px;background:#203760;border:1px solid #81a8de;border-radius:12px;box-shadow:0 8px 20px #08112b80}
:root #plazaChat .chat-channels{padding:0;gap:6px}
:root #plazaChat .chat-channels:has(#telegramChannel[hidden]){display:none}
:root #plazaChat #editChatName{width:100%;margin-top:6px}
:root #plazaChat:has(#chatIdentity[hidden]) #editChatName{display:none}
:root #plazaChat:has(#chatIdentity[hidden]):has(#telegramChannel[hidden]) .chat-options{display:none}
:root #plazaChat #chatStatus{font:600 11px/1.4 Nunito;margin:6px 12px;flex:none}
:root #plazaChat #chatMessages{min-height:0;padding:0 12px;flex:1 1 auto;font:600 14px/1.45 Nunito}
:root #plazaChat #chatMessages li{padding:6px 0}
:root #plazaChat #chatMessages .chat-sender{display:inline-block;min-height:28px;padding:3px 6px 3px 0;margin:0;font:900 12px/1.4 Nunito;vertical-align:baseline;box-shadow:none}
:root #plazaChat #chatForm{padding:8px;gap:6px;flex:none;align-items:center;border-top:1px solid #7293c640}
:root #plazaChat #chatText{min-height:44px;font-size:16px;padding:8px}
:root #plazaChat #chatSend{padding:8px 10px;min-height:44px;font-size:12px}
:root #plazaChat #chatReactionToggle{width:44px;min-height:44px;flex:none;padding:0;font:24px Nunito;background:#304d7f;color:#ffe369}
:root #plazaChat .chat-reaction-tray{position:absolute;left:8px;bottom:67px;z-index:3;border:1px solid #81a8de;border-radius:12px;background:#203760;box-shadow:0 8px 20px #08112b80}
:root #plazaChat .chat-reactions{padding:6px;gap:4px}
:root #plazaChat .chat-reactions button{padding:0;min-width:44px;min-height:44px}
:root #plazaChat:has(#chatForm[hidden]) .chat-reaction-tray{display:none}
:root #plazaChat #chatModeration{flex:none;max-height:35%;overflow:auto;font:700 12px/1.4 Nunito;padding:0 12px 6px}
:root #plazaChat #chatModeration summary{min-height:32px;padding:6px 0;cursor:pointer}
:root #plazaChat :is(summary,button):focus-visible{outline:3px solid #ffe369;outline-offset:2px}
#sprintTouch{display:none}
.performance-help{margin-top:14px}.performance-help a{color:#7de7ff}
@media(max-width:700px){
 :root #plazaChat{width:auto;left:12px;right:12px;max-height:calc(100dvh - 130px - var(--chat-keyboard,0px) - var(--tg-safe-top,0px));bottom:calc(12px + var(--chat-keyboard,0px) + var(--tg-safe-bottom,0px))}
 :root #plazaChat:has(#chatForm:not([hidden])){height:min(560px,calc(100dvh - 130px - var(--chat-keyboard,0px) - var(--tg-safe-top,0px)))}
 :root #plazaChat #chatDisplayName{max-width:130px}
 #sprintTouch{display:block;position:fixed;right:112px;bottom:34px;z-index:6;min-width:64px;min-height:48px;background:#7de7ff;color:#152350;touch-action:none}
 .walk-pad .touch-sprint{grid-column:1 / -1;width:100%;font-size:12px;touch-action:none}
 #touchWalk .touch-sprint{touch-action:none}
 body:has(#plazaChat:not([hidden])) #sprintTouch{display:none}
}

/* Chat identity row: CHANGE NAME is a secondary action and must not outweigh the chat text. */
:root #plazaChat #editChatName{font:800 11px/1.3 Nunito,sans-serif;letter-spacing:.04em;min-height:34px;padding:6px 10px;border-radius:9px}
