/* v3 City at /world/city: full viewport pan/zoom map, pins by district, the dev list under it (owner: pixel, build-plan Delta G1/G2).
   Page-scoped: city.html must link it, after scene.css (and world.css if used); <= 4 KB gz (build.mjs PAGE_CSS). Never loads three.js.
   Components GC20 to GC25, layouts LG3. The World toggle rules are repeated in css/chrome/world-toggle.css for /world (same box, LG3.1). */
.v3 .city { --pin-dev: 24px; --pin-tok: 14px; --pin-hit: 32px; --world-bar: 48px; --toggle-h: 32px; --seg: 72px; --ctl: 40px; --card-w: 280px; display: block; }
@media (pointer: coarse) { .v3 .city, .v3 .world-toggle { --toggle-h: 40px; --seg: 84px; --ctl: 44px; --pin-hit: 44px; } }
/* toggle (GC20): fixed, the same box on /world and /world/city */
.v3 .world-toggle { --toggle-h: 32px; --seg: 72px; position: fixed; z-index: 19; top: calc(var(--chrome-top) + (48px - var(--toggle-h)) / 2); left: calc(var(--sb-w, 0px) + var(--q-inset));
  display: flex; height: var(--toggle-h); padding: 1px; border: 1px solid var(--c-control); border-radius: var(--r-pill); background: var(--bg); }
@media (pointer: coarse) { .v3 .world-toggle { --toggle-h: 40px; --seg: 84px; } }
.v3 .world-toggle a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: var(--seg); border: 1px solid transparent; border-radius: var(--r-pill);
  color: var(--mu); font-weight: var(--w-strong); font-size: var(--t-ui); text-decoration: none; }
.v3 .world-toggle a:hover { color: var(--fg); }
.v3 .world-toggle a:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.v3 .world-toggle .tick { fill: currentColor; visibility: hidden; }
.v3 .world-toggle a[aria-current="page"] { background: var(--sf3); color: var(--fg); border-color: var(--fg); }
.v3 .world-toggle a[aria-current="page"] .tick { visibility: visible; }
/* world bar 48 under the header: the note starts after the toggle */
.v3 .city-bar { position: sticky; top: var(--chrome-top); z-index: 7; background: var(--bg); height: var(--world-bar); display: flex; align-items: center; gap: var(--s-5); padding: 0 var(--q-inset) 0 calc(var(--q-inset) + 2 * var(--seg) + 4px + 16px);
  font-size: var(--t-small); line-height: var(--lh-meta); color: var(--mu); border-bottom: 1px solid var(--ln); }
