.world-caption { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 7px 26px; background: #fff; border-bottom: 1px solid #ccc; flex-shrink: 0; }
.world-caption h1 { font: 19px var(--hand); margin: 0; }
#world-count { font-size: 10px; color: #777; border-left: 1px solid #ccc; padding-left: 12px; }
#world-activity { margin-left: auto; font-size: 10px; color: #777; }
.world-stage { position: relative; display: block; overflow: hidden; min-height: 0; flex: 1; }
#world-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.world-empty { position: absolute; left: 50%; top: 45%; transform: translate(-50%,-50%); width: min(360px,85%); padding: 25px; text-align: center; background: #fafafae8; border: 1px dashed #bbb; border-radius: 4px 2px 6px 3px; }
.world-empty-mark { font: 30px var(--hand); color: #777; }
.world-empty h2 { font: 26px var(--hand); margin: 8px 0; }
.world-empty p { font-size: 12px; line-height: 1.8; color: #777; margin-bottom: 18px; }
.world-placement { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 5px 8px 5px 16px; background: #fff; border: 1px dashed var(--ink); max-width: calc(100% - 24px); }
.world-placement span { font-size: 11px; overflow-wrap: anywhere; }
.world-placement button { text-decoration: underline; font-size: 10px; }
.world-selection { position: absolute; left: 16px; bottom: 16px; display: flex; align-items: center; gap: 7px; padding: 8px; border: 1px solid #aaa; background: #fff; border-radius: 3px 5px 3px 2px; max-width: calc(100% - 32px); box-shadow: 2px 2px 0 #0001; }
.world-selection strong { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--hand); font-size: 15px; padding-inline: 5px; }
.world-selection button { font-size: 10px; min-height: 28px; }
.world-residents { position: absolute; right: 16px; top: 16px; width: 210px; max-width: calc(100% - 32px); background: #fff; border: 1px solid #aaa; border-radius: 2px 4px 3px 2px; box-shadow: 2px 2px 0 #0001; }
.world-residents summary { cursor: pointer; padding: 9px 12px; font: 14px var(--hand); }
.world-residents summary span { float: right; color: #777; font: 11px ui-monospace,monospace; }
#world-resident-list { max-height: 200px; overflow: auto; border-top: 1px dashed #ccc; padding: 4px; }
#world-resident-list button { display: block; width: 100%; text-align: left; font-size: 11px; white-space: normal; overflow-wrap: anywhere; }
#world-resident-list button[aria-pressed="true"] { background: var(--ink); color: #fff; }
#deploy-dialog { width: min(640px,calc(100vw - 28px)); max-height: calc(100dvh - 40px); padding: 24px; overflow: auto; background: #fff; color: var(--ink); border: 2px solid var(--ink); border-radius: 4px 2px 7px 3px; }
#deploy-dialog::backdrop, #clear-world-dialog::backdrop { background: #0006; }
.deploy-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.dialog-kicker { font: 9px ui-monospace,monospace; letter-spacing: 1.5px; color: #777; }
#deploy-dialog h2 { font: 28px var(--hand); margin: 6px 0; }
#deploy-dialog h3 { font: 18px var(--hand); font-weight: 500; margin: 18px 0 10px; }
.deploy-library { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.creature-card { width: 100%; min-width: 0; display: flex; align-items: center; gap: 12px; white-space: normal; text-align: left; padding: 10px; border: 1px solid #bbb; background: #fff; border-radius: 2px 4px 2px 3px; }
.creature-card canvas { width: 65px; height: 72px; flex-shrink: 0; object-fit: contain; background: repeating-conic-gradient(#eee 0% 25%,white 0% 50%) 0 0 / 8px 8px; }
.creature-card div { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.creature-card strong { font: 17px var(--hand); overflow-wrap: anywhere; }
.creature-card span { font-size: 10px; line-height: 1.6; color: #777; }
.creature-card small { font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }
.deploy-empty { margin: 0; border: 1px dashed #ccc; padding: 15px; font-size: 11px; color: #777; line-height: 1.7; grid-column: 1 / -1; }
.deploy-empty p { margin: 0 0 12px; }
.deploy-library-link { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 12px; border: 1px solid var(--ink); border-radius: 2px 4px 2px 3px; color: var(--ink); background: #fff; text-decoration: none; }
.deploy-library-link:hover { background: #efefef; }
.deploy-size { margin-block: 18px; padding: 12px; border: 1px dashed #aaa; border-radius: 2px 4px 2px 3px; }
.deploy-size label { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.deploy-size input { width: 110px; }
.deploy-size p { margin: 8px 0 0; line-height: 1.6; }
#clear-world-dialog { width: min(400px,calc(100vw - 28px)); padding: 24px; background: #fff; color: var(--ink); border: 2px solid var(--ink); }
#clear-world-dialog h2 { font: 26px var(--hand); margin: 0 0 14px; }
#clear-world-dialog p { line-height: 1.7; }
.world-page footer { min-height: 28px; }
@media(max-width:690px){.world-caption{padding-inline:12px}.world-page .file-actions{flex-wrap:wrap}.world-residents{right:10px;top:10px;width:165px}.world-selection{left:10px;bottom:10px}.world-selection strong{max-width:130px}.deploy-library{grid-template-columns:1fr}#deploy-dialog{padding:18px}.world-placement{top:9px}}

.creature-card img { width: 94px; height: 104px; object-fit: contain; background: repeating-conic-gradient(#eee 0% 25%,#fff 0% 50%) 0 0 / 10px 10px; }

.world-selection-label { min-width: 0; }
.world-selection-label strong { display: block; }
.world-selection-label span { display: block; padding-inline: 5px; font-size: 9px; line-height: 1.5; color: #777; }

.world-space-panel { position: absolute; inset: 0; overflow: hidden; }
.world-space-tabs { display: flex; gap: 4px; }
.world-space-tabs button { min-height: 29px; padding: 5px 11px; font-size: 11px; border: 1px solid #bbb; border-radius: 2px 4px 2px 3px; }
.world-space-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.global-space-empty { pointer-events: none; }
.global-coming-soon { display: inline-block; margin-top: 5px; padding: 6px 12px; border: 1px dashed #999; border-radius: 2px 5px 2px 3px; font-size: 10px; color: #666; background: #fff; }
@media(max-width:600px){.world-caption { flex-wrap: wrap; gap: 8px; }.world-space-tabs button { font-size: 10px; padding-inline: 8px; }}
