/* Desktop uses the responsive page picture. Only the mobile field pans its own crop. */
.location-landscape-motion { position:absolute; pointer-events:none; max-width:none; object-fit:fill; }
.location-landscape-motion[hidden] { display:none !important; }
body.interface-shell:not([data-forest-field-active]) .bg-s > .location-scene-picture > .reworked-landscape-loop {
  inset:0; width:100%; height:100%; object-fit:cover;
}
body.interface-shell:not(.interface-mobile)[data-forest-field-active] .location-scene-picture > .reworked-landscape-loop {
  inset:auto; left:var(--landscape-left); top:var(--landscape-top);
  width:var(--landscape-width); height:var(--landscape-height); object-fit:fill;
}
/* Transparent sprite corners must not steal clicks from the row behind them. */
#main .lv[data-forest-field][data-staged-field] #eR .ec[data-field-actor] { pointer-events:none; }
#main .lv[data-forest-field][data-staged-field] #eR .ec[data-field-actor] .ep { position:relative; pointer-events:none; }
#main .lv[data-forest-field][data-staged-field] #eR .ec[data-field-actor] .ep::after {
  content:"";position:absolute;inset:0;pointer-events:auto;clip-path:var(--actor-hit-area,none);
}
#main .lv[data-forest-field][data-staged-field] #eR .ec[data-field-actor] .en,
#main .lv[data-forest-field][data-staged-field] #eR .ec[data-field-actor] .erl { pointer-events:auto; }
body.interface-shell:not(.interface-mobile) .location-scene-picture > .location-landscape-motion {
  left:var(--landscape-left); top:var(--landscape-top); width:var(--landscape-width); height:var(--landscape-height);
}
body.interface-mobile #main .lv[data-forest-field] #eR .location-landscape-motion {
  left:var(--field-bg-left,0px); top:var(--field-bg-top,0px); width:var(--field-video-width); height:var(--field-video-height);
  z-index:0;
}
.location-landscape-lights {
  position:absolute; pointer-events:none; max-width:none; object-fit:fill;
  mix-blend-mode:plus-lighter;
  left:calc(var(--landscape-left) + var(--light-x) * var(--landscape-width));
  top:calc(var(--landscape-top) + var(--light-y) * var(--landscape-height));
  width:calc(var(--light-width) * var(--landscape-width));
  height:calc(var(--light-height) * var(--landscape-height));
}
body.interface-mobile #eR .location-landscape-lights {
  --landscape-left:var(--field-bg-left,0px); --landscape-top:var(--field-bg-top,0px);
  --landscape-width:var(--field-video-width); --landscape-height:var(--field-video-height);
  z-index:0;
}
body.interface-shell:not(.interface-mobile)[data-forest-field-active] .location-scene-picture > img {
  position: absolute;
  left: var(--landscape-left);
  top: var(--landscape-top);
  width: var(--landscape-width);
  height: var(--landscape-height);
  max-width: none;
}
body.interface-shell:not(.interface-mobile)[data-forest-field-active] .location-scene-picture[data-field-reference] > img {
  object-fit: fill;
}
/* Extra desktop width reveals scenery beyond the authored stage. Keep the
   foreground and its clickable actors at their original shared scale. */
body.interface-shell:not(.interface-mobile)[data-forest-field-active] .location-scene-picture[data-field-edge-fill]::before {
  content: "";
  position: absolute;
  inset: -12px;
  background: var(--field-backdrop-paint) center / cover no-repeat;
  filter: blur(12px) brightness(.55);
  pointer-events: none;
}
body.interface-shell:not(.interface-mobile) #main .lv[data-forest-field] #lBg { display: none !important; }
body.interface-mobile[data-forest-field-active] .bg-s > .location-scene-picture { visibility: hidden; }
body.interface-mobile #main .lv[data-forest-field] #lBg { display:none !important; }
/* Mobile WebKit scrolls the field on the compositor thread. Keep scenery and
   figures in that same native scroll surface, including during momentum. */
