/* Building hotspots are anchored in the original 909 × 1731 city artwork. */
.family-city-canvas .family-city-buildings { z-index: 1; }

[data-city-stage="settlement"] > .family-city-canvas {
  --home-palace-x: 54.67%; --home-palace-y: 30.53%;
  --home-barracks-x: 19.67%; --home-barracks-y: 48.77%;
  --home-workshop-x: 80.67%; --home-workshop-y: 49.82%;
  --market-support-x: 82.67%; --market-support-y: 61.23%;
}
[data-city-stage="village"] > .family-city-canvas {
  --home-palace-x: 57%; --home-palace-y: 41.23%;
  --home-barracks-x: 20%; --home-barracks-y: 58.25%;
  --home-workshop-x: 81.33%; --home-workshop-y: 57.54%;
  --market-support-x: 82.67%; --market-support-y: 71.05%;
}
[data-city-stage="fortified"] > .family-city-canvas {
  --home-palace-x: 60%; --home-palace-y: 36.14%;
  --home-barracks-x: 20.33%; --home-barracks-y: 52.63%;
  --home-workshop-x: 81.33%; --home-workshop-y: 55.44%;
  --market-support-x: 81.67%; --market-support-y: 68.07%;
}
[data-city-stage="royal"] > .family-city-canvas {
  --home-palace-x: 56.33%; --home-palace-y: 38.6%;
  --home-barracks-x: 19.67%; --home-barracks-y: 57.02%;
  --home-workshop-x: 81.67%; --home-workshop-y: 56.84%;
  --market-support-x: 83.67%; --market-support-y: 70.88%;
}
.family-city-view[data-city-stage] .family-city-canvas [data-city-building="palace"] { --building-x:var(--home-palace-x); --building-y:var(--home-palace-y) }
.family-city-view[data-city-stage] .family-city-canvas [data-city-building="barracks"] { --building-x:var(--home-barracks-x); --building-y:var(--home-barracks-y) }
.family-city-view[data-city-stage] .family-city-canvas [data-city-building="workshop"] { --building-x:var(--home-workshop-x); --building-y:var(--home-workshop-y) }

/* The brass hook meets the painted outer stall post in both reading directions. */
.family-city-canvas > .family-market-support {
  position: absolute;
  left: var(--market-support-x);
  top: var(--market-support-y);
  z-index: 2;
  transform: translate(-86%, -50%);
  display: inline-grid;
  place-items: center;
  min-inline-size: 44px;
  min-block-size: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff4d6;
  font: inherit;
  text-align: center;
  cursor: pointer;
}
.family-market-support > span {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-block-size: 26px;
  padding: 2px 9px;
  border: 1px solid #ebcd90;
  border-radius: 4px 4px 6px 6px;
  background: linear-gradient(#52654d,#2e493a 50%,#203c32);
  box-shadow: 0 2px 3px #382a13aa;
  font-size: clamp(.71rem, 2.9vw, .86rem);
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}
.family-market-support > span::before {
  content: "";
  inline-size: 15px;
  block-size: 15px;
  background: #f8d996;
  -webkit-mask: var(--kingdom-icon-supply) center / contain no-repeat;
  mask: var(--kingdom-icon-supply) center / contain no-repeat;
}
.family-market-support > span::after {
  content: "";
  position: absolute;
  right: 8%;
  top: -5px;
  width: 4px;
  height: 5px;
  border: 1px solid #f2d28f;
  border-radius: 3px;
  background: #685235;
  pointer-events: none;
}
.family-city-view[data-city-stage] .family-city-canvas .city-post-workshop > button.court-post-portrait,
.family-city-view[data-city-stage] .family-city-canvas .city-post-workshop > .court-post-vacant{
  top: 0;
  right: 0;
  left: auto;
  transform: translateY(-95%);
}
.family-city-view[data-city-stage] .family-city-canvas .city-post-workshop > :is(button.court-post-portrait,.court-post-vacant) {
  top: 0;
  right: 0;
  left: auto;
  transform: translateY(-95%);
}
.family-market-support:focus-visible > span { outline: 2px solid #fff5c7; outline-offset: 2px; }
@media (hover: hover) {
  .family-market-support:hover > span { background: #315f4c; }
}

@media (max-width: 680px) {
  .family-city-view .family-market-support:not(:focus-visible) { opacity: var(--market-visible, 1); }
  .family-city-view[data-market-at-start] .family-market-support { pointer-events: none; }
}
