.world-location.world-layout-overridden{
  left:var(--world-layout-x,var(--world-x))!important;
  top:var(--world-layout-y,var(--world-y))!important;
}
.world-location .world-building{
  transform:scale(var(--world-layout-scale,1));
  transform-origin:center bottom;
}
.world-location .world-building[hidden],
.world-location .world-place-label[hidden],
[data-world-scenery][hidden]{display:none!important}

[data-world-scenery]{
  translate:var(--world-scenery-shift-x,0px) var(--world-scenery-shift-y,0px);
  rotate:var(--world-scenery-rotation,0deg);
  scale:var(--world-scenery-scale,1);
}

.world-admin-editor-open{
  position:absolute;
  z-index:24;
  top:max(10px,env(safe-area-inset-top));
  right:10px;
  min-height:44px;
  padding:9px 13px;
  display:inline-flex;
  align-items:center;
  gap:6px;
  border:1px solid rgba(54,42,91,.2);
  border-radius:999px;
  background:rgba(42,28,66,.92);
  box-shadow:0 8px 22px rgba(35,26,55,.2);
  color:#fff;
  font:800 .76rem/1 system-ui,sans-serif;
  -webkit-tap-highlight-color:transparent;
}
.world-admin-editor-open[hidden]{display:none!important}

.world-admin-editor{
  position:fixed;
  z-index:90;
  left:max(8px,env(safe-area-inset-left));
  right:max(8px,env(safe-area-inset-right));
  bottom:max(8px,env(safe-area-inset-bottom));
  max-width:760px;
  max-height:min(54dvh,500px);
  margin-inline:auto;
  overflow:auto;
  overscroll-behavior:contain;
  padding:8px 12px calc(12px + env(safe-area-inset-bottom));
  border:1px solid rgba(45,35,78,.2);
  border-radius:22px;
  background:rgba(252,250,255,.97);
  box-shadow:0 22px 70px rgba(29,24,48,.28);
  color:#2d2940;
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}
.world-admin-editor[hidden],
.world-admin-editor-panel[hidden]{display:none!important}
.world-admin-editor-handle{
  width:42px;
  height:5px;
  margin:1px auto 8px;
  border-radius:999px;
  background:rgba(55,48,75,.22);
}
.world-admin-editor-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.world-admin-editor-header h2,
.world-admin-editor-header p{margin:0}
.world-admin-editor-header h2{font-size:1.18rem}
.world-admin-editor-header p:last-child{
  max-width:570px;
  margin-top:4px;
  color:#696278;
  font-size:.72rem;
  line-height:1.35;
}
.world-admin-editor-icon-button{
  flex:0 0 44px;
  width:44px;
  height:44px;
  border:0;
  border-radius:14px;
  background:#eee9f5;
  color:#403750;
  font-size:1.5rem;
}
.world-admin-editor-toolbar,
.world-admin-editor-reset-row{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px;
  margin-top:10px;
}
.world-admin-editor-toolbar button,
.world-admin-editor-reset-row button,
.world-admin-editor-mode button{
  min-height:44px;
  padding:8px 10px;
  border:1px solid rgba(67,55,92,.16);
  border-radius:12px;
  background:#f0edf5;
  color:#443c55;
  font:800 .76rem/1.15 system-ui,sans-serif;
  -webkit-tap-highlight-color:transparent;
}
.world-admin-editor-toolbar .primary{
  background:#493967;
  color:#fff;
}
.world-admin-editor-toolbar button:disabled{opacity:.42}
.world-admin-editor-mode{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:7px;
  margin-top:9px;
  padding:4px;
  border-radius:14px;
  background:#eeeaf4;
}
.world-admin-editor-mode button{
  background:transparent;
  border-color:transparent;
}
.world-admin-editor-mode button[aria-pressed="true"]{
  border-color:rgba(74,57,103,.2);
  background:#fff;
  color:#493967;
  box-shadow:0 3px 10px rgba(42,30,63,.1);
}
.world-admin-editor-panel{margin-top:9px}
.world-admin-editor-location-field{margin-top:0}
.world-admin-editor-field{
  display:grid;
  gap:4px;
  min-width:0;
}
.world-admin-editor-field>span{
  color:#625a70;
  font-size:.69rem;
  font-weight:850;
}
.world-admin-editor-field input,
.world-admin-editor-field select{
  box-sizing:border-box;
  width:100%;
  min-height:44px;
  padding:9px 10px;
  border:1px solid rgba(68,55,94,.18);
  border-radius:11px;
  background:#fff;
  color:#302a3c;
  font:750 16px/1.2 system-ui,sans-serif;
}
.world-admin-editor-fields{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr) 92px 92px;
  gap:8px;
  margin-top:8px;
}
.world-admin-editor-fields.scenery{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.world-admin-editor-field.scale{
  grid-column:1/-1;
}
.world-admin-editor-field.scale>span{
  display:flex;
  justify-content:space-between;
}
.world-admin-editor-field input[type="range"]{
  padding:0;
  accent-color:#5a4778;
}
.world-admin-editor-toggles{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin-top:8px;
}
.world-admin-editor-toggles.scenery{grid-template-columns:1fr}
.world-admin-editor-toggles label{
  display:flex;
  min-height:44px;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border:1px solid rgba(68,55,94,.14);
  border-radius:12px;
  background:#f8f6fb;
  font-size:.75rem;
  font-weight:800;
}
.world-admin-editor-toggles input{
  width:22px;
  height:22px;
  flex:0 0 auto;
  accent-color:#5a4778;
}
.world-admin-editor-reset-row{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.world-admin-editor-reset-row.single{grid-template-columns:1fr}
.world-admin-editor-reset-row .danger{
  border-color:rgba(153,56,70,.2);
  background:#fff0f2;
  color:#963c4b;
}
.world-admin-editor-help{
  margin:7px 2px 0;
  color:#746d80;
  font-size:.67rem;
  font-weight:700;
  line-height:1.35;
}
.world-admin-editor-status{
  min-height:18px;
  margin:8px 2px 0;
  color:#4e6d5b;
  font-size:.7rem;
  font-weight:800;
}
.world-admin-editor-status.error{color:#a13f45}

.world-admin-editing .world-map{
  outline:3px solid rgba(88,65,125,.28);
  outline-offset:2px;
}
.world-admin-editing-building .world-location{
  cursor:grab;
  touch-action:none;
}
.world-admin-editing-building .world-location:active{cursor:grabbing}
.world-admin-editing-building .world-location.world-admin-selected{
  z-index:20;
  filter:drop-shadow(0 0 10px rgba(93,67,145,.55));
}
.world-admin-editing-building .world-location.world-admin-selected::after{
  content:"";
  position:absolute;
  inset:-8px;
  border:2px dashed rgba(83,59,126,.8);
  border-radius:18px;
  pointer-events:none;
}
.world-admin-editing-scenery .world-location,
.world-admin-editing-scenery .world-tree-portal{pointer-events:none!important}
.world-admin-editing-scenery .world-polish-layer{
  z-index:23;
  pointer-events:none;
}
.world-admin-editing-scenery [data-world-scenery],
.world-admin-editing-scenery [data-world-scenery] *{
  pointer-events:auto;
}
.world-admin-editing-scenery [data-world-scenery]{
  cursor:grab;
  touch-action:none;
  outline:0 solid transparent;
  outline-offset:4px;
}
.world-admin-editing-scenery [data-world-scenery]:active{cursor:grabbing}
.world-admin-editing-scenery [data-world-scenery].world-admin-scenery-selected{
  z-index:24;
  outline:2px dashed rgba(83,59,126,.9);
  filter:drop-shadow(0 0 9px rgba(93,67,145,.62));
}
.world-admin-editor-toast{
  position:absolute;
  z-index:30;
  left:50%;
  top:max(12px,env(safe-area-inset-top));
  max-width:calc(100% - 32px);
  padding:9px 13px;
  border-radius:999px;
  background:#2f664d;
  color:#fff;
  font-size:.75rem;
  font-weight:850;
  opacity:0;
  pointer-events:none;
  transform:translate(-50%,-8px);
  transition:opacity .18s ease,transform .18s ease;
}
.world-admin-editor-toast.show{
  opacity:1;
  transform:translate(-50%,0);
}

@media(max-width:620px){
  .world-admin-editor{
    left:5px;
    right:5px;
    bottom:calc(4px + env(safe-area-inset-bottom));
    max-height:min(51dvh,455px);
    border-radius:19px;
    padding-inline:10px;
  }
  .world-admin-editor-fields{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  }
  .world-admin-editor-field.compact{grid-column:auto}
  .world-admin-editor-field.scale{grid-column:1/-1}
  .world-admin-editor-toolbar button,
  .world-admin-editor-reset-row button,
  .world-admin-editor-mode button{font-size:.71rem}
  .world-admin-editor-open{
    top:8px;
    right:8px;
  }
}
@media(max-width:390px){
  .world-admin-editor{
    max-height:min(49dvh,435px);
  }
  .world-admin-editor-header p:last-child{display:none}
  .world-admin-editor-toolbar{
    grid-template-columns:1fr 1fr 1.2fr;
  }
  .world-admin-editor-fields,
  .world-admin-editor-fields.scenery{
    grid-template-columns:1fr 1fr;
  }
  .world-admin-editor-field:not(.compact):not(.scale){grid-column:1/-1}
  .world-admin-editor-toggles{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){
  .world-admin-editor-toast{transition:none}
  .world-admin-editing-building .world-location{transition:none}
}