body.interface-mobile #main .lv[data-forest-field] #eR::before {
  content:""; display:block;
  position: absolute;
  inset:0 auto 0 0; width:var(--field-span,100%); z-index:-1;
  pointer-events: none;
  background: linear-gradient(180deg, #080b0e33, transparent 45%, #090b0c24),
              var(--field-paint) var(--field-bg-left, 0px) var(--field-bg-top, 50%) / var(--field-bg-size, cover) no-repeat,
              linear-gradient(#10111099,#10111099),var(--field-paint) center / cover no-repeat !important;
}
#main .lv[data-forest-field] #eR {
  position: absolute;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  padding: 0 !important;
  transform: none !important;
  translate: none;
  overflow: clip !important;
  scroll-snap-type: none;
  pointer-events: none;
  z-index: 3;
}
/* Manual desktop placements use the full backdrop, including space above the
   reserved scene. Keep the normal clipping and panning rules on mobile. */
body:not(.interface-mobile) #main:has(> .scr.active .lv[data-authored-field]),
body:not(.interface-mobile) #main > .scr.active:has(.lv[data-authored-field]),
body:not(.interface-mobile) #main .lv[data-authored-field],
body:not(.interface-mobile) #main .lv[data-authored-field] #eR {
  overflow: visible !important;
}
#main .lv[data-forest-field] #eR .boss-list,
#main .lv[data-forest-field] #eR #bossPanel:not([style*="display: none"]) { display: contents; }
#main .lv[data-forest-field] #eR .ec[data-field-actor] {
  position: absolute;
  left: var(--field-x);
  top: var(--field-feet);
  width: var(--field-width) !important;
  height: calc(var(--field-height) + 19px) !important;
  min-width: 44px;
  padding: 0 !important;
  margin: 0;
  display: grid !important;
  grid-template: "name" 19px "portrait" minmax(0,1fr) / minmax(0,1fr) !important;
  gap: 0 !important;
  translate: none;
  transform: translate(-50%,-100%) !important;
  transition: none;
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible;
  pointer-events: auto;
}
#main .lv[data-forest-field] #eR .ec[data-field-actor]::before {
  content: "";
  position: absolute;
  z-index: -1;
  bottom: 1%;
  left: 18%;
  width: 64%;
  height: 7%;
  pointer-events: none;
  background: radial-gradient(ellipse, #0808078c, transparent 70%);
}
#main .lv[data-forest-field] #eR .ec[data-field-actor] .en {
  grid-area: name;
  justify-self: center;
  align-self: end;
  display: block;
  width: max-content !important;
  min-height: 0 !important;
  max-height: none !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 5px !important;
  white-space: nowrap !important;
  overflow-wrap: normal;
  word-break: normal;
  overflow: visible;
  transform: translate(var(--field-label-shift,0px),var(--field-label-lift,0px));
  font: 700 clamp(12px,1.85cqh,16px)/19px var(--font-ui),sans-serif !important;
  text-align: center !important;
  color: #fff2d9;
  background: linear-gradient(90deg,transparent,#16120edd 10% 90%,transparent);
  border-radius: 3px;
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}
#main .lv[data-forest-field] #eR .boss-card[data-field-actor] .en { color: #ffd1cd; }
#main .lv[data-forest-field] #eR .ec[data-field-selected] .en { color: #9dffad !important; background-color: #102318; }
#main .lv[data-forest-field] #eR .ec[data-field-actor] .erl {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
#main .lv[data-forest-field] #eR .ec[data-field-actor] .ep {
  grid-area: portrait;
  min-width: 0 !important;
  aspect-ratio: auto;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
}
#main .lv[data-forest-field] .mobile-scene-arrow { display: none !important; }
#main .lv[data-field-pan] #eR {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #be9c61 #221c12;
  pointer-events: auto;
}
#main .lv[data-field-pan] #eR::after {
  content: "";
  display:block;
  width:var(--field-span);
  height:1px;
  pointer-events:none;
}
body.interface-mobile #main .lv[data-field-pan] .mobile-scene-arrow:not([hidden]) {
  display: grid !important;
  top: auto !important;
  bottom: 5px !important;
  height: 40px;
}
/* The editor frames the scene contents, leaving HUD controls outside the crop. */
body.interface-shell:not(.interface-mobile)[data-forest-field-active] .location-scene-picture[data-screen-frame] {
  clip-path:var(--field-picture-clip);
}
body.interface-shell:not(.interface-mobile)[data-forest-field-active] .location-scene-picture[data-screen-frame] > img,
body.interface-shell:not(.interface-mobile)[data-forest-field-active] .location-scene-picture[data-screen-frame] > .location-landscape-motion,
body.interface-mobile #main .lv[data-screen-frame] #eR .location-landscape-motion {
  object-fit:cover;
}
body.interface-mobile #main .lv[data-screen-frame] #eR::before {
  background:var(--field-paint) var(--field-cover-position) / var(--field-cover-size) no-repeat !important;
  clip-path:var(--field-cover-clip);
}
.location-scene-picture[data-screen-frame] > .location-landscape-lights,
body.interface-mobile .lv[data-screen-frame] #eR .location-landscape-lights {
  --landscape-left:var(--light-cover-left); --landscape-top:var(--light-cover-top);
  --landscape-width:var(--light-cover-width); --landscape-height:var(--light-cover-height);
  clip-path:inset(
    max(0px,calc(var(--light-crop-y) - var(--light-y) * var(--light-cover-height)))
    max(0px,calc(var(--light-crop-x) - (1 - var(--light-x) - var(--light-width)) * var(--light-cover-width)))
    max(0px,calc(var(--light-crop-y) - (1 - var(--light-y) - var(--light-height)) * var(--light-cover-height)))
    max(0px,calc(var(--light-crop-x) - var(--light-x) * var(--light-cover-width))));
}
#main .lv[data-screen-frame] #eR {
  clip-path:inset(var(--field-frame-top)
    calc(100% - var(--field-frame-right) + var(--field-frame-scroll,0px))
    calc(100% - var(--field-frame-bottom))
    calc(var(--field-frame-left) - var(--field-frame-scroll,0px)));
}
#eR > .field-background-surface {
  position:absolute; inset:0 auto 0 0; width:var(--field-span); overflow:hidden;
  pointer-events:none; z-index:0;
}
#main .lv[data-town-field] #eR .npc[data-field-actor] .erl {
  clip-path: none;
  inset: auto auto 100% 50%;
  transform: translateX(calc(-50% + var(--field-label-shift, 0px)));
  width: max-content;
  max-width: none !important;
  white-space: nowrap;
  padding: 0 4px;
  margin: 0;
  background: #151810d9;
  border-radius: 3px;
  height: auto;
  font-size: 11px;
  line-height: 1.1;
  color:#dbefbb;
  text-shadow:0 1px 3px #10160b, 0 0 5px #12170d;
  pointer-events:none;
}
body.interface-shell #eR .npc[data-animated-art],
body.interface-shell #eR .npc[data-animated-art] .ep,
body.interface-shell #npcBox .npc-dialog-portrait.has-animated-art {
  background:transparent !important;
  border:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
  backdrop-filter:none !important;
}
body.interface-shell #eR .npc[data-animated-art] .ep img,
body.interface-shell #npcBox .npc-dialog-portrait.has-animated-art img {
  object-fit: contain !important;
  object-position:center bottom !important;
  padding:0 !important;
}
body.interface-shell:not(.interface-mobile) #main .lv:not([data-town-field]) #eR .npc[data-animated-art] .ep {
  width:clamp(98px,8vw,150px);
  height:clamp(130px,12vw,197px);
}
#npcBox .npc-dialog-portrait.has-animated-art::after { display:none; }
#dropPanel .dp-loot-choice {
  display:inline-flex;align-items:center;justify-content:center;
  min-height:28px;margin-top:4px;padding:2px 9px;border:1px solid #587153;border-radius:5px;
  background:#1e3228;color:#d3efce;font:600 11px/1.2 var(--font-ui);cursor:pointer;
}
#dropPanel [data-loot-state="off"] .dp-loot-choice {border-color:#756960;color:#ead8ca;background:#342d29}
#dropPanel [data-loot-state="off"] .dp-item-icon {filter:saturate(.25);opacity:.63}
#dropPanel [data-loot-state="manual"] .dp-loot-choice {border-color:#8c744a;color:#f7dcac;background:#3d321f}
#dropPanel .dp-loot-choice:focus-visible {outline:2px solid #ffe8a7;outline-offset:2px}
#dropPanel .dp-loot-choice:disabled {opacity:.65;cursor:progress}
.interface-mobile #dropPanel .dp-loot-choice {min-height:44px}
#main .lv[data-forest-field] #cPanel[data-field-target] {
  position: absolute;
  left: var(--field-x) !important;
  top: var(--field-head) !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%,-100%) !important;
  width: 82px !important;
  height: auto !important;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  z-index: 7;
  pointer-events: none;
}
#main .lv[data-forest-field] #cPanel[data-field-target],
#main .lv[data-forest-field] #cPanel[data-field-target] .tgt-card {
  background: none !important;
  border: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
