/* Map terrain, state overlays and lightweight scene animation. */
.ww-world-map{display:block;background:#e2cdb4;isolation:isolate;overflow:hidden}
.ww-world-map .ww-terrain,.ww-world-map .ww-map-life,.ww-world-map .ww-roads,.ww-march-path,.ww-march-layer{pointer-events:none}
.ww-world-map .ww-ambient,.ww-world-map .ww-node-building,.ww-world-map .ww-map-sprite,.ww-world-map .ww-node-caption,.ww-world-map .ww-node-number,.ww-world-map .ww-node-id,.ww-world-map .ww-open-marker{pointer-events:none}
.ww-map-image{visibility:hidden}
.ww-map-image.is-loaded{visibility:visible}
.ww-settlement-sprite.is-loaded~.ww-settlement-fallback{display:none}
.ww-land-relief{opacity:1}
.ww-land-relief.is-loaded~.ww-relief-fallback{display:none}
.ww-world-map .ww-road-depth,
.ww-world-map .ww-road-edge,
.ww-world-map .ww-road{fill:none;stroke-linecap:round;stroke-linejoin:round}
.ww-world-map :is(.ww-road-depth,.ww-road-edge,.ww-road){fill:none;stroke-linecap:round;stroke-linejoin:round}
.ww-world-map .ww-road-depth{stroke:#544855;stroke-width:5.2;opacity:.34;transform:translateY(.7px)}
.ww-world-map .ww-road-edge{stroke:#a48276;stroke-width:3.9;opacity:.88}
.ww-world-map .ww-road-edge.is-owned{stroke:#377477;opacity:.92}
.ww-world-map .ww-road{stroke:#f6e5c1;stroke-width:2.2;opacity:.99}
.ww-world-map .ww-road.is-owned{stroke:#dbd7ae;stroke-width:2;opacity:.96}
.ww-world-map .ww-topography{fill:none;stroke:#eed3a6;stroke-width:1.7;opacity:.36}
.ww-world-map .ww-ridge-line{fill:none;stroke:#eed0a1;stroke-width:1.4;stroke-linecap:round;opacity:.37}
.ww-world-map .ww-region-label>path{fill:#ebd5a9;stroke:#9d7c55;stroke-width:.65;opacity:.86}
.ww-world-map .ww-region-label>text{font-size:11px;fill:#5a5439;font-weight:750;letter-spacing:2px}
.ww-world-map .ww-compass circle{fill:none;stroke:#fff0c6;stroke-width:1.5}
.ww-world-map .ww-compass path{fill:#c2a96d;stroke:#655e45;stroke-width:.7}
.ww-world-map .ww-compass path+path{fill:#f4e5bd}
.ww-world-map .ww-province{cursor:pointer;outline:none}
.ww-world-map .ww-node-touch{fill:transparent;pointer-events:all}
.ww-world-map .ww-hex-tile{pointer-events:none}
.ww-world-map .ww-hex-depth{fill:#634937;opacity:.24}
.ww-world-map .ww-hex-highlight{fill:none;stroke:#fff0c3;stroke-width:.8;stroke-linejoin:round;opacity:.42;transform:translateY(1.2px)}
.ww-world-map .ww-selection-shadow{fill:#e5bd78;fill-opacity:.22;stroke:#846c4e;stroke-width:.9;stroke-linejoin:round;transition:fill .2s,stroke .2s}
.ww-world-map .is-owned .ww-hex-depth{fill:#1d5046;opacity:.32}
.ww-world-map .is-owned .ww-selection-shadow{fill:#72b6a0;fill-opacity:.34;stroke:#266e60;stroke-width:1.4}
.ww-world-map .is-owned .ww-settlement-sprite{filter:saturate(1.12) contrast(1.03) brightness(1.06)}
.ww-world-map .is-open .ww-selection-shadow{fill:#edc587;fill-opacity:.52;stroke:#ae6b32;stroke-width:1.45}
.ww-world-map .is-marching .ww-selection-shadow{fill:#e9aa68;fill-opacity:.55;stroke:#9a582e;stroke-width:1.55}
.ww-world-map .is-locked .ww-node-building{opacity:.98;filter:saturate(.89)}
.ww-world-map .is-locked .ww-selection-shadow{fill:#bca180;fill-opacity:.22;stroke:#836c52}
.ww-world-map .ww-province:not(.is-owned).selected .ww-selection-shadow,
.ww-world-map .ww-province:not(.is-owned):focus-visible .ww-selection-shadow{fill:#fae3a6;stroke:#fff2bc;stroke-width:3;filter:drop-shadow(0 0 2px #674b2e)}
.ww-world-map .ww-province:not(.is-owned):is(.selected,:focus-visible) .ww-selection-shadow{fill:#fae3a6;stroke:#fff2bc;stroke-width:3;filter:drop-shadow(0 0 2px #674b2e)}
.ww-world-map .ww-province:not(.is-owned):hover .ww-selection-shadow{stroke:#765a31;stroke-width:2.7}
.ww-world-map .ww-node-number{fill:#4b454a;stroke:#f9d4a1;stroke-width:1.25}
.ww-world-map .is-owned .ww-node-number{fill:#126955;stroke:#d1e9b5}
.ww-world-map .ww-province.is-owned.selected .ww-node-number,
.ww-world-map .ww-province.is-owned:focus-visible .ww-node-number{stroke:#fff1a9;stroke-width:2.6}
.ww-world-map .ww-province.is-owned:is(.selected,:focus-visible) .ww-node-number{stroke:#fff1a9;stroke-width:2.6}
.ww-world-map .is-open .ww-node-number{fill:#99551d;stroke:#ffe6a8}
.ww-world-map .ww-node-id{fill:#fff5d8;font-size:9.3px;font-weight:800;dominant-baseline:auto}
.ww-world-map .ww-node-caption rect{fill:#344454;fill-opacity:.97;stroke:#dbccae;stroke-width:.85}
.ww-world-map .ww-node-caption .province-name{font-size:13.4px;fill:#fff5dd;font-weight:775;paint-order:normal;stroke:none}
.ww-world-map .is-owned .ww-node-caption rect{fill:#175c61;stroke:#a7d4c4}
.ww-world-map .is-owned .ww-node-caption .province-name{fill:#fff4d3}
.ww-world-map .is-open .ww-node-caption rect{fill:#745032;stroke:#ffdb94}
.ww-world-map .ww-province:not(.is-owned).selected .ww-node-caption rect,
.ww-world-map .ww-province:not(.is-owned):focus-visible .ww-node-caption rect{fill:#f6e1a1;stroke:#87602e;stroke-width:1.3}
.ww-world-map .ww-province:not(.is-owned):is(.selected,:focus-visible) .ww-node-caption rect{fill:#f6e1a1;stroke:#87602e;stroke-width:1.3}
.ww-world-map .ww-province:not(.is-owned).selected .ww-node-caption .province-name,
.ww-world-map .ww-province:not(.is-owned):focus-visible .ww-node-caption .province-name{fill:#49371d}
.ww-world-map .ww-province:not(.is-owned):is(.selected,:focus-visible) .ww-node-caption .province-name{fill:#49371d}
.ww-world-map .ww-open-marker{fill:#fff2c3;fill-opacity:.86;stroke:#a65e1a;stroke-width:2.1}
.ww-world-map .ww-target-pin{fill:#a46635;stroke:#fff0bf;stroke-width:1.5}
.ww-world-map .ww-territory-crest,.ww-world-map .ww-rebel-marker{pointer-events:none}
.ww-world-map .ww-territory-crest-rim{fill:#2d456d;stroke:#e7c974;stroke-width:1.3;filter:drop-shadow(0 1px .8px #15342165)}
.ww-world-map .ww-territory-emblem-bed{fill:#243c61}
.ww-world-map .ww-territory-crest-edge{fill:none;stroke:#deb965;stroke-width:.6;stroke-opacity:.9}
.ww-world-map .ww-territory-emblem{fill:#f7e6bb}
.ww-world-map .ww-territory-crest:has(.ww-territory-badge.is-loaded) .ww-territory-emblem{opacity:0}
.ww-world-map .ww-province.is-rebel .ww-selection-shadow{fill:#e4a07c;stroke:#97482f;stroke-dasharray:4 2.5}
.ww-world-map .ww-province.is-rebel.selected .ww-selection-shadow,.ww-world-map .ww-province.is-rebel:focus-visible .ww-selection-shadow{stroke:#fff1c5}
.ww-world-map .ww-province.is-rebel .ww-node-number,.ww-world-map .ww-rebel-marker rect{fill:#97482e;stroke:#fbe1bf;stroke-width:1}
.ww-world-map .ww-province.is-rebel .ww-node-caption rect{fill:#f9e1cc;stroke:#a25336}
.ww-world-map .ww-province.is-rebel .ww-node-caption .province-name{fill:#65311f}
.ww-world-map .ww-rebel-marker text{fill:#fff7e5;font-size:9px;font-weight:850}
.ww-map-edge{fill:none;stroke:#6d613d;stroke-width:1;stroke-opacity:.5;pointer-events:none}
.ww-flag-cloth{transform-origin:0 -24px;animation:ww-flag 3.8s ease-in-out infinite;animation-delay:var(--flag-phase,-1s)}
.ww-actor{offset-distance:35%;offset-rotate:0deg;animation:ww-commute var(--trip,30s) linear infinite;animation-delay:var(--phase,0s)}
.ww-walk-bob{animation:ww-walk-bob .9s ease-in-out infinite;animation-delay:var(--walk-phase,0s)}
.ww-river-current{animation:ww-current 12s linear infinite}
.ww-river-current-deep{animation-duration:19s}
.ww-water-shine{animation:ww-water-light 6s ease-in-out infinite}
.ww-islet-surf{animation:ww-islet-wash 7s ease-in-out var(--wash-delay,0s) infinite}
.ww-palm-movement{animation:ww-palms 5.8s ease-in-out infinite;animation-delay:var(--palm-phase,0s);transform-origin:0 4px}
.ww-boat{transform-box:fill-box;transform-origin:center;animation:ww-boat-bob 6.5s ease-in-out infinite}
.ww-pond-ripple{transform-box:fill-box;transform-origin:center;animation:ww-ripple 4s ease-out infinite;animation-delay:var(--ripple-phase,0s)}
.ww-fountain{animation:ww-water-light 3s ease-in-out infinite;animation-delay:var(--water-phase,0s)}
.ww-march-route-halo,.ww-march-route-edge,.ww-march-route,.ww-march-trail{fill:none;stroke-linecap:round}
.ww-march-route-halo{stroke:#483225;stroke-width:12;opacity:.50}
.ww-march-route-edge{stroke:#ffdf8e;stroke-width:9.5}
.ww-march-route{stroke:#305a74;stroke-width:6.8}
.ww-march-trail{stroke:#2c897f;stroke-width:6.5;stroke-dasharray:var(--route-fill,0) 101;animation:ww-trail-progress var(--march-duration,1800s) linear forwards}
.ww-march-arrow{fill:#ffe6a0;stroke:#533819;stroke-width:.55;stroke-linejoin:round}
.ww-march-column{offset-rotate:0deg;animation:ww-march-forward var(--march-duration,1800s) linear forwards}
.ww-march-shadow{fill:#192d23;opacity:.26}
.ww-march-stride{animation:ww-road-step 1.17s steps(1) var(--march-stride-delay,0s) infinite}
.ww-march-rider-step{animation:ww-rider-step .52s ease-in-out infinite alternate}
@keyframes ww-rider-step{from{transform:translateY(0)}to{transform:translateY(-.85px)}}
.ww-march-tag rect{fill:#283e55;stroke:#e6c776;stroke-width:1}
.ww-march-tag text{fill:#fff0c2;font-size:9.2px;font-weight:800}
.ww-march-pulse{fill:none;stroke:#b57a38;stroke-width:2;animation:ww-march-pulse 2.8s ease-out infinite;pointer-events:none}
.ww-castle-icon{width:100%;height:100%;display:block;overflow:visible}
.ww-building-scene{width:100%;height:100%;display:block;overflow:hidden;position:absolute;inset:0;pointer-events:none}
.art-tile.ww-living-building{position:relative;background:#d1a570 radial-gradient(ellipse at 48% 28%,#e3ba87,#c99c6e)!important;overflow:hidden;height:auto;aspect-ratio:4/3}
.art-tile.ww-living-building .level{position:absolute;z-index:2}
.world-paused .ww-world-map *,.world-paused .ww-building-scene *,.ww-scene-paused *{animation-play-state:paused!important}
.ww-map-offscreen .ww-terrain *,
.ww-map-offscreen .ww-map-life *{animation-play-state:paused!important}
.ww-map-offscreen :is(.ww-terrain,.ww-map-life) *{animation-play-state:paused!important}
.ww-map-offscreen .ww-march-formation *{animation-play-state:paused!important}
@keyframes ww-flag{0%,100%{transform:skewY(-3deg) scaleX(.94)}50%{transform:skewY(5deg) scaleX(1.05)}}
@keyframes ww-commute{
  0%,7.99%,92%,100%{offset-distance:0%;--travel-gait:paused}
  8%,91.99%{offset-distance:0%;--travel-gait:running}
  43.99%,56.01%{offset-distance:100%;--travel-gait:running}
  44%,56%{offset-distance:100%;--travel-gait:paused}
}
@keyframes ww-walk-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-.65px)}}
@keyframes ww-current{to{stroke-dashoffset:-93}}
@keyframes ww-water-light{0%,100%{opacity:.4}50%{opacity:.85}}
@keyframes ww-islet-wash{0%,100%{opacity:.26}50%{opacity:.76}}
@keyframes ww-palms{0%,100%{transform:skewX(-.7deg)}50%{transform:skewX(1.3deg)}}
@keyframes ww-boat-bob{0%,100%{translate:0 0;rotate:-1deg}50%{translate:1px 1px;rotate:2deg}}
@keyframes ww-ripple{0%{scale:.65;opacity:.8}100%{scale:1.4;opacity:0}}
@keyframes ww-trail-progress{to{stroke-dasharray:100 101}}
@keyframes ww-march-forward{from{offset-distance:var(--march-from,0%)}to{offset-distance:100%}}
@keyframes ww-march-pulse{0%{opacity:.8;scale:1}100%{opacity:0;scale:1.15}}
@media(prefers-reduced-motion:reduce){.ww-world-map *,.ww-building-scene *{animation:none!important;transition:none!important}.ww-march-column{offset-distance:var(--march-from,0%)!important}.ww-flag-cloth{transform:none}.ww-actor{offset-distance:40%}.ww-march-pulse{opacity:.6}}

.ww-trip-facing{animation:ww-turnaround var(--trip,30s) linear infinite;animation-delay:var(--phase,0s);transform-origin:0 0}
.ww-smoke-puff{animation:ww-smoke 7s ease-out infinite;animation-delay:var(--smoke-phase,0s)}
.ww-smoke-puff.secondary{animation-delay:calc(var(--smoke-phase,0s) - 3.5s)}
.ww-hoist{animation:ww-crane 5s ease-in-out infinite;animation-delay:var(--work-phase,0s)}
@keyframes ww-turnaround{0%,49.99%{transform:scaleX(1)}50%,99.99%{transform:scaleX(-1)}100%{transform:scaleX(1)}}
@keyframes ww-smoke{0%{transform:translate(0,0) scale(.6);opacity:0}20%{opacity:.42}100%{transform:translate(12px,-34px) scale(2);opacity:0}}
@keyframes ww-crane{0%,100%{transform:translateY(0)}45%,55%{transform:translateY(-6px)}}
.map-scroll:has(.ww-world-map){height:clamp(340px,calc(100vh - 365px),900px);height:clamp(340px,calc(100dvh - 365px),900px);min-height:340px;max-height:900px}
@media(prefers-reduced-motion:reduce){.ww-trip-facing{transform:none}}

.ww-world-map .ww-road-traveler {
  offset-distance: var(--road-near);
  offset-rotate: 0deg;
  animation: ww-road-journey var(--road-trip) linear var(--road-delay) infinite;
  --road-gait: 0;
}
.ww-world-map .ww-traveler-facing {
  transform: scaleX(var(--road-facing));
  animation: ww-road-facing var(--road-trip) linear var(--road-delay) infinite;
}
.ww-world-map .ww-traveler-idle { opacity: calc(1 - var(--road-gait)); }
.ww-world-map .ww-traveler-walk {
  opacity: var(--road-gait);
  animation: ww-road-step var(--road-stride) steps(1) var(--road-step-delay) infinite;
}
.ww-world-map .ww-traveler-shadow { fill: #392f20; opacity: .34; }
.ww-world-map .ww-road-traveler:has(.ww-traveler-atlas:not(.is-loaded)) .ww-traveler-shadow { visibility: hidden; }

@keyframes ww-road-journey {
  0%, 6%, 94%, 100% { offset-distance: var(--road-near); --road-gait: 0; }
  6.001% { offset-distance: var(--road-near); --road-gait: 1; }
  43.999% { offset-distance: var(--road-far); --road-gait: 1; }
  44%, 56% { offset-distance: var(--road-far); --road-gait: 0; }
  56.001% { offset-distance: var(--road-far); --road-gait: 1; }
  93.999% { offset-distance: var(--road-near); --road-gait: 1; }
}
@keyframes ww-road-facing {
  0%, 49.999% { transform: scaleX(var(--road-facing)); }
  50%, 100% { transform: scaleX(var(--road-return)); }
}
/* Eight painted frames per stride (Cocos build atlas). */
.ww-world-map .ww-traveler-walk.ww-steps8, .ww-march-stride.ww-steps8 { animation-name: ww-road-step8; }
@keyframes ww-road-step8 {
  0% { transform: translateX(0); }
  12.5% { transform: translateX(-128px); }
  25% { transform: translateX(-256px); }
  37.5% { transform: translateX(-384px); }
  50% { transform: translateX(-512px); }
  62.5% { transform: translateX(-640px); }
  75% { transform: translateX(-768px); }
  87.5%, 100% { transform: translateX(-896px); }
}
@keyframes ww-road-step {
  0% { transform: translateX(0); }
  25% { transform: translateX(-128px); }
  50% { transform: translateX(-256px); }
  75%, 100% { transform: translateX(-384px); }
}

.ww-world-map .ww-influence-map { pointer-events: none; }
.ww-world-map .ww-influence-tiles {
  fill: #d7b681;
  fill-opacity: .035;
  stroke: #745c40;
  stroke-opacity: .07;
  stroke-width: .65;
}
.ww-world-map .ww-influence-tiles.is-owned {
  fill: #229578;
  fill-opacity: .19;
  stroke: #276c56;
  stroke-opacity: .15;
}
.ww-world-map .ww-influence-tiles.is-rebel {
  fill: #bb5544;
  fill-opacity: .27;
  stroke: #883e34;
  stroke-opacity: .30;
}
.ww-world-map .ww-influence-border {
  fill: none;
  stroke: #745c40;
  stroke-opacity: .14;
  stroke-width: .98;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.ww-world-map .ww-influence-border.is-owned { stroke: #276b55; stroke-opacity: .55; }
.ww-world-map .ww-influence-border.is-rebel { stroke: #8c4338; stroke-opacity: .64; }
