/* Four original, editable isometric worlds. */
.world-room{min-height:430px!important;aspect-ratio:600/445;border:3px solid #7e7196!important;border-radius:0!important;background:#aabac7!important;overflow:hidden;isolation:isolate}
#worldViewport{position:absolute;inset:0}
#worldStage{width:100%;height:100%;display:block;image-rendering:pixelated}
#worldStage .pet-avatar{width:70px;height:auto;filter:none;overflow:visible;transform:none;animation:none}
#worldStage .world-avatar-holder{transform-origin:0 0;transition:none}
#worldStage .pixel-leg-left,#worldStage .pixel-leg-right{animation:none}
#worldStage .world-walking .pixel-leg-left{animation:pixel-step .4s steps(2,end) infinite}
#worldStage .world-walking .pixel-leg-right{animation:pixel-step .4s steps(2,end) infinite reverse}
#worldStage .world-object,#worldStage [data-world-fixed][role="button"]{cursor:pointer;outline:none}
#worldStage .world-object:hover{filter:brightness(1.08)}
#worldStage .world-object:focus-visible,#worldStage [data-world-fixed]:focus-visible{filter:drop-shadow(0 0 3px #fff3b1);outline:2px solid #e9dca4}
#worldStage [data-world-cell]{cursor:crosshair;outline:none}
#worldStage [data-world-cell]:focus>path{fill:#fff0a966;stroke:#ffe6a2;stroke-width:2}
#worldStage .world-object.selected{filter:drop-shadow(0 2px #fff3ac) drop-shadow(2px 0 #fff3ac)}
.world-room .pet-speech{top:60px;max-width:65%;padding:6px 10px;font-size:13px;pointer-events:none;border-width:2px;z-index:6}
.world-room .pet-nametag{bottom:12px;max-width:80%;font-size:14px;border-width:2px;pointer-events:none;overflow:hidden;text-overflow:ellipsis;z-index:6}
.world-room .world-shop-door{top:10px;right:10px;left:auto;bottom:auto;min-width:68px;padding:5px 8px;z-index:8;box-shadow:3px 3px #68534c}
.world-room .world-shop-door>span{font-size:24px}.world-room .world-shop-door strong{font-size:12px}
.world-location{position:absolute;left:10px;top:10px;background:#fff0d9ed;color:#3b4c62;border:2px solid #66768a;padding:6px 10px;font-size:14px;z-index:6;pointer-events:none}
.world-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:14px}
.world-tools button{font-size:15px}.world-tools [aria-pressed="true"]{background:#307d70;border-color:#b8e7cb;box-shadow:inset -2px -2px #26564f,3px 3px #12172b}
#worldHint{font-size:14px;color:#c3d5db;min-height:42px;margin:10px 0}
.world-selection{padding:12px;background:#29354b;border:2px solid #91c9bc;display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:12px}
.world-selection strong{flex:1 0 100%;color:#ffe0a4}.world-selection button{padding:7px 10px;font-size:13px}
.world-inventory{padding:14px;border:2px solid #736182;background:#1d2037;margin-bottom:14px}
.world-inventory h4{font-size:18px;margin:0 0 5px;color:#f1d3f4}.world-inventory>p{font-size:13px;color:#c1b6cd;margin:4px 0 13px}
.world-inventory-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;max-height:390px;overflow:auto}
.world-inventory-item{padding:10px;display:flex;flex-direction:column;gap:5px;border:2px solid #4e526e;background:#141c31;min-width:0}
.world-inventory-item>svg{width:100%;height:85px;image-rendering:pixelated;background:#9daeb330}
.world-inventory-item strong{font-size:14px;color:#f1e2e9}.world-inventory-item small{font-size:12px;color:#a9d9cb}.world-inventory-item button{font-size:13px;padding:7px 9px;margin-top:auto}
.world-room .pet-game-shop{inset:8px;max-height:calc(100% - 16px);overflow:hidden;z-index:20}
.world-room .pet-game-shop>.pet-shop{overflow:auto;min-height:0}.world-room .pet-game-shop .pet-loyalty-card{overflow:auto;flex-shrink:0;max-height:35%}
.world-room.sleeping #worldStage{filter:brightness(.6)}.world-room.sleeping:after{display:none}
#worldStage .pet-avatar.action-dance .pixel-body{animation:pixel-dance .4s steps(2,end) 5}
#worldStage .pet-avatar.action-wave .pixel-arm-right{animation:pixel-wave .4s steps(2,end) 4;transform-origin:37px 30px}
@media(max-width:900px){.world-room{min-height:440px!important}.world-inventory-list{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:560px){.world-room{min-height:330px!important;aspect-ratio:1.08/1}.world-room .pet-speech{top:53px;font-size:11px;max-width:80%;padding:4px 7px}.world-room .pet-nametag{bottom:9px;font-size:12px;padding:4px 9px}.world-location{font-size:12px;max-width:60%;padding:5px 7px}.world-room .world-shop-door{min-width:55px;right:8px;top:8px;padding:4px 6px}.world-room .world-shop-door>span{font-size:20px}.world-room .world-shop-door strong{font-size:10px}.world-tools{gap:8px}.world-tools button{font-size:14px;padding:8px 10px}.world-inventory-list{grid-template-columns:repeat(2,minmax(0,1fr))}.world-selection{padding:10px;gap:6px}.world-selection button{font-size:12px;padding:7px}.world-inventory{padding:10px}}
@media(prefers-reduced-motion:reduce){#worldStage *{animation:none!important;transition:none!important}}

#worldStage .world-raster-sprite{image-rendering:pixelated;shape-rendering:auto}
.world-product-preview{display:block;width:100%;height:100px;pointer-events:none}

.world-room > .world-selection{position:absolute;left:8px;right:8px;bottom:38px;z-index:12;margin:0;padding:8px;gap:6px;background:#172338f5;box-shadow:0 3px 12px #0006;border-radius:10px}
.world-room > .world-selection.hidden{display:none}
.world-room > .world-selection strong{flex-basis:100%;font-size:13px}
.world-room > .world-selection button{flex:1;min-height:44px;padding:6px 8px;font-size:12px}
@media(max-width:480px){.world-room > .world-selection{bottom:34px;left:5px;right:5px}}

#worldViewport { touch-action: none; }
#worldViewport [data-world-item] { cursor: grab; }
.world-drag-origin { opacity: .35; }
.world-drag-preview { pointer-events: none; opacity: .78; }
.world-drag-preview.invalid { opacity: .55; filter: drop-shadow(0 0 5px #ff465f); }
.world-expand {
  position: absolute;
  inset-inline-end: 8px;
  inset-block-end: 8px;
  z-index: 10;
  width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 24px;
}
#worldFullscreen:not([open]) { display: none; }
#worldFullscreen[open] {
  position: fixed;
  inset: 0;
  z-index: 200;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  margin: 0;
  border: 0;
  background: #15172c;
  overflow: hidden;
}
#worldFullscreen .world-fullscreen-header{
 display:flex;align-items:center;justify-content:space-between;gap:.65rem;
 padding:4px 6px;min-width:0;
}
#worldFullscreenTitle{font-size:1.15rem;margin:0;color:#fff4ff}
#worldFullscreen .world-fullscreen-close {
  flex:none;
  min-height:48px;
  padding:0 12px;
  margin: 0;
  font-size: 1rem;
  display: inline-flex;
  align-items:center;
  gap:.35rem;
  background: #241b39;
  color: #fff4ff;
  border: 2px solid #c6abe7;
  box-shadow: 0 3px 0 #0f1020;
}
#worldFullscreen > .world-room {
  position: relative;
  width: 100%;
  height: 100%;
  display:grid;
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:minmax(0,1fr) auto auto;
  min-height: 0 !important;
  aspect-ratio: auto;
}
#worldFullscreen #worldViewport{grid-row:1;position:relative;inset:auto;min-height:0}
#worldFullscreen #petSceneTabs,
#worldFullscreen #worldSelection:not(.hidden){
 position:relative;inset:auto;min-width:0;width:auto;
 margin:0;padding:4px;justify-content:center;flex-wrap:wrap;
 background:#22233d;border-radius:0;
}
#worldFullscreen #petSceneTabs{grid-row:3}
#worldFullscreen #worldSelection:not(.hidden){grid-row:2}
#worldFullscreen :is(.world-expand,.world-scene-hud,.world-care-meters,.world-tool-cascade,.pet-nametag,.pet-speech,.world-location,.world-shop-door,#petShopOverlay){display:none!important}

.world-rotate { cursor: pointer; touch-action: manipulation; }
.world-rotate:focus-visible circle:nth-child(2) { stroke: #fff; stroke-width: 2px; }

.world-rotate:hover circle:nth-child(2),
.world-rotate:focus-visible circle:nth-child(2) {
 fill:#292044;
 stroke:#8be6d9;
 stroke-width:2;
 vector-effect:non-scaling-stroke;
}
.world-rotate:focus-visible circle:first-child {
 stroke:#fff1cc;
 stroke-width:1;
 vector-effect:non-scaling-stroke;
}

.world-fullscreen-close .companion-icon {width:22px;height:22px}
.world-fullscreen-close:focus-visible,
.world-expand:focus-visible {
 outline:2px solid var(--cyan);
 outline-offset:2px;
}

/* Fullscreen keeps the community meter clear of the action and travel trays. */
#worldFullscreen .pet-community-bar{top:12px;bottom:auto;left:12px;width:128px;box-sizing:border-box;padding:6px 8px;background:#171b30e8;border:1px solid #83739b;font-size:14px;line-height:1.25}
#worldFullscreen .pet-community-bar progress{margin-top:4px;height:10px}

.world-sound-toggle{min-width:44px;min-height:44px;padding:4px;font:20px system-ui}
#petRoom>.world-sound-toggle{position:absolute;inset-inline-end:58px;inset-block-end:8px;z-index:11}
#worldFullscreen #petRoom>.world-sound-toggle{display:none}
.world-fullscreen-header{grid-template-columns:minmax(0,1fr) auto auto}
#petSoundLevel{display:inline-flex;align-items:center;gap:.5rem;padding:.4rem}
#petSoundLevel input{width:7em}

#petSoundLevel[hidden]{display:none} #petSoundLevel{position:absolute;z-index:50;bottom:56px;right:8px;color:white;background:#241e38;border:2px solid #9985be;border-radius:6px;padding:8px} .world-fullscreen-header{position:relative}.world-fullscreen-header #petSoundLevel{bottom:auto;top:100%}
