
@font-face{font-family:BuildPixel;src:url('./vt323.ttf') format('truetype');font-display:swap}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#bfe7ff;color:#24342e;font:12px system-ui}#map{position:absolute;inset:0;background:#bfe7ff}button,input,select,summary{-webkit-tap-highlight-color:transparent}button,summary{cursor:pointer}button,select,input[type=number]{font:inherit;color:inherit;background:#f5f7f4;border:1px solid #d6ded6;border-radius:7px;min-height:34px;padding:6px 10px}button:hover,summary:hover{background:#eaf0e9}button:disabled{opacity:.4;cursor:default}button:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #27825b;outline-offset:3px}[hidden]{display:none!important}label{display:flex;align-items:center;gap:6px}input[type=checkbox],input[type=range]{accent-color:#267957}header{position:fixed;top:16px;left:16px;z-index:4;width:310px;max-width:calc(100% - 70px)}.searchbar{display:flex;align-items:center;gap:8px;background:#fffffff5;border:1px solid #d5dfd5;border-radius:12px;padding:8px;box-shadow:0 4px 18px #183c2920}.brand{display:grid;place-items:center;width:32px;height:32px;flex-shrink:0;background:#e5efe3;color:#39734b;border-radius:8px;font-size:24px}#search{min-width:0;width:100%;background:none;border:0;outline:none;padding:5px;font:13px system-ui;color:#263e31}.map-options{position:relative}.map-options>summary{list-style:none;display:grid;place-items:center;width:34px;height:34px;border-radius:6px;font-size:21px}.map-options>summary::-webkit-details-marker{display:none}.map-popover{position:absolute;right:0;top:48px;width:290px;padding:16px;background:#fffffff9;border:1px solid #d5dfd5;border-radius:12px;box-shadow:0 8px 24px #132c2429}.map-popover strong{font-size:13px}.map-popover .tools{margin-top:14px}#status,#altitude{font-size:11px;line-height:1.5;color:#6d7e73}.tilt-control{margin-top:12px}.tilt-control input{width:120px}.tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap}#edit{position:fixed;left:16px;top:86px;z-index:3;min-width:162px;height:44px;padding:0 20px;border:2px solid #242723;border-radius:0;background:repeating-linear-gradient(0deg,#ffffff03 0 2px,#00000003 2px 4px),#777;box-shadow:inset 2px 2px #c6c6c6,inset -2px -3px #414141,0 2px 0 #0004;color:#fff;font:23px system-ui,sans-serif;text-shadow:2px 2px #303030;touch-action:manipulation}#edit:hover{background-color:#85859c;color:#ffffae}#edit[aria-pressed=true]{background-color:#5e7165;box-shadow:inset 2px 2px #acbfae,inset -2px -3px #344538}
#editor{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);z-index:5;width:368px;max-width:calc(100% - 24px);background:#fffffff7;border:1px solid #d2ddd2;border-radius:15px;box-shadow:0 8px 35px #193b2d30;overflow:hidden}.editor-head{height:46px;display:flex;align-items:center;gap:9px;padding:10px 12px;border-bottom:1px solid #e4e9e2}.editor-mark{display:grid;place-items:center;width:30px;height:30px;background:#e6f1e4;border-radius:8px;color:#3d7751;font-size:22px}.editor-title{flex:1}.editor-title strong{font:19px system-ui,sans-serif;display:block}.editor-title small{font-size:10px;color:#7b8a7d}.icon-button{width:30px;min-height:30px;padding:2px;font-size:18px;background:transparent;border-color:transparent}.editor-body{padding:10px;max-height:calc(75dvh - 52px);overflow-y:auto}.action-row{display:flex;gap:8px;align-items:center;margin-bottom:8px}.mode-switch{display:flex;padding:3px;gap:3px;border-radius:8px;background:#edf2eb;flex:1}.mode-switch button{border:0;background:transparent;min-height:31px;flex:1;color:#637267;font-weight:600}.mode-switch button[aria-pressed=true]{background:#fff;color:#256044;box-shadow:0 1px 4px #172e1920}.mode-switch button[data-mode=remove][aria-pressed=true]{color:#b14943}.section-label{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px;color:#728074;font-size:10px;font-weight:700;letter-spacing:.09em;text-transform:uppercase}.color-custom{font-size:10px;letter-spacing:0;text-transform:none;font-weight:500}#cube-color{border:0;background:none;padding:0;width:24px;height:24px;cursor:pointer}.palette{display:grid;grid-template-columns:repeat(10,1fr);gap:6px;margin-bottom:10px}.swatch{padding:0;min-height:26px;height:26px;border-radius:5px;border:1px solid #00000015;position:relative}.swatch:hover{background:var(--swatch);transform:translateY(-1px)}.swatch[aria-pressed=true]{outline:2px solid #2d7350;outline-offset:2px}.swatch[aria-pressed=true]:after{content:'✓';position:absolute;inset:0;display:grid;place-items:center;color:#fff;font-size:16px;text-shadow:0 1px 3px #000,0 0 2px #000}.dimensions{display:flex;gap:10px;padding:7px;background:#f3f6f0;border-radius:8px}.dimensions label{flex:1;color:#71816f;font-size:11px;justify-content:space-between}.dimensions input{width:58px}.dimensions select,.dimensions input{background:#fff;min-height:30px;padding:4px 6px}.editor-bottom{display:flex;align-items:center;justify-content:space-between;margin-top:8px;gap:8px}#cube-count{font-size:10px;color:#6e7e72;margin:0;line-height:1.4}.editor-extras{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}.camera-tools[open]{grid-column:1/-1}.camera-tools{margin-top:8px;border-top:1px solid #e5ebe2;padding-top:7px}.camera-tools summary{color:#657b68;font-size:11px;user-select:none;padding:3px 0}.camera-tools .tools{margin-top:10px}.camera-tools button{flex:1;min-width:35px}.camera-tools p{font-size:11px;color:#7b8a7d;line-height:1.6}.camera-tools #clear{color:#ab5148;background:#fbf4f0}.quiet-help{font-size:10px;color:#88958a;margin:12px 0 0;line-height:1.6}kbd{font:10px system-ui;background:#edf2e9;padding:1px 4px;border-radius:3px;color:#4d6a53}#editor.is-minimized .editor-body{display:none}#editor.is-minimized .editor-head{border-bottom:0}.maplibregl-ctrl-scale{background:#ffffffe6}.maplibregl-popup-content{color:#172c3f}footer{position:fixed;bottom:8px;left:50%;transform:translateX(-50%);font-size:9px;letter-spacing:.1em;color:#3e6050;background:#ffffffc9;padding:3px 8px;border-radius:4px;pointer-events:none;white-space:nowrap}#error{position:fixed;top:40%;left:10%;right:10%;z-index:10;padding:15px;background:#fff3e9;color:#8b3026;border-radius:8px}
@media(max-width:600px){header{left:12px;top:12px;width:280px}#search{font-size:16px}#edit{left:12px;top:78px;min-width:140px;height:40px;font-size:21px}#editor{bottom:35px;width:352px}.editor-body{max-height:calc(65dvh - 52px)}.palette{gap:6px}.swatch{min-height:25px;height:25px}footer{display:none}.map-popover{width:270px}}
@media(prefers-reduced-motion:no-preference){button{transition:background-color .12s,box-shadow .12s}.editor-body{scroll-behavior:smooth}}

/* Horizontal building dock, matching the supplied layout. */
#editor{left:12px;right:12px;bottom:30px;transform:none;width:auto;max-width:none;border:2px solid #334258;border-radius:0;background:#f8faff;box-shadow:inset 2px 2px #fff,inset -2px -2px #b6c2d4,0 3px 0 #23304440;overflow:visible;padding:8px}
.editor-head{height:36px;padding:0 2px 7px;gap:10px;border:0}.editor-title{display:flex;align-items:baseline;gap:9px;min-width:190px}.editor-title strong{font:17px system-ui;color:#24344f;white-space:nowrap}#cube-count{font:11px monospace;color:#60718a}.action-row{margin:0;gap:6px}.mode-switch{padding:0;background:none;gap:5px}.mode-switch button,#editor .icon-button{border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;min-height:30px;height:30px;color:#536884}.mode-switch button{font-size:11px;white-space:nowrap}.mode-switch button[aria-pressed=true]{background:#286ee9;color:#fff;box-shadow:inset 2px 2px #8fb4ff,inset -2px -2px #1646a4}.mode-switch button[data-mode=remove][aria-pressed=true]{color:#fff;background:#b74f53}#editor .icon-button{flex-shrink:0}#minimize-editor{margin-left:auto}.editor-body{display:grid;grid-template-columns:minmax(0,1fr) 178px;gap:8px;padding:0;overflow:visible;max-height:none}.palette-tray{background:#e4eaf4;border:2px solid #35445b;padding:7px;box-shadow:inset 2px 2px #fff;display:flex;align-items:flex-start;gap:8px;min-height:76px}.palette{display:flex;flex-wrap:wrap;gap:5px;margin:0;flex:1;align-content:flex-start}.swatch{width:27px;height:27px;min-height:27px;flex:0 0 27px;border:2px solid #5a6474;border-radius:0;box-shadow:inset 2px 2px #ffffff50,inset -2px -2px #00000025}.swatch[aria-pressed=true]{outline:2px solid #18283f;outline-offset:2px}.swatch[aria-pressed=true]:after{content:none}.color-custom{border-left:1px solid #b5c1d2;display:flex;align-items:center;gap:3px;padding-left:7px;color:#667994;font-size:14px}#cube-color{width:26px;height:29px}.build-settings{border:1px solid #acbad0;box-shadow:inset 2px 2px #fff,inset -2px -2px #c5cede;padding:5px;background:#edf2fb;display:flex;flex-direction:column;gap:4px}.dimensions{padding:0;background:none;border-radius:0;gap:6px}.dimensions label{font-size:10px;gap:3px;color:#536984;min-width:0}.dimensions select,.dimensions input{border-radius:0;min-height:26px;height:26px;padding:2px;width:47px;border-color:#acbad0}.build-settings #home{border-radius:0;min-height:27px;padding:3px;font-size:11px;color:#435e85;background:#e0e9f8;border-color:#a5b6cf}.editor-extras{display:flex;gap:7px;position:static}.camera-tools{margin:0;padding:0;border:0;position:relative}.camera-tools summary{list-style:none;border:1px solid #a0afc5;padding:6px 8px;height:30px;color:#536884;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;font-size:11px;white-space:nowrap}.camera-tools summary::-webkit-details-marker{display:none}.camera-tools[open]{position:relative}.camera-tools[open]>:not(summary){background:#f8faff;margin:0;padding:10px;width:290px;border-left:1px solid #a0afc5;border-right:1px solid #a0afc5}.camera-tools[open]{display:flex;flex-direction:column}.camera-tools[open] summary{order:2}.camera-tools[open]{position:absolute;bottom:calc(100% + 8px);right:88px;box-shadow:0 -5px 20px #24344f25}.camera-tools[open]>.tools{border-top:1px solid #a0afc5}.camera-tools p{color:#60718a}.camera-tools p:last-child{padding-bottom:14px}#editor.is-minimized{width:420px;max-width:calc(100% - 24px)}#editor.is-minimized .action-row,#editor.is-minimized .editor-extras{display:none}#editor.is-minimized .editor-head{padding-bottom:0;height:30px}.camera-tools button{border-radius:0}
@media(max-width:760px){#editor{left:8px;right:8px;bottom:30px;padding:7px}.editor-head{flex-wrap:wrap;height:auto;min-height:66px;gap:5px;padding-bottom:7px}.editor-title{min-width:0;flex:1;order:0}.editor-title strong{font-size:14px}.editor-title #cube-count{font-size:9px}.action-row{order:3;flex:1}.editor-extras{order:4;gap:4px}#minimize-editor,#close-editor{order:1}.editor-body{grid-template-columns:minmax(0,1fr) 122px;gap:5px}.palette-tray{min-height:94px;padding:5px;display:block}.palette{gap:4px;max-height:110px;overflow-y:auto;padding:3px}.swatch{width:25px;height:25px;min-height:25px;flex-basis:25px}.color-custom{border:0;padding:3px 0 0;justify-content:flex-end}#cube-color{height:23px}.dimensions{flex-direction:column;gap:4px}.dimensions label{flex:auto}.build-settings{justify-content:space-between}.build-settings #home{font-size:10px}.camera-tools summary{font-size:10px;padding:6px}#editor.is-minimized{width:auto}.camera-tools[open]{bottom:calc(100% + 8px);right:8px}.editor-title{gap:5px}.mode-switch button{padding:4px 7px}}

/* Full-height vertical dock. */
#editor{top:12px;bottom:12px;left:12px;right:auto;width:190px;max-width:calc(100% - 24px);display:flex;flex-direction:column;padding:8px;gap:8px}
.editor-head{display:flex;flex-wrap:wrap;align-content:flex-start;flex-shrink:0;height:auto;min-height:0;gap:7px;padding:0;max-height:55dvh;overflow-y:auto}.editor-title{flex:0 0 100%;min-width:0;display:block;order:0}.editor-title strong{font-size:16px}.editor-title #cube-count{font-size:10px;margin:5px 0 0}.action-row{order:2;flex:0 0 100%;gap:5px}.mode-switch{flex:1;min-width:0}.mode-switch button{padding:4px;font-size:10px}.editor-extras{order:3;flex:0 0 100%;display:flex;flex-direction:column;gap:6px}.camera-tools summary{font-size:11px;padding:6px 8px}.camera-tools[open]{position:static;bottom:auto;right:auto;box-shadow:none;display:block}.camera-tools[open] summary{order:0}.camera-tools[open]>:not(summary){width:100%;padding:7px;border:1px solid #b6c3d5}.camera-tools[open]>.tools{gap:4px}.camera-tools button{min-width:26px;padding:4px}.camera-tools p{font-size:10px}.editor-head #minimize-editor{order:1;margin-left:auto}.editor-head #close-editor{order:1}.editor-body{display:flex;flex:1;min-height:0;flex-direction:column;gap:8px;overflow-y:auto}.palette-tray{display:flex;flex-direction:column;flex:1;min-height:100px;gap:8px;padding:7px;overflow-y:auto}.palette{display:grid;grid-template-columns:repeat(4,27px);justify-content:space-between;align-content:start;flex:1;gap:7px 5px;max-height:none;overflow:visible;padding:2px}.swatch{width:27px;height:27px;min-height:27px}.color-custom{width:100%;border-left:0;border-top:1px solid #b5c1d2;padding:7px 0 0;justify-content:flex-end}.build-settings{flex-shrink:0;gap:7px}.dimensions{flex-direction:column;gap:6px}.dimensions label{flex:auto}.dimensions select,.dimensions input{width:66px}.build-settings #home{font-size:11px;min-height:30px}#editor.is-minimized{width:190px;max-width:calc(100% - 24px);bottom:auto;gap:0}#editor.is-minimized .editor-head{height:auto;min-height:0;padding:0;overflow:visible}body:has(#editor:not([hidden])) header{left:218px;max-width:calc(100% - 280px)}body:has(#editor:not([hidden])) #edit{left:218px}
@media(max-width:600px){#editor{left:8px;top:8px;bottom:30px;width:178px;padding:7px}.palette{grid-template-columns:repeat(4,25px);gap:6px 4px}.swatch{width:25px;height:25px;min-height:25px}.editor-title strong{font-size:14px}.editor-title #cube-count{font-size:9px}.mode-switch button{font-size:9px;padding:4px 3px}#editor.is-minimized{width:178px;bottom:auto}body:has(#editor:not([hidden])) header{left:194px;width:calc(100% - 246px);max-width:none}.searchbar{gap:3px}body:has(#editor:not([hidden])) .brand{display:none}body:has(#editor:not([hidden])) #search{font-size:12px;padding:0}body:has(#editor:not([hidden])) .map-options>summary{width:24px}body:has(#editor:not([hidden])) #edit{left:194px;min-width:0;width:calc(100% - 206px);font-size:19px;padding:0 6px}.map-popover{right:0;width:min(270px,calc(100vw - 28px))}}
.editor-body{overflow:hidden}.palette-tray{overflow:hidden;min-height:80px}.palette{min-height:0;overflow-y:auto;flex:1;scrollbar-width:thin;align-content:start}.color-custom{flex-shrink:0;background:#e4eaf4;margin-top:auto}.build-settings #build-action{height:48px;min-height:48px;border:2px solid #263f67;border-radius:0;background:#286ee9;box-shadow:inset 2px 2px #8fb4ff,inset -2px -3px #1646a4;color:#fff;font:21px system-ui,sans-serif;text-shadow:1px 2px #173f83}.build-settings #build-action:hover{background:#387ef5}.build-settings #build-action[aria-pressed=false]{background:#607da7}.build-settings #home{height:30px}
.palette-tray{align-items:stretch;padding-right:2px}.palette{align-self:stretch;width:100%;padding:5px 4px 5px 4px;scrollbar-gutter:stable;grid-template-columns:repeat(4,27px)}.color-footer{display:flex;align-items:center;justify-content:space-between;flex-shrink:0;gap:5px;margin:0 5px 0 0;padding:7px 0 0;border-top:1px solid #b5c1d2;min-height:36px}#recent-colors{display:flex;gap:4px;align-items:center;min-width:0;flex:1}#recent-colors:empty:before{content:'Recentes';font-size:9px;color:#78879b}.recent-swatch{width:19px;height:21px;min-height:21px;padding:0;flex:0 0 19px;border-radius:0;border:1px solid #66758b;box-shadow:inset 1px 1px #ffffff55;cursor:pointer}.recent-swatch[aria-pressed=true]{outline:1px solid #1c395e;outline-offset:1px}.color-footer .color-custom{width:auto;margin:0;padding:0;border:0;gap:3px;flex-shrink:0}@media(max-width:600px){.palette-tray{padding-right:2px}.palette{grid-template-columns:repeat(4,25px)}.recent-swatch{width:17px;flex-basis:17px}#recent-colors{gap:3px}}

/* Title and window controls share one compact row. */
.editor-title{flex:1 1 0;min-width:0;order:0;align-self:center}.editor-title strong{font-size:16px}#cube-count{display:none}#cube-count.is-notice{display:block;position:absolute;left:calc(100% + 12px);top:0;width:240px;background:#f8faff;border:1px solid #a0afc5;padding:10px;color:#435e85;font:12px system-ui;box-shadow:0 3px 12px #24344f20}.editor-head #minimize-editor{margin-left:0}.editor-head #minimize-editor,.editor-head #close-editor{order:1}.editor-head{min-height:30px}.editor-title #cube-count{margin:0}@media(max-width:600px){#cube-count.is-notice{left:0;top:calc(100% + 6px);width:100%;z-index:8}.editor-title strong{font-size:15px}}

/* Construction launcher sits above the bottom-left map controls. */
#edit,body:has(#editor:not([hidden])) #edit{top:auto;left:24px;bottom:20px;width:162px;min-width:162px;padding:0 20px}
@media(max-width:600px){#edit,body:has(#editor:not([hidden])) #edit{top:auto;left:20px;bottom:20px;width:150px;min-width:150px;padding:0 12px}}

/* Shared pixel typeface across application menus and interface controls. */
html body,body button,body input,body select,body option,body summary,body output,body label,body kbd,body small,body strong,body p,body footer,body .editor-title strong,body #cube-count,body #status,body #altitude,body #search,body #recent-colors:empty:before,body .maplibregl-control-container,body .maplibregl-popup-content{font-family:system-ui,sans-serif}


.build-settings #home{border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;font-weight:400;text-shadow:none}
.build-settings #home:hover{background:#eaf0e9}

.build-settings #build-action{height:68px;min-height:68px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}.build-settings #build-action small{font:14px system-ui,sans-serif;color:inherit}.maplibregl-ctrl-group{background:transparent;box-shadow:none!important;border-radius:0;display:flex;flex-direction:column;gap:6px}.maplibregl-ctrl-group button{width:30px;height:30px;min-height:30px;border:1px solid #a0afc5!important;border-radius:0!important;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884}.maplibregl-ctrl-group button:hover{background:#eaf0e9}.maplibregl-ctrl-group button .maplibregl-ctrl-icon{background-image:none!important;display:grid;place-items:center;font:22px system-ui,sans-serif}.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon:after{content:'+'}.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon:after{content:'−'}

@font-face{font-family:PixelNumbers;src:url('./vt323.ttf') format('truetype');font-display:swap}
.build-settings #build-action{height:54px;min-height:54px;gap:1px;font-size:20px}.build-settings #build-action #build-budget{font-family:system-ui,sans-serif;font-size:21px;line-height:20px;font-weight:400;letter-spacing:1px;font-variant-numeric:tabular-nums;text-shadow:1px 2px #173f83}

#cube-count,#cube-count.is-notice{display:none!important}#notifications{position:fixed;z-index:20;top:20px;left:50%;transform:translateX(-50%);width:320px;max-width:calc(100vw - 32px);pointer-events:none}.notification-card{position:absolute;top:0;left:0;width:100%;min-height:62px;display:flex;gap:10px;align-items:center;padding:12px 14px;background:#f8faff;border:1px solid #a0afc5;border-radius:0;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1,0 3px 8px #23304420;color:#536884;transform:translateY(var(--notice-offset,0px)) scale(var(--notice-scale,1));transform-origin:top center;transition:transform .28s cubic-bezier(.22,.61,.36,1);}.notification-card p{margin:0;font:14px/1.45 system-ui,sans-serif}.notification-icon{flex-shrink:0;display:grid;place-items:center;width:24px;height:24px;font:20px system-ui,sans-serif;background:#e3e9f2;border:1px solid #a0afc5;box-shadow:inset 1px 1px #fff,inset -1px -1px #a0adc1}.notification-live{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}@media(prefers-reduced-motion:reduce){.notification-card{transition:none}}@media(max-width:600px){#notifications{top:18px;left:auto;right:12px;transform:none;width:min(260px,calc(100vw - 32px))}}

#notifications{top:20px;left:20px;right:auto;transform:none;width:320px;max-width:calc(100vw - 40px)}body:has(#editor:not([hidden])) #notifications{left:218px;max-width:calc(100vw - 234px)}@media(max-width:600px){#notifications{top:16px;left:16px;right:auto;width:260px;max-width:calc(100vw - 32px)}body:has(#editor:not([hidden])) #notifications{left:194px;max-width:calc(100vw - 206px)}.notification-card{padding:10px;gap:7px}.notification-card p{font-size:12px;overflow-wrap:anywhere}.notification-icon{width:19px;height:21px;font-size:17px}}

#interface-tooltip{position:fixed;z-index:1000;pointer-events:none;max-width:min(280px,calc(100vw - 16px));padding:7px 10px;color:#fff;background:#101014f5;border:0;box-shadow:none;border-radius:6px;font:13px/1.4 system-ui,sans-serif;text-shadow:none;overflow-wrap:anywhere}

#how-build{width:100%;height:30px;text-align:left;font:11px system-ui,sans-serif;border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;padding:6px 8px}#build-tutorial{position:fixed;inset:0;margin:auto;width:470px;max-width:calc(100vw - 32px);max-height:calc(100dvh - 40px);overflow:auto;padding:22px;background:#101014;color:#eee;border:0;border-radius:10px;font:14px/1.45 system-ui,sans-serif;box-shadow:0 14px 60px #0005}#build-tutorial::backdrop{background:#0006}.tutorial-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.tutorial-heading h2{margin:0;font:600 20px system-ui,sans-serif}.tutorial-heading #close-tutorial{background:#ffffff12;border:0;border-radius:5px;color:#fff;box-shadow:none;font:22px system-ui;min-height:30px;padding:0;width:30px}#build-tutorial .tutorial-intro{font:13px/1.5 system-ui;color:#b6b6c0;margin:10px 0 18px}#build-tutorial dl{margin:0}#build-tutorial dt{font:600 13px/1.4 system-ui;color:#fff;margin:13px 0 3px}#build-tutorial dd{font:13px/1.45 system-ui;color:#c4c4cf;margin:0}#build-tutorial #tutorial-done{width:100%;margin-top:20px;border:1px solid #ffffff30;background:#ffffff12;border-radius:6px;color:#fff;box-shadow:none;font:14px system-ui;min-height:38px}

#build-tutorial{scrollbar-width:thin;scrollbar-color:#45454f #101014;color-scheme:dark}#build-tutorial::-webkit-scrollbar{width:9px}#build-tutorial::-webkit-scrollbar-track{background:#101014;border-radius:10px}#build-tutorial::-webkit-scrollbar-thumb{background:#45454f;border:2px solid #101014;border-radius:10px}#build-tutorial::-webkit-scrollbar-thumb:hover{background:#646471}#build-tutorial::-webkit-scrollbar-corner{background:#101014}

.maplibregl-ctrl-group button:not(:disabled):hover,.maplibregl-ctrl-group button:not(:disabled):focus-visible{background-color:#e3e9f2;opacity:1}.maplibregl-ctrl-group button:not(:disabled):active{background-color:#cad6e8;opacity:1}

.maplibregl-ctrl-scale{visibility:hidden;pointer-events:none}
#selection-panel{position:fixed;z-index:5;left:12px;top:50%;transform:translateY(-50%);width:190px;max-width:calc(100vw - 64px);padding:9px;background:#f8faff;border:2px solid #536884;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884}.selection-head{display:flex;align-items:center;justify-content:space-between;gap:5px}.selection-head strong{font-size:13px;font-weight:400}.selection-head button{width:28px;height:28px;min-height:28px;padding:0;border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884}#selection-panel p{font-size:11px;line-height:1.5;margin:12px 0 6px}#selection-panel output{font:17px system-ui,sans-serif;overflow-wrap:anywhere}@media(max-width:600px){#selection-panel{left:8px;width:178px}}#place-search{position:fixed;left:12px;top:12px;z-index:8;display:flex;align-items:flex-start;gap:7px}#place-search button,.save-place button{border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;min-height:30px;padding:6px;font-size:12px}#place-search .search-toggle{width:34px;height:34px;display:grid;place-items:center;padding:0;line-height:1}.place-search-box{width:300px;max-width:calc(100vw - 70px);padding:9px;background:#f8faff;border:2px solid #536884;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1}.place-search-box form{display:flex;gap:5px}.place-search-box input,.save-place input{min-width:0;width:100%;padding:7px;border:1px solid #a0afc5;border-radius:0;background:white;color:#536884;font:13px system-ui,sans-serif}.place-results{display:flex;flex-direction:column;gap:5px;max-height:40vh;overflow-y:auto;margin:7px 0;font-size:12px}.place-results button{text-align:left;line-height:1.5}.place-search-box small{font:10px system-ui;color:#69798a}.save-place{margin-top:10px;padding-top:8px;border-top:1px solid #b5c1d2}.save-place>button,.save-place form button{width:100%}.save-place form{margin-top:8px}.save-place label{display:block;font-size:11px;line-height:1.5}.save-place input{margin:5px 0 7px}.save-place .save-place-status{font-size:11px;margin:7px 0 0}body:has(#editor:not([hidden])) #place-search{left:218px}@media(max-width:600px){#place-search{left:8px;top:8px}body:has(#editor:not([hidden])) #place-search{left:194px}.place-search-box{max-width:calc(100vw - 240px)}} 
#world{position:fixed;inset:0;width:100vw;height:100vh;touch-action:none}html,body{background:#f3f0e9}#zoom-controls{position:fixed;right:12px;top:12px;z-index:3}#paint-move{height:30px;width:100%;border-radius:0}#editor .build-settings #build-action:disabled{opacity:.45}#editor .swatch:hover{background-color:var(--swatch)}

@media(max-width:600px){}

/* Keep document gestures out of the mural and respect mobile browser chrome. */
html,body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none;touch-action:pan-y;-webkit-text-size-adjust:100%}
button,input,summary{touch-action:manipulation}#world{height:100dvh}#editor,.palette,#build-tutorial{overscroll-behavior:contain}.palette,#build-tutorial{touch-action:pan-y}button{-webkit-tap-highlight-color:transparent}
@media(pointer:coarse){#zoom-controls{top:max(12px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right))}#zoom-controls button{width:44px;height:44px}#editor .icon-button,.mode-switch button,#how-build{min-height:40px;height:40px}.swatch:hover{transform:none}}
@media(max-width:600px) and (min-height:500px){
 #editor{left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));top:auto;bottom:max(8px,env(safe-area-inset-bottom));width:auto;max-width:none;height:min(56dvh,460px);padding:10px;gap:8px}
 #editor.is-minimized{width:auto;bottom:max(8px,env(safe-area-inset-bottom));height:auto;max-width:none}
 .editor-head{gap:7px;overflow:visible;max-height:none}.editor-head #minimize-editor{margin-left:auto}
 .editor-body{min-height:0}.palette-tray{min-height:80px;padding:5px 2px 5px 5px}.palette{grid-template-columns:repeat(8,minmax(0,1fr));gap:8px 6px;padding:5px 4px;scrollbar-gutter:stable}
 .swatch{width:100%;height:auto;min-height:30px;aspect-ratio:1;max-height:42px;min-width:0}
 .build-settings{display:grid;grid-template-columns:1fr 1fr;align-items:stretch}.build-settings #home{height:54px;min-height:44px}
 #edit,body:has(#editor:not([hidden])) #edit{bottom:max(16px,env(safe-area-inset-bottom));min-height:44px}
 #notifications,body:has(#editor:not([hidden])) #notifications{left:12px;right:64px;top:max(12px,env(safe-area-inset-top));width:auto;max-width:none}
 #build-tutorial{max-height:calc(100dvh - 32px);padding:18px}#build-tutorial #tutorial-done{min-height:44px}
}

#world{-webkit-touch-callout:none;user-select:none}

.mobile-icon{display:none}
@media(max-width:600px),(pointer:coarse) and (max-height:500px){
 #editor{left:0;right:0;top:auto;bottom:0;width:100%;max-width:none;box-sizing:border-box;height:calc(clamp(164px,25dvh,240px) + env(safe-area-inset-bottom));padding:6px max(8px,env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));gap:6px;overflow:hidden}
 #editor.is-minimized{left:0;right:0;top:auto;bottom:0;width:100%;max-width:none;height:auto}
 #editor .editor-title{display:none}#editor .editor-head{flex-wrap:nowrap;align-items:center;gap:6px;min-height:32px;height:32px;max-height:none;overflow:visible;padding:0}
 #editor .action-row,#editor .editor-extras{display:contents}#editor .mode-switch{display:flex;gap:6px;width:auto;flex:0 0 auto}
 #editor .control-label{display:none}#editor .mobile-icon{display:block;flex:none;width:19px;height:19px}
 #editor .mode-switch button,#editor .icon-button,#editor #how-build{display:grid;place-items:center;width:32px;min-width:32px;height:32px;min-height:32px;margin:0;padding:0;flex:0 0 32px;font-size:20px;line-height:1}
 #editor #minimize-editor{margin-left:auto}#editor.is-minimized .action-row,#editor.is-minimized .editor-extras{display:contents}
 #editor .editor-body{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:6px;min-height:0;overflow:hidden}
 #editor.is-minimized .editor-body{display:none}
 #editor .palette-tray{display:flex;flex-direction:column;min-width:0;min-height:0;gap:3px;padding:3px 2px 3px 3px;overflow:hidden}
 #editor .palette{width:100%;box-sizing:border-box;grid-template-columns:repeat(8,minmax(0,1fr));gap:7px 5px;padding:5px 4px;min-height:0;overflow-y:auto;overflow-x:hidden;flex:1;scrollbar-gutter:stable}
 #editor .swatch{width:100%;min-width:0;min-height:24px;height:26px;max-height:26px;aspect-ratio:auto}
 #editor .color-footer{min-height:24px;height:24px;padding-top:2px;flex-shrink:0;gap:4px;margin:0}
 #editor #recent-colors{min-height:20px}#editor .recent-swatch{width:20px;height:20px;min-height:20px}
 #editor .color-custom{height:22px;min-height:22px}#editor .color-custom input{height:20px}
 #editor .build-settings{display:flex;flex-direction:column;justify-content:space-between;gap:4px;min-height:0;padding:3px}
 #editor .build-settings #home{display:grid;place-items:center;width:100%;height:30px;min-height:30px;padding:0}
 #editor .build-settings #build-action{width:100%;height:auto;min-height:40px;flex:1;padding:2px;gap:1px}
 #editor #build-budget{font-size:13px!important;line-height:15px!important;letter-spacing:0!important}
}

@media(min-width:601px) and (min-height:501px),(min-width:601px) and (pointer:fine){
 #editor .mobile-icon{display:inline-block;width:14px;height:14px;flex:0 0 14px;vertical-align:middle}
 #editor .mode-switch button,#editor #how-build,#editor #home{display:flex;align-items:center;justify-content:center;gap:4px}
 #editor #how-build{justify-content:flex-start}
 #editor .mode-switch button{padding:4px 3px;gap:3px}
 #editor .mode-switch .mobile-icon{width:12px;height:12px;flex-basis:12px}
 #editor #build-action{flex-direction:row;flex-wrap:wrap;align-content:center;column-gap:5px;row-gap:1px}
 #editor #build-action .mobile-icon{width:17px;height:17px;flex-basis:17px}
 #editor #build-budget{flex-basis:100%;text-align:center}
}

/* Animation tools extend the painting menu; the ordinary painting layout is unchanged. */
.animation-toggle{width:100%;display:flex;align-items:center;gap:5px;min-height:30px;height:30px;padding:5px 8px;font:11px system-ui,sans-serif;color:#536884;border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;text-align:left}
.animation-toggle[aria-pressed=true]{background:#7950b0;color:#fff;box-shadow:inset 2px 2px #c1a2e7,inset -2px -2px #4b2b77}
#animation-panel{flex-shrink:0;min-width:0;padding:5px;border:1px solid #acbad0;background:#e4eaf4;box-shadow:inset 1px 1px #fff;color:#536884}
#animation-panel[hidden]{display:none}.animation-frame-row{display:flex;gap:4px;min-width:0;align-items:center}#animation-frames{display:flex;gap:4px;min-width:0;flex:1;overflow-x:auto;overflow-y:hidden;padding:3px;scrollbar-width:thin;scrollbar-color:#8b9bb4 #e4eaf4;touch-action:pan-x}
#animation-panel button{display:grid;place-items:center;flex:0 0 28px;width:28px;height:28px;min-height:28px;padding:0;border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;font:17px system-ui,sans-serif}
#animation-panel button[aria-pressed=true]{background:#7950b0;color:#fff;box-shadow:inset 2px 2px #c1a2e7,inset -2px -2px #4b2b77}#animation-panel button:disabled{opacity:.4}
.animation-tools{display:flex;gap:4px;align-items:center;margin-top:5px;flex-wrap:wrap}.animation-tools label{font:10px system-ui,sans-serif;margin-left:auto}#animation-fps{font:16px system-ui,sans-serif;color:#536884;background:#f8faff;border:1px solid #a0afc5;border-radius:0;height:28px;min-width:42px;max-width:54px;padding:0 2px}
#animation-status{font:11px/1.4 system-ui,sans-serif;margin:5px 0 0;overflow-wrap:anywhere}#editor.is-minimized #animation-panel{display:none}
@media(max-width:600px),(pointer:coarse) and (max-height:500px){
 #editor .animation-toggle{display:grid;place-items:center;width:32px;min-width:32px;height:32px;min-height:32px;padding:0;flex:0 0 32px}
 #editor:has(#animation-panel:not([hidden])){height:calc(clamp(242px,38dvh,360px) + env(safe-area-inset-bottom))}
 #editor.is-minimized:has(#animation-panel:not([hidden])){height:auto}
 #editor #animation-panel{grid-column:1/-1;padding:4px;min-height:0}
 #editor:has(#animation-panel:not([hidden])) .editor-body{grid-template-rows:auto minmax(0,1fr)}
 #animation-panel .animation-frame-row{gap:5px}#animation-panel .animation-tools{flex-wrap:nowrap;margin-top:3px;gap:5px}
 #animation-panel button{width:28px;height:28px;min-height:28px;flex-basis:28px}#animation-status{margin-top:3px;font-size:10px}
}

@media(min-width:601px) and (min-height:501px),(min-width:601px) and (pointer:fine){
 .animation-tools{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
 #animation-panel .animation-tools button{width:100%;min-width:0}
 #animation-panel #animation-reload{grid-column:4;grid-row:1}
 .animation-tools label{grid-row:2;grid-column:1/3;margin:0;text-align:right}
 #animation-fps{grid-row:2;grid-column:3/5;max-width:none;width:100%}
}
/* Compact only the extra animation tools on shorter desktop windows. */
@media(min-width:601px) and (max-height:600px) and (pointer:fine){
 #editor:has(#animation-panel:not([hidden])) .editor-extras{flex-direction:row;gap:4px}
 #editor:has(#animation-panel:not([hidden])) #how-build,#editor:has(#animation-panel:not([hidden])) .animation-toggle{flex:1;min-width:0;width:auto;font-size:9px;padding:4px;gap:3px}
 #editor:has(#animation-panel:not([hidden])) #how-build .mobile-icon,#editor:has(#animation-panel:not([hidden])) .animation-toggle .mobile-icon{width:12px;height:12px;flex-basis:12px}
 #editor:has(#animation-panel:not([hidden])) #animation-status{font-size:10px;line-height:1.25}
}

#animation-status[hidden]{display:none}
@media(min-width:601px) and (min-height:501px),(min-width:601px) and (pointer:fine){
 #editor .control-label{display:none}
 #editor .editor-extras{flex-direction:row;gap:5px}
 #editor #how-build,#editor .animation-toggle{flex:1;min-width:0;width:auto;justify-content:center;padding:0}
 #editor .mobile-icon,#editor .mode-switch .mobile-icon,#editor:has(#animation-panel:not([hidden])) #how-build .mobile-icon,#editor:has(#animation-panel:not([hidden])) .animation-toggle .mobile-icon{width:18px;height:18px;flex:0 0 18px}
 #editor #build-action .mobile-icon{width:19px;height:19px;flex-basis:19px}
}

/* Wider desktop dock with compact action rows. Mobile rules remain separate. */
@media(min-width:601px) and (min-height:501px),(min-width:601px) and (pointer:fine){
 #editor,#editor.is-minimized{width:184px;max-width:calc(100vw - 24px)}
 #editor .editor-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-height:0;max-height:none;height:auto;overflow:visible;padding:0}
 #editor .editor-title{flex:1 0 calc(100% - 68px);order:0;min-width:0}
 #editor .action-row,#editor .mode-switch,#editor .editor-extras{display:contents}
 #editor .mode-switch button,#editor #undo,#editor #how-build,#editor .animation-toggle{order:2;flex:0 0 28px;width:28px;min-width:28px;height:28px;min-height:28px;margin:0;padding:0;display:grid;place-items:center}
 #editor #minimize-editor,#editor #close-editor{order:1;flex:0 0 28px;width:28px;height:28px;min-height:28px;margin:0;padding:0}
 #editor.is-minimized .action-row,#editor.is-minimized .editor-extras{display:none}
 #editor .palette{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px 6px}
 #editor .swatch{width:100%;min-width:0;height:25px;min-height:25px}
 #editor .build-settings{display:grid;grid-template-columns:1fr 1fr;gap:6px}
 #editor .build-settings #home,#editor .build-settings #build-action{width:100%;height:40px;min-height:40px;padding:2px}
 #editor #build-budget{font-size:15px;line-height:16px;letter-spacing:0}
 #animation-frames{gap:3px}#animation-panel #animation-frames button{flex:0 0 24px;width:24px;height:26px;min-height:26px}
 #animation-panel .animation-tools{display:flex;flex-wrap:nowrap;gap:4px}
 #animation-panel .animation-tools button{flex:0 0 26px;width:26px;height:26px;min-height:26px}
 #animation-panel .animation-tools label{margin-left:auto}
 #animation-panel #animation-fps{flex:0 0 50px;width:50px;min-width:0;max-width:50px;height:26px}
 body:has(#editor:not([hidden])) #notifications{left:212px;max-width:calc(100vw - 228px)}
}
@media(min-width:601px) and (min-height:501px),(min-width:601px) and (pointer:fine){
 #editor:has(#animation-panel:not([hidden])) #how-build,#editor:has(#animation-panel:not([hidden])) .animation-toggle{flex:0 0 28px;width:28px;min-width:28px;padding:0;display:grid;place-items:center}
 #editor .build-settings #build-action{row-gap:0}
 #editor .build-settings #build-action .mobile-icon{width:16px;height:16px;flex-basis:16px}
 #editor .build-settings #build-action #build-budget{font-size:14px;line-height:14px;letter-spacing:0}
}

@media(min-width:601px) and (min-height:501px),(min-width:601px) and (pointer:fine){
 #editor .swatch{height:auto;min-height:18px;aspect-ratio:1}
 #animation-panel .animation-tools{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
 #animation-panel .animation-tools button{width:100%;min-width:0}
 #animation-panel .animation-tools label{grid-row:2;grid-column:1/3;margin:0;text-align:right}
 #animation-panel #animation-fps{grid-row:2;grid-column:3/5;width:100%;min-width:0;max-width:none}
 #animation-panel #animation-reload{grid-column:4;grid-row:1}
}

/* Keep the frame strip stable before the first frame and on overflow. */
#animation-panel .animation-frame-row{align-items:flex-start;min-height:42px}
#animation-panel #animation-frames{box-sizing:border-box;height:40px;min-height:40px;align-items:flex-start;overflow-x:scroll;scrollbar-width:thin;scrollbar-color:#8b9bb4 #e4eaf4;padding:3px 3px 7px}
#animation-frames::-webkit-scrollbar{height:4px}
#animation-frames::-webkit-scrollbar-track{background:#e4eaf4;box-shadow:inset 0 1px #c4cede;border-radius:2px}
#animation-frames::-webkit-scrollbar-thumb{background:#8b9bb4;border-radius:2px}
#animation-frames::-webkit-scrollbar-thumb:hover{background:#697e9e}
#animation-frames::-webkit-scrollbar-button{display:none;width:0;height:0}
#animation-panel #animation-add{margin-top:3px;flex-shrink:0}

#animation-panel{box-sizing:border-box;min-height:0}
#animation-panel #animation-fps{height:26px;min-height:26px;min-width:0;max-width:42px;width:42px;flex:0 0 42px;font-size:12px;padding:0 1px}
@media(min-width:601px) and (min-height:501px),(min-width:601px) and (pointer:fine){
 #animation-panel .animation-tools label{grid-column:1;grid-row:2;text-align:center}
 #animation-panel #animation-fps{grid-column:2;grid-row:2;width:100%;max-width:none}
}

/* Animation actions share one compact row, including the FPS picker. */
#editor #animation-panel .animation-tools{display:flex;flex-wrap:nowrap;gap:3px;align-items:center}
#editor #animation-panel .animation-tools button{width:25px;min-width:25px;height:26px;min-height:26px;flex:0 0 25px;order:0}
#editor #animation-panel .animation-tools label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);margin:0}
#editor #animation-panel #animation-fps{width:36px;min-width:36px;max-width:36px;flex:0 0 36px;height:26px;margin:0;order:1}

/* Label uses the existing space above the FPS picker without taking layout space. */
#editor #animation-panel .animation-tools{position:relative}
#editor #animation-panel .animation-tools label{display:block;left:112px;top:-11px;width:36px;height:10px;line-height:10px;font-size:8px;text-align:center;overflow:visible;clip-path:none;pointer-events:none}

#pixel-details{position:fixed;z-index:9;left:12px;bottom:84px;width:300px;max-width:calc(100vw - 24px);padding:10px;box-sizing:border-box;border:2px solid #53606b;background:#e4eaf4;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;font-family:system-ui,sans-serif}
#pixel-details[hidden]{display:none}.pixel-details-head{display:flex;gap:10px;align-items:center}.pixel-details-head>div{flex:1;min-width:0}.pixel-details-head strong{display:block;font-size:16px}.pixel-details-head small{display:block;margin-top:5px;font-size:10px;line-height:1.4}
#pixel-detail-swatch{width:38px;height:38px;flex:0 0 38px;border:2px solid #8b9bb4;box-shadow:inset 2px 2px #ffffff80}
#pixel-details button{border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;font:12px system-ui,sans-serif;min-height:28px;padding:4px 8px}
#pixel-details #pixel-detail-close{align-self:flex-start;width:26px;min-height:26px;padding:0;font-size:18px}.pixel-details-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px}#pixel-detail-coordinates{font-size:11px}#pixel-details #pixel-navigate[aria-pressed=true]{background:#7950b0;color:white;box-shadow:inset 2px 2px #c1a2e7,inset -2px -2px #4b2b77}
@media(max-width:600px){#pixel-details{bottom:76px;width:calc(100vw - 24px)}}

.pixel-speed-control{display:grid;grid-template-columns:1fr auto;gap:7px;margin-top:12px;font:10px system-ui,sans-serif}
#pixel-speed-value{font:11px system-ui,sans-serif;min-width:34px;text-align:right}
#pixel-zoom-speed{grid-column:1/-1;width:100%;height:18px;min-height:18px;margin:0;padding:0;appearance:none;-webkit-appearance:none;background:transparent;cursor:ew-resize;touch-action:none;box-shadow:none;border:0;accent-color:#7950b0}
#pixel-zoom-speed::-webkit-slider-runnable-track{height:6px;background:#c7d1e1;border:1px solid #8b9bb4;box-shadow:inset 1px 1px #a0adc1}
#pixel-zoom-speed::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:14px;height:18px;margin-top:-7px;background:#7950b0;border:1px solid #4b2b77;box-shadow:inset 2px 2px #c1a2e7,inset -2px -2px #4b2b77}
#pixel-zoom-speed::-moz-range-track{height:4px;background:#c7d1e1;border:1px solid #8b9bb4}
#pixel-zoom-speed::-moz-range-thumb{width:12px;height:16px;border-radius:0;background:#7950b0;border:1px solid #4b2b77;box-shadow:inset 2px 2px #c1a2e7,inset -2px -2px #4b2b77}
#pixel-zoom-speed:focus-visible{outline:2px solid #168bff;outline-offset:3px}

#pixel-details .pixel-navigation-controls{display:flex;align-items:center;gap:8px;flex-shrink:0}
#pixel-details .pixel-speed-control{position:relative;display:flex;align-items:center;gap:4px;width:85px;margin:0}
#pixel-details .pixel-speed-control>span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#pixel-details #pixel-speed-value{font-size:9px;min-width:25px;width:25px;text-align:right}
#pixel-details #pixel-zoom-speed{width:56px;min-width:0;flex:0 0 56px;height:18px}
#pixel-details #pixel-zoom-speed::-webkit-slider-thumb{width:10px;height:14px;margin-top:-5px}
#pixel-details #pixel-zoom-speed::-moz-range-thumb{width:8px;height:12px}
#pixel-details .pixel-details-bottom{gap:5px}
#pixel-details #pixel-detail-coordinates{font-size:10px}

#pixel-details{left:auto;right:12px;bottom:12px}
@media(max-width:600px){#pixel-details{left:auto;right:12px;bottom:12px}}

#open-login{position:fixed;top:12px;left:12px;z-index:10;padding:6px 15px;min-height:34px;border:2px solid #53606b;border-radius:0;background:#e4eaf4;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;font:14px system-ui,sans-serif}
#login-modal{box-sizing:border-box;position:fixed;inset:0;margin:auto;width:330px;max-width:calc(100vw - 32px);padding:28px 22px;border:2px solid #53606b;border-radius:0;background:#e4eaf4;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;max-height:calc(100dvh - 32px);overflow:auto}
#login-modal::backdrop{background:#17243766}
.login-options{display:flex;flex-direction:column;align-items:center;gap:12px}
#login-modal button{display:flex;justify-content:center;align-items:center;gap:10px;box-sizing:border-box;width:100%;height:44px;min-height:44px;padding:7px 10px;border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;font:14px system-ui,sans-serif}
#login-modal button:hover,#open-login:hover{background:#d5dfef}
#login-modal button:active,#open-login:active{box-shadow:inset 2px 2px #a0adc1,inset -1px -1px #fff}
#login-modal button:focus-visible,#open-login:focus-visible{outline:2px solid #168bff;outline-offset:3px}
.google-login-mark{font:bold 20px/1 system-ui,sans-serif;color:#4285f4}
@media(prefers-reduced-motion:no-preference){#login-modal[open]{animation:login-appear .2s ease-in-out}@keyframes login-appear{from{opacity:0;transform:translateY(8px) scale(.97)}to{opacity:1;transform:none}}}

/* Match Entrar's left edge and finish, preserving Pintar's existing dimensions. */
#edit,body:has(#editor:not([hidden])) #edit{left:12px;border-color:#53606b;background:#e4eaf4;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;text-shadow:none}
#edit:hover{background:#d5dfef;color:#536884}
#edit:active{box-shadow:inset 2px 2px #a0adc1,inset -1px -1px #fff}
#edit:focus-visible{outline:2px solid #168bff;outline-offset:3px}

/* Larger, bold labels while retaining the existing button boxes. */
body button{font-weight:700}
#edit,body:has(#editor:not([hidden])) #edit{font-size:28px;font-weight:700;line-height:1}
#open-login{font-size:20px;font-weight:700;line-height:1}
#login-modal button{font-size:22px;font-weight:700;line-height:1}
#pixel-details #pixel-navigate{font-size:16px;font-weight:700;line-height:1;padding:4px 7px}
#animation-panel #animation-frames button{font-size:20px;font-weight:700;line-height:1}
#tutorial-done{font-size:20px;font-weight:700;line-height:1.15}
#editor .build-settings #build-action #build-budget{font-size:18px;font-weight:700;line-height:18px}

#screen-coordinates{position:absolute;right:calc(100% + 10px);top:0;display:flex;align-items:center;justify-content:center;min-height:30px;padding:3px 8px;white-space:nowrap;pointer-events:none;font:700 18px/1 system-ui,sans-serif;color:#536884;background:#f8faff;border:1px solid #a0afc5;box-shadow:inset 1px 1px #fff}
@media(pointer:coarse){#screen-coordinates{min-height:44px;font-size:18px}}

#zoom-controls #screen-coordinates{padding:0;font-size:14px;font-weight:700;background:transparent;border:0;box-shadow:none}

#account-area,#account-form{display:flex;flex-direction:column;align-items:stretch;gap:12px}#account-area[hidden]{display:none}#account-area strong{text-align:center;font:700 24px system-ui,sans-serif;overflow-wrap:anywhere}#account-form input{box-sizing:border-box;width:100%;height:42px;padding:8px 10px;border:1px solid #8b9bb4;border-radius:0;background:#f8faff;color:#24364e;font:18px system-ui,sans-serif}#auth-status{font:16px/1.3 system-ui,sans-serif;margin:12px 0 0;text-align:center;overflow-wrap:anywhere}#login-modal .login-options[hidden]{display:none}

#open-login.account-avatar{width:42px;height:42px;min-width:42px;min-height:42px;padding:4px;overflow:hidden;display:grid;place-items:center;position:fixed;box-sizing:border-box}
.account-avatar-fallback{grid-area:1/1;width:100%;height:100%;display:block;object-fit:cover;image-rendering:pixelated}
#open-login .account-avatar-photo{grid-area:1/1;width:100%;height:100%;min-width:0;min-height:0;object-fit:cover;display:block;z-index:1;background:#e4eaf4}

#world{image-rendering:pixelated;filter:none;opacity:1}

/* Keep the account, painting dock and notices in separate screen areas. */
#open-login{top:max(12px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left))}
@media(max-width:600px),(pointer:coarse) and (max-height:500px){
 #notifications,body:has(#editor:not([hidden])) #notifications{top:calc(max(12px,env(safe-area-inset-top)) + 64px);left:max(12px,env(safe-area-inset-left));right:max(64px,env(safe-area-inset-right));transform:none;width:auto;max-width:none}
 body:has(#editor:not([hidden])) #open-login{left:max(12px,env(safe-area-inset-left))}
}

#account-shortcuts{--shortcut-size:30px;--profile-width:42px;--profile-height:42px;position:fixed;left:12px;top:12px;z-index:9;width:calc(var(--profile-width) + 8px + var(--shortcut-size));height:calc(var(--profile-height) + 3 * (var(--shortcut-size) + 8px));pointer-events:none}
#account-shortcuts button{position:absolute;left:calc((var(--profile-width) - var(--shortcut-size)) / 2);width:var(--shortcut-size);height:var(--shortcut-size);min-width:var(--shortcut-size);min-height:var(--shortcut-size);padding:0;display:grid;place-items:center;border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;pointer-events:auto}
#account-shortcuts #shortcut-search{left:calc(var(--profile-width) + 8px);top:calc((var(--profile-height) - var(--shortcut-size)) / 2)}
#shortcut-store{top:calc(var(--profile-height) + 8px)}
#shortcut-rank{top:calc(var(--profile-height) + var(--shortcut-size) + 16px)}
#shortcut-info{top:calc(var(--profile-height) + 2 * var(--shortcut-size) + 24px)}
#account-shortcuts button:hover{background:#d5dfef}
#account-shortcuts button:active{box-shadow:inset 2px 2px #a0adc1,inset -1px -1px #fff}
#account-shortcuts button:focus-visible{outline:2px solid #168bff;outline-offset:3px}
@media(pointer:coarse){#account-shortcuts{--shortcut-size:44px}}

#account-shortcuts #shortcut-search{z-index:2}
#shortcut-search-panel{position:absolute;left:calc(var(--profile-width) + 8px + var(--shortcut-size) - 1px);top:calc((var(--profile-height) - var(--shortcut-size)) / 2);width:0;height:var(--shortcut-size);margin:0;overflow:hidden;visibility:hidden;pointer-events:none;transition:width .24s ease-in-out,visibility 0s .24s}
#account-shortcuts.search-open #shortcut-search-panel{width:var(--search-width,220px);visibility:visible;pointer-events:auto;transition:width .24s ease-in-out,visibility 0s}
#shortcut-search-input{display:block;width:var(--search-width,220px);min-width:0;height:var(--shortcut-size);min-height:0;margin:0;padding:0 8px;border:1px solid #a0afc5;border-radius:0;outline:none;background:#f8faff;box-shadow:inset 1px 1px #fff,inset -1px -1px #a0adc1;color:#536884;font:18px system-ui,sans-serif;touch-action:manipulation}
#shortcut-search-input:focus-visible{outline:none;border-color:#536884}
@media(prefers-reduced-motion:reduce){#shortcut-search-panel,#account-shortcuts.search-open #shortcut-search-panel{transition:none}}

/* Animate layout changes independently of each notification's entrance/exit. */
@media(prefers-reduced-motion:no-preference){
 #notifications{transition:left .24s cubic-bezier(.16,1,.3,1),top .24s cubic-bezier(.16,1,.3,1),width .24s cubic-bezier(.16,1,.3,1),max-width .24s cubic-bezier(.16,1,.3,1)}
}

#login-modal.profile-menu{inset:auto;left:var(--profile-menu-left,12px);top:var(--profile-menu-top,12px);margin:0;width:250px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:18px;transform-origin:top left;animation:none}
#login-modal.profile-menu::backdrop{background:transparent}

.account-menu-head{display:grid;grid-template-columns:42px minmax(0,1fr) 28px;gap:8px;align-items:start}
.account-menu-avatar{width:42px;height:42px;padding:4px;display:grid;place-items:center;overflow:hidden;border:2px solid #53606b;background:#e4eaf4;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1}
.account-menu-avatar img{grid-area:1/1;width:100%;height:100%;min-width:0;min-height:0;object-fit:cover;display:block}
.account-menu-avatar .account-avatar-photo{z-index:1;background:#e4eaf4}
.account-menu-identity{display:flex;flex-wrap:wrap;align-items:baseline;align-content:center;gap:0 5px;min-width:0;min-height:42px}
#account-area .account-menu-identity strong{text-align:left;font-size:22px;line-height:1.05;overflow-wrap:anywhere;min-width:0}
.account-menu-number{font:22px/1.05 system-ui,sans-serif;color:#536884;white-space:nowrap}
#login-modal #account-menu-close{width:28px;height:28px;min-height:28px;padding:0;gap:0;flex:none;font:24px/1 system-ui,sans-serif}

#login-modal.profile-menu{width:350px;padding:20px;min-height:210px}
#login-modal.profile-menu #account-area{gap:16px}
#login-modal.profile-menu .account-menu-head{grid-template-columns:64px minmax(0,1fr) 28px;gap:12px}
#login-modal.profile-menu .account-menu-avatar{width:64px;height:64px}
#login-modal.profile-menu .account-menu-identity{min-height:64px}
#login-modal.profile-menu .account-menu-identity strong{font-size:26px}
#login-modal.profile-menu .account-menu-number{font-size:24px}

#login-modal.profile-menu .account-menu-identity strong,#login-modal.profile-menu .account-menu-number{font-size:20px;font-weight:400;color:#000;line-height:1.15}
#login-modal.profile-menu .account-menu-avatar{position:relative;overflow:visible}
#login-modal #account-avatar-edit{position:absolute;right:-5px;bottom:-5px;width:24px;height:24px;min-height:24px;padding:0;z-index:2}
#account-avatar-edit svg{pointer-events:none}
#open-login .account-avatar-photo,.account-menu-avatar .account-avatar-photo{image-rendering:pixelated}
#avatar-editor{position:fixed;inset:0;margin:auto;width:760px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:14px;border:2px solid #53606b;border-radius:0;background:#e4eaf4;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;overflow:auto}
#avatar-editor::backdrop{background:#17243766}
.avatar-editor-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.avatar-editor-heading h2{margin:0;font:400 24px system-ui,sans-serif;color:#000}
#avatar-editor button{border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;font:20px system-ui,sans-serif;padding:4px 7px;min-height:32px}
#avatar-editor button:hover{background:#d5dfef}
#avatar-editor .avatar-editor-close{width:28px;height:28px;min-height:28px;padding:0;font-size:24px;flex:none}
.avatar-editor-body{display:grid;grid-template-columns:minmax(0,1fr) 186px;gap:14px}
.avatar-drawing{min-width:0;align-self:start;border:2px solid #53606b;background:#fff}
#avatar-editor canvas{position:static;inset:auto;display:block;width:100%;height:auto;aspect-ratio:1;image-rendering:pixelated;touch-action:none;cursor:crosshair}
.avatar-editor-tools{position:static;display:flex;flex-direction:column;gap:12px;min-width:0}
.avatar-tools-row{display:flex;gap:4px}
#avatar-editor button[aria-pressed=true]{outline:2px solid #286ee9;outline-offset:1px}
.avatar-editor-palette{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px;padding:5px;border:1px solid #a0afc5;background:#edf2fb}
#avatar-editor .avatar-color{width:100%;min-width:0;height:25px;min-height:25px;padding:0;border:2px solid #5a6474}
#avatar-editor .avatar-custom-color{font:18px system-ui,sans-serif;display:flex;gap:8px;align-items:center}
#avatar-editor input[type=color]{width:44px;height:30px;padding:1px;border:1px solid #a0afc5;background:#fff}
.avatar-editor-status{font:18px/1.2 system-ui,sans-serif;margin:0;overflow-wrap:anywhere}
#avatar-editor .avatar-save{margin-top:auto;min-height:42px;font-size:22px}
@media(max-width:600px){#avatar-editor{padding:10px}.avatar-editor-body{grid-template-columns:minmax(0,1fr)}.avatar-drawing{width:min(100%,46dvh);justify-self:center}.avatar-editor-palette{grid-template-columns:repeat(8,minmax(0,1fr))}.avatar-editor-tools{gap:8px}.avatar-tools-row button{flex:1}.avatar-editor-heading h2{font-size:22px}}

/* Fit the avatar editor to the viewport; shrink the canvas, never scroll the dialog. */
#avatar-editor{height:min(620px,calc(100dvh - 24px));overflow:hidden}
#avatar-editor[open]{display:flex;flex-direction:column;gap:12px}
#avatar-editor .avatar-editor-heading{flex:none;margin:0}
#avatar-editor .avatar-editor-body{flex:1;min-height:0;grid-template-rows:minmax(0,1fr);overflow:hidden}
#avatar-editor .avatar-drawing{width:100%;height:100%;min-height:0;align-self:stretch;justify-self:stretch;display:flex;align-items:center;justify-content:center;border:0;background:transparent}
#avatar-editor canvas{width:auto;height:auto;max-width:100%;max-height:100%;aspect-ratio:1;object-fit:contain;outline:2px solid #53606b;outline-offset:-1px}
#avatar-editor .avatar-editor-tools{min-height:0}
@media(max-width:600px) and (min-height:421px){
 #avatar-editor .avatar-editor-body{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;gap:10px}
 #avatar-editor .avatar-editor-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'tools custom' 'palette palette' 'status save';gap:7px 8px;align-items:center}
 #avatar-editor .avatar-tools-row{grid-area:tools;min-width:0}
 #avatar-editor .avatar-tools-row button{min-width:0;min-height:28px;padding:2px 4px;font-size:18px}
 #avatar-editor .avatar-custom-color{grid-area:custom;font-size:16px;gap:4px}
 #avatar-editor .avatar-editor-palette{grid-area:palette;grid-template-columns:repeat(8,minmax(0,1fr));gap:5px;padding:4px}
 #avatar-editor .avatar-color{height:22px;min-height:22px}
 #avatar-editor .avatar-editor-status{grid-area:status;font-size:16px;line-height:1.1}
 #avatar-editor .avatar-save{grid-area:save;margin:0;min-height:36px;font-size:20px}
}
@media(max-height:600px) and (min-width:601px),(max-height:420px){
 #avatar-editor{padding:10px}
 #avatar-editor[open]{gap:8px}
 #avatar-editor .avatar-editor-body{grid-template-columns:minmax(0,1fr) 202px;grid-template-rows:minmax(0,1fr);gap:10px}
 #avatar-editor .avatar-editor-tools{display:flex;gap:5px}
 #avatar-editor .avatar-tools-row button{min-height:26px;padding:1px 4px;font-size:17px}
 #avatar-editor .avatar-editor-palette{grid-template-columns:repeat(8,minmax(0,1fr));gap:4px;padding:4px}
 #avatar-editor .avatar-color{height:18px;min-height:18px}
 #avatar-editor .avatar-custom-color{font-size:16px;gap:5px}
 #avatar-editor input[type=color]{height:24px}
 #avatar-editor .avatar-editor-status{font-size:16px;line-height:1.05}
 #avatar-editor .avatar-save{min-height:30px;font-size:19px}
 #avatar-editor .avatar-editor-heading h2{font-size:20px}
}

/* Match the painting inventory: square swatches, icon tools and pressed states. */
#avatar-editor .avatar-editor-palette{grid-template-columns:repeat(5,28px);grid-auto-rows:28px;gap:7px 6px;padding:6px;align-content:start;justify-content:start;align-self:start;width:100%;flex:none;min-height:0}
#avatar-editor .avatar-color{width:28px;height:28px;min-width:28px;min-height:28px;max-height:28px;aspect-ratio:1;border:2px solid #5a6474;box-shadow:inset 2px 2px #ffffff50,inset -2px -2px #00000025;transform:none}
#avatar-editor .avatar-color[aria-pressed=true]{outline:2px solid #18283f;outline-offset:2px}
#avatar-editor .avatar-tools-row{gap:6px;flex-wrap:nowrap;flex:none;padding:3px}
#avatar-editor .avatar-tools-row button{width:28px;min-width:28px;height:28px;min-height:28px;flex:0 0 28px;padding:0;display:grid;place-items:center;outline:none;overflow:visible}
#avatar-editor .avatar-tools-row svg,#avatar-editor .avatar-save svg{display:block;width:18px;height:18px;flex:none}
#avatar-editor .avatar-tools-row button[data-tool=paint][aria-pressed=true]{background:#286ee9;color:#fff;box-shadow:inset 2px 2px #8fb4ff,inset -2px -2px #1646a4;outline:none}
#avatar-editor .avatar-tools-row button[data-tool=erase][aria-pressed=true]{background:#b74f53;color:#fff;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;outline:none}
#avatar-editor .avatar-save{width:42px;min-width:42px;height:42px;min-height:42px;display:grid;place-items:center;padding:0;justify-self:end;align-self:flex-end;flex:none}
#avatar-editor .avatar-editor-status:empty{display:none}
#avatar-editor .avatar-editor-tools{overflow:visible}
@media(max-width:600px) and (min-height:421px){#avatar-editor .avatar-editor-palette{grid-template-columns:repeat(auto-fit,28px)}#avatar-editor .avatar-tools-row button{flex:0 0 28px}}
@media(max-height:600px) and (min-width:601px),(max-height:420px) and (min-width:481px){
 #avatar-editor .avatar-editor-body{grid-template-columns:minmax(0,1fr) 286px}
 #avatar-editor .avatar-editor-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto minmax(42px,1fr);grid-template-areas:'tools custom' 'palette palette' 'status save';gap:7px 6px;align-content:start;align-items:start}
 #avatar-editor .avatar-tools-row{grid-area:tools}
 #avatar-editor .avatar-custom-color{grid-area:custom;align-self:center}
 #avatar-editor .avatar-editor-palette{grid-area:palette;grid-template-columns:repeat(8,28px)}
 #avatar-editor .avatar-editor-status{grid-area:status;font-size:16px;align-self:end}
 #avatar-editor .avatar-save{grid-area:save;align-self:end;margin:0}
}
@media(max-width:480px) and (max-height:420px){
 #avatar-editor .avatar-editor-body{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto}
 #avatar-editor .avatar-editor-tools{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'tools custom' 'palette palette' 'status save';gap:5px}
 #avatar-editor .avatar-tools-row{grid-area:tools}
 #avatar-editor .avatar-custom-color{grid-area:custom}
 #avatar-editor .avatar-editor-palette{grid-area:palette;grid-template-columns:repeat(auto-fit,28px)}
 #avatar-editor .avatar-editor-status{grid-area:status}
 #avatar-editor .avatar-save{grid-area:save;margin:0}
}

#custom-color-dialog{position:fixed;inset:0;margin:auto;width:300px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:16px;border:2px solid #53606b;border-radius:0;background:#e4eaf4;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884}
#custom-color-dialog::backdrop{background:#17243766}
.custom-color-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:14px}
.custom-color-heading h2{margin:0;font:24px system-ui,sans-serif;color:#000}
#custom-color-dialog button{border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;font:20px system-ui,sans-serif}
#custom-color-dialog .custom-color-close{width:28px;height:28px;min-height:28px;padding:0;font-size:24px}
.custom-color-fields{display:flex;align-items:center;gap:12px}
#custom-color-dialog input[type=color]{width:64px;height:56px;padding:2px;border:1px solid #a0afc5;background:#fff}
#custom-color-dialog .custom-color-hex{width:0;flex:1;min-width:0;height:40px;padding:6px;border:1px solid #a0afc5;border-radius:0;background:#f8faff;color:#000;font:22px system-ui,sans-serif}
#custom-color-dialog .custom-color-confirm{width:100%;margin-top:16px;height:40px;display:flex;align-items:center;justify-content:center;gap:8px}
.custom-color-error{margin:8px 0 0;font:16px system-ui,sans-serif;color:#a22}

#custom-color-dialog{inset:auto;margin:0;left:12px;top:12px;width:290px;padding:12px;overflow:hidden;transform-origin:top left}
#custom-color-dialog::backdrop{background:transparent}
#custom-color-dialog .custom-color-heading{margin-bottom:10px}
#custom-color-dialog .custom-color-heading h2{font-size:22px}
#custom-color-dialog .color-sv-canvas{display:block;position:static;inset:auto;width:100%;height:150px;max-height:40dvh;border:1px solid #536884;touch-action:none;cursor:crosshair;image-rendering:auto}
#custom-color-dialog .color-hue{display:block;box-sizing:border-box;appearance:none;width:100%;height:18px;margin:12px 0;padding:0;border:1px solid #536884;border-radius:0;background:linear-gradient(to right,#f00,#ff0,#0f0,#0ff,#00f,#f0f,#f00);cursor:pointer}
#custom-color-dialog .color-hue::-webkit-slider-thumb{appearance:none;width:12px;height:24px;border:2px solid #53606b;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1}
#custom-color-dialog .color-hue::-moz-range-thumb{width:10px;height:22px;border:2px solid #53606b;border-radius:0;background:#e3e9f2}
#custom-color-dialog .custom-color-fields{display:grid;grid-template-columns:32px 32px minmax(0,1fr) 32px;gap:8px;align-items:center}
#custom-color-dialog .custom-color-dropper{width:32px;height:32px;min-height:32px;padding:0;display:grid;place-items:center;cursor:pointer}
#custom-color-dialog.is-sampling{inset:0!important;width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;padding:0;border:0;box-shadow:none;background:transparent;transform:none!important;opacity:1!important;cursor:crosshair;touch-action:none}
#custom-color-dialog.is-sampling>:not(.custom-color-sample-hint){display:none!important}
#custom-color-dialog .custom-color-sample-hint{position:absolute;bottom:max(16px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 24px);padding:8px 12px;background:#e4eaf4;border:2px solid #53606b;color:#536884;font:14px system-ui,sans-serif;pointer-events:none}
.custom-color-preview{display:block;width:32px;height:32px;border:2px solid #5a6474;box-shadow:inset 2px 2px #ffffff50,inset -2px -2px #00000025}
#custom-color-dialog .custom-color-hex{width:100%;height:32px;font-size:20px}
#custom-color-dialog .custom-color-confirm{width:32px;height:32px;min-height:32px;margin:0;padding:0;display:grid;place-items:center}
#custom-color-dialog .color-sv-canvas:focus-visible{outline:2px solid #168bff;outline-offset:2px}
@media(max-height:360px){#custom-color-dialog .color-sv-canvas{height:100px}#custom-color-dialog .color-hue{margin:8px 0}}

/* Match inventory swatches while preserving the compact footer dimensions. */
#recent-colors .recent-swatch{box-sizing:border-box;border:2px solid #5a6474;border-radius:0;box-shadow:inset 2px 2px #ffffff50,inset -2px -2px #00000025}
#recent-colors .recent-swatch[aria-pressed=true]{outline:2px solid #18283f;outline-offset:2px}
.color-custom input[type=color]{box-sizing:border-box;padding:0;border:2px solid #5a6474;border-radius:0;box-shadow:inset 2px 2px #ffffff50,inset -2px -2px #00000025;cursor:pointer}
.color-custom input[type=color]::-webkit-color-swatch-wrapper{padding:0}
.color-custom input[type=color]::-webkit-color-swatch{border:0;border-radius:0;box-shadow:inset 2px 2px #ffffff50,inset -2px -2px #00000025}
.color-custom input[type=color]::-moz-color-swatch{border:0;border-radius:0;box-shadow:inset 2px 2px #ffffff50,inset -2px -2px #00000025}
#avatar-editor .avatar-custom-color,#avatar-editor .avatar-custom-color input[type=color]{cursor:pointer}

@media(prefers-reduced-motion:no-preference){html.pixel-intro-pending :is(#open-login,#shortcut-search,#shortcut-store,#shortcut-rank,#shortcut-info,#in,#out,#edit){visibility:hidden}}

/* Reserve one square account slot, and resolve the session before revealing it. */
#open-login{box-sizing:border-box;width:42px;height:42px;min-width:42px;min-height:42px;padding:4px;display:grid;place-items:center}
html[data-auth=pending] #open-login,html[data-auth=pending] #account-shortcuts,html[data-auth=pending] #edit,html[data-auth=pending] #editor{visibility:hidden!important}
html[data-auth=guest] #editor,html[data-auth=guest] #shortcut-store,html[data-auth=guest] #shortcut-info{display:none!important}
@media(max-width:600px),(pointer:coarse) and (max-height:500px){html[data-auth=guest] #edit{bottom:calc(max(16px,env(safe-area-inset-bottom)) + 52px)}}
html[data-auth=pending] #shortcut-rank,html[data-auth=guest] #shortcut-rank{top:calc(var(--profile-height) + 8px)}
@media(prefers-reduced-motion:no-preference){html[data-auth-ready] #shortcut-rank{transition:top .26s cubic-bezier(.16,1,.3,1),background-color .12s,box-shadow .12s}}

html[data-auth=guest] #account-shortcuts,html[data-auth=pending] #account-shortcuts{height:calc(var(--profile-height) + var(--shortcut-size) + 8px)}
html[data-auth=pending] #notifications{visibility:hidden}

#open-login:not(.account-avatar){font-size:18px;padding:0}

#open-login:not(.account-avatar){width:82px;min-width:82px;padding:6px 15px;font-size:20px}
@media(prefers-reduced-motion:no-preference){html[data-auth-ready] #shortcut-rank{transition:top .26s cubic-bezier(.16,1,.3,1),left .26s cubic-bezier(.16,1,.3,1),background-color .12s,box-shadow .12s}html[data-auth-ready] #shortcut-search{transition:left .26s cubic-bezier(.16,1,.3,1),top .26s cubic-bezier(.16,1,.3,1),background-color .12s,box-shadow .12s}}

#login-modal .login-window-controls{display:flex;justify-content:flex-end;margin:0 0 12px}
#login-modal #login-close{width:28px;height:28px;min-height:28px;flex:none;padding:0;gap:0;font:24px/1 system-ui,sans-serif}

#login-modal .login-window-controls{position:absolute;top:8px;right:8px;width:28px;height:28px;margin:0}
#login-modal:not(.profile-menu){padding-top:48px}

/* Explicit row size keeps the square palette cells from compressing in animation mode. */
@media(min-width:601px) and (min-height:501px),(min-width:601px) and (pointer:fine){
 #editor .palette{grid-auto-rows:var(--paint-swatch-size,32px);align-content:start;row-gap:7px}
 #editor .palette .swatch{height:var(--paint-swatch-size,32px);min-height:var(--paint-swatch-size,32px);max-height:var(--paint-swatch-size,32px);flex-shrink:0;align-self:start}
}
#login-modal #account-menu-close,#avatar-editor .avatar-editor-close,#custom-color-dialog .custom-color-close,#build-tutorial #close-tutorial,#pixel-details #pixel-detail-close{position:absolute;top:8px;right:8px;z-index:2;width:28px;height:28px;min-height:28px;max-height:28px;margin:0;padding:0;flex:none;display:grid;place-items:center;gap:0;border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;font:24px/1 system-ui,sans-serif}
#avatar-editor .avatar-editor-heading,#custom-color-dialog .custom-color-heading{min-height:28px;padding-right:36px}
#build-tutorial .tutorial-heading{min-height:28px;padding-right:36px}
#pixel-details .pixel-details-head{padding-right:36px}

#open-login.account-avatar,#login-modal.profile-menu .account-menu-avatar{padding:0;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
.account-avatar-fallback{min-width:0;min-height:0}


#profile-smoke{position:absolute;left:0;top:0;width:var(--profile-width,42px);height:var(--profile-height,42px);overflow:visible;pointer-events:none;z-index:0}
.profile-smoke-pixel{position:absolute;display:block;width:var(--smoke-size,4px);height:var(--smoke-size,4px);color:#8795a6;background:currentColor;box-shadow:var(--smoke-size,4px) 0 currentColor,0 calc(-1 * var(--smoke-size,4px)) currentColor;opacity:0;pointer-events:none;animation:profile-pixel-smoke 2s steps(11,end) infinite;will-change:transform,opacity}
@keyframes profile-pixel-smoke{0%{opacity:0;transform:translate(0,0)}15%{opacity:.42}70%{opacity:.22}100%{opacity:0;transform:translate(var(--smoke-drift,2px),-44px)}}
html:not([data-auth=signed-in]) #profile-smoke{display:none}
@media(prefers-reduced-motion:reduce){#profile-smoke{display:none}}

@media(max-width:600px),(pointer:coarse) and (max-height:500px){
 html[data-auth=guest] #open-login{left:calc(50% - 41px)!important;top:auto!important;bottom:max(16px,env(safe-area-inset-bottom))}
 html[data-auth=guest] #account-shortcuts{height:var(--profile-height,42px)}
 html[data-auth=guest] #account-shortcuts #shortcut-search{left:calc(0px - var(--shortcut-size) - 8px);top:calc((var(--profile-height) - var(--shortcut-size))/2)}
 html[data-auth=guest] #account-shortcuts #shortcut-rank{left:calc(var(--profile-width) + 8px);top:calc((var(--profile-height) - var(--shortcut-size))/2)}
 html[data-auth=guest] #shortcut-search-panel{left:calc((var(--profile-width) - var(--search-width,280px))/2);top:auto;bottom:calc(var(--profile-height) + 12px)}
}

@media(max-width:600px),(pointer:coarse) and (max-height:500px){
 html[data-auth=guest] #open-login{left:calc(50% - 81px)!important;width:162px;min-width:162px;height:44px;min-height:44px;padding:0 20px;font-size:28px}
 html[data-auth=guest] #account-shortcuts #shortcut-search{position:fixed;left:max(16px,env(safe-area-inset-left));right:auto;top:auto;bottom:calc(max(16px,env(safe-area-inset-bottom)) + (44px - var(--shortcut-size))/2)}
 html[data-auth=guest] #account-shortcuts #shortcut-rank{position:fixed;left:auto;right:max(16px,env(safe-area-inset-right));top:auto;bottom:calc(max(16px,env(safe-area-inset-bottom)) + (44px - var(--shortcut-size))/2)}
}

@media(max-width:600px),(pointer:coarse) and (max-height:500px){
 html[data-auth=guest] #open-login{left:calc(50% - 41px)!important;width:82px;min-width:82px;height:42px;min-height:42px;padding:6px 15px;font-size:20px}
 html[data-auth=guest] #account-shortcuts{--shortcut-size:30px}
 html[data-auth=guest] #account-shortcuts #shortcut-search,html[data-auth=guest] #account-shortcuts #shortcut-rank{width:30px;min-width:30px;height:30px;min-height:30px;bottom:calc(max(16px,env(safe-area-inset-bottom)) + 6px)}
}

@media(max-width:600px),(pointer:coarse) and (max-height:500px){
 html[data-auth=guest] #open-login{left:calc(50% - 52px)!important;width:104px;min-width:104px;height:54px;min-height:54px;padding:8px 19px;font-size:26px}
 html[data-auth=guest] #account-shortcuts #shortcut-search,html[data-auth=guest] #account-shortcuts #shortcut-rank{width:var(--shortcut-size);min-width:var(--shortcut-size);height:var(--shortcut-size);min-height:var(--shortcut-size)}
 html[data-auth=guest] #account-shortcuts #shortcut-search{left:max(12px,env(safe-area-inset-left));top:max(12px,env(safe-area-inset-top));bottom:auto}
 html[data-auth=guest] #account-shortcuts #shortcut-rank{bottom:calc(max(16px,env(safe-area-inset-bottom)) + (54px - var(--shortcut-size))/2)}
 html[data-auth=guest] #shortcut-search-panel{position:fixed;left:calc(max(12px,env(safe-area-inset-left)) + var(--shortcut-size) - 1px);top:max(12px,env(safe-area-inset-top));bottom:auto}
}
@media(pointer:coarse){html[data-auth=guest] #account-shortcuts{--shortcut-size:44px}}

@media(max-width:600px),(pointer:coarse){
 #shortcut-search-input{-webkit-appearance:none;appearance:none;background-image:none}
 #shortcut-search-input::-webkit-search-decoration,#shortcut-search-input::-webkit-search-results-button,#shortcut-search-input::-webkit-search-results-decoration{-webkit-appearance:none;display:none}
}

@media(max-width:600px),(pointer:coarse) and (max-height:500px){
 html[data-auth=guest] #account-shortcuts #shortcut-rank{left:calc(50% + 60px);right:auto}
}

/* Persistent build notice stays below the entire transient stack. */
.update-notification{position:absolute;left:0;top:0;width:100%;box-sizing:border-box;padding:12px 14px;background:#f8faff;border:1px solid #a0afc5;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1,0 3px 8px #23304420;color:#536884;pointer-events:auto;transition:top .24s ease}
.update-notification p{margin:0 0 10px;font:14px/1.45 system-ui,sans-serif;overflow-wrap:anywhere}
.update-notification button{border-radius:0;appearance:none;display:block;width:100%;min-height:32px;cursor:pointer;font:14px system-ui,sans-serif;color:#536884;background:#e3e9f2;border:1px solid #a0afc5;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1}
.update-notification button:hover{background:#d5dfef}.update-notification button:active{box-shadow:inset 2px 2px #a0adc1,inset -1px -1px #fff}.update-notification button:focus-visible{outline:2px solid #337cf2;outline-offset:2px}
@media(prefers-reduced-motion:reduce){.update-notification{transition:none}}
/* Empty shop shell, using the avatar editor's modal frame and site controls. */
#shop-modal{position:fixed;inset:0;margin:auto;width:760px;height:560px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:14px;border:2px solid #53606b;border-radius:0;background:#e4eaf4;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;overflow:hidden}
#shop-modal[open]{display:grid;grid-template-rows:auto minmax(0,1fr);gap:14px}#shop-modal::backdrop{background:#17243766}
#shop-modal .shop-heading{position:static;display:flex;align-items:center;width:auto;max-width:none;min-height:28px;margin:0;padding:0 36px 0 0}
#shop-modal h2{margin:0;font:26px/1.2 system-ui,sans-serif}
#shop-modal button{border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;cursor:pointer;padding:0;display:grid;place-items:center}
#shop-modal button:hover{background:#d5dfef}#shop-modal button:active{box-shadow:inset 2px 2px #a0adc1,inset -1px -1px #fff}
#shop-modal .shop-close{position:absolute;top:8px;right:8px;width:28px;height:28px;min-height:28px;font:24px/1 system-ui,sans-serif}
#shop-modal .shop-body{display:grid;grid-template-columns:38px minmax(0,1fr);gap:12px;min-height:0}
#shop-modal .shop-categories{display:flex;flex-direction:column;gap:12px;padding:3px;align-items:center}
#shop-modal .shop-categories button{width:32px;height:32px;min-height:32px;flex:none}
#shop-modal .shop-categories button[aria-selected=true]{background:#e3e9f2;color:#536884;box-shadow:inset 2px 2px #a0adc1,inset -1px -1px #fff;outline:2px solid #18283f;outline-offset:1px}
#shop-modal .shop-content{min-width:0;min-height:0;background:#f8faff;border:1px solid #a0afc5;box-shadow:inset 1px 1px #fff}
@media(max-width:600px){#shop-modal{padding:12px;height:620px}#shop-modal .shop-body{grid-template-columns:38px minmax(0,1fr);gap:8px}}
/* Shop category heading and reserved currency controls. */
#shop-modal[open]{grid-template-rows:auto auto minmax(0,1fr);gap:10px}
#shop-modal .shop-heading{gap:12px;justify-content:space-between;min-width:0}
#shop-modal .shop-section-title{margin:0 0 0 50px;text-align:center;font:22px/1.2 system-ui,sans-serif;min-width:0}
#shop-modal .shop-wallet{display:flex;gap:8px;min-width:0;align-items:center}
#shop-modal .shop-balance{display:flex;align-items:center;gap:5px;padding:3px 4px 3px 6px;min-width:0;border:1px solid #a0afc5;background:#f8faff;box-shadow:inset 1px 1px #fff,inset -1px -1px #a0adc1;font:16px/1 system-ui,sans-serif;white-space:nowrap}
#shop-modal .shop-balance[data-currency=coins]{color:#9b692a}#shop-modal .shop-balance[data-currency=crystals]{color:#8151b2}
#shop-modal .shop-currency-icon{font:22px/1 monospace}
#shop-modal .shop-balance button{width:22px;height:22px;min-height:22px;flex:none;font:22px/1 system-ui,sans-serif;color:inherit}
@media(max-width:600px){#shop-modal .shop-heading{flex-wrap:wrap;gap:8px}#shop-modal .shop-wallet{flex-wrap:wrap;gap:6px}#shop-modal .shop-balance{font-size:14px;gap:3px}#shop-modal .shop-section-title{margin-left:46px;font-size:20px}}

/* Wider shop and larger pixel currency counters. */
#shop-modal{width:1000px}
#shop-modal .shop-wallet{gap:12px}
#shop-modal .shop-balance{gap:8px;padding:5px 6px 5px 8px;font-size:22px;min-height:44px}
#shop-modal .shop-currency-icon{display:block;width:32px;height:32px;flex:none;image-rendering:pixelated;object-fit:contain}
#shop-modal .shop-balance button{width:30px;height:30px;min-height:30px;font-size:28px}
@media(max-width:600px){#shop-modal .shop-heading{padding-right:30px}#shop-modal .shop-wallet{gap:8px;flex-wrap:wrap}#shop-modal .shop-balance{font-size:20px;gap:6px}#shop-modal .shop-currency-icon{width:32px;height:32px}}

/* Compact currency height, preserving the large text and horizontal spacing. */
#shop-modal .shop-balance{padding:1px 6px 1px 8px;min-height:28px}
#shop-modal .shop-currency-icon{width:24px;height:24px}
#shop-modal .shop-balance button{width:24px;height:24px;min-height:24px;font-size:24px}

/* Flush + segment: contained inside the counter's outer border. */
#shop-modal .shop-balance{padding:0 0 0 8px;min-height:28px;overflow:hidden;align-items:center}
#shop-modal .shop-balance button{align-self:stretch;margin:0 0 0 auto;width:26px;height:auto;min-height:0;border-width:0 0 0 1px;flex-shrink:0}
#shop-currency-modal{position:fixed;inset:auto;margin:0;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:14px;border:2px solid #53606b;border-radius:0;background:#e4eaf4;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;overflow:hidden;transform-origin:top left}
#shop-currency-modal[open]{display:grid;grid-template-rows:auto minmax(0,1fr);gap:14px}
#shop-currency-modal::backdrop{background:#17243722}
#shop-currency-modal h2{margin:0;min-height:28px;padding-right:36px;font:24px/28px system-ui,sans-serif}
#shop-currency-modal .shop-currency-content{min-height:0;background:#f8faff;border:1px solid #a0afc5}
#shop-currency-modal .shop-currency-close{position:absolute;top:8px;right:8px;width:28px;height:28px;min-height:28px;display:grid;place-items:center;padding:0;border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;font:24px/1 system-ui,sans-serif}
#shop-currency-modal .shop-currency-close:hover{background:#d5dfef}#shop-currency-modal .shop-currency-close:active{box-shadow:inset 2px 2px #a0adc1,inset -1px -1px #fff}

#shop-modal{transform-origin:top left}

#avatar-editor{transform-origin:top left}

@media(prefers-reduced-motion:no-preference){#shop-modal .shop-categories button{transition:box-shadow .18s ease-in-out}}

#shop-currency-modal h2{display:flex;align-items:center;justify-content:center;gap:8px;min-height:28px;padding:0 28px;font:22px/1 system-ui,sans-serif;text-align:center}
#shop-currency-modal h2 img{display:block;width:24px;height:24px;flex:none;image-rendering:pixelated}
#shop-currency-modal h2[data-currency=coins]{color:#9b692a}#shop-currency-modal h2[data-currency=crystals]{color:#8151b2}
@media(max-width:600px){#shop-currency-modal h2{font-size:20px}}

#shop-currency-modal .shop-currency-content{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(130px,1fr)) auto;gap:10px;padding:10px;overflow:auto;scrollbar-width:thin;scrollbar-color:#a0adc1 #e4eaf4}
#shop-currency-modal .shop-package{min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:12px 5px;background:#e4eaf4;border:1px solid #a0afc5;box-shadow:inset 1px 1px #fff;color:#536884;gap:6px;text-align:center}
#shop-currency-modal .shop-package-quantity{display:flex;align-items:center;justify-content:center;gap:5px;max-width:100%}
#shop-currency-modal .shop-package-quantity img{width:24px;height:24px;image-rendering:pixelated;flex:none}
#shop-currency-modal .shop-package strong{font:24px/1 system-ui,sans-serif}
#shop-currency-modal .shop-package-name{font:18px/1 system-ui,sans-serif}
#shop-currency-modal .shop-package-bonus{margin:0;font:14px/1.2 system-ui,sans-serif;min-height:32px;display:flex;align-items:center;justify-content:center}
#shop-currency-modal .shop-package-buy{width:100%;max-width:135px;min-height:32px;font:20px/1 system-ui,sans-serif;margin:0;padding:4px;border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884}
#shop-currency-modal .shop-package-buy:disabled{opacity:1;cursor:default}
#shop-currency-modal .shop-package-note{grid-column:1/-1;margin:0;text-align:center;font:14px/1.2 system-ui,sans-serif}
@media(max-width:360px){#shop-currency-modal .shop-currency-content{padding:6px;gap:6px}#shop-currency-modal .shop-package strong{font-size:21px}#shop-currency-modal .shop-package-quantity img{width:20px;height:20px}}

#shop-currency-modal .shop-package-quantity{gap:4px;white-space:nowrap}
#shop-currency-modal .shop-package-quantity img{width:20px;height:20px}
#shop-currency-modal .shop-package strong{font-size:21px}
#shop-currency-modal .shop-package-extra{font:12px/1 system-ui,sans-serif;color:#32765c}
#shop-currency-modal [data-currency=crystals] .shop-package strong{font-size:18px}
@media(max-width:360px){#shop-currency-modal .shop-package-quantity{flex-wrap:wrap}#shop-currency-modal [data-currency=crystals] .shop-package strong{font-size:17px}}

/* Currency menus: black bold lettering, preserving sizes and spacing. */
#shop-currency-modal .shop-package strong,#shop-currency-modal .shop-package-name,#shop-currency-modal .shop-package-bonus,#shop-currency-modal .shop-package-extra,#shop-currency-modal .shop-package-buy,#shop-currency-modal .shop-package-note{font-weight:400;color:#536884}

#shop-currency-modal h2{font-weight:400}
#shop-currency-modal,#shop-currency-modal *{-webkit-text-stroke:0;text-shadow:none;font-synthesis:none}

#shop-currency-modal .shop-package-buy{font-weight:700;font-synthesis:weight}

#shop-currency-modal .shop-package-quantity strong{font-weight:700;font-synthesis:weight}
#payment-modal{position:fixed;inset:0;margin:auto;width:1000px;height:560px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:14px;border:2px solid #53606b;border-radius:0;background:#e4eaf4;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;overflow:hidden;transform-origin:top left}
#payment-modal::backdrop{background:#17243766}#payment-modal[open]{display:grid;grid-template-rows:auto auto minmax(0,1fr);gap:18px}
#payment-modal .payment-heading{position:static;display:flex;align-items:center;gap:10px;width:auto;max-width:none;margin:0;padding:0 36px 0 0;min-height:28px}
#payment-modal h2{margin:0;font:24px/1 system-ui,sans-serif}
#payment-modal button{border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;font:20px/1 system-ui,sans-serif;cursor:pointer}
#payment-modal button:hover{background:#d5dfef}#payment-modal button:active,#payment-modal button[aria-selected=true]{box-shadow:inset 2px 2px #a0adc1,inset -1px -1px #fff}
#payment-modal .payment-close{position:absolute;right:8px;top:8px}#payment-modal :is(.payment-back,.payment-close){width:28px;height:28px;min-height:28px;padding:0;display:grid;place-items:center;font-size:24px}
#payment-modal .payment-tabs{display:grid;grid-template-columns:1fr 1fr;border:1px solid #53606b;padding:3px;gap:4px}#payment-modal .payment-tabs button{height:34px;min-height:34px}
#payment-modal .payment-scroll{min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:#a0adc1 #e4eaf4}
#payment-modal .payment-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:440px;margin:0 auto 18px;padding:12px;background:#f8faff;border:1px solid #a0afc5;font:18px/1.2 system-ui,sans-serif}
#payment-modal .payment-form{max-width:440px;margin:auto}#payment-modal .payment-status{font:16px/1.4 system-ui,sans-serif;overflow-wrap:anywhere}#payment-modal .payment-submit{width:100%;height:38px;min-height:38px;font-weight:700}
#payment-modal .payment-protection{font:14px/1.2 system-ui,sans-serif;text-align:center;margin:12px 0}
@media(max-width:600px){#payment-modal{padding:12px}#payment-modal[open]{gap:12px}#payment-modal .payment-summary{font-size:16px}}

/* Fit payment fields into the available viewport without scaling the iframe. */
#payment-modal{height:min(660px,calc(100dvh - 24px));padding:12px}
#payment-modal[open]{gap:8px}
#payment-modal .payment-tabs button{height:28px;min-height:28px;font-size:18px;padding:2px 6px}
#payment-modal .payment-summary{margin-bottom:8px;padding:7px 10px;font-size:16px;gap:8px}
#payment-modal .payment-status{margin:6px 0;font-size:14px;line-height:1.2}
#payment-modal .payment-status:empty{display:none}
#payment-modal .payment-submit{height:32px;min-height:32px;margin-top:8px;font-size:18px}
#payment-modal .payment-protection{font-size:12px;margin:6px 0 0}
#payment-modal .payment-scroll{overflow-x:hidden;padding:0 3px 3px}
@media(max-width:600px){#payment-modal{max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);height:calc(100dvh - 16px);padding:10px}#payment-modal[open]{gap:8px}}
@media(max-height:500px) and (min-width:650px){#payment-modal .payment-scroll{display:grid;grid-template-columns:minmax(160px,1fr) minmax(300px,440px);gap:16px;align-items:start}#payment-modal .payment-summary{width:100%;margin:0}#payment-modal .payment-form{width:100%;margin:0}}

#payment-modal[open]{grid-template-rows:auto minmax(0,1fr)}

.wallet-received-value[data-currency=coins]{color:#9b692a}.wallet-received-value[data-currency=crystals]{color:#8151b2}
#notifications[popover]{margin:0;padding:0;border:0;overflow:visible;background:transparent;bottom:auto;height:0}

/* Standard system typography throughout the interface. */
html,body,button,input,select,textarea,summary{font-family:system-ui,-apple-system,"Segoe UI",sans-serif}
/* Text must fit the existing button geometry, including save progress. */
#editor .build-settings #build-action #build-budget{font-size:11px!important;line-height:13px!important;letter-spacing:0!important;text-shadow:none;white-space:nowrap;max-width:100%;min-width:0}
button .control-label{min-width:0;max-width:100%;line-height:1.15;overflow-wrap:anywhere}
#login-modal .login-options button{font-size:16px;line-height:1.2}
#tutorial-done{font-size:16px;line-height:1.2}

#editor #paint-charge-status{grid-column:1/-1;display:block;width:100%;text-align:center;font-size:10px;line-height:13px;font-weight:400;color:#536884;white-space:nowrap}

@media(max-width:600px),(pointer:coarse) and (max-height:500px){#editor #paint-charge-status{font-size:9px;line-height:11px;white-space:normal;overflow-wrap:anywhere;flex:none}}

/* Keep shop balances at the right edge, including while the paint dock is open. */
#shop-modal[open] .shop-heading{width:100%;max-width:none}
#shop-modal[open] .shop-wallet{margin-left:auto;justify-content:flex-end}
/* Compact shop balances; preserve the right-corner anchor and purchase actions. */
#shop-modal .shop-wallet{gap:8px}
#shop-modal .shop-balance{min-height:24px;padding-left:5px;gap:5px;font-size:14px;line-height:1.15}
#shop-modal .shop-currency-icon{width:18px;height:18px}
#shop-modal .shop-balance button{width:22px;font-size:18px}

#interface-tooltip[popover]{inset:auto;margin:0;width:max-content}
/* Reserve scrollbar space so payment-method changes do not resize secure fields. */
#payment-modal .payment-scroll{scrollbar-gutter:stable;overflow-anchor:none}
/* Account-bound coin items, isolated from the currency purchase cards. */
#shop-modal .shop-items-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:12px}
#shop-modal .shop-item-card{display:flex;flex-direction:column;align-items:center;gap:12px;padding:22px 12px;background:#e3e9f2;border:1px solid #a0afc5;text-align:center;color:#536884}
#shop-modal .shop-item-art{width:80px;height:80px;color:#536884}#shop-modal .shop-item-art svg{width:100%;height:100%}
#shop-modal .shop-item-card h3{font:600 21px/1.2 system-ui,sans-serif;margin:0}#shop-modal .shop-item-card p{margin:0;font:14px/1.4 system-ui,sans-serif}
#shop-modal .shop-item-quantity{display:flex;align-items:center;gap:10px;margin-top:auto}#shop-modal .shop-item-quantity button{width:32px;height:32px;padding:0}#shop-modal .shop-item-quantity output{min-width:52px;padding:5px;background:#f8faff;border:1px solid #536884}
#shop-modal .shop-item-buy{display:flex;align-items:center;justify-content:center;gap:6px;min-width:160px;min-height:36px;font:600 17px system-ui,sans-serif}#shop-modal .shop-item-buy img{width:22px;height:22px}#shop-modal .shop-item-status{padding:0 12px;font:14px system-ui,sans-serif}
#account-avatar-edit.avatar-locked::after{content:'🔒';position:absolute;font:10px system-ui;right:-3px;bottom:-3px}
@media(max-width:600px){#shop-modal .shop-items-grid{grid-template-columns:1fr;padding:8px}#shop-modal .shop-item-card{padding:16px 10px}}
.notification-icon.notification-icon-error{color:#c13939}
#shop-modal .shop-item-art.shop-profile-tile{width:64px;height:64px}#shop-modal .shop-profile-tile img{display:block;width:100%;height:100%;image-rendering:pixelated}

.notification-card .restored-owner-name{color:#b58900}

.account-name-row{display:flex;align-items:center;gap:6px;min-width:0}.account-name-row strong{overflow-wrap:anywhere}
#login-modal .account-name-edit{width:22px;height:22px;min-height:22px;padding:2px;flex:none;display:grid;place-items:center;border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;color:#536884;box-shadow:inset 1px 1px #fff,inset -1px -1px #a0adc1}
#username-editor{width:min(360px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:18px;border:2px solid #536884;border-radius:0;background:#e3e9f2;color:#536884;font:14px system-ui;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1}
#username-editor>strong{display:block;padding-right:30px;margin-bottom:18px}#username-editor form{display:grid;gap:12px}#username-editor p{font-size:12px;margin:0;line-height:1.5}
#username-editor input{width:100%;min-width:0;padding:9px;background:#f8faff;color:#536884;border:1px solid #a0afc5;border-radius:0;font:16px system-ui}
#username-editor button{border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;color:#536884;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;font:14px system-ui;cursor:pointer}
#username-editor button:hover{background:#d5dfef}#username-editor .username-close{position:absolute;top:8px;right:8px;width:28px;height:28px;min-height:28px;padding:0;font:24px/1 system-ui}

#pixel-details{width:350px;transform-origin:bottom right;padding:12px}#pixel-detail-swatch{width:48px;height:48px;flex:0 0 48px;overflow:hidden;display:grid;place-items:center}#pixel-detail-swatch img{display:block;width:100%;height:100%;object-fit:cover;image-rendering:pixelated}
#pixel-detail-swatch.pixel-unpainted{background:conic-gradient(#e0e3e8 25%,#f8faff 0 50%,#e0e3e8 0 75%,#f8faff 0) 0 0/12px 12px}
#pixel-details #pixel-detail-owner{font-size:12px;line-height:1.5;margin-top:6px}.pixel-owner-tag{font-weight:600;overflow-wrap:anywhere}
@media(max-width:600px){#pixel-details{width:min(350px,calc(100vw - 24px))}}

#pixel-details{width:400px}#pixel-details #pixel-detail-owner{font-size:13px;font-weight:700}.pixel-owner-tag{font-weight:700}@media(max-width:600px){#pixel-details{width:min(400px,calc(100vw - 24px))}}

/* Creature product: existing shop controls, expandable details on desktop and touch. */
#shop-modal .shop-creature-info{width:100%;min-width:0}
#shop-modal .shop-creature-info-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:30px;padding:4px 10px;font:inherit;cursor:pointer}
#shop-modal .shop-creature-info-panel{display:grid;grid-template-rows:0fr;opacity:0;transition:grid-template-rows 280ms ease-in-out,opacity 280ms ease-in-out;text-align:left}
#shop-modal .shop-creature-info-panel>div{overflow:hidden;min-height:0}
#shop-modal .shop-creature-info.expanded .shop-creature-info-panel{grid-template-rows:1fr;opacity:1}
#shop-modal .shop-creature-info ul{padding:10px 0 0 18px;margin:0;font:14px/1.45 system-ui,sans-serif}
#shop-modal .shop-creature-info li+li{margin-top:8px}
@media(prefers-reduced-motion:reduce){#shop-modal .shop-creature-info-panel{transition:none}}

/* Scroll only the shop products; keep wallet, title and categories fixed. */
#shop-modal .shop-content{overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;touch-action:pan-y;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#a0adc1 #e4eaf4}
#shop-modal .shop-content::-webkit-scrollbar{width:8px;height:8px}
#shop-modal .shop-content::-webkit-scrollbar-track{background:#e4eaf4}
#shop-modal .shop-content::-webkit-scrollbar-thumb{background:#a0adc1;border:1px solid #536884;border-radius:0;box-shadow:inset 1px 1px #fff}
#shop-modal .shop-content::-webkit-scrollbar-thumb:hover{background:#8295af}
#shop-modal .shop-items-grid{align-items:start}

/* Both controls stay anchored to their own row while details expand below. */
#shop-modal .shop-creature-actions{position:relative;width:100%;height:36px;flex:none;display:flex;justify-content:center}
#shop-modal .shop-creature-info{padding-top:0;margin-top:-12px}
#shop-modal .shop-creature-info-button{position:absolute;top:0;left:calc(50% + 84px);width:112px;height:36px;min-height:36px;padding:0 4px;font:12px system-ui,sans-serif;gap:3px}
#shop-modal .shop-creature-info-button span{display:inline}
#shop-modal .shop-creature-info-button>svg:first-child{display:none}
#shop-modal .shop-creature-arrow{flex:none;transition:transform 280ms ease-in-out}
#shop-modal .shop-creature-info-button[aria-expanded=true] .shop-creature-arrow{transform:rotate(180deg)}
@media(max-width:600px){
 #shop-modal .shop-creature-actions{justify-content:flex-start}
 #shop-modal .shop-creature-card .shop-item-buy{min-width:0;width:calc(100% - 112px);font-size:14px}
 #shop-modal .shop-creature-info-button{left:auto;right:0;width:106px;font-size:12px}
 #shop-modal .shop-creature-card .shop-item-buy img{width:18px;height:18px}
}
@media(prefers-reduced-motion:reduce){#shop-modal .shop-creature-arrow{transition:none}}

#inventory-panel{position:fixed;left:12px;top:12px;bottom:12px;width:210px;max-width:calc(100vw - 24px);z-index:40;box-sizing:border-box;display:flex;flex-direction:column;gap:12px;padding:10px;border:2px solid #53606b;background:#e4eaf4;color:#536884;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;overflow:hidden}
#inventory-panel[hidden]{display:none}
#inventory-panel header{display:flex;align-items:center;justify-content:space-between;flex:none}
#inventory-panel h2{font:16px system-ui,sans-serif;margin:0}
#inventory-panel button{border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;color:#536884;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;font:13px system-ui,sans-serif;cursor:pointer}
#inventory-panel button:active,#inventory-panel button[aria-pressed=true]{box-shadow:inset 2px 2px #a0adc1,inset -1px -1px #fff}
#inventory-panel .inventory-close{width:28px;height:28px;font-size:24px;line-height:1}
#inventory-panel .inventory-slots{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-content:start;gap:6px;overflow-y:auto;min-height:0;scrollbar-width:thin;scrollbar-color:#a0adc1 #e4eaf4}
#inventory-panel .inventory-slot{position:relative;aspect-ratio:1;min-width:0;padding:8px;border:1px solid #a0afc5;background:#f8faff;box-sizing:border-box}
#inventory-panel .inventory-slot svg{display:block;width:100%;height:100%;image-rendering:pixelated}
#inventory-panel .inventory-slot span{position:absolute;right:3px;bottom:1px;font-size:12px;font-weight:700;background:#e4eaf4}
#inventory-panel .inventory-recall{padding:8px;flex:none}
#inventory-panel .inventory-status{font:12px/1.4 system-ui,sans-serif;margin:0}
@media(max-height:420px){#inventory-panel{top:6px;bottom:6px;gap:6px}}

/* Isolate the inventory header from the old global header/aside rules. */
#inventory-panel{pointer-events:auto}
#inventory-panel>header{position:relative;inset:auto;z-index:auto;width:100%;max-width:none;min-height:28px;height:28px;flex:0 0 28px;display:flex;align-items:center;justify-content:space-between;gap:6px;margin:0;padding:0;pointer-events:auto}
#inventory-panel>header h2{min-width:0;margin:0;font:400 14px/1.2 system-ui,sans-serif;letter-spacing:normal}
#inventory-panel>header .inventory-close{position:static;inset:auto;flex:0 0 28px;width:28px;height:28px;min-height:28px;margin:0;padding:0;border-radius:0;display:grid;place-items:center;font:24px/1 system-ui,sans-serif}
#inventory-panel .inventory-slot .inventory-in-use{left:2px;right:2px;bottom:2px;padding:2px 0;text-align:center;background:#dce5f2;color:#536884;border:1px solid #a0afc5;font:700 9px/1.1 system-ui,sans-serif}
#inventory-panel .inventory-slot-in-use svg{height:calc(100% - 9px)}
#inventory-panel .inventory-slot[aria-pressed=true]{outline:2px solid #536884;outline-offset:-2px}
.purchase-confirm{position:fixed;inset:0;margin:auto;width:360px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto;padding:14px;border:2px solid #53606b;border-radius:0;background:#e4eaf4;color:#536884;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;font:14px system-ui,sans-serif}
.purchase-confirm::backdrop{background:#17243766}.purchase-confirm h2{margin:0 34px 18px 0;font:16px system-ui,sans-serif}.purchase-confirm p{margin:0 0 10px;overflow-wrap:anywhere}.purchase-confirm strong{display:block;margin-bottom:18px}
.purchase-confirm button{border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;color:#536884;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;font:14px system-ui,sans-serif;cursor:pointer;padding:7px 10px;min-height:34px}.purchase-confirm button:active{box-shadow:inset 2px 2px #a0adc1,inset -1px -1px #fff}
.purchase-confirm .purchase-confirm-close{position:absolute;top:8px;right:8px;width:28px;height:28px;min-height:28px;padding:0;font:24px/1 system-ui,sans-serif}.purchase-confirm-actions{display:flex;gap:10px}.purchase-confirm-actions button{flex:1;min-width:0}
#grid-picker{position:fixed;left:12px;bottom:12px;width:330px;max-width:calc(100vw - 24px);z-index:45;padding:12px;border:2px solid #53606b;background:#e4eaf4;color:#536884;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;pointer-events:auto;font:13px system-ui,sans-serif}
#grid-picker[hidden]{display:none}#grid-picker header{position:relative;inset:auto;width:100%;max-width:none;display:flex;align-items:center;justify-content:space-between;margin:0 0 10px;pointer-events:auto}#grid-picker h2{font:16px system-ui;margin:0}#grid-picker p{font:13px/1.4 system-ui;margin:8px 0}#grid-picker output{display:block;font-weight:600;margin:10px 0}
#grid-picker button{border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;color:#536884;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;font:13px system-ui;cursor:pointer;min-height:32px;padding:5px 7px}#grid-picker .grid-picker-close{width:28px;height:28px;min-height:28px;padding:0;font:24px/1 system-ui}#grid-picker .grid-picker-actions{display:flex;gap:8px}#grid-picker .grid-picker-buy{flex:1}
html[data-grid-selecting=true] #open-login,html[data-grid-selecting=true] #account-shortcuts,html[data-grid-selecting=true] #edit,html[data-grid-selecting=true] #inventory-panel{visibility:hidden!important;pointer-events:none!important}
/* Interface labels and artwork are controls, not selectable document content. */
html,body{user-select:none;-webkit-user-select:none}
input,textarea,[contenteditable="true"]{user-select:text;-webkit-user-select:text}
img,svg,canvas{-webkit-user-drag:none}
/* Apply to dialog descendants too; native dialogs may not inherit body selection. */
body *,body *::before,body *::after{user-select:none!important;-webkit-user-select:none!important}
body input,body textarea,body [contenteditable="true"],body [contenteditable="true"] *{user-select:text!important;-webkit-user-select:text!important}

/* Equal collapsed product cards; only the chosen information panel grows. */
#shop-modal .shop-item-card{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:80px 26px 20px 34px 36px;align-content:start;justify-items:center;gap:12px}
#shop-modal .shop-item-card>.shop-item-art{grid-row:1;align-self:center}
#shop-modal .shop-item-card>h3{grid-row:2;align-self:center;max-width:100%;font-size:20px}
#shop-modal .shop-item-card>p{grid-row:3;align-self:center;max-width:100%}
#shop-modal .shop-item-card>.shop-item-quantity{grid-row:4;margin:0;align-self:center}
#shop-modal .shop-item-card>.shop-item-buy,#shop-modal .shop-item-card>.shop-creature-actions{grid-row:5;align-self:start}
#shop-modal .shop-item-card>.shop-creature-info{grid-row:6}
@media(max-width:600px){#shop-modal .shop-item-card{grid-template-rows:80px 26px 20px 34px 36px}}

/* Restore the original ink-card height; no additional title/description rows. */
#shop-modal .shop-item-card>h3{font-size:18px;line-height:1.2}
#shop-modal .shop-item-card>p{font-size:12px;line-height:1.2}
@media(max-width:600px){#shop-modal .shop-item-card{gap:8px;grid-template-rows:80px 26px 28px 34px 36px}#shop-modal .shop-item-card>.shop-creature-info{margin-top:-8px}#shop-modal .shop-item-card>h3{font-size:16px}}
/* Details share the purchase row: no sixth track or extra gap when closed. */
#shop-modal .shop-item-card{grid-template-rows:80px 26px 20px 34px minmax(36px,auto)}
#shop-modal .shop-item-card>.shop-creature-info{grid-row:5;grid-column:1;align-self:start;margin:0;padding:36px 0 0;pointer-events:none}
#shop-modal .shop-item-card>.shop-creature-info .shop-creature-info-panel{pointer-events:auto}
#shop-modal .shop-item-card>.shop-creature-actions{grid-row:5;grid-column:1;z-index:1}
@media(max-width:600px){#shop-modal .shop-item-card{grid-template-rows:80px 26px 28px 34px minmax(36px,auto)}#shop-modal .shop-item-card>.shop-creature-info{margin:0;padding-top:36px}}
#login-modal .login-wordmark{display:block;width:220px;max-width:85%;height:auto;margin:10px auto 22px;object-fit:contain}
#login-modal.profile-menu .login-wordmark{display:none}

/* Ranking: same shop shell, with horizontal period tabs. */
#ranking-modal{position:fixed;inset:0;margin:auto;box-sizing:border-box;width:1000px;height:560px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:14px;border:2px solid #53606b;border-radius:0;background:#e4eaf4;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;overflow:hidden;transform-origin:top left}
#ranking-modal[open]{display:grid;grid-template-columns:max-content minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:14px 12px}
#ranking-modal::backdrop{background:#17243766}
#ranking-modal .ranking-heading{grid-column:1/-1;position:static;display:flex;align-items:center;width:100%;max-width:none;min-height:28px;margin:0;padding:0 36px 0 0;background:none;border:0;box-shadow:none;border-radius:0}
#ranking-modal h2{margin:0;font:26px/1.2 system-ui,sans-serif}
#ranking-modal button{border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;cursor:pointer;padding:0;display:grid;place-items:center;font:16px/1.2 system-ui,sans-serif;touch-action:manipulation}
#ranking-modal button:hover{background:#d5dfef}
#ranking-modal button:active,#ranking-modal button[aria-selected=true]{box-shadow:inset 2px 2px #a0adc1,inset -1px -1px #fff}
#ranking-modal button[aria-selected=true]{outline:2px solid #18283f;outline-offset:1px}
#ranking-modal .ranking-close{position:absolute;top:8px;right:8px;width:28px;height:28px;min-height:28px;font:24px/1 system-ui,sans-serif}
#ranking-modal .ranking-tabs{display:flex;flex-direction:column;align-items:flex-start;gap:12px;padding:3px;min-width:0}
#ranking-modal .ranking-tabs button{width:84px;min-width:84px;height:32px;min-height:32px;padding:0 10px;flex:none}
#ranking-modal .ranking-content{min-width:0;min-height:0;overflow:auto;background:#f8faff;border:1px solid #a0afc5;box-shadow:inset 1px 1px #fff}
@media(max-width:600px){#ranking-modal{padding:12px;height:620px}#ranking-modal .ranking-tabs{gap:6px}#ranking-modal .ranking-tabs button{font-size:14px}}
@media(prefers-reduced-motion:no-preference){#ranking-modal button{transition:box-shadow .18s ease-in-out,background-color .12s}}

/* Ranking rows share the site's square avatar and neutral menu colors. */
#ranking-modal .ranking-table{width:100%;border-collapse:collapse;table-layout:fixed;font:14px/1.35 system-ui,sans-serif;color:#536884}
#ranking-modal .ranking-table th{font-weight:600;text-align:left;padding:12px 10px;border-bottom:1px solid #dce3ee}
#ranking-modal .ranking-table th:first-child{width:46px}#ranking-modal .ranking-table th:last-child{width:155px;text-align:center}
#ranking-modal .ranking-table td{padding:12px 10px;border-bottom:1px solid #e4eaf4;vertical-align:middle}
#ranking-modal .ranking-position{text-align:center;font-variant-numeric:tabular-nums}
#ranking-modal .ranking-position-label{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#ranking-modal .ranking-player{display:flex;align-items:center;gap:12px;min-width:0}
#ranking-modal .ranking-avatar{display:block;flex:none;width:40px;height:40px;box-sizing:border-box;border:2px solid #53606b;outline:1px solid #a0afc5;outline-offset:1px;image-rendering:pixelated;object-fit:cover;background:#f8faff}
#ranking-modal .ranking-identity{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap;min-width:0}
#ranking-modal .ranking-username{font-weight:600;overflow-wrap:anywhere}
#ranking-modal .ranking-user-id{font-size:12px;color:#75869e}
#ranking-modal .ranking-pixels{text-align:center;font-variant-numeric:tabular-nums;white-space:nowrap}
#ranking-modal .ranking-status{padding:16px;margin:0;font:14px/1.4 system-ui,sans-serif}
#ranking-modal .ranking-retry{margin:0 16px 16px;padding:6px 12px;min-height:32px}
@media(max-width:600px){#ranking-modal .ranking-table{font-size:12px}#ranking-modal .ranking-table th,#ranking-modal .ranking-table td{padding:10px 5px}#ranking-modal .ranking-table th:first-child{width:24px}#ranking-modal .ranking-table th:last-child{width:84px}#ranking-modal .ranking-player{gap:7px;align-items:flex-start}#ranking-modal .ranking-avatar{width:28px;height:28px}#ranking-modal .ranking-identity{gap:1px;flex-direction:column}#ranking-modal .ranking-user-id{font-size:10px}}
/* Improve ranking text weight without changing typography size or geometry. */
#ranking-modal h2,#ranking-modal button,#ranking-modal .ranking-table th,#ranking-modal .ranking-table td,#ranking-modal .ranking-username,#ranking-modal .ranking-user-id,#ranking-modal .ranking-status{font-weight:700}

/* Shop categories match the ranking's text tabs; wallet remains in its header. */
#shop-modal[open]{grid-template-rows:auto minmax(0,1fr);gap:14px}
#shop-modal .shop-body{grid-template-columns:90px minmax(0,1fr);gap:12px}
#shop-modal .shop-categories{align-items:flex-start;gap:12px}
#shop-modal .shop-categories button{width:84px;height:32px;min-height:32px;padding:0 10px;font:700 16px/1.2 system-ui,sans-serif}
#shop-modal .shop-heading h2,#shop-modal .shop-heading .shop-balance>span,#shop-modal .shop-content :is(h3,p,span,strong,output,li),#shop-modal .shop-content .shop-item-card h3,#shop-modal .shop-content .shop-item-card p,#shop-modal button[type=button]{font-weight:700}
@media(max-width:600px){#shop-modal .shop-body{grid-template-columns:90px minmax(0,1fr);gap:12px}#shop-modal .shop-categories{gap:6px}#shop-modal .shop-categories button{font-size:14px}}
.gift-received-reason{color:#1671d9;overflow-wrap:anywhere}
/* Six coin packs retain their card size and scroll within the existing modal. */
#shop-currency-modal .shop-currency-content:is([data-currency=coins],[data-currency=crystals]){grid-template-rows:none;grid-auto-rows:minmax(130px,auto);align-content:start;overflow-y:scroll;overscroll-behavior:contain;touch-action:pan-y;scrollbar-gutter:stable}
#shop-currency-modal .shop-currency-content:is([data-currency=coins],[data-currency=crystals])::-webkit-scrollbar{width:7px}
#shop-currency-modal .shop-currency-content:is([data-currency=coins],[data-currency=crystals])::-webkit-scrollbar-track{background:#e4eaf4}
#shop-currency-modal .shop-currency-content:is([data-currency=coins],[data-currency=crystals])::-webkit-scrollbar-thumb{background:#a0adc1;border:1px solid #f8faff}

#guild-modal{position:fixed;inset:0;margin:auto;box-sizing:border-box;width:1000px;height:560px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:14px;border:2px solid #53606b;border-radius:0;background:#e4eaf4;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;overflow:hidden;transform-origin:top left}
#guild-modal[open]{display:grid;grid-template-columns:max-content minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:14px 12px}
#guild-modal::backdrop{background:#17243766}
#guild-modal .guild-heading{grid-column:1/-1;position:static;display:flex;align-items:center;width:100%;max-width:none;min-height:28px;margin:0;padding:0 36px 0 0;background:none;border:0;box-shadow:none;border-radius:0}
#guild-modal h2{margin:0;font:26px/1.2 system-ui,sans-serif}
#guild-modal button{border:1px solid #a0afc5;border-radius:0;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;cursor:pointer;padding:0;display:grid;place-items:center;font:16px/1.2 system-ui,sans-serif;touch-action:manipulation}
#guild-modal button:hover{background:#d5dfef}
#guild-modal button:active,#guild-modal button[aria-selected=true]{box-shadow:inset 2px 2px #a0adc1,inset -1px -1px #fff}
#guild-modal button[aria-selected=true]{outline:2px solid #18283f;outline-offset:1px}
#guild-modal .guild-close{position:absolute;top:8px;right:8px;width:28px;height:28px;min-height:28px;font:24px/1 system-ui,sans-serif}
#guild-modal .guild-tabs{display:flex;flex-direction:column;align-items:flex-start;gap:12px;padding:3px;min-width:0}
#guild-modal .guild-tabs button{width:96px;min-width:84px;height:32px;min-height:32px;padding:0 10px;flex:none}
#guild-modal .guild-content{min-width:0;min-height:0;overflow:auto;background:#f8faff;border:1px solid #a0afc5;box-shadow:inset 1px 1px #fff}
@media(max-width:600px){#guild-modal{padding:12px;height:620px}#guild-modal .guild-tabs{gap:6px}#guild-modal .guild-tabs button{font-size:14px}}
@media(prefers-reduced-motion:no-preference){#guild-modal button{transition:box-shadow .18s ease-in-out,background-color .12s}}


#login-modal.profile-menu{width:410px;min-height:260px}
#guild-modal[open]{display:flex;flex-direction:column;gap:14px}
#guild-modal .guild-body{display:grid;grid-template-columns:102px minmax(0,1fr);gap:12px;min-height:0;flex:1}
#guild-modal .guild-content{overflow:auto;padding:14px;font:14px/1.45 system-ui,sans-serif}
#guild-modal .guild-tabs{display:flex;flex-direction:column;gap:12px;padding:3px;align-items:flex-start}
#guild-modal .guild-tabs button{width:96px;height:32px;font-weight:700}
#guild-modal .guild-close{position:absolute;top:8px;right:8px;width:28px;height:28px;font-size:24px}
#guild-modal .guild-row{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:12px 0;border-bottom:1px solid #dce3ee}
#guild-modal .guild-row>div{flex:1;min-width:100px;overflow-wrap:anywhere}#guild-modal small{display:block;color:#536884}
#guild-modal h3{margin:0 0 12px}#guild-modal p{margin:8px 0 14px}
#guild-modal button{min-height:32px;padding:5px 10px;font-weight:700}#guild-modal button:disabled{opacity:.55;cursor:default}
#guild-modal input:not([type=checkbox]),#guild-modal select{box-sizing:border-box;width:100%;min-height:36px;padding:6px 8px;border:1px solid #a0afc5;border-radius:0;background:#f8faff;color:#536884;font:14px system-ui,sans-serif}
#guild-modal form{display:grid;gap:12px;margin:0 0 20px}#guild-modal .guild-invite{grid-template-columns:minmax(0,1fr) auto}
#guild-modal label{display:flex;align-items:center;gap:8px}#guild-modal input[type=checkbox]{width:16px;height:16px}
#guild-modal .guild-confirm{padding:12px;margin-bottom:14px;border:1px solid #a0afc5;background:#e4eaf4}#guild-modal .guild-confirm button+button{margin-left:8px}
#guild-modal button[aria-pressed=true]{box-shadow:inset 2px 2px #a0adc1,inset -1px -1px #fff;outline:2px solid #18283f;outline-offset:1px}
.guild-user-tag{display:inline-block;color:#8151b2;font:700 12px/1.3 system-ui,sans-serif;white-space:nowrap}
@media(max-width:600px){#login-modal.profile-menu{width:350px;min-height:240px}#guild-modal .guild-body{grid-template-columns:96px minmax(0,1fr);gap:8px}#guild-modal .guild-tabs button{width:90px}#guild-modal .guild-content{padding:10px}#guild-modal .guild-invite{grid-template-columns:minmax(0,1fr)}}

/* XP uses only the bottom border; the level badge sits opposite the edit pencil. */
#open-login.account-avatar,.account-menu-avatar{overflow:visible}
.profile-xp-track{position:absolute;left:-2px;right:-2px;bottom:-2px;height:3px;z-index:4;background:#a0afc5;pointer-events:none;overflow:hidden}
.profile-xp-fill{display:block;width:0;height:100%;background:#168bff}
.profile-level-badge{position:absolute;left:auto;right:-10px;top:-10px;bottom:auto;z-index:5;box-sizing:border-box;display:grid;place-items:center;min-width:18px;height:18px;padding:0 2px;border:1px solid #a0afc5;background:#e3e9f2;box-shadow:inset 2px 2px #fff,inset -2px -2px #a0adc1;color:#536884;font:700 12px/1 system-ui,sans-serif;pointer-events:none}
@media(prefers-reduced-motion:no-preference){.profile-xp-fill{transition:width .28s ease-in-out}}

#guild-modal.guild-empty .guild-body{grid-template-columns:minmax(0,1fr)}
#guild-modal.guild-empty .guild-tabs{display:none}
#guild-modal .guild-content.guild-create-screen{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px}
#guild-modal .guild-create-launch{display:inline-flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:14px;margin:0;max-width:100%;box-sizing:border-box;min-height:48px;padding:10px 20px;font:700 16px/1.4 system-ui,sans-serif}
#guild-modal .guild-create-cost{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
#guild-modal .guild-create-cost img{width:22px;height:22px;image-rendering:pixelated;flex:none}
/* Compact phone UI: preserve desktop geometry and native input readability. */
@media(max-width:600px),(pointer:coarse) and (max-height:500px){
 #zoom-controls button,#account-shortcuts button{width:32px;min-width:32px;height:32px;min-height:32px;padding:0}
 #account-shortcuts,html[data-auth=guest] #account-shortcuts{--shortcut-size:32px}
 #zoom-controls #screen-coordinates{min-height:32px;font-size:11px}
 #open-login.account-avatar{width:36px;min-width:36px;height:36px;min-height:36px}
 html[data-auth=guest] #open-login{width:96px;min-width:96px;height:40px;min-height:40px;left:calc(50% - 48px)!important;padding:4px 12px;font-size:20px}
 html[data-auth=guest] #account-shortcuts #shortcut-rank{left:calc(50% + 56px);bottom:calc(max(16px,env(safe-area-inset-bottom)) + 4px)}
 #edit{width:132px;min-width:0;height:40px;min-height:40px;font-size:22px;padding:4px 12px}
 #editor .mode-switch button,#editor .icon-button,#editor #how-build,#editor #animate-toggle{width:28px;min-width:28px;height:28px;min-height:28px;flex-basis:28px}
 #editor .editor-head{height:28px;min-height:28px;gap:4px}
 #editor .mobile-icon{width:17px;height:17px}
 :is(#shop-modal,#ranking-modal,#guild-modal,#payment-modal,#avatar-editor,#shop-currency-modal,.purchase-confirm){box-sizing:border-box;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:10px}
 :is(#shop-modal,#ranking-modal,#guild-modal,#payment-modal,#shop-currency-modal)[open]{gap:8px}
 :is(#shop-modal,#ranking-modal,#guild-modal,#payment-modal,#shop-currency-modal) h2{font-size:20px}
 #shop-modal .shop-body,#ranking-modal .ranking-body,#guild-modal .guild-body{grid-template-columns:74px minmax(0,1fr);gap:6px;min-height:0}
 #shop-modal .shop-categories button,#ranking-modal .ranking-tabs button,#guild-modal .guild-tabs button{width:68px;min-width:0;min-height:30px;height:30px;font-size:12px;padding:0 3px}
 #shop-modal .shop-heading{flex-wrap:wrap;gap:5px;padding-right:30px}
 #shop-modal .shop-wallet{max-width:100%;gap:4px;flex-wrap:wrap}
 #shop-modal .shop-balance{min-width:0;font-size:12px}
 #shop-modal .shop-balance>span{font-size:12px}
 #shop-modal .shop-items-grid{padding:6px;gap:8px}
 #shop-modal .shop-item-card{min-width:0;padding:10px 6px}
 #shop-modal .shop-item-card>h3{font-size:14px}
 #shop-modal .shop-item-card p{overflow-wrap:anywhere}
 #shop-modal .shop-creature-info button,#shop-modal .shop-item-buy{font-size:12px;min-width:0}
 #ranking-modal .ranking-content,#guild-modal .guild-content{min-width:0;padding:6px;overscroll-behavior:contain}
 #guild-modal .guild-create input,#guild-modal .guild-invite input,#payment-modal input,#login-modal input{font-size:16px;min-width:0;box-sizing:border-box}
 #guild-modal .guild-row{flex-wrap:wrap;gap:6px}
 #shop-currency-modal .shop-currency-content{grid-template-columns:minmax(0,1fr)}
 #shop-currency-modal .shop-package{min-width:0}
 .purchase-confirm button{font-size:14px;min-height:32px}
}
@media(max-width:600px),(pointer:coarse){
 html{position:fixed;inset:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
 body{position:fixed;inset:0;width:100%;height:100%;height:100dvh;overflow:hidden;overscroll-behavior:none}
 input:not([type=range]):not([type=color]):not([type=checkbox]):not([type=radio]),textarea,select{font-size:16px!important}
}
@media(max-width:600px),(pointer:coarse) and (max-height:500px){
 #notifications{overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin}
 #notifications .notification-card{min-height:48px;padding:8px;gap:7px}
 #notifications .notification-card p{font-size:12px;line-height:1.35}
 #notifications .update-notification{padding:9px}
 #notifications .update-notification p{font-size:13px;line-height:1.35;margin-bottom:7px}
 #notifications .update-notification button{font-size:13px;min-height:34px;touch-action:manipulation}
}
