.worlds-screen{background:#fff8e9;color:#63351f;font-family:"Baloo 2","Nunito",sans-serif;}
.worlds-screen button:focus-visible,.worlds-screen [tabindex]:focus-visible{outline:3px solid #438ca1;outline-offset:3px;}
.worlds-header{width:100%;max-width:1060px;margin:0 auto;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 18px;flex:none;}
.worlds-header h1{font-size:clamp(23px,4vw,34px);line-height:1.15;text-align:center;}
html body :is(#screen-worlds-editor,#screen-worlds-select) .worlds-header {
  --worlds-header-side: 12px;
  --worlds-header-top: 16px;
  --worlds-header-hit: 44px;
  --worlds-header-plate: 30.8px;
  --worlds-header-icon: 22px;
  --worlds-header-height: 76px;
  position: relative;
  inset: auto;
  width: 100%;
  max-width: none;
  height: var(--worlds-header-height);
  padding: 0;
  margin: 0;
  transform: none;
  z-index: 10;
  pointer-events: none;
}
html body #screen-worlds-editor .worlds-header { position: absolute; inset: 0 0 auto; }
@media (min-width:700px) {
  html body :is(#screen-worlds-editor,#screen-worlds-select) .worlds-header {
    --worlds-header-side: 32px;
    --worlds-header-top: 36px;
    --worlds-header-hit: 56px;
    --worlds-header-plate: 39.2px;
    --worlds-header-icon: 30px;
    --worlds-header-height: 128px;
  }
}
@media (min-width:700px) and (orientation:landscape) {
  html body :is(#screen-worlds-editor,#screen-worlds-select) .worlds-header {
    --worlds-header-top: 24px;
    --worlds-header-height: 104px;
  }
}
html body :is(#screen-worlds-editor,#screen-worlds-select) .worlds-header > :is(#worlds-buddy-back,#worlds-scene-back,#navigation-worlds-home,#navigation-world-home) {
  position: absolute !important;
  top: var(--worlds-header-top) !important;
  left: var(--worlds-header-side) !important;
  right: auto !important;
  width: var(--worlds-header-hit) !important;
  height: var(--worlds-header-hit) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  pointer-events: auto;
}
html body :is(#screen-worlds-editor,#screen-worlds-select) .worlds-header > :is(#navigation-worlds-home,#navigation-world-home) {
  --header-hit: var(--worlds-header-hit);
  --header-glyph: var(--worlds-header-icon);
  right: var(--worlds-header-side) !important;
  left: auto !important;
  bottom: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: grid;
  place-items: center;
  isolation: isolate;
}
html body :is(#screen-worlds-editor,#screen-worlds-select) .worlds-header > :is(#navigation-worlds-home,#navigation-world-home)::before {
  content: "" !important;
  position: absolute !important;
  inset: 50% auto auto 50% !important;
  width: var(--worlds-header-plate) !important;
  height: var(--worlds-header-plate) !important;
  transform: translate(-50%,-50%) !important;
  border: 1px solid #c4e1ee !important;
  border-radius: calc(var(--worlds-header-plate) / 3) !important;
  background: linear-gradient(150deg,#fff,#e8f8ff 55%,#b6e7fc) !important;
  box-shadow: inset 0 2px #fff,0 2px #add4df28 !important;
  z-index: -1;
}
html body :is(#screen-worlds-editor,#screen-worlds-select) .worlds-header > :is(#navigation-worlds-home,#navigation-world-home) img {
  width: var(--worlds-header-icon) !important;
  height: var(--worlds-header-icon) !important;
}
.worlds-icon-control{width:44px;height:44px;padding:0;display:grid;place-items:center;border-radius:50%;background:#fffffff0;box-shadow:0 2px 5px #63351f16;pointer-events:auto;}
.worlds-icon-control svg{width:18px;height:28px;fill:none;stroke:#936737;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round;}
.worlds-button{min-height:44px;padding:8px 16px;border-radius:18px;background:#ffdf72;font-size:17px;font-weight:800;box-shadow:0 3px 0 #d5ac4866;}
.worlds-button:disabled{opacity:.45;cursor:default;}
.worlds-button:active:not(:disabled){transform:translateY(1px);}
.worlds-select-body{width:min(100%,1060px);margin:0 auto;padding:8px 22px 30px;overflow-y:auto;}
#screen-worlds-select .worlds-header .worlds-slogan {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
/* Crop the transparent margins of the approved banner, keeping the whole wordmark. */
.worlds-slogan{position:relative;width:clamp(168px,34vw,326px);max-width:100%;aspect-ratio:2008/345;overflow:hidden;}
.worlds-slogan img{position:absolute;width:108.16733%;height:209.85507%;max-width:none;left:-4.28287%;top:-52.17391%;}
.worlds-scene-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;}
#screen-worlds-select .worlds-scene-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(40px, 1fr);
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border-radius: clamp(12px, 2vw, 24px);
  background: #fff;
  box-shadow: 0 4px 12px #82532924;
  border: 1px solid #e2e9e8;
}
html body #screen-worlds-select #worlds-scenes .worlds-scene-card > img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center var(--worlds-thumbnail-focus, 50%);
  pointer-events: none;
}
[data-scene="supermarket"] { --worlds-thumbnail-focus: 13%; }
[data-scene="desk"] { --worlds-thumbnail-focus: 21%; }
[data-scene="zoo"] { --worlds-thumbnail-focus: 9%; }
#screen-worlds-select #worlds-scenes .worlds-scene-card > span {
  display: grid;
  place-items: center;
  padding: 6px 4px;
  color: #344d64;
  font: 750 clamp(11px, 2.7vw, 20px)/1.15 Nunito, sans-serif;
  overflow-wrap: anywhere;
}
#screen-worlds-select .worlds-lock-badge {
  position: absolute;
  top: clamp(3px, 1vw, 9px);
  right: clamp(3px, 1vw, 9px);
  padding: 3px 6px;
  border-radius: 20px;
  background: #fffcf3ed;
  font: 800 clamp(9px, 1.6vw, 12px)/1.15 Nunito, sans-serif;
  color: #684425;
}
.worlds-editor-main{position:absolute;inset:0;min-height:0;display:flex;justify-content:center;align-items:center;overflow:clip;container-type:size;}
.worlds-editor-main::before {
  content: "";
  position: absolute;
  inset: -18px;
  background: var(--worlds-scene-image) center / cover no-repeat;
  filter: blur(23px) saturate(.83);
  pointer-events: none;
}
/* The fitted canvas preserves saved sticker positions. Extend only the
   outer edge of the image, without repeating objects from the play area. */
#screen-worlds-editor .worlds-canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(100cqw, calc(100cqh * var(--worlds-scene-ratio, 941 / 1672)));
  aspect-ratio: var(--worlds-scene-ratio, 941 / 1672);
  overflow: visible;
  touch-action: none;
  isolation: isolate;
}
.worlds-canvas::before,
.worlds-canvas::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background: var(--worlds-scene-image) center / 100% 100% no-repeat;
  filter: blur(4px) saturate(.86);
  pointer-events: none;
  z-index: -1;
}
[data-fill-axis="sides"] .worlds-canvas::before,
[data-fill-axis="sides"] .worlds-canvas::after {
  top: 0;
  width: max(100%, calc((100cqw - 100%) / 2 + 24px));
  background-size: 1700% 100%;
  transform: scaleX(-1);
}
[data-fill-axis="sides"] .worlds-canvas::before { right: 100%; background-position: left center; }
[data-fill-axis="sides"] .worlds-canvas::after { left: 100%; background-position: right center; }
[data-fill-axis="ends"] .worlds-canvas::before,
[data-fill-axis="ends"] .worlds-canvas::after {
  left: 0;
  height: max(100%, calc((100cqh - 100%) / 2 + 24px));
  background-size: 100% 1700%;
  transform: scaleY(-1);
}
[data-fill-axis="ends"] .worlds-canvas::before { bottom: 100%; background-position: center top; }
[data-fill-axis="ends"] .worlds-canvas::after { top: 100%; background-position: center bottom; }
.worlds-scene-art{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;}
#learning-world-canvas.has-scene-outpaint {
  position: relative;
  isolation: isolate;
}
@container (max-aspect-ratio: 343 / 100) {
  :is(#screen-worlds-editor[data-fill-axis="sides"] .has-scene-outpaint, #learning-world-canvas.has-scene-outpaint)::before,
  :is(#screen-worlds-editor[data-fill-axis="sides"] .has-scene-outpaint, #learning-world-canvas.has-scene-outpaint)::after {
    top: 0;
    left: auto;
    right: auto;
    width: var(--scene-outpaint-side);
    background: var(--scene-outpaint-image) left center / 200% 100% no-repeat;
    filter: none;
    transform: none;
  }
  :is(#screen-worlds-editor[data-fill-axis="sides"] .has-scene-outpaint, #learning-world-canvas.has-scene-outpaint)::before { right: 100%; }
  :is(#screen-worlds-editor[data-fill-axis="sides"] .has-scene-outpaint, #learning-world-canvas.has-scene-outpaint)::after { left: 100%; background-position: right center; }
}
@container (max-aspect-ratio: 4 / 3) {
  #screen-theme-editor #learning-world-canvas.has-scene-outpaint::before,
  #screen-theme-editor #learning-world-canvas.has-scene-outpaint::after { content: none; background-image: none; }
}
.worlds-instance{position:absolute;width:var(--worlds-sticker-width,18%);aspect-ratio:1;transform:translate(-50%,-50%) rotate(var(--worlds-rotation,0deg)) scale(var(--worlds-scale,1));padding:0;border:0;background:transparent;border-radius:16%;touch-action:none;cursor:grab;}
.worlds-instance img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none;filter:drop-shadow(0 2px 2px #54351f30);}
.worlds-instance.is-selected,.worlds-screen .worlds-instance:focus-visible{outline:2px solid #bd9358;outline-offset:1px;box-shadow:0 0 5px #e8c67940;z-index:2;}
.worlds-instance:active{cursor:grabbing;}
.worlds-drag-ghost{position:fixed;z-index:1000;pointer-events:none;aspect-ratio:1;transform:translate(-50%,-50%);object-fit:contain;filter:drop-shadow(0 3px 4px #54351f55);}
@media (max-width: 600px) {
  .worlds-header { padding: 10px 12px; gap: 8px; }
  .worlds-button { font-size: 15px; padding: 8px 11px; }
  .worlds-scene-grid { gap: 9px; }
  .worlds-select-body { padding: 12px; }
}
#screen-worlds-editor {
  overflow: hidden;
  --worlds-tray-anchor: max(12px, env(safe-area-inset-left));
  --worlds-tray-right: max(12px, env(safe-area-inset-right));
  --worlds-tray-bottom: max(12px, env(safe-area-inset-bottom));
  --worlds-tray-height: 124px;
}
html[data-ui-platform="ipad"] #screen-worlds-editor:not(.is-landscape) {
  --worlds-tray-height: 142px;
}
.worlds-remove{justify-self:end;width:44px;height:44px;display:grid;place-items:center;border:1px solid #dbc6aa;border-radius:50%;background:#fff8e9e6;box-shadow:0 2px 5px #63351f16;pointer-events:auto;}
.worlds-remove svg{width:22px;height:22px;fill:none;stroke:#936737;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
html body #screen-worlds-editor>.worlds-bottom-actions {
  position: absolute;
  right: var(--worlds-tray-right);
  bottom: var(--worlds-tray-bottom);
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
html body #screen-worlds-editor.has-open-tray>.worlds-bottom-actions {
  bottom: calc(var(--worlds-tray-bottom) + var(--worlds-tray-height) + 8px);
}
#screen-worlds-editor>.worlds-bottom-actions > button { pointer-events: auto; }
html body #screen-worlds-editor #worlds-layout-lock:has(> svg[data-header-glyph])::after { content: none !important; display: none !important; }
#screen-worlds-editor .worlds-tray-panel {
  position: absolute;
  z-index: 5;
  left: var(--worlds-tray-anchor);
  right: var(--worlds-tray-right);
  bottom: var(--worlds-tray-bottom);
  height: var(--worlds-tray-height);
  width: auto;
  max-width: none;
  margin: 0;
  padding: 10px 12px;
  border-radius: 24px;
  background: rgb(247 252 255 / .9);
  backdrop-filter: blur(7px);
  box-shadow: 0 3px 14px #63351f22;
  transform: translateX(calc(-100% - var(--worlds-tray-anchor) - 18px));
  transition: transform 260ms cubic-bezier(.32,.72,0,1);
  pointer-events: none;
}
#screen-worlds-editor .worlds-tray-panel.is-open { transform: translateX(0); pointer-events: auto; }
#screen-worlds-editor .worlds-tray-panel.is-dragging { opacity: 0; pointer-events: none; }
.worlds-tray-heading{height:22px;display:flex;align-items:center;}
.worlds-tray-heading h2{font-size:16px;line-height:1.1;}
.worlds-tray-close{position:absolute;right:8px;bottom:14px;width:44px;min-height:70px;padding:4px!important;font-size:12px!important;border-radius:18px;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.1;}
.worlds-tray-close svg,.worlds-drawer-handle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round;}
.worlds-tray-row{height:calc(100% - 22px);display:flex;gap:10px;padding-right:50px;align-items:flex-start;min-width:0;}
.worlds-tray{display:flex;flex:1;min-width:0;gap:11px;overflow-x:auto;overflow-y:hidden;padding:2px 2px 8px;overscroll-behavior:contain;touch-action:pan-x;scrollbar-width:thin;scrollbar-color:#cfb48b transparent;}
.worlds-category{position:relative;flex:0 0 82px;min-width:82px;max-width:82px;height:70px;display:flex;align-items:center;justify-content:center;gap:0;padding:3px 4px 9px;background:#fff9ed;border:1px solid #e8d6b5;border-radius:20px;text-align:center;font-size:14px;font-weight:800;line-height:1.12;touch-action:pan-x;}
.worlds-category img{flex:none;width:56px;height:56px;object-fit:contain;pointer-events:none;}
.worlds-category-count{position:absolute;right:4px;bottom:3px;min-width:20px;padding:2px 4px;border-radius:8px;background:#fffaf2ed;color:#856449;font:800 12px/1.1 "Nunito",sans-serif;}
.worlds-category span{min-width:0;}
.worlds-tray-sticker{flex:0 0 82px;height:72px;min-width:0;padding:3px;background:#fff9ed;border:1px solid #e8d6b5;border-radius:22px;touch-action:none;cursor:grab;}
.worlds-tray-sticker img{display:block;margin:auto;width:48px;height:48px;object-fit:contain;pointer-events:none;}
.worlds-tray-sticker span{display:block;font-size:12px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.worlds-tray-sticker.is-previewed{position:relative;background:#fff0b6;border-color:#d6ad55;box-shadow:0 0 0 2px #f5d884;}
.worlds-tray-sticker.is-previewed::after{content:'+';position:absolute;right:2px;top:2px;width:19px;height:19px;border-radius:50%;background:#ffd85e;color:#795329;border:1px solid #d6ad55;font:800 17px/18px "Baloo 2",sans-serif;}
#worlds-category-back{flex:0 0 76px;min-height:72px;margin:2px 0 0;padding:6px;font-size:12px;line-height:1.1;border-radius:20px;}
.worlds-empty{font:14px/1.4 "Nunito",sans-serif;padding:8px;min-width:160px;}
.worlds-drawer-handle{position:absolute;z-index:4;left:var(--worlds-tray-anchor);bottom:var(--worlds-tray-bottom);width:118px;min-height:48px;padding:8px 12px;border:1px solid #e8d6b5;border-radius:12px 24px 24px 12px;background:#fff8e9e6;box-shadow:-2px 3px 8px #63351f20;font-size:18px;font-weight:800;}
.worlds-drawer-handle:not([hidden]){display:flex;align-items:center;justify-content:center;gap:8px;}
.worlds-drawer-handle[hidden],#worlds-category-back[hidden],.worlds-remove[hidden]{display:none;}
#worlds-save-status{position:absolute;left:var(--worlds-tray-anchor);bottom:calc(var(--worlds-tray-bottom) + 56px);z-index:6;max-width:calc(100% - 36px);border-radius:12px;background:#fff8e9e6;padding:4px 8px;color:#795329;font:13px/1.3 "Nunito",sans-serif;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .2s ease,visibility .2s;}
#screen-worlds-editor.has-open-tray #worlds-save-status{bottom:calc(var(--worlds-tray-bottom) + var(--worlds-tray-height) + 8px);}
#worlds-save-status.is-visible{opacity:1;visibility:visible;}
#worlds-save-status[data-error=true]{color:#a52520;font-weight:800;}
@media (prefers-reduced-motion: reduce) {
  #screen-worlds-editor .worlds-tray-panel { opacity: 0; transform: none; transition: opacity 120ms ease; }
  #screen-worlds-editor .worlds-tray-panel.is-open { opacity: 1; transform: none; }
  #worlds-save-status { transition: none; }
}

/* Saved chances remain visible until the player chooses a locked scene. */
.worlds-rewards{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:9px;margin:0 0 16px;border:2px solid #e8d6b5;border-radius:24px;background:#fff9ed;box-shadow:0 3px 0 #d5ac4822;}
#screen-worlds-select .worlds-reward-part {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  justify-items: center;
  align-items: center;
  column-gap: 6px;
  row-gap: 3px;
  min-width: 0;
  padding: 7px 4px;
  border-radius: 16px;
  text-align: center;
}
.worlds-chances{background:#f0e9f8;color:#694788;}
.worlds-stars{background:#fff0bc;color:#775519;}
.worlds-reward-part strong{font:800 clamp(21px,5vw,29px)/1 Nunito,sans-serif;}
.worlds-chance-icon,.worlds-reward-part img{width:26px;height:26px;object-fit:contain;}
.worlds-reward-part small{grid-column:1/-1;font:800 clamp(10px,2.8vw,14px)/1.16 Nunito,sans-serif;text-wrap:balance;}
.worlds-reward-error{grid-column:1/-1;color:#a52520;padding:2px 6px;}
.worlds-unlock-dialog{width:min(360px,calc(100% - 32px));max-height:calc(100% - 32px);overflow:auto;margin:auto;padding:22px;border:2px solid #e8d6b5;border-radius:24px;background:#fff8e9;color:#63351f;font-family:"Nunito",sans-serif;box-shadow:0 8px 40px #63351f30;}
.worlds-unlock-dialog::backdrop{background:#43302166;}
.worlds-unlock-dialog h2{font:800 27px/1.1 "Baloo 2","Nunito",sans-serif;margin:0 0 12px;}
.worlds-unlock-dialog img{width:100%;aspect-ratio:1672/941;object-fit:contain;border-radius:12px;}
.worlds-unlock-dialog p{font-size:15px;line-height:1.45;margin:12px 0;}
#worlds-unlock-error{color:#a52520;font-weight:800;}
#worlds-unlock-error:empty{display:none;}
.worlds-unlock-actions{display:flex;justify-content:space-between;gap:12px;margin-top:18px;}
.worlds-unlock-actions button{flex:1;}

/* Size the bitmap at its displayed size so WebKit does not magnify a small filtered layer. */
#screen-worlds-editor.is-ipad-room .worlds-instance {
  width: calc(var(--worlds-sticker-width, 10%) * var(--worlds-scale, 1));
  transform: translate(-50%, -50%) rotate(var(--worlds-rotation, 0deg));
}

/* Candy House is a named collection across selection, unlocking and the room editor. */
.worlds-series-heading{grid-column:1/-1;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:13px 18px;margin-top:8px;border:2px solid #ecc0d1;border-radius:20px;background:linear-gradient(110deg,#fff7eb,#ffe8f1);box-shadow:0 3px 0 #efd0dc55;}
.worlds-series-heading>span{font:800 15px "Nunito",sans-serif;color:#b97792;white-space:nowrap;}
.worlds-series-badge{display:block;font:800 12px/1.35 "Nunito",sans-serif;letter-spacing:.3px;color:#a55979;}
.worlds-series-badge[hidden]{display:none;}
.worlds-series-heading .worlds-series-badge{font-size:19px;letter-spacing:.5px;}
.worlds-scene-card.is-candy-house{border-color:#efbad0;background:#fff7fb;box-shadow:0 4px 14px #b9698924;}
.worlds-scene-card.is-candy-house>span{color:#a05a76;font-size:clamp(14px,2.5vw,23px);line-height:1.2;padding-bottom:6px;}
.worlds-scene-card.is-candy-house>.worlds-series-badge{padding:0 6px 9px;font-size:11px;}
.worlds-scene-card.is-candy-house .worlds-lock-badge{color:#ac7189;}
.worlds-unlock-dialog.is-candy-house{border-color:#edb8cb;background:#fff2f7;}
.worlds-unlock-dialog.is-candy-house>.worlds-series-badge{margin:-3px 0 12px;}
@media(max-width:600px){.worlds-series-heading{padding:10px 12px;gap:8px;}.worlds-series-heading .worlds-series-badge{font-size:15px;}.worlds-series-heading>span{font-size:12px;}#worlds-scene-title.is-series-title .worlds-series-badge{font-size:10px;}.worlds-scene-card.is-candy-house>.worlds-series-badge{font-size:9px;}}
