/* Island scale is independent of the camera and the walkable map geometry. */
body.scene-owned-island {
  --island-avatar-scale:1.4;
}

body.scene-owned-island #player.pixel-player,
body.scene-owned-island #map.overview #player.pixel-player,
body.scene-owned-island .online-remote-player-marker {
  width:32px;
  height:48px;
  transform:translate(-50%,-90%) scale(var(--island-avatar-scale));
  /* Authored avatars plant their feet at row 43 of the 48-pixel canvas. */
  transform-origin:50% 90%;
}

body.scene-owned-island .player-dash-echo {
  transform-origin:50% 90%;
}

/* Labels stay readable at the same screen size while characters grow. */
body.scene-owned-island #player-nameplate,
body.scene-owned-island .online-remote-player-name {
  max-width:160px!important;
  font-size:10px!important;
  padding:3px 8px!important;
  transform:translateX(-50%) scale(calc(var(--island-ui-scale,.444444) / var(--island-avatar-scale)));
  transform-origin:center bottom;
}

/* High-resolution resource illustrations should retain their source detail. */
#owned-island-scene .forge-island-object[data-resource="diamond"],
#owned-island-scene .forge-island-object.harvestable-tree {
  image-rendering:auto;
}

/* Landscape phones have less map height; resources retain useful silhouettes. */
@media (max-width:900px) and (orientation:landscape) {
  #owned-island-scene .forge-island-object.harvestable-tree[data-resource="wood"]:not(.felled) {
    min-width:90px;
  }
  #owned-island-scene .forge-island-object.harvestable-tree[data-resource="ancientWood"]:not(.felled) {
    min-width:180px;
  }
  #owned-island-scene .forge-island-object.harvestable-rock[data-resource="diamond"]:not(.mined) {
    min-width:112px;
  }
}

/* Map images retain their native detail; generated ground is painted at a
   larger resolution and enriched independently of collision coordinates. */
#owned-island-scene.island-terrain-enhanced .forge-terrain,
#owned-island-scene.owned-island-legendary.island-terrain-enhanced .forge-terrain {
  image-rendering:auto;
}

#owned-island-scene.prize-island-smooth.amethyst-terrain-detail .forge-terrain,
#owned-island-scene.prize-island-smooth.compact-source-terrain .forge-terrain {
  /* Apply a mild edge restoration pass after browser texture interpolation. */
  filter:url("#island-terrain-detail");
}

#owned-island-scene .amethyst-grass-detail,
#owned-island-scene .island-terrain-detail {
  position:absolute;
  z-index:3;
  pointer-events:none;
  image-rendering:auto;
}

/* Diamond progress uses screen coordinates, outside the zoomed world. */
#gather-action-progress[data-kind="diamond"] {
  width:min(260px,calc(100vw - 24px));
  pointer-events:auto;
}
#gather-action-progress[data-kind="diamond"] strong,
#gather-action-progress[data-kind="diamond"] small {
  font:600 11px/1.4 system-ui,sans-serif;
}
#gather-action-progress[data-kind="diamond"] button {
  margin-top:7px;
  padding:6px 12px;
  border:1px solid #9cbbbf;
  border-radius:4px;
  color:#fff2c9;
  background:#203b40;
  font:600 11px system-ui,sans-serif;
  cursor:pointer;
}