#main .lv[data-forest-field] #cPanel[data-field-target]::after,
#main .lv[data-forest-field] #cPanel[data-field-target] :is(.tgt-mob-card,.tgt-sprite-wrap,.tgt-n) { display:none !important; }
#main .lv[data-forest-field] #cPanel[data-field-target] .tgt-card {
  position: relative;
  display: flex !important;
  flex-flow: column !important;
  align-items: center;
  gap: 2px;
  width: 100%;
  min-width: 0;
  height: auto !important;
  min-height: 0;
  padding: 0 !important;
  margin: 0;
  pointer-events: none;
  overflow: visible;
}
#main .lv[data-forest-field] #cPanel[data-field-target] #tgtBlocks {
  position: static !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: auto;
  height: 9px;
  margin: 0;
  order: 2;
  filter: drop-shadow(0 1px 2px #000);
}
#main .lv[data-forest-field] #tgtBlocks .tgt-blk {
  flex: none; width: 9px; height: 9px; max-width: none;
  border: 1px solid #181b14;
  box-shadow: inset 0 1px 0 #ffffff35;
}
#main .lv[data-forest-field] #cPanel[data-field-target] #tgtHp {
  position: static !important;
  transform: none;
  margin: 0;
  padding: 0 2px;
  order: 1;
  color: #fff4d4;
  font: 650 10px/12px var(--font-ui);
  text-shadow: 0 1px 2px #000, 0 0 4px #000;
}
#main .lv[data-forest-field] #cPanel[data-field-target] .tgt-stop {
  position: absolute;
  top: 0;
  left: calc(100% + 1px);
  margin: 0;
  padding: 4px 7px;
  white-space: nowrap;
  pointer-events: auto;
  background: #171914e6;
  color: #e9d5ad;
}
#main .lv[data-forest-field] #cPanel[data-field-target] .target-effect-strip {
  pointer-events: auto;
  position: absolute;
  top: auto;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
}
body.interface-mobile #main .lv[data-forest-field] #cPanel[data-field-target] .tgt-stop { display: none; }
/* Keep touch shortcuts along the upper edge, outside the clearing. */
body.interface-mobile #main .lv[data-forest-field] #mobileQuestButton {
  top: 5px !important; bottom: auto !important; left: auto !important; right: 62px !important;
  width: auto; min-width:44px; max-width:100px !important; min-height:44px;
}
body.interface-mobile #main .lv[data-forest-field] #mobileDropButton {
  right: 6px !important; top: 57px !important; bottom: auto !important; left: auto !important;
}
.lv .combat-hit-marker[data-origin="actor"] {
  --combat-marker-enter-x: 0px;
  --combat-marker-exit-x: 8px;
  object-fit: contain;
}

#npcBox .npc-dialog-layout[data-animated-art] .npc-dialog-portrait { position:relative; min-width:0; }
