.wwm-stage {
  --wm-ink: #fff2dc;
  --wm-gold: #dbbd91;
  --wm-panel: #253e53;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  height: clamp(410px, 66vh, 730px);
  height:clamp(410px, 66vh, 730px);height: clamp(410px, 66svh, 730px);
  box-sizing: border-box;
  border: 1px solid #a89380;
  border-radius: 16px;
  background: #dec5a8;
  color: var(--wm-ink);
  line-height: 1.25;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  cursor: grab;
  contain: layout paint;
}
.wwm-stage.is-dragging { cursor: grabbing; }
.wwm-stage:focus-visible { outline: 3px solid #efd194; outline-offset: 2px; }
.wwm-stage * { box-sizing: border-box; }
.wwm-stage .wwm-plane {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  direction: ltr;
}
.wwm-land { position: absolute; inset: 0; pointer-events: none; }
.wwm-stage img { -webkit-user-drag: none; user-select: none; }
.wwm-stage .wwm-land img { position: absolute; display: block; width: 100%; height: 100%; max-width: none; object-fit: fill; }
/* Keep the registered river and relief visible during the full tile's first decode. */
.wwm-stage .wwm-tile { background: url("data:image/webp;base64,UklGRvADAABXRUJQVlA4IOQDAAAQEACdASpAACsAPp06mEmloyKhN/46qLATiWwAtkfMcAfdnavPXWT3Zp+6HEizy5lMk3iknMee8CNKVNS8emoQRr9fe3Rk0xmai/NXZuoAmX9Q5tO5nt3DOdN0spst+so76pKxUyjt95wQX6fmvqSuAxV8Eff1c8MUnEn7f/mk6vqmQ1f56DWRAAD+l4oupkolDBGnwh+X4XyjuIDVALXVIv4qwPJgz1Xlz3r/mip338OMXWsN9McWkR4Ctzq5YABpyzED9fdPc7QLzXGMFTq0F2wpn+69I1A5TOBOhXHwPq5/UGftHf6AiPjNoAplHAQlD46bou5z1VwqoiEr9xk9eTYtrMNO31AJ10dNL3VL0Xom1FTcD0Jqwun8EDxiobtqW3fPfB5AuF36UsGAEzjJsw+fjuDvtOXvs6IRshaaiX+6OvQDmJKTZQKc/KbTWeJ4M3CgvzCjnVpLosBfV0N6ODOdILenhEhrcCwUe14a0S01qo3e1pcZS9Hh3/DZFIBIg405voks/49pn8t77WMB3PVEbfxwxI/DL2/g9UtV1tVQIXoZynwQc3s3SQyUR1vsxG3z91k71bnPumDqEWMF+icay2Ql7N1saWNvwrLLlDhTulfC1Srv0i4ap9e8QhC6oxkSkcqk2a0lsO++Gf3as3Adl21GuzLCxBwiDCChNklLTIGe0K+upoD+O6ac++KmdW6cPskY/Xavcm5o8pax15Xqww2TzykKQiEG8Io98afwH46BJTvft3K7zazFUZ9fd3B7guAaweJkfIgsYfoDIP8134mBiY18wXWNDaUcrWIuQHBHuK538CewpoeWeWlP6WiO1o5Wbk31Lq84uyGAZZwWD/2KjL69rAmMsY5FsC4V41JmzzpK4Tcz0ZSVA+7qRImUiO+TnB1lIlW/X1ODGwM6mmwTVTBp9Y3GsNfpvW770d4FsF8WeVMvBLNmSehfff+jF7gMnFX5DBn7o5/8cELCK+dkqPTXIBamhLa5c53ITQLw/2cqS6q/vAXeoYyWGf+0+C9ioylJR33Jl3FdXibrC3nbkGoBwMBWLgmGaRTdZW+szON6JxZiACN740f9OEG4OWhi4qDCMVMBpl4Ny+2p1woJi3PCnIsGaOXdkiwGBttHcD93K8iJPXTXGvmkn/Z++O6RBrJ0IQyPfS2N+cWpQB6YaC7k0VmZnE+wTfrVZi3rSfFUuJpqH2jG+SjZ0rvC86uiXxmPAd8t4rclFTjdlBvqJHWhoetuXlmaUnPTWEIOEjP3Z6d++JAJGl/0usSJFgFZ4V63MmzjOxZ2Yfytq6+x7U5BT4ci1wF8jchZwAA=") center / 100% 100% no-repeat; }
.wwm-cities,.wwm-routes,.wwm-columns { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wwm-routes { z-index: 1; }
.wwm-cities { z-index: 3; }
.wwm-columns { z-index: 2; }
.wwm-stage .wwm-cities .wwm-city {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  position: absolute;
  width: 168px;
  height: 123px;
  min-width: 0;
  min-height: 0;
  border: 0;
  padding: 0;
  margin: 0;
  transform: translate(-50%,-85%);
  background: none;
  border-radius: 0;
  color: var(--wm-ink);
  cursor: pointer;
  font: inherit;
  overflow: visible;
  pointer-events: auto;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}
.wwm-stage .wwm-city:focus-visible { outline: none; }
.wwm-model { width: 168px; height: 100px; position: relative; pointer-events: none; display: block; }
.wwm-model img { position: absolute; display: block; object-fit: contain; height: auto; max-width: none; border: 0; filter: drop-shadow(2px 3px 1px rgba(80,48,30,.20)); }
.wwm-model .wwm-wall { inset: 0; width: 100%; height: 100%; filter: none; }
.wwm-plinth { position: absolute; left: 9%; top: 39%; width: 83%; height: 58%; background: radial-gradient(ellipse at center,rgba(132,85,46,.34),rgba(150,109,49,.3) 43%,rgba(163,133,66,.13) 63%,transparent 73%); transform: rotate(-5deg); }
.wwm-stage .wwm-keep { bottom: 24%; left: 49%; height: 102px; transform: translateX(-50%); object-position: bottom center; }
.wwm-stage .wwm-palm { width: 20%; height: 39%; inset: auto auto 38% 14%; object-position: bottom; }
.wwm-stage .wwm-bastion { width: 26%; height: 46%; inset: auto 15% 37% auto; object-position: bottom; }
.wwm-stage .wwm-annex { width: 21%; height: 33%; inset: auto auto 42% 20%; object-position: bottom; }
.wwm-stage .wwm-workshop { width: 27%; height: 36%; inset: auto 14% 21% auto; object-position: bottom; }
.wwm-stage .wwm-barracks { width: 23%; height: 30%; inset: auto auto 24% 13%; object-position: bottom; }
/* The lower clip follows the inside of the two near walls in wallArt's
   168 × 100 projection. Roofs can rise above the enclosure, but cropped
   sprite bases and their shadows cannot reappear beyond the masonry. */
.wwm-courtyard {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 -60%,100% -60%,100% 54%,50% 88.6%,0 54%);
}
.wwm-stage .wwm-courtyard .wwm-workshop { width: 23%; height: 31%; right: 20%; bottom: 30%; }
.wwm-stage .wwm-courtyard .wwm-barracks { width: 20%; height: 28%; left: 20%; bottom: 30%; }
.wwm-stage .wwm-courtyard .wwm-bastion { right: 18%; bottom: 41%; }
.wwm-stage .wwm-courtyard .wwm-annex { left: 23%; bottom: 43%; }
.wwm-stage .wwm-courtyard .wwm-palm { left: 17%; bottom: 42%; }
.wwm-caption {
  display: inline-flex;
  position: relative;
  z-index: 1;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 155px;
  min-height: 22px;
  margin-top: -6px;
  padding: 2px 7px 2px 3px;
  color: #fff7e0;
  background: linear-gradient(#405866f5,#24374bf7);
  border: 1px solid #d6d2ba;
  border-radius: 6px;
  box-shadow: 0 2px 4px #302d3e65,inset 0 1px rgba(255,255,255,.1);
  font-weight: 700;
  font-size: var(--atlas-label,12px);
  line-height: 1.25;
  letter-spacing: 0;
  white-space: nowrap;
}
.wwm-stage[dir=rtl] .wwm-caption { direction: rtl; padding: 2px 3px 2px 7px; }
.wwm-city.is-own .wwm-caption { background: linear-gradient(#526483,#323f61); border-color: #edd09c; color: #ffefd0; }
.wwm-city.is-own .wwm-rank { background: #f2d69e; color: #473012; }
.wwm-stage .wwm-city:focus-visible .wwm-caption { outline: 3px solid #143a37; outline-offset: 2px; }
.wwm-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.wwm-rank { display: grid; place-items: center; border-radius: 3px; min-width: 17px; height: 16px; padding-inline: 2px; background: #e0c68e; color: #203e34; font-size: 10px; font-weight: 800; }
.wwm-mark { display: flex; color: #efcf8a; }
.wwm-mark svg { width: 14px; height: 14px; }
.wwm-march-token,.wwm-march-commander { position: absolute; width: 0; height: 0; pointer-events: none; }
.wwm-march-token[hidden] { display: none; }
.wwm-march-token[data-enemy]::after {
  content: ""; position: absolute; left: -9px; top: 0; width: 18px; height: 5px;
  border-bottom: 3px solid #a62e31; border-radius: 50%; box-shadow: 0 1px 0 #fff1cf;
}
.wwm-march-token[data-enemy=returning]::after { border-color: #754565; }
.wwm-stage .wwm-march-troops,.wwm-stage .wwm-commander-rider {
  position: absolute; left: 0; bottom: 0; width: 34px; height: 31px; max-width: none;
  object-fit: contain; object-position: bottom; transform: translateX(-50%) scaleX(var(--march-face,1));
  filter: drop-shadow(1px 2px 1px #3e241c70);
}
.wwm-stage .wwm-commander-rider { width: 38px; height: 37px; transform: translateX(-50%) scaleX(var(--leader-face,1)); }
.wwm-stage .wwm-commander-portrait {
  position: absolute; left: 0; bottom: 38px; width: 19px; height: 19px; max-width: none;
  transform: translateX(-50%); object-fit: cover; object-position: center 32%; border-radius: 50%;
  border: 1.5px solid #ffd989; background: #173e38; box-shadow: 0 0 0 1px #684821,0 1px 3px #38231388;
}
.wwm-mast,.wwm-foot { position: absolute; z-index: 4; inset-inline: 12px; display: flex; align-items: start; justify-content: space-between; gap: 6px; pointer-events: none; }
.wwm-mast { top: 12px; }
.wwm-foot { bottom: 12px; align-items: end; }
.wwm-mast-label,.wwm-sector,.wwm-tools {
  display: inline-flex; align-items: center; gap: 7px;
  background: linear-gradient(140deg,#365c61f0,#263950f5); border: 1px solid #d9b97c;
  border-radius: 10px; box-shadow: 0 2px 7px #422e1f40; color: var(--wm-ink);
}
.wwm-mast-label { padding: 9px 12px; }
.wwm-mast-label svg { width: 20px; height: 20px; color: #efd39a; }
.wwm-stage .wwm-heading { padding: 0; margin: 0; font: inherit; font-size: clamp(14px,2vw,18px); font-weight: 750; line-height: 1.2; color: inherit; letter-spacing: .01em; }
.wwm-sector { min-height: 32px; gap: 0; padding-inline: 7px; }
.wwm-sector-title { font-size: 12px; font-weight: 650; white-space: nowrap; }
.wwm-tools { padding: 2px; gap: 3px; pointer-events: auto; }
.wwm-stage .wwm-tool,.wwm-stage .wwm-nav {
  display: grid; place-items: center; flex: none; min-width: 0; min-height: 0;
  margin: 0; padding: 0; width: 44px; height: 44px; border: 0;
  color: inherit; background: transparent; border-radius: 7px; box-shadow: none;
  cursor: pointer; pointer-events: auto; touch-action: manipulation;
}
.wwm-sector { pointer-events: auto; }
.wwm-stage .wwm-tool:not(:first-child) { border-inline-start: 1px solid #c5aa7350; border-start-start-radius: 0; border-end-start-radius: 0; }
.wwm-stage .wwm-tool:focus-visible,.wwm-stage .wwm-nav:focus-visible { outline: 2px solid #ffdc89; outline-offset: -3px; }
.wwm-stage .wwm-tool:disabled,.wwm-stage .wwm-nav:disabled { opacity: .38; cursor: default; }
.wwm-tool svg { width: 20px; height: 20px; }
.wwm-nav svg { width: 15px; height: 15px; }
.wwm-stage[dir=rtl] .wwm-nav svg { transform: scaleX(-1); }
.wwm-hint { display: inline-flex; align-items: center; gap: 5px; color: #fff3d4; background: #33394bd9; border: 1px solid #ead1a169; border-radius: 20px; padding: 5px 9px; font-size: 11px; line-height: 1.2; }
.wwm-hint svg { width: 12px; height: 12px; flex: none; }
.wwm-stage .wwm-empty { position: absolute; top: 46%; left: 50%; transform: translate(-50%,-50%); text-align: center; margin: 0; padding: 10px 14px; background: #273e32e0; color: #fff0d2; border: 1px solid #c2a671; border-radius: 9px; font-size: 14px; z-index: 4; }
.wwm-stage [hidden] { display: none !important; }
@media (hover:hover) { .wwm-stage .wwm-tool:enabled:hover,.wwm-stage .wwm-nav:enabled:hover { background: #d6b57424; } .wwm-city:hover .wwm-caption { border-color: white; } }
@media (max-width:550px) {
  .wwm-stage { border-radius: 12px; height: clamp(345px,67vh,630px); height:clamp(345px,67vh,630px);height: clamp(345px,67svh,630px); }
  .wwm-mast,.wwm-foot { inset-inline: 7px; }
  .wwm-mast { top: 7px; } .wwm-foot { bottom: 7px; }
  .wwm-mast-label { padding: 7px 9px; }
  .wwm-hint { min-width: 0; }
  .wwm-hint { font-size: 10px; padding: 5px 7px; }
}

.wwm-stage .wwm-city:not(.has-wall) .wwm-keep { bottom: 16%; }
