/* City architecture (city.js): styles for the world, its player, labels, legend and step list.
   Self-contained: every colour has a fallback, so it works on a bare page and picks up a host
   site's --accent, --ink, --surface-2, --line, --muted and --font when they exist. */
.city { --c-accent: var(--accent, #f2c230); --c-ink: var(--ink, #f5f5f7); --c-ink2: var(--ink-2, #c7c7cc); --c-muted: var(--muted, #8e8e93); --c-surface: var(--surface-2, #1c1c1e); --c-surface3: var(--surface-3, #2c2c2e); --c-line: var(--line, rgba(255,255,255,0.14)); --c-font: var(--font, -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, system-ui, sans-serif); font-family: var(--c-font); color: var(--c-ink); }
.city-fig { outline: none; }
.city-fig:focus-visible .city-stage { box-shadow: 0 0 0 2px var(--c-accent); }

/* player */
.city-play { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.city .chip { padding: 7px 12px; border: 1px solid var(--c-line); border-radius: 999px; background: var(--c-surface); color: var(--c-ink); font: 500 13px var(--c-font); cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.city .chip:hover { border-color: var(--c-muted); }
.city .chip:disabled { opacity: 0.4; cursor: default; }
.city .city-playbtn { font-weight: 600; }
.city-count { margin-left: 6px; font-size: 11px; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.city-spacer { flex: 1; }

/* stage */
.city-stage { position: relative; aspect-ratio: 16 / 9; min-height: 320px; border-radius: 16px; overflow: hidden; background: #244d2d; }
.city-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.city-stage canvas:active { cursor: grabbing; }
.city-labels { position: absolute; inset: 0; pointer-events: none; }
.city-label { position: absolute; left: 0; top: 0; padding: 4px 9px; border-radius: 8px; background: rgba(12, 14, 12, 0.72); color: #f5f5f7; font-size: 12px; line-height: 1.25; white-space: nowrap; text-align: center; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.city-label b { display: block; font-size: 13px; }
.city-label span { color: #c7c7cc; font-size: 11px; }
.city-label span:empty { display: none; }
.city-label[data-key]:not([data-key=""]) span::after { content: attr(data-key); color: #9fc6f5; }
.city-label[data-key*="revoked"] span::after, .city-label[data-key*="Revoked"] span::after { color: #ff8aa6; }
.city-label.hall { text-align: center; max-width: 220px; white-space: normal; }
.city-label.hall b { font-size: 15px; }
.city-ledger { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px 6px; margin: 5px 0 0; padding: 5px 0 0; list-style: none; border-top: 1px solid rgba(255,255,255,0.15); font-size: 10.5px; color: var(--c-accent); }
.city-ledger::before { content: attr(data-ledger); width: 100%; color: #c7c7cc; }
.city-ledger li.dark { color: #8e8e93; text-decoration: line-through; }

/* the contract card */
.city-card { position: absolute; left: 0; top: 0; width: 230px; padding: 10px 12px; border-radius: 10px; background: rgba(10, 10, 12, 0.9); border: 1px solid var(--c-accent); color: var(--c-ink); font-size: 11px; opacity: 0; transform: translate(-9999px, 0); transition: opacity 0.3s; }
.city-card.on { opacity: 1; }
.city-card b { display: block; margin-bottom: 4px; font-size: 13px; }
.city-card b em { font-style: normal; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--c-accent); color: #000; font-size: 10px; }
.city-card dl { display: grid; gap: 2px; margin: 0; }
.city-card dl div { display: grid; grid-template-columns: 64px 1fr; gap: 6px; line-height: 1.25; }
.city-card dt { color: #a1a1a6; }
.city-card dd { margin: 0; }

/* legend (bottom left, on ?) */
.city-legend { position: absolute; left: 12px; bottom: 12px; max-width: 360px; padding: 12px 14px; border-radius: 12px; background: rgba(10, 10, 12, 0.88); color: #f5f5f7; font-size: 12px; line-height: 1.35; opacity: 0; transform: translateY(8px); transition: opacity 0.25s, transform 0.25s; pointer-events: none; }
.city-legend.on { opacity: 1; transform: none; pointer-events: auto; }
.city-legend b { display: block; margin-bottom: 6px; }
.city-legend ul { margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 4px; }
.city-legend li { display: flex; align-items: center; gap: 8px; }
.city-legend small { color: #a1a1a6; }
.city .lg { flex: none; width: 16px; height: 12px; }
.city .lg-coin { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: inset -2px -2px 0 rgba(0,0,0,0.3); }
.city .lg-bird { background: linear-gradient(135deg, transparent 45%, #f5f5f7 45% 55%, transparent 55%) left/50% 100% no-repeat, linear-gradient(45deg, transparent 45%, #f5f5f7 45% 55%, transparent 55%) right/50% 100% no-repeat; }
.city .lg-cart { background: #8c5a2b; border-radius: 2px; box-shadow: 4px 6px 0 -2px #2b2b2b, 12px 6px 0 -2px #2b2b2b; height: 8px; }
.city .lg-hall { background: #9a9a9e; clip-path: polygon(0 100%, 0 35%, 15% 35%, 15% 20%, 30% 20%, 30% 35%, 45% 35%, 45% 0, 55% 0, 55% 35%, 70% 35%, 70% 20%, 85% 20%, 85% 35%, 100% 35%, 100% 100%); }
.city .lg-flag { background: linear-gradient(90deg, #e9e9ee 0 2px, transparent 2px) left/100% 100% no-repeat; position: relative; }
.city .lg-flag::after { content: ""; position: absolute; left: 2px; top: 0; border-style: solid; border-width: 4px 0 4px 10px; border-color: transparent transparent transparent #ff3b30; }
.city .lg-ring { border: 2px solid #ff3b30; border-radius: 50%; width: 14px; height: 10px; }
.city .lg-person { width: 8px; height: 12px; background: linear-gradient(#f1c9a5 0 4px, #3987e5 4px 10px, #2b2b2b 10px); margin: 0 4px; }
.city .lg-mill { background: #a86e3b; clip-path: polygon(50% 0, 100% 40%, 85% 40%, 85% 100%, 15% 100%, 15% 40%, 0 40%); }

/* the line under the picture and the step cards */
.city-info { display: block; min-height: 56px; margin: 12px 0 0; padding: 12px 16px; border-radius: 16px; background: var(--c-surface); font-size: 14px; line-height: 1.4; color: var(--c-ink2); }
.city-info b { display: block; margin-bottom: 2px; color: var(--c-ink); }
.city-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.city-steps > li { padding: 12px 12px 14px; border-top: 3px solid var(--c-accent); border-radius: 4px 4px 14px 14px; background: var(--c-surface); cursor: pointer; transition: opacity 0.3s, background 0.3s; }
.city-steps > li:hover, .city-steps > li:focus-visible { background: var(--c-surface3); outline: none; }
.city-steps > li.now { background: color-mix(in srgb, var(--c-accent) 18%, var(--c-surface)); }
.city-steps > li.off { opacity: 0.45; }
.city-steps > li > b { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--c-accent); }
.city-steps h3 { margin: 3px 0 6px; font-size: 15px; line-height: 1.25; color: var(--c-ink); }
.city-steps p { margin: 0; font-size: 11.5px; line-height: 1.35; color: var(--c-ink2); }

/* full screen */
.city-fig.full { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; padding: 10px 14px; background: #0b0b0d; overflow: auto; }
.city-fig.full .city-stage { flex: 1; aspect-ratio: auto; min-height: 0; }
.city-fig.full .city-steps { display: none; }
.city-fig.full .city-info { margin-top: 8px; }