.v3 .city-demo { margin-left: auto; }
@media (max-width: 47.99em) { .v3 .city-demo { display: none; } }
.v3 .city-skip { position: absolute; left: var(--q-inset); top: calc(var(--chrome-top) + var(--world-bar) + 8px); z-index: 6; background: var(--bg); padding: 0 var(--s-4); transform: translateY(-200%); }
.v3 .city-skip:focus { transform: none; }
/* viewport (GC21) */
.v3 .city-map { position: relative; height: calc(100dvh - var(--chrome-top) - var(--world-bar)); overflow: hidden; touch-action: none; background: var(--bg); outline: none; cursor: grab; user-select: none; }
.v3 .city-map:focus-visible { box-shadow: inset 0 0 0 2px var(--c-focus); }
.v3 .city-map[data-drag] { cursor: grabbing; }
.v3 .city-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: url("/img/v3/world/map.f57566c8.svg") center / 100% 100% no-repeat; }
@media (max-width: 47.99em) { .v3 .city-layer { background-image: url("/img/v3/world/map-tall.f09f1520.svg"); } }
.v3 .city-map[data-anim] .city-layer { transition: transform var(--d-base) var(--e-out); }
.v3 .city-map[data-drag] .city-layer { will-change: transform; }
.v3 .city-pins { position: absolute; inset: 0; }
/* cluster (GC22) and pin (GC23): counter-scaled by --iz so they keep their screen size */
.v3 .cl, .v3 .pin { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); transform: translate(calc(var(--dx, 0) * var(--iz) * 1px), calc(var(--dy, 0) * var(--iz) * 1px)) scale(var(--iz)) translate(-50%, -50%); }
.v3 .cl { display: grid; justify-items: center; gap: 2px; padding: 4px 8px; background: var(--sf); border: 1px solid var(--ln2); border-radius: var(--step); color: var(--fg); font: 600 var(--t-small) / 18px var(--sans); white-space: nowrap; cursor: pointer; }
.v3 .cl:hover { border-color: var(--fg); } .v3 .cl:active { background: var(--sf2); }
.v3 .cl-heads { display: flex; } .v3 .cl-heads > * + * { margin-left: -16px; }
.v3 .cl svg, .v3 .pin svg, .v3 .cc-lock svg, .v3 .cd-lock svg { display: block; width: var(--pin-dev); height: auto; }
.v3 .cl-n { font: 500 var(--t-small) / 1 var(--mono); }
.v3 .pin { width: var(--pin-hit); height: var(--pin-hit); display: grid; place-items: center; cursor: pointer; }
.v3 .pin-b, .v3 .cc-b { position: absolute; right: calc(50% - 16px); bottom: calc(50% - 14px); width: var(--pin-tok); height: var(--pin-tok); outline: 1px solid var(--bg); }
.v3 .pin[data-on]::after { content: ""; position: absolute; inset: calc(50% - 14px); box-shadow: 0 0 0 2px var(--ac); }
.v3 .pin-tag { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); display: none; padding: 2px 8px; background: var(--sf); border: 1px solid var(--ln2); color: var(--fg); font-size: var(--t-small); white-space: nowrap; }
@media (hover: hover) { .v3 .pin:hover .pin-tag { display: block; } }
.v3 .pin[data-asleep] svg { filter: grayscale(1); }
/* controls and hint */
.v3 .city-ctl { position: absolute; right: var(--q-inset); bottom: calc(var(--q-inset) + env(safe-area-inset-bottom)); display: grid; gap: 8px; z-index: 3; }
.v3 .city-ctl button { width: var(--ctl); height: var(--ctl); display: grid; place-items: center; background: var(--sf); border: 1px solid var(--ln2); border-radius: var(--step); color: var(--fg); }
.v3 .city-ctl button:hover { background: var(--sf2); } .v3 .city-ctl button:active { background: var(--sf3); }
.v3 .city-ctl button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.v3 .city-ctl button[aria-disabled="true"] { color: var(--mu); cursor: not-allowed; }
.v3 .city-ctl svg { width: 12px; height: 12px; fill: currentColor; }
.v3 .city-hint { position: absolute; left: var(--q-inset); bottom: calc(var(--q-inset) + env(safe-area-inset-bottom)); z-index: 2; max-width: calc(100% - 2 * var(--q-inset) - var(--ctl) - 16px); padding: 4px 8px; background: var(--bg); color: var(--mu); font-size: var(--t-small); line-height: var(--lh-meta); }
.v3 .city-keys { display: none; } .v3 .city-map:focus-visible .city-keys { display: block; } .v3 .city-map:focus-visible [data-hint] { display: none; }
.v3 .city-map[data-card-open] [data-hint] { display: none; }
.v3 .city-err { position: absolute; inset: auto var(--q-inset) 50%; z-index: 4; padding: var(--s-4); background: var(--sf); color: var(--fg); }
/* pin card (GC24): anchored on 64em+, docked under it */
.v3 .city-card { position: absolute; z-index: 5; left: 16px; right: 16px; bottom: calc(3 * var(--ctl) + 16px + var(--q-inset)); padding: 16px; background: var(--sf); border: 1px solid var(--ln2); border-radius: var(--step); box-shadow: var(--el-sheet);
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; }
.v3 .city-card[hidden] { display: none; }
@media (min-width: 64em) { .v3 .city-card { right: auto; bottom: auto; width: var(--card-w); box-shadow: var(--el-float); } }
.v3 .cc-lock, .v3 .cd-lock { position: relative; width: 40px; height: 36px; } .v3 .cc-lock svg { width: 32px; }
.v3 .cc-b { right: 0; bottom: 0; width: 20px; height: 20px; }
.v3 .cc-n { font-weight: 600; font-size: var(--t-body); color: var(--fg); display: flex; gap: 8px; align-items: center; }
.v3 .cc-l { grid-column: 2 / -1; color: var(--mu); font-size: var(--t-small); }
.v3 .cc-a { grid-column: 1 / -1; }
.v3 .cc-x { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; color: var(--fg); }
.v3 .cc-x svg { width: 10px; height: 10px; fill: currentColor; }
/* dev list (GC25) */
.v3 .city-devs { max-width: calc(1224px + 2 * var(--gutter)); margin: 0 auto; padding: var(--q-sec) var(--gutter); display: grid; gap: var(--s-4); outline: none; }
.v3 .city-devs h3 { font-size: var(--t-body); margin-top: var(--s-5); }
.v3 .cd { display: grid; grid-template-columns: 40px 1fr; gap: 4px 12px; align-items: center; padding: var(--s-3) 0; border-bottom: 1px solid var(--ln); }
.v3 .cd:hover { background: var(--sf2); }
.v3 .cd-lock svg { width: 24px; } .v3 .cd-lock .cc-b { width: 14px; height: 14px; right: 8px; bottom: 6px; }
.v3 .cd-n { font-weight: 600; color: var(--fg); } .v3 .cd-t, .v3 .cd-s { color: var(--mu); font-size: var(--t-small); }
.v3 .cd > :not(.cd-lock) { grid-column: 2; } .v3 .cd-lock { grid-row: span 3; align-self: start; }
@media (max-width: 63.99em) { .v3 .cd-d { display: none; } }
.v3 .cd-a { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; }
.v3 .cd-a .btn { min-height: 32px; position: relative; } .v3 .cd-a .btn::after { content: ""; position: absolute; inset: -6px 0; }
.v3 .city-empty { color: var(--fgl); }
@media (min-width: 64em) {
  .v3 .cd { grid-template-columns: 40px minmax(0, 2fr) 1fr 1fr auto; min-height: 56px; padding: 0; }
  .v3 .cd > :not(.cd-lock) { grid-column: auto; } .v3 .cd-lock { grid-row: auto; align-self: center; }
}
/* warm sky (A3a) behind the map plate: sky and sea strip, no land, drifts slowly (scene.css .amb-sky), decorative */
.v3 .city-sky { position: absolute; inset: 0 -6% 0 0; transform: translateX(-3%); pointer-events: none; animation: city-drift 90s linear infinite alternate; background: image-set(url(/img/v3/warm/a3a-world-sky-2560.avif) type("image/avif"), url(/img/v3/warm/a3a-world-sky-2560.webp) type("image/webp")) center bottom / cover; }
@media (max-width: 47.99em) { .v3 .city-sky { background-image: image-set(url(/img/v3/warm/a3a-world-sky-tall-900x1400.avif) type("image/avif"), url(/img/v3/warm/a3a-world-sky-tall-900x1400.webp) type("image/webp")); } }
.v3 .cc-poke { justify-content: flex-start; }
@keyframes city-drift { to { transform: translateX(-6%); } }
.v3[data-motion="paused"] .city-sky, .v3 [data-scene-run="no"] .city-sky { animation: none; }
@media (prefers-reduced-motion: reduce) { .v3 .city-sky { animation: none; } }
