/* Nous City card (city/city.js) */
.city-card { padding: 20px; position: relative; }
.city-loading { padding: 60px 0; text-align: center; color: #6b7a99; font-weight: 300; }
.city-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.city-title { font-size: 22px; font-weight: 300; color: #363f51; margin: 0 0 6px; }
.city-sub { font-size: 13px; font-weight: 300; color: #6b7a99; margin: 0 0 12px; }
.city-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.city-chip { display: inline-flex; align-items: center; gap: 2px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 400; color: #4a5568; background: #f1f4f8; }
.city-chip--th { background: #363f51; color: #fff; }
.city-chip--coin { color: #92400e; background: #fef3c7; }
.city-icon { flex: none; }

/* Mystery box waiting */
.city-box-btn { position: relative; flex: none; border: 0; background: #f8f9fb; border-radius: 16px; padding: 6px; cursor: pointer; box-shadow: inset 0 0 0 1px #e4e8ee; animation: cityBoxNudge 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
.city-box-btn__n { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #ef4444; color: #fff; font-size: 12px; line-height: 20px; }
@keyframes cityBoxNudge { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-7deg) scale(1.05); } 84% { transform: rotate(6deg) scale(1.05); } 92% { transform: rotate(-3deg); } }
.city-box-btn:not(.is-limit)::before { content: ''; position: absolute; inset: -3px; border-radius: inherit; pointer-events: none; border: 3px solid #fbbf24; opacity: 0; animation: cityBoxGlow 2.4s ease-out infinite; }
@keyframes cityBoxGlow { 0%, 60% { transform: scale(1); opacity: .55; } 100% { transform: scale(1.35); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .city-box-btn:not(.is-limit)::before { animation: none; } }

/* The 3D stage: sky per theme behind a transparent canvas */
.city-stage { position: relative; height: 380px; border-radius: 18px; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none;
    background: linear-gradient(180deg, #5fa8ec 0%, #8cc4f2 38%, #c6e3f8 72%, #e8f4fc 100%); }
body.night-mode .city-stage { background: radial-gradient(1.5px 1.5px at 12% 18%, #ffffffcc 50%, transparent 51%), radial-gradient(1.5px 1.5px at 78% 9%, #ffffffaa 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 22%, #ffffffaa 50%, transparent 51%), radial-gradient(1.5px 1.5px at 88% 30%, #ffffffcc 50%, transparent 51%),
    linear-gradient(180deg, #1b2a5c 0%, #2d3f7a 55%, #4b5d96 100%); }
.city-stage.is-edit { box-shadow: inset 0 0 0 2px #34d399; }
@media (min-width: 1024px) { .city-stage { height: 480px; } }
.city-stage__canvas { position: absolute; inset: 0; }
.city-stage__canvas canvas { display: block; width: 100% !important; height: 100% !important; cursor: grab; }
.city-stage__canvas canvas:active { cursor: grabbing; }
.city-stage__fail { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: #6b7a99; font-weight: 300; }

/* What's being built */
.city-hud { position: absolute; left: 10px; top: 10px; max-width: min(270px, calc(100% - 130px)); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; pointer-events: none; z-index: 1; }
.city-progress { max-width: 100%; padding: 8px 12px; border-radius: 14px; background: rgba(255, 255, 255, .88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 2px 10px rgba(54, 63, 81, .08); pointer-events: none; }
.city-progress__label { font-size: 13px; color: #363f51; font-weight: 400; }
.city-progress__bar { height: 6px; margin: 6px 0 4px; border-radius: 3px; background: #e4e8ee; overflow: hidden; }
.city-progress__bar span { display: block; height: 100%; background: linear-gradient(90deg, #f59e0b, #fbbf24); transform-origin: left; transition: transform 1s ease; }
.city-progress.is-live .city-progress__bar span { background: linear-gradient(90deg, #f59e0b, #fde68a, #f59e0b); background-size: 200% 100%; animation: cityBuilding 1.6s linear infinite; }
@keyframes cityBuilding { to { background-position: -200% 0; } }
.city-progress__sub { font-size: 11px; color: #6b7a99; font-weight: 300; }

.city-toast { position: absolute; left: 50%; bottom: 62px; transform: translateX(-50%); padding: 7px 14px; border-radius: 999px; background: rgba(54, 63, 81, .92); color: #fff; font-size: 13px; font-weight: 300; white-space: nowrap; max-width: 90%; max-height: 48px; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; animation: cityToast .25s ease-out; pointer-events: none; }
@keyframes cityToast { from { opacity: 0; transform: translate(-50%, 6px); } }

.city-rot { position: absolute; right: 10px; bottom: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .9); color: #4a5568; box-shadow: 0 2px 10px rgba(54, 63, 81, .12); cursor: pointer; }

/* Edit bar */
.city-editbar { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px; border-radius: 14px; background: rgba(255, 255, 255, .94); box-shadow: 0 2px 12px rgba(54, 63, 81, .14); }
.city-editbar__name { flex: 1; min-width: 0; font-size: 13px; color: #363f51; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-editbar button { height: 36px; min-width: 36px; padding: 0 10px; border-radius: 10px; border: 0; background: #f1f4f8; color: #363f51; display: inline-flex; align-items: center; justify-content: center; gap: 4px; font: inherit; font-size: 13px; cursor: pointer; }
.city-editbar .city-editbar__done { background: #10b981; color: #fff; }

/* Toolbar */
.city-tools { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-top: 12px; }
.city-tool { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 12px; border: 0; background: #f8f9fb; color: #4a5568; font: inherit; font-size: 12px; font-weight: 300; cursor: pointer; transition: background .15s, color .15s; }
.city-tool:hover { background: #eef1f6; }
.city-tool.is-on { background: #363f51; color: #fff; }
.city-tool__badge { position: absolute; top: 3px; right: 10px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #f59e0b; color: #fff; font-size: 10px; line-height: 16px; font-weight: 600; }

/* Panels */
.city-panel { margin-top: 12px; padding: 12px; border-radius: 14px; background: #f8f9fb; animation: cityPanel .2s ease-out; }
@keyframes cityPanel { from { opacity: 0; transform: translateY(-4px); } }
.city-panel__lead { font-size: 12px; font-weight: 300; color: #6b7a99; margin: 0 0 10px; }
.city-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: #fff; margin-bottom: 6px; }
.city-row.is-locked { opacity: .55; }
.city-row__text { flex: 1; min-width: 0; }
.city-row__name { font-size: 14px; color: #363f51; display: flex; align-items: center; gap: 6px; }
.city-row__count { font-size: 11px; color: #6b7a99; font-weight: 300; display: inline-flex; align-items: center; gap: 2px; }
.city-row__sub { font-size: 12px; color: #6b7a99; font-weight: 300; }
.city-btn { flex: none; display: inline-flex; align-items: center; gap: 3px; padding: 7px 12px; border-radius: 10px; border: 0; background: #363f51; color: #fff; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.city-btn:disabled { background: #e4e8ee; color: #6b7a99; cursor: default; }

.city-thumb { flex: none; display: inline-grid; place-items: center; border-radius: 12px; background: linear-gradient(#eef6ff, #e6f2dd); overflow: hidden; }
.city-thumb img { width: 100%; height: 100%; object-fit: contain; }
.city-thumb__wait { width: 40%; height: 40%; border-radius: 50%; background: #dfe6ee; animation: cityPulse 1s ease-in-out infinite alternate; }
@keyframes cityPulse { to { opacity: .4; } }
.city-thumb--prize { background: transparent; }

.city-tabs { display: flex; gap: 4px; margin-bottom: 10px; padding: 3px; border-radius: 10px; background: #eef1f6; }
.city-tabs button { flex: 1; padding: 6px; border-radius: 8px; border: 0; background: transparent; font: inherit; font-size: 13px; color: #6b7a99; cursor: pointer; }
.city-tabs button.is-on { background: #fff; color: #363f51; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }

.city-shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.city-shop__item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 14px; border: 0; background: #fff; font: inherit; cursor: pointer; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tier, #e4e8ee) 30%, transparent); transition: transform .12s; }
.city-shop__item:hover:not(:disabled) { transform: translateY(-2px); }
.city-shop__item:disabled { opacity: .5; cursor: default; }
.city-shop__name { font-size: 12px; color: #363f51; text-align: center; }
.city-shop__tier { font-size: 9px; line-height: 14px; }
.city-shop__price { font-size: 12px; color: #92400e; display: inline-flex; align-items: center; gap: 2px; }
.city-shop__count { position: absolute; top: 4px; right: 6px; font-size: 11px; color: #6b7a99; }

.city-treat__icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #fef3c7; color: #b45309; flex: none; }
.city-treat-form { display: flex; gap: 6px; margin-top: 8px; }
.city-treat-form input { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 10px; border: 1px solid #e4e8ee; font: inherit; font-size: 13px; background: #fff; }
.city-treat-form .city-treat-form__cost { flex: 0 0 72px; }

.city-themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.city-theme { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 14px; border: 0; background: #fff; font: inherit; cursor: pointer; box-shadow: inset 0 0 0 1px #e4e8ee; transition: transform .12s, box-shadow .12s; }
.city-theme:hover { transform: translateY(-2px); }
.city-theme.is-on { box-shadow: inset 0 0 0 2px #363f51; }
.city-theme__name { font-size: 14px; color: #363f51; }
.city-theme__blurb { font-size: 11px; font-weight: 300; color: #6b7a99; text-align: center; line-height: 1.3; }
.city-theme--sakura .city-thumb { background: linear-gradient(#fff1f6, #f6e7ee); }

/* Night mode */
body.night-mode .city-title, body.night-mode .city-row__name, body.night-mode .city-progress__label, body.night-mode .city-theme__name, body.night-mode .city-shop__name, body.night-mode .city-editbar__name { color: #e5e7eb; }
body.night-mode .city-chip { background: #1f2937; color: #cbd5e1; }
body.night-mode .city-chip--coin { background: #422006; color: #fde68a; }
body.night-mode .city-panel, body.night-mode .city-tool { background: #111827; color: #cbd5e1; }
body.night-mode .city-row, body.night-mode .city-shop__item, body.night-mode .city-theme, body.night-mode .city-tabs button.is-on, body.night-mode .city-treat-form input { background: #1f2937; color: #e5e7eb; }
body.night-mode .city-tabs { background: #0b1220; }
body.night-mode .city-progress, body.night-mode .city-editbar, body.night-mode .city-rot { background: rgba(17, 24, 39, .88); color: #e5e7eb; }
body.night-mode .city-editbar button { background: #1f2937; color: #e5e7eb; }
body.night-mode .city-box-btn { background: #1f2937; box-shadow: inset 0 0 0 1px #374151; }
@media (prefers-reduced-motion: reduce) { .city-box-btn, .city-progress.is-live .city-progress__bar span { animation: none; } }

/* Fullscreen button on the normal card: dark so it stands out on the sky */
.city-full { position: absolute; right: 58px; bottom: 10px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .9); display: grid; place-items: center; background: #363f51; color: #fff; box-shadow: 0 3px 12px rgba(54, 63, 81, .3); cursor: pointer; }
.city-full:active { transform: scale(.94); }
body.night-mode .city-full { background: #e5e7eb; color: #0f172a; border-color: rgba(17, 24, 39, .6); }
.city-progress__pct, .city-head__close { display: none; }
.city-sheets { display: contents; }

/* Fullscreen city (mobile city builder): the stage fills the screen, a slim top bar, a HUD pill,
   a floating dock of round tool buttons and panels as a bottom sheet over the stage */
.city-card.is-full { --top: calc(env(safe-area-inset-top) + 52px); --dock: calc(env(safe-area-inset-bottom) + 80px);
    position: fixed; inset: 0; z-index: 60; width: 100%; height: 100vh; height: 100dvh; margin: 0; padding: 0; border-radius: 0; overflow: hidden; box-shadow: none; }
.city-card.is-full .city-stage { position: absolute; inset: 0; height: auto; min-height: 0; border-radius: 0; }
/* top bar */
.city-card.is-full .city-head { position: absolute; left: 0; right: 0; top: 0; z-index: 4; display: flex; align-items: center; gap: 8px; margin: 0;
    padding: calc(env(safe-area-inset-top) + 6px) max(10px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left)); min-height: 40px;
    background: rgba(255, 255, 255, .62); backdrop-filter: blur(12px) saturate(1.3); -webkit-backdrop-filter: blur(12px) saturate(1.3); box-shadow: 0 1px 0 rgba(54, 63, 81, .08); }
.city-card.is-full .city-head__main { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.city-card.is-full .city-title { font-size: 16px; font-weight: 400; margin: 0; min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-card.is-full .city-chips { flex: none; flex-wrap: nowrap; gap: 4px; }
.city-card.is-full .city-chip { padding: 2px 7px; font-size: 11px; }
.city-card.is-full .city-chip:not(.city-chip--th):not(.city-chip--coin) { display: none; }
.city-card.is-full .city-head__side { gap: 6px; }
.city-card.is-full .city-collect { height: 32px; padding: 0 10px; font-size: 12px; }
.city-card.is-full .city-box-btn { padding: 2px; border-radius: 10px; }
.city-card.is-full .city-box-btn svg { width: 28px; height: 28px; }
.city-card.is-full .city-head__close { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; border: 0; background: rgba(54, 63, 81, .88); color: #fff; cursor: pointer; }
/* HUD: one slim pill, small banners under it */
.city-card.is-full .city-hud { top: calc(var(--top) + 8px); left: max(10px, env(safe-area-inset-left)); max-width: calc(100% - 150px); gap: 4px; }
.city-card.is-full .city-progress { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 999px; max-width: 100%; box-sizing: border-box; }
.city-card.is-full .city-progress__label { font-size: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-card.is-full .city-progress__bar { flex: 0 0 54px; height: 5px; margin: 0; }
.city-card.is-full .city-progress__pct { display: inline; flex: none; font-size: 11px; color: #6b7a99; }
.city-card.is-full .city-progress__sub { display: none; }
.city-card.is-full .city-banner { padding: 3px 9px; font-size: 11px; }
/* controls: mode toggle, zoom and turn down the right edge, clear of the dock and the sheet */
.city-card.is-full .city-mode { top: calc(var(--top) + 8px); right: max(10px, env(safe-area-inset-right)); }
.city-card.is-full .city-zoom { top: calc(var(--top) + 56px); right: max(10px, env(safe-area-inset-right)); transform: none; }
.city-card.is-full .city-rot { top: calc(var(--top) + 146px); bottom: auto; right: max(10px, env(safe-area-inset-right)); }
.city-card.is-full .city-toast { bottom: calc(var(--dock) + 10px); }
.city-card.is-full .city-editbar { bottom: calc(var(--dock) - 66px); left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right)); }
.city-card.is-full .city-stage.is-edit { box-shadow: inset 0 0 0 3px #34d399; }
/* the dock */
.city-card.is-full .city-tools { position: absolute; z-index: 5; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 12px); transform: translateX(-50%); display: flex; gap: 8px; margin: 0; padding: 7px;
    border-radius: 999px; background: rgba(255, 255, 255, .72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 6px 22px rgba(54, 63, 81, .18); }
.city-card.is-full .city-tool { width: 50px; height: 50px; padding: 0; border-radius: 50%; justify-content: center; background: #fff; box-shadow: 0 1px 4px rgba(54, 63, 81, .12); }
.city-card.is-full .city-tool.is-on { background: #363f51; color: #fff; }
.city-card.is-full .city-tool > span:not(.city-tool__badge) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.city-card.is-full .city-tool__badge { top: -3px; right: -3px; }
/* build mode keeps the dock (and the live/build toggle) in fullscreen: the edit card sits above it */
.city-card.is-full .city-stage.is-edit ~ .city-tools { display: flex; }
/* panels as a bottom sheet */
.city-card.is-full .city-sheets { display: block; position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; max-height: 60vh; max-height: 60dvh; overflow-y: auto; overscroll-behavior: contain;
    padding: 0 max(12px, env(safe-area-inset-right)) calc(var(--dock) + 4px) max(12px, env(safe-area-inset-left)); box-sizing: border-box;
    background: rgba(255, 255, 255, .97); border-radius: 22px 22px 0 0; box-shadow: 0 -8px 30px rgba(54, 63, 81, .18); animation: citySheetUp .22s ease-out; }
.city-card.is-full .city-sheets:empty { display: none; }
.city-card.is-full .city-sheets > .city-panel:first-child, .city-card.is-full .city-sheets > :first-child { margin-top: 10px; }
.city-card.is-full .city-sheets > .city-sheets__bar { margin-top: 0; }
.city-sheets__bar { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: center; height: 38px; margin: 0 -12px; background: #fff; border-radius: 22px 22px 0 0; touch-action: none; cursor: grab; }
body.night-mode .city-sheets__bar { background: #111827; }
.city-sheets__grip { width: 40px; height: 4px; border-radius: 2px; background: #d6dbe3; }
.city-sheets__x { position: absolute; right: 8px; top: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: #f1f4f8; color: #6b7a99; display: grid; place-items: center; cursor: pointer; }
@keyframes citySheetUp { from { transform: translateY(24px); opacity: 0; } }
body.night-mode .city-card.is-full .city-head, body.night-mode .city-card.is-full .city-tools { background: rgba(17, 24, 39, .66); }
body.night-mode .city-card.is-full .city-tool { background: #1f2937; color: #e5e7eb; }
body.night-mode .city-card.is-full .city-tool.is-on { background: #e5e7eb; color: #0f172a; }
body.night-mode .city-card.is-full .city-sheets { background: rgba(17, 24, 39, .97); }
body.night-mode .city-sheets__x { background: #1f2937; color: #cbd5e1; }
body.night-mode .city-sheets__grip { background: #374151; }
@media (prefers-reduced-motion: reduce) { .city-card.is-full .city-sheets { animation: none; } }

/* City life: happiness, residents, quests, the collection book */
button.city-chip { border: 0; font: inherit; font-size: 12px; cursor: pointer; }
.city-chip--mood { background: #dcfce7; color: #166534; }
.city-chip--mood.is-okay { background: #fef9c3; color: #854d0e; }
.city-chip--mood.is-unhappy { background: #fee2e2; color: #991b1b; }
.city-progress__bonus { display: flex; align-items: center; gap: 3px; margin-top: 2px; }
.city-bubble { position: absolute; left: 0; top: 0; visibility: hidden; max-width: 220px; padding: 7px 11px; border-radius: 14px; background: #fff; color: #363f51; font-size: 12px; line-height: 1.35; box-shadow: 0 4px 14px rgba(54, 63, 81, .18); pointer-events: none; z-index: 2; margin-top: -8px; }
.city-bubble::after { content: ''; position: absolute; left: calc(50% + var(--tail, 0px)); bottom: -5px; width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); }
.city-needs { display: grid; gap: 6px; margin-bottom: 12px; padding: 10px; border-radius: 12px; background: #fff; }
.city-need { display: grid; grid-template-columns: 70px 1fr 44px; align-items: center; gap: 8px; font-size: 12px; color: #4a5568; }
.city-need__val { text-align: right; color: #6b7a99; font-weight: 300; }
.city-need__bar, .city-quest__bar { height: 6px; border-radius: 3px; background: #e4e8ee; overflow: hidden; }
.city-need__bar span, .city-quest__bar span { display: block; height: 100%; background: #10b981; transform-origin: left; transition: transform .6s ease; }
.city-need__bar.is-mid span { background: #f59e0b; }
.city-need__bar.is-low span { background: #ef4444; }
.city-quest__bar { margin: 5px 0 3px; max-width: 160px; }
.city-quest.is-done { opacity: .6; }
.city-resident__face { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #e0e7ff; color: #3730a3; font-size: 14px; }
.city-locked { display: flex; gap: 12px; align-items: flex-start; color: #6b7a99; font-size: 13px; font-weight: 300; }
.city-locked b { color: #363f51; font-weight: 500; }
.city-panel__row { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.city-btn--ghost { background: #fff; color: #363f51; box-shadow: inset 0 0 0 1px #e4e8ee; }
.city-book { margin-top: 12px; }
.city-book__head { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #363f51; margin-bottom: 8px; }
.city-book__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 6px; }
.city-book__item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tier) 35%, transparent); font-size: 10px; color: #4a5568; text-align: center; }
.city-book__item.is-missing img { filter: brightness(0) opacity(.18); }
.city-book__item.is-missing { color: #9aa5b8; }
@media (max-width: 420px) { .city-tool { font-size: 11px; padding: 7px 2px; } .city-tool__badge { right: 4px; } }
body.night-mode .city-needs, body.night-mode .city-book__item, body.night-mode .city-btn--ghost { background: #1f2937; color: #e5e7eb; }
body.night-mode .city-bubble { background: #1f2937; color: #e5e7eb; }
body.night-mode .city-book__head, body.night-mode .city-locked b { color: #e5e7eb; }

/* Zoom buttons, stacked on the right edge */
.city-zoom { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; border-radius: 20px; background: rgba(255, 255, 255, .9); box-shadow: 0 2px 10px rgba(54, 63, 81, .12); overflow: hidden; }
.city-zoom button { width: 40px; height: 40px; border: 0; background: transparent; color: #4a5568; display: grid; place-items: center; cursor: pointer; }
.city-zoom button + button { border-top: 1px solid #e4e8ee; }
.city-zoom button:active { background: #eef1f6; }
body.night-mode .city-zoom { background: rgba(17, 24, 39, .88); }
body.night-mode .city-zoom button { color: #e5e7eb; }
body.night-mode .city-zoom button + button { border-top-color: #374151; }
@media (max-width: 480px) { .city-stage { height: min(440px, 62vh); } }

/* --- v2: collect, modes, banners, upgrade sheet, worlds, home card --- */
.city-head__main { min-width: 0; }
.city-head__side { display: flex; align-items: center; gap: 8px; flex: none; }
.city-collect { display: inline-flex; align-items: center; gap: 5px; height: 40px; padding: 0 14px; border-radius: 999px; border: 0; background: linear-gradient(180deg, #fde68a, #f59e0b); color: #78350f; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; box-shadow: 0 2px 8px rgba(245, 158, 11, .35), inset 0 -2px 0 rgba(120, 53, 15, .15); animation: cityCollect 2.8s ease-in-out infinite; }
.city-collect:active { transform: scale(.96); }
@keyframes cityCollect { 0%, 80%, 100% { transform: translateY(0); } 88% { transform: translateY(-3px); } }

/* live | build switch, top right of the stage */
.city-mode { position: absolute; right: 10px; top: 10px; z-index: 2; display: flex; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .9); box-shadow: 0 2px 10px rgba(54, 63, 81, .12); }
.city-mode button { display: inline-flex; align-items: center; gap: 3px; height: 32px; padding: 0 11px; border-radius: 999px; border: 0; background: transparent; color: #6b7a99; font: inherit; font-size: 12px; cursor: pointer; }
.city-mode button.is-on { background: #363f51; color: #fff; }
.city-stage.is-edit .city-mode button.is-on { background: #10b981; }

/* Banners under the progress box */
.city-banner { white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 400; box-shadow: 0 2px 10px rgba(54, 63, 81, .08); }
.city-banner--anchor { background: linear-gradient(90deg, #fef3c7, #fde68a); color: #78350f; animation: cityGlow 3s ease-in-out infinite; }
.city-banner--study { background: rgba(224, 231, 255, .94); color: #3730a3; }
@keyframes cityGlow { 0%, 100% { box-shadow: 0 2px 10px rgba(54, 63, 81, .08); } 50% { box-shadow: 0 0 14px 2px rgba(251, 191, 36, .55); } }
.city-stage.is-anchored { box-shadow: inset 0 0 0 2px rgba(251, 191, 36, .75), inset 0 0 40px rgba(251, 191, 36, .25); }
.city-stage.is-anchored.is-edit { box-shadow: inset 0 0 0 2px #34d399; }

/* Build mode bar: clear words, not just icons */
.city-editbar__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.city-editbar__hint { display: flex; align-items: center; gap: 4px; font-size: 11px; color: #6b7a99; font-weight: 300; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; flex: none; }
.city-dot--ok { background: #34d399; }
.city-dot--bad { background: #ef4444; margin-left: 2px; }
.city-editbar button span { font-size: 12px; }
.city-edithint { position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .92); box-shadow: 0 2px 10px rgba(54, 63, 81, .12); font-size: 11px; color: #4a5568; white-space: nowrap; pointer-events: none; }
.city-edithint__sep { width: 1px; height: 10px; background: #e4e8ee; margin: 0 6px; }
body.night-mode .city-edithint { background: rgba(17, 24, 39, .9); color: #e5e7eb; }
@media (max-width: 380px) { .city-editbar button:not(.city-editbar__done) span { display: none; } }

/* Upgrade sheet */
.city-sheet { position: relative; }
.city-sheet__head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.city-sheet__name { font-size: 16px; }
.city-sheet__levels { display: flex; gap: 4px; margin-top: 5px; }
.city-sheet__x { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 0; background: #fff; color: #6b7a99; display: grid; place-items: center; cursor: pointer; }
.city-pip { width: 18px; height: 6px; border-radius: 3px; background: #e4e8ee; }
.city-pip.is-on { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.city-pip.is-cap:not(.is-on) { background: repeating-linear-gradient(45deg, #e4e8ee 0 3px, #f8f9fb 3px 6px); }
.city-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.city-stats > div { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; border-radius: 12px; background: #fff; }
.city-stats b { font-size: 18px; font-weight: 400; color: #363f51; }
.city-stats span { font-size: 11px; font-weight: 300; color: #6b7a99; }
.city-btn--wide { width: 100%; justify-content: center; padding: 10px 12px; font-size: 13px; margin-bottom: 8px; }
.city-btn--gold { background: linear-gradient(180deg, #fde68a, #f59e0b); color: #78350f; }
.city-btn--go { background: #10b981; }

/* Worlds */
.city-panel__lead--gap { margin-top: 14px; }
.city-world.is-here { box-shadow: inset 0 0 0 2px #363f51; }
.city-worlds { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.city-world-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px #e4e8ee; text-align: center; }
.city-world-card .city-btn { margin-top: auto; padding: 4px 8px; font-size: 11px; }
.city-world-card .city-theme__name { font-size: 13px; }
/* keep the vibe line to two short lines so a dozen worlds fit on a phone */
.city-world-card .city-theme__blurb { font-size: 10px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.city-world-card.is-locked .city-thumb img { filter: saturate(.35) opacity(.75); }
.city-theme--beach .city-thumb { background: linear-gradient(#e0f7ff, #fdf0c8); }
.city-theme--dojo .city-thumb { background: linear-gradient(#fbe9e7, #efe3d3); }
.city-theme--cyberpunk .city-thumb { background: linear-gradient(#1e1b4b, #312e81); }
.city-theme--ice .city-thumb { background: linear-gradient(#f0f9ff, #dbeafe); }
.city-theme--silk .city-thumb { background: linear-gradient(#fff4e6, #f6e0c2); }

/* Collection book: groups by world and a filter */
.city-book__title { flex: 1; }
.city-tabs--mini { margin: 0; padding: 2px; }
.city-tabs--mini button { padding: 3px 9px; font-size: 11px; }
.city-book__group + .city-book__group { margin-top: 10px; }
.city-book__sub { display: flex; justify-content: space-between; font-size: 11px; color: #6b7a99; font-weight: 300; margin: 0 2px 5px; }
.city-book__item { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--tier) 55%, transparent); }
.city-book__item.is-missing { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tier) 30%, transparent); }
.city-sub--gap { margin-top: 12px; }
.city-citizen { padding: 0; background: transparent; }

/* The city page: a taller stage */
.city-card--page .city-stage { height: min(560px, 62vh); }
@media (max-width: 480px) { .city-card--page { padding: 14px; } .city-card--page .city-stage { height: min(520px, 60vh); } }

/* Home card: a picture of the city and what is going on */
.city-home { display: flex; gap: 14px; align-items: stretch; padding: 14px; }
.city-home__pic { flex: 0 0 42%; max-width: 220px; aspect-ratio: 4 / 3; border: 0; padding: 0; border-radius: 14px; overflow: hidden; cursor: pointer; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 0%, #ffffff 0%, #d6ecff 55%, #bcdcf7 100%); }
.city-home__pic img { width: 100%; height: 100%; object-fit: cover; }
.city-home__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.city-home__text .city-title { margin: 0; font-size: 19px; }
.city-home__text .city-sub { margin: 0; }
.city-home__text .city-btn--wide { margin: auto 0 0; }
.city-home__build .city-progress__bar { margin: 4px 0 3px; }
.city-home--new { flex-direction: column; }

body.night-mode .city-mode, body.night-mode .city-sheet__x, body.night-mode .city-stats > div, body.night-mode .city-world-card { background: rgba(31, 41, 55, .92); color: #e5e7eb; }
body.night-mode .city-stats b, body.night-mode .city-home__text .city-progress__label { color: #e5e7eb; }
body.night-mode .city-banner--study { background: rgba(49, 46, 129, .9); color: #e0e7ff; }
body.night-mode .city-home__pic { background: radial-gradient(120% 90% at 50% 0%, #334155 0%, #1e293b 60%, #0f172a 100%); }
@media (prefers-reduced-motion: reduce) { .city-collect, .city-banner--anchor, .city-banner--gate { animation: none; } }

/* Founding: a scrollable list of every world */
.city-found__list { display: flex; flex-direction: column; gap: 8px; max-height: min(460px, 56vh); overflow-y: auto; padding: 2px; margin-bottom: 12px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.city-found__item { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; border-radius: 16px; border: 0; background: #f8f9fb; font: inherit; text-align: left; cursor: pointer; box-shadow: inset 0 0 0 1px #e4e8ee; transition: box-shadow .15s, background .15s; }
.city-found__item.is-on { background: #fff; box-shadow: inset 0 0 0 2px #363f51, 0 4px 14px rgba(54, 63, 81, .08); }
.city-found__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.city-found__text .city-theme__blurb { text-align: left; }
.city-found__tick { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #363f51; color: #fff; }
.city-found__item:not(.is-on) .city-found__tick { background: transparent; box-shadow: inset 0 0 0 1.5px #d5dbe5; }
.city-found__go { margin: 0; }
.city-theme--singapore .city-thumb { background: linear-gradient(#e6fffa, #def7e6); }
.city-theme--rome .city-thumb { background: linear-gradient(#fff7ed, #f5e6cf); }
.city-theme--cairo .city-thumb { background: linear-gradient(#fff4dc, #efd9a8); }
.city-theme--dubai .city-thumb { background: linear-gradient(#e6f4fb, #f1dfb6); }
.city-theme--sydney .city-thumb { background: linear-gradient(#dff1fb, #bfe0ee); }
.city-theme--shanghai .city-thumb { background: linear-gradient(#2b2550, #5a3a6e); }
body.night-mode .city-found__item { background: #111827; box-shadow: inset 0 0 0 1px #374151; }
body.night-mode .city-found__item.is-on { background: #1f2937; box-shadow: inset 0 0 0 2px #cbd5e1; }

/* Someone waiting at the gate: a tappable banner */
.city-banner--gate { border: 0; font: inherit; font-size: 12px; cursor: pointer; pointer-events: auto; background: #dcfce7; color: #166534; animation: cityGate 2.2s ease-in-out infinite; }
@keyframes cityGate { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }

/* Workers in a building */
.city-work { margin-top: 4px; padding: 10px; border-radius: 12px; background: #fff; }
.city-work__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: #6b7a99; font-weight: 300; margin-bottom: 8px; }
.city-btn--sm { padding: 5px 10px; font-size: 11px; }
.city-work__slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.city-work__slot { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; border: 0; background: #f8f9fb; font: inherit; font-size: 12px; color: #363f51; cursor: pointer; min-width: 0; }
.city-work__slot span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-work__slot i { font-style: normal; font-size: 10px; color: #6b7a99; font-weight: 300; }
.city-work__slot:not(.is-filled) { box-shadow: inset 0 0 0 1.5px #d5dbe5; background: transparent; }
.city-work__slot.is-on { box-shadow: inset 0 0 0 2px #363f51; }
.city-work__plus { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #f1f4f8; color: #6b7a99; }
.city-work__pick { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-height: 240px; overflow-y: auto; }
.city-work__person { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; border: 0; background: #f8f9fb; font: inherit; text-align: left; cursor: pointer; }
.city-work__who { display: flex; flex-direction: column; min-width: 0; }
.city-work__who b { font-weight: 400; font-size: 13px; color: #363f51; }
.city-work__who i { font-style: normal; font-size: 11px; color: #6b7a99; font-weight: 300; }
.city-treat__icon--box { background: #ede9fe; color: #6d28d9; }
body.night-mode .city-work, body.night-mode .city-work__person { background: #1f2937; }
body.night-mode .city-work__slot { background: #111827; color: #e5e7eb; }
body.night-mode .city-work__who b { color: #e5e7eb; }

/* Founding: a first look at the starting world */
.city-found__hero { display: flex; justify-content: center; margin: 4px 0 16px; }
.city-found__hero .city-thumb { border-radius: 24px; background: linear-gradient(180deg, #e0f2fe, #ecfdf5); }

/* --- polish pass: calmer head, quieter HUD, bigger touch targets, night mode --- */
/* head: title + actions on one line, stats chips on their own full-width row */
.city-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; row-gap: 8px; margin-bottom: 14px; }
.city-head__main { display: contents; }
.city-head .city-title { grid-column: 1; grid-row: 1; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #334155; }
.city-head .city-chips { grid-column: 1 / -1; grid-row: 2; }
.city-head__side { grid-column: 2; grid-row: 1; }
.city-chip { height: 24px; padding: 0 10px; gap: 4px; }
.city-chip--th { background: #334155; }
.city-box-btn { padding: 4px; border-radius: 14px; }

.city-collect { height: 36px; padding: 0 14px; }

/* HUD over the 3D view: compact, never more than two banners */
.city-hud { max-width: min(260px, calc(100% - 150px)); }
.city-progress { padding: 8px 11px; }
.city-progress__label { font-size: 12.5px; line-height: 1.3; }
.city-progress__sub { line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.city-banner { max-width: 100%; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; padding: 5px 10px; font-size: 11.5px; }
.city-banner svg { flex: none; }
.city-hud > .city-banner ~ .city-banner ~ .city-banner { display: none; }
@media (max-width: 480px) {
    .city-hud { max-width: calc(100% - 140px); }
    .city-progress__alt { display: none; }
    .city-hud:has(.city-banner) .city-progress__bonus { display: none; }
}

/* toolbar: soft accent for the open tool, same language as the main nav */
.city-tools { gap: 6px; }
.city-tool { min-height: 52px; justify-content: center; border-radius: 14px; }
.city-tool.is-on { background: #e8eefa; color: #4a69b5; box-shadow: inset 0 0 0 1px #d3def5; }
.city-tool__badge { top: 4px; box-shadow: 0 0 0 2px #fff; }

/* buttons: consistent radius, comfortable touch targets */
.city-btn { min-height: 32px; border-radius: 12px; justify-content: center; background: #334155; }
.city-btn--sm { min-height: 30px; padding: 0 12px; font-size: 12px; }
.city-btn--wide { min-height: 42px; border-radius: 14px; }
.city-btn--gold { background: linear-gradient(180deg, #fde68a, #f59e0b); }
.city-btn--go { background: #10b981; }
.city-btn--ghost { background: #fff; }
.city-panel { padding: 14px; border-radius: 16px; }
.city-row { padding: 10px; border-radius: 14px; }

/* worlds grid: readable names, full-width unlock button */
.city-worlds { gap: 8px; }
.city-world-card { padding: 10px 6px 8px; gap: 3px; }
.city-world-card .city-btn { align-self: stretch; margin: auto 4px 0; min-height: 28px; padding: 0 8px; font-size: 11px; }
.city-world-card .city-theme__blurb { font-size: 10.5px; color: #64748b; }
.city-world.is-here { box-shadow: inset 0 0 0 2px #6B8DD6; }

/* building sheet */
.city-sheet__name { font-size: 17px; color: #334155; }
.city-sheet__x { width: 36px; height: 36px; box-shadow: 0 1px 4px rgba(54, 63, 81, .08); }
.city-stats > div { padding: 10px 4px; border-radius: 14px; }
.city-work { padding: 12px; border-radius: 14px; }
.city-work__slot { min-height: 88px; justify-content: center; border-radius: 14px; }

/* build mode legend sits clear of the bar */
.city-edithint { bottom: 70px; }

/* home card */
.city-home__pic { border-radius: 16px; box-shadow: inset 0 0 0 1px rgba(54, 63, 81, .06); }

/* night mode: fill the gaps */
body.night-mode .city-head .city-title, body.night-mode .city-sheet__name, body.night-mode .city-theme__name, body.night-mode .city-work__slot { color: #e5e7eb; }
body.night-mode .city-sub, body.night-mode .city-row__sub, body.night-mode .city-progress__sub, body.night-mode .city-panel__lead, body.night-mode .city-stats span, body.night-mode .city-theme__blurb, body.night-mode .city-work__head, body.night-mode .city-book__sub, body.night-mode .city-need { color: #94a3b8; }
body.night-mode .city-chip--th { background: #cbd5e1; color: #0f172a; }
body.night-mode .city-btn { background: #6B8DD6; color: #fff; }
body.night-mode .city-btn:disabled { background: #1f2937; color: #64748b; }
body.night-mode .city-btn--gold { background: linear-gradient(180deg, #fde68a, #f59e0b); color: #78350f; }
body.night-mode .city-btn--go { background: #059669; }
body.night-mode .city-btn--ghost { background: #1f2937; color: #e5e7eb; box-shadow: inset 0 0 0 1px #374151; }
body.night-mode .city-tool.is-on { background: rgba(107, 141, 214, .22); color: #c7d4f2; box-shadow: inset 0 0 0 1px rgba(107, 141, 214, .4); }
body.night-mode .city-tool__badge { box-shadow: 0 0 0 2px #111827; }
body.night-mode .city-mode button { color: #94a3b8; }
body.night-mode .city-mode button.is-on { background: #e5e7eb; color: #0f172a; }
body.night-mode .city-stage.is-edit .city-mode button.is-on { background: #10b981; color: #fff; }
body.night-mode .city-banner--gate { background: rgba(6, 78, 59, .92); color: #bbf7d0; }
body.night-mode .city-work__slot:not(.is-filled) { background: transparent; box-shadow: inset 0 0 0 1.5px #374151; }
body.night-mode .city-work__plus, body.night-mode .city-pip:not(.is-on) { background: #374151; color: #cbd5e1; }
body.night-mode .city-progress__bar, body.night-mode .city-need__bar, body.night-mode .city-quest__bar { background: #374151; }
body.night-mode .city-world.is-here, body.night-mode .city-theme.is-on { box-shadow: inset 0 0 0 2px #6B8DD6; }
body.night-mode .city-sheet__x { box-shadow: none; }
body.night-mode .city-toast { background: rgba(229, 231, 235, .95); color: #0f172a; }
body.night-mode .city-found__tick { background: #6B8DD6; }
/* gate banner: a soft glow instead of a bounce (calmer, and stays put under a finger) */
.city-banner--gate { animation: cityGateGlow 2.4s ease-in-out infinite; }
@keyframes cityGateGlow { 0%, 100% { box-shadow: 0 2px 10px rgba(54, 63, 81, .08); } 50% { box-shadow: 0 0 0 3px rgba(34, 197, 94, .25), 0 2px 10px rgba(54, 63, 81, .08); } }

/* --- v3: calm view and easier editing --- */
/* progress: one compact pill (normal view and fullscreen); tap it for the details */
.city-hud { max-width: min(250px, calc(100% - 150px)); gap: 6px; }
.city-progress { display: block; padding: 6px 12px; border-radius: 14px; box-sizing: border-box; pointer-events: auto; cursor: pointer; box-shadow: 0 1px 8px rgba(54, 63, 81, .07); -webkit-tap-highlight-color: transparent; }
.city-progress:focus-visible { outline: 2px solid #6B8DD6; outline-offset: 2px; }
.city-progress__row { display: flex; align-items: center; gap: 8px; min-height: 20px; }
.city-progress__label { flex: 0 1 auto; min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-progress__row .city-progress__bar { flex: 0 0 36px; height: 5px; margin: 0; }
.city-progress__pct { display: inline; flex: none; font-size: 11px; color: #6b7a99; }
.city-progress__more-ic { flex: none; width: 14px; text-align: center; font-size: 13px; line-height: 1; color: #94a3b8; }
.city-progress__more { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(54, 63, 81, .06); animation: cityPanel .2s ease-out; }
.city-progress__more .city-progress__sub { display: block; white-space: normal; }
.city-progress__note { display: flex !important; align-items: center; gap: 4px; }
.city-card.is-full .city-progress__sub { display: none; }
.city-card.is-full .city-progress__more .city-progress__sub { display: block; }
.city-banner { box-shadow: 0 1px 8px rgba(54, 63, 81, .06); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.city-hud.is-open .city-banner { display: none; }
body.night-mode .city-progress__more { border-top-color: rgba(255, 255, 255, .08); }

/* zoom and turn: only while you handle the stage, then they fade away */
.city-zoom, .city-rot { opacity: 0; pointer-events: none; transition: opacity .5s ease; box-shadow: 0 1px 8px rgba(54, 63, 81, .08); }
.city-stage.show-ctrls .city-zoom, .city-stage.show-ctrls .city-rot, .city-zoom:focus-within, .city-rot:focus-visible { opacity: 1; pointer-events: auto; transition-duration: .2s; }
.city-zoom button + button { border-top-color: #eef1f5; }
.city-mode, .city-full { box-shadow: 0 1px 8px rgba(54, 63, 81, .08); }
.city-full { border: 0; }

/* build mode: only the edit card on a softly ringed stage */
.city-stage.is-edit { box-shadow: inset 0 0 0 2px rgba(52, 211, 153, .55); }
.city-card.is-full .city-stage.is-edit { box-shadow: inset 0 0 0 3px rgba(52, 211, 153, .55); }
.city-card.is-full.is-editing .city-head { opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.city-editcard { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); width: min(340px, calc(100% - 28px)); box-sizing: border-box; padding: 14px 14px 12px; border-radius: 14px;
    background: rgba(255, 255, 255, .95); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 6px 24px rgba(54, 63, 81, .10); animation: cityEditIn .28s ease-out; z-index: 3; }
@keyframes cityEditIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.city-card.is-full .city-editcard { bottom: calc(env(safe-area-inset-bottom) + 18px); }
/* a piece in hand: the card fades and lets the drop through, so the bottom corners are reachable */
.city-editcard { transition: opacity .18s ease; }
.city-stage.is-holding .city-editcard { opacity: .12; pointer-events: none; }
.city-stage.is-holding .city-editbar, .city-stage.is-holding .city-mode, .city-stage.is-holding .city-zoom, .city-stage.is-holding .city-rot { opacity: .25; pointer-events: none; transition: opacity .18s ease; }
.city-editcard__head { display: flex; align-items: baseline; justify-content: center; gap: 8px; min-width: 0; padding: 0 4px; }
.city-editcard__name { min-width: 0; font-size: 15px; font-weight: 400; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-editcard__sub { flex: none; font-size: 12px; font-weight: 300; color: #6b7a99; }
.city-editcard__tip { margin: 6px 0 0; text-align: center; font-size: 12px; font-weight: 300; color: #6b7a99; }
.city-editcard__name-form { display: flex; gap: 6px; margin: 8px 0 0; }
.city-editcard__name-input { flex: 1; min-width: 0; padding: 7px 10px; border-radius: 10px; border: 1px solid #d5dbe6; background: #fff; color: #363f51; font: inherit; font-size: 16px; }
body.night-mode .city-editcard__name-input { background: #1e2533; border-color: #3a4457; color: #e2e8f0; }
.city-editcard__acts { display: flex; gap: 10px; margin-top: 12px; }
.city-editcard__btn { flex: 1; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; border-radius: 12px; background: #f3f5f8; color: #475569; font: inherit; font-size: 12px; cursor: pointer; transition: transform .12s ease, background .2s ease; -webkit-tap-highlight-color: transparent; }
.city-editcard__btn:active { transform: scale(.96); }
.city-editcard__btn:disabled { opacity: .4; cursor: default; }
.city-editcard__done, .city-editcard__place { background: #10b981; color: #fff; }
.city-editcard__nudge { display: flex; gap: 8px; margin-top: 10px; }
.city-editcard__arrow { flex: 1; min-height: 44px; display: flex; align-items: center; justify-content: center; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; color: #475569; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .12s ease; }
.city-editcard__arrow:active { transform: scale(.94); background: #f3f5f8; }
body.night-mode .city-editcard__arrow { background: #111827; border-color: #374151; color: #e5e7eb; }
body.night-mode .city-editcard { background: rgba(17, 24, 39, .92); box-shadow: 0 6px 24px rgba(0, 0, 0, .3); }
body.night-mode .city-editcard__name { color: #e5e7eb; }
body.night-mode .city-editcard__sub, body.night-mode .city-editcard__tip { color: #94a3b8; }
body.night-mode .city-editcard__btn { background: #1f2937; color: #e5e7eb; }
body.night-mode .city-editcard__done, body.night-mode .city-editcard__place { background: #059669; color: #fff; }
.city-stage.is-edit .city-toast { bottom: auto; top: calc(env(safe-area-inset-top) + 14px); }

/* building sheet: one clear action, the rest quiet */
.city-sheet { padding: 16px; border-radius: 14px; }
.city-sheet__head { margin-bottom: 14px; }
.city-sheet__x { box-shadow: none; background: rgba(54, 63, 81, .05); }
.city-sheet__primary { margin-bottom: 12px; }
.city-sheet__step { margin: 0 0 8px; text-align: center; font-size: 13px; font-weight: 300; color: #475569; }
.city-sheet .city-sheet__go { min-height: 48px; margin-bottom: 12px; border-radius: 12px; font-size: 14px; box-shadow: none; }
.city-sheet__primary .city-sheet__go, .city-sheet__primary .city-sheet__why { margin-bottom: 0; }
.city-sheet .city-stats { gap: 8px; margin-bottom: 12px; }
.city-sheet .city-stats > div { border-radius: 12px; background: rgba(255, 255, 255, .7); }
.city-sheet .city-stats b { font-size: 16px; }
.city-sheet__quiet { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.city-quiet-btn { flex: 1 1 auto; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; box-shadow: inset 0 0 0 1px rgba(54, 63, 81, .08); color: #475569; font: inherit; font-size: 12px; cursor: pointer; }
.city-quiet-btn:disabled { color: #94a3b8; cursor: default; }
.city-sheet__note { margin: 0 0 12px; text-align: center; }
body.night-mode .city-sheet__step { color: #cbd5e1; }
body.night-mode .city-sheet .city-stats > div { background: rgba(31, 41, 55, .7); }
body.night-mode .city-quiet-btn { color: #cbd5e1; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
body.night-mode .city-sheet__x { background: rgba(255, 255, 255, .06); }
@media (prefers-reduced-motion: reduce) { .city-editcard, .city-progress__more { animation: none; } .city-zoom, .city-rot { transition: none; } }

/* --- coins on builds, gems, more land, the spend pill ------------------------------------- */
.city-cost { gap: 6px; }
.city-cost__coin, .city-cost__hours { display: inline-flex; align-items: center; gap: 2px; }
.city-cost__coin { color: #fde68a; font-weight: 500; }
.city-cost__hours { opacity: .85; }
.city-btn:disabled .city-cost__coin, .city-quiet-btn .city-cost__coin { color: inherit; }
.city-btn.is-short:disabled, .city-sheet__go.is-short:disabled { background: #fef2f2; color: #b91c1c; box-shadow: inset 0 0 0 1px #fecaca; }
.city-btn.is-short .city-cost__coin { color: #b91c1c; }
.city-shop__item.is-short .city-shop__price { color: #b91c1c; }
.city-chip--gem { color: #6d28d9; background: #ede9fe; }
.city-gem { color: #7c3aed; }
.city-panel__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.city-panel__top .city-panel__lead { flex: 1; }
.city-land-btn { flex: none; display: inline-flex; align-items: center; gap: 3px; border: 0; border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 11px; cursor: pointer;
    background: linear-gradient(180deg, #ecfdf5, #d1fae5); color: #065f46; box-shadow: inset 0 0 0 1px #a7f3d0; }
.city-land-btn.is-off { background: #f1f5f9; color: #64748b; box-shadow: inset 0 0 0 1px #e2e8f0; cursor: default; }
.city-land-ic { flex: none; width: 72px; height: 72px; border-radius: 18px; display: grid; place-items: center; color: #059669; background: radial-gradient(circle at 50% 40%, #d1fae5, #ecfdf5 70%); }
.city-row--land { background: linear-gradient(90deg, #f0fdf4, transparent); border-radius: 14px; }
.city-spend { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; gap: 3px; margin-top: 2px; border: 0; border-radius: 999px; padding: 4px 10px;
    background: #fffbeb; color: #92400e; box-shadow: inset 0 0 0 1px #fde68a; font: inherit; font-size: 11px; cursor: pointer; animation: citySpendIn .5s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes citySpendIn { from { opacity: 0; transform: translateY(-4px) scale(.9); } }
.city-help { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center; background: #f1f5f9; color: #64748b; cursor: pointer; }
.city-gemshop { margin-top: 14px; padding: 10px; border-radius: 16px; background: linear-gradient(180deg, #f5f3ff, #faf5ff); }
.city-gemshop__head { display: flex; align-items: center; gap: 4px; font-size: 12px; color: #6d28d9; margin-bottom: 8px; }
.city-gemshop__head span { margin-left: auto; font-weight: 300; color: #7c3aed; }
.city-gemshop__row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.city-gemshop__item { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; border-radius: 12px; padding: 6px 2px; background: #fff; box-shadow: 0 1px 2px #6d28d91a; font: inherit; font-size: 11px; cursor: pointer; }
.city-gemshop__item:disabled { opacity: .55; cursor: default; }
.city-gemshop__ic { width: 48px; height: 48px; display: grid; place-items: center; color: #7c3aed; }
body.night-mode .city-chip--gem { background: #2e1065; color: #ddd6fe; }
body.night-mode .city-spend { background: #422006; color: #fde68a; box-shadow: none; }
body.night-mode .city-help { background: #1f2937; color: #94a3b8; }
body.night-mode .city-gemshop { background: #1e1b4b; }
body.night-mode .city-gemshop__item { background: #111827; color: #e5e7eb; }
body.night-mode .city-land-btn { background: #064e3b; color: #a7f3d0; box-shadow: none; }
body.night-mode .city-row--land { background: linear-gradient(90deg, #052e1f, transparent); }
body.night-mode .city-btn.is-short:disabled { background: #450a0a; color: #fecaca; box-shadow: none; }

/* --- the mystery box overlay -------------------------------------------------------------- */
.city-ob { position: fixed; inset: 0; z-index: 9000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
    background: rgba(15, 23, 42, .78); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff; font-family: inherit; overflow: hidden; animation: cityObIn .3s ease both; -webkit-user-select: none; user-select: none; }
@keyframes cityObIn { from { opacity: 0; } }
.city-ob__glow { position: absolute; left: 50%; top: 44%; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle, color-mix(in srgb, var(--glow) 55%, transparent) 0%, color-mix(in srgb, var(--glow) 18%, transparent) 38%, transparent 68%);
    transition: background .35s ease; animation: cityObBreathe 3s ease-in-out infinite; }
@keyframes cityObBreathe { 50% { transform: scale(1.06); } }
.city-ob__rays { position: absolute; left: 50%; top: 44%; width: 760px; height: 760px; margin: -380px 0 0 -380px; pointer-events: none; opacity: .5; border-radius: 50%;
    background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--glow) 40%, transparent) 0 9deg, transparent 9deg 24deg);
    -webkit-mask: radial-gradient(circle, #000 0 18%, transparent 62%); mask: radial-gradient(circle, #000 0 18%, transparent 62%);
    animation: cityObRays 9s linear infinite, cityObRaysIn .5s ease-out both; }
@keyframes cityObRays { to { transform: rotate(360deg); } }
@keyframes cityObRaysIn { from { opacity: 0; transform: scale(.4); } }
.city-ob__stage { position: relative; width: 220px; height: 220px; display: grid; place-items: center; }
.city-ob__box { position: relative; width: 150px; height: 150px; border: 0; padding: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.city-ob__box:focus-visible { outline: 3px solid #fff8; outline-offset: 8px; border-radius: 30px; }
.city-ob__wob { position: absolute; inset: 0; display: block; transform-origin: 50% 100%; animation: cityObIdle 2.2s ease-in-out infinite; }
.city-ob__wob.is-bump { animation: cityObSquash .42s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes cityObIdle { 50% { transform: translateY(-5px) rotate(-1.5deg); } }
/* each tap shakes the box a little harder (--k: taps so far / taps needed) */
.city-ob__shake { position: absolute; inset: 0; display: block; transform-origin: 50% 100%; }
.city-ob__wob.is-bump .city-ob__shake { animation: cityObShake .36s ease-out; }
@keyframes cityObShake { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(calc(var(--k, 0) * -9deg)); } 45% { transform: rotate(calc(var(--k, 0) * 8deg)); } 70% { transform: rotate(calc(var(--k, 0) * -4deg)); } }
/* left alone: a bigger wiggle and the hint breathes */
.city-ob.is-idle .city-ob__wob { animation: cityObNudge 1.1s ease-in-out infinite; }
@keyframes cityObNudge { 0%, 60%, 100% { transform: rotate(0); } 68% { transform: rotate(-7deg) scale(1.05); } 80% { transform: rotate(6deg) scale(1.05); } 90% { transform: rotate(-3deg); } }
.city-ob.is-idle .city-ob__hint { animation: cityObHint 1.1s ease-in-out infinite; }
@keyframes cityObHint { 50% { transform: scale(1.08); opacity: 1; } }
.city-ob.is-idle .city-ob__hint, .city-ob.is-charge .city-ob__hint { opacity: .8; }
/* light leaking from under the lid, brighter with every tap */
.city-ob__seam { position: absolute; left: 14px; right: 14px; top: 60px; height: 6px; z-index: 1; border-radius: 3px; pointer-events: none; background: #fff;
    opacity: calc(var(--k, 0) * .9); box-shadow: 0 0 10px 3px #fff, 0 0 26px 10px var(--glow); transition: opacity .25s ease; }
/* epic and up: the box rattles and the light swells before it bursts */
.city-ob.is-charge .city-ob__wob { animation: cityObRattle .085s linear infinite; }
@keyframes cityObRattle { 0% { transform: translate(-3px, 0) rotate(-3deg); } 25% { transform: translate(3px, -2px) rotate(3deg); } 50% { transform: translate(-3px, 1px) rotate(-2deg); } 75% { transform: translate(3px, -1px) rotate(2.5deg); } 100% { transform: translate(-3px, 0) rotate(-3deg); } }
.city-ob.is-charge .city-ob__seam { opacity: 1; box-shadow: 0 0 18px 8px #fff, 0 0 60px 26px var(--glow); animation: cityObSeam .3s ease-in-out infinite alternate; }
@keyframes cityObSeam { from { transform: scale(.9, .7); opacity: .7; } to { transform: scale(1.15, 1.3); opacity: 1; } }
.city-ob.is-charge .city-ob__glow { animation: cityObCharge .5s ease-in-out infinite alternate; }
@keyframes cityObCharge { to { transform: scale(1.35); opacity: 1.2; } }
.city-ob.is-charge .city-ob__hint { color: #fff; animation: cityObHint .5s ease-in-out infinite; }
@keyframes cityObSquash { 0% { transform: scale(1, 1); } 22% { transform: scale(1.16, .8); } 50% { transform: scale(.92, 1.12) translateY(-12px); } 75% { transform: scale(1.04, .96); } 100% { transform: scale(1); } }
.city-ob__body { position: absolute; left: 14px; right: 14px; bottom: 6px; height: 88px; border-radius: 22px 22px 26px 26px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--glow) 35%, #fff) 0%, color-mix(in srgb, var(--glow) 60%, #fff) 100%);
    box-shadow: inset 0 -8px 0 color-mix(in srgb, var(--glow) 30%, #0002), 0 14px 26px -10px #0007; transition: background .3s ease; }
.city-ob__lid { position: absolute; left: 6px; right: 6px; top: 34px; height: 30px; z-index: 2; border-radius: 16px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--glow) 25%, #fff), color-mix(in srgb, var(--glow) 50%, #fff));
    box-shadow: inset 0 -5px 0 color-mix(in srgb, var(--glow) 25%, #0002); transition: background .3s ease; }
.city-ob__ribbon { position: absolute; left: 50%; top: 0; bottom: 0; width: 18px; margin-left: -9px; background: #fff; opacity: .85; border-radius: 4px; }
.city-ob__lid::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 18px; margin-left: -9px; background: #fff; opacity: .9; border-radius: 4px; }
.city-ob__bow { position: absolute; left: 50%; top: -18px; width: 44px; height: 22px; margin-left: -22px; }
.city-ob__bow::before, .city-ob__bow::after { content: ''; position: absolute; top: 0; width: 22px; height: 20px; border-radius: 50% 50% 40% 40%; background: #fff; box-shadow: inset 0 -3px 0 #0001; }
.city-ob__bow::before { left: 0; transform: rotate(-18deg); }
.city-ob__bow::after { right: 0; transform: rotate(18deg); }
.city-ob__face { position: absolute; left: 0; right: 0; top: 40px; height: 20px; }
.city-ob__face i { position: absolute; top: 0; width: 8px; height: 9px; border-radius: 50%; background: #1e293b; }
.city-ob__face i:first-child { left: 26%; }
.city-ob__face i:nth-child(2) { right: 26%; }
.city-ob__face b { position: absolute; left: 50%; top: 8px; width: 12px; height: 6px; margin-left: -6px; border-radius: 0 0 8px 8px; background: #1e293b; }
.city-ob__face::before, .city-ob__face::after { content: ''; position: absolute; top: 9px; width: 12px; height: 6px; border-radius: 50%; background: #fb7185; opacity: .45; }
.city-ob__face::before { left: 17%; }
.city-ob__face::after { right: 17%; }
.city-ob.is-open .city-ob__lid { animation: cityObLid .6s cubic-bezier(.2,.6,.3,1) forwards; }
.city-ob.is-open .city-ob__wob { animation: cityObPop .55s ease forwards; }
.city-ob.is-open .city-ob__seam { opacity: 1; animation: cityObSeamOut .5s ease-out forwards; }
@keyframes cityObSeamOut { to { opacity: 0; transform: scaleX(2); } }
@keyframes cityObLid { 30% { transform: translate(10px, -70px) rotate(-14deg); opacity: 1; } to { transform: translate(70px, -220px) rotate(72deg); opacity: 0; } }
@keyframes cityObPop { 25% { transform: scale(1.18, .86); } 55% { transform: scale(.94, 1.08) translateY(-8px); } 100% { transform: scale(.6) translateY(24px); opacity: 0; } }
/* a column of light up out of the box as the lid goes */
.city-ob__beam { position: absolute; left: 50%; bottom: 60px; width: 120px; height: 300px; margin-left: -60px; pointer-events: none; transform-origin: 50% 100%; border-radius: 60px 60px 0 0;
    background: linear-gradient(0deg, color-mix(in srgb, var(--glow) 70%, #fff) 0%, color-mix(in srgb, var(--glow) 35%, #fff0) 55%, transparent 100%);
    animation: cityObBeam .7s cubic-bezier(.2,.8,.3,1) forwards; }
@keyframes cityObBeam { 0% { transform: scale(.2, 0); opacity: 0; } 35% { opacity: 1; } 100% { transform: scale(1.4, 1.2); opacity: 0; } }
/* the shockwave ring */
.city-ob__ring { position: absolute; left: 50%; top: 44%; width: 160px; height: 160px; margin: -80px 0 0 -80px; pointer-events: none; border-radius: 50%;
    border: 3px solid #fff; box-shadow: 0 0 24px 4px var(--glow), inset 0 0 24px 4px var(--glow); animation: cityObRing .8s cubic-bezier(.1,.7,.2,1) forwards; }
.city-ob.is-rank3 .city-ob__ring, .city-ob.is-rank4 .city-ob__ring { animation-duration: 1.05s; border-width: 4px; }
@keyframes cityObRing { 0% { transform: scale(.25); opacity: 1; } 100% { transform: scale(3.2); opacity: 0; } }
/* confetti thrown up out of the box, arcing out then falling */
.city-ob__confetti { position: absolute; left: 50%; top: 44%; width: 0; height: 0; pointer-events: none; z-index: 2; }
.city-ob__conf { position: absolute; left: -4px; top: -7px; width: 8px; height: 14px; border-radius: 2px; opacity: 0; animation: cityObConf 1.8s cubic-bezier(.2,.7,.4,1) forwards; }
.city-ob__conf.is-dot { width: 9px; height: 9px; border-radius: 50%; }
@keyframes cityObConf { 0% { transform: translate(0, 0) rotate(0) scale(.5); opacity: 1; } 12% { opacity: 1; transform: translate(calc(var(--dx) * .35), calc(var(--dy) * .55)) rotate(calc(var(--r) * .2)) scale(1.1); }
    55% { opacity: 1; transform: translate(var(--dx), var(--dy)) rotate(calc(var(--r) * .7)); } 100% { opacity: 0; transform: translate(calc(var(--dx) * 1.15), calc(var(--dy) + var(--fall))) rotate(var(--r)); } }
.city-ob__burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.city-ob__burst i { position: absolute; left: calc(var(--s) / -2); top: calc(var(--s) / -2); width: var(--s); height: var(--s); border-radius: 50%; background: var(--c);
    box-shadow: 0 0 8px var(--c); animation: cityObBurst .7s cubic-bezier(.2,.7,.3,1) forwards; }
.city-ob__burst i:nth-child(3n) { background: #fff; }
@keyframes cityObBurst { from { transform: rotate(var(--a)) translateX(20px) scale(1); opacity: 1; } to { transform: rotate(var(--a)) translateX(var(--d)) scale(.2); opacity: 0; } }
.city-ob__tier { position: absolute; top: -18px; left: 50%; z-index: 3; padding: 5px 14px; border-radius: 999px; white-space: nowrap; font-size: 14px; font-weight: 600; letter-spacing: .02em;
    background: #fff; color: var(--c); box-shadow: 0 6px 18px -6px var(--c); animation: cityObTier .9s cubic-bezier(.3,1.6,.5,1) both; transform: translateX(-50%); }
@keyframes cityObTier { 0% { opacity: 0; transform: translate(-50%, 14px) scale(.6); } 40% { opacity: 1; transform: translate(-50%, 0) scale(1.08); } 100% { opacity: 1; transform: translate(-50%, 0) scale(1); } }
.city-ob__dots { position: relative; display: flex; gap: 8px; }
.city-ob__dots span { width: 10px; height: 10px; border-radius: 50%; background: #ffffff38; transition: background .2s ease, transform .3s cubic-bezier(.3,1.6,.5,1); }
.city-ob__dots span.is-on { background: var(--c); transform: scale(1.25); box-shadow: 0 0 8px var(--c); }
.city-ob__hint { position: relative; margin: 0; font-size: 13px; font-weight: 300; color: #e2e8f0; }
.city-ob__reveal { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 380px; }
.city-ob__prize { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: cityObPrize .55s cubic-bezier(.3,1.5,.5,1) both; }
.city-ob__prize .city-thumb { border-radius: 28px; background: radial-gradient(circle at 50% 45%, #fff, color-mix(in srgb, var(--glow) 30%, #fff)); box-shadow: 0 16px 34px -14px var(--glow); }
@keyframes cityObPrize { 0% { opacity: 0; transform: scale(.3) translateY(70px); } 60% { opacity: 1; transform: scale(1.08) translateY(-6px); } 100% { transform: none; } }
.city-ob__prize .city-thumb--prize, .city-ob__itemprize { animation: cityObFloat 3.2s ease-in-out .6s infinite; }
@keyframes cityObFloat { 50% { transform: translateY(-6px) rotate(-1.5deg); } }
.city-ob.is-rank3 .city-ob__prize .city-thumb, .city-ob.is-rank4 .city-ob__prize .city-thumb { box-shadow: 0 16px 34px -14px var(--glow), 0 0 0 4px #fff6, 0 0 40px 6px color-mix(in srgb, var(--glow) 50%, transparent); }
.city-ob__stars { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 2; }
.city-ob__star { position: absolute; left: calc(var(--w) / -2); top: calc(var(--w) / -2); width: var(--w); height: var(--w); transform: translate(var(--x), var(--y)) scale(0);
    background: #fff; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); filter: drop-shadow(0 0 4px var(--glow)); animation: cityObStar 1.4s ease-in-out infinite; }
@keyframes cityObStar { 0%, 100% { transform: translate(var(--x), var(--y)) scale(0) rotate(0); opacity: 0; } 50% { transform: translate(var(--x), var(--y)) scale(1) rotate(45deg); opacity: 1; } }
.city-ob__name { font-size: 20px; font-weight: 600; }
.city-ob__chip { padding: 3px 10px; border-radius: 999px; font-size: 11px; background: color-mix(in srgb, var(--c) 22%, #fff); color: color-mix(in srgb, var(--c) 80%, #000); }
.city-ob__cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; width: 100%; }
.city-ob__card { min-height: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 8px 3px; border-radius: 16px;
    background: #fff; color: #334155; box-shadow: 0 6px 14px -8px #0008, inset 0 -3px 0 #0000000d; text-align: center; font-size: 10px; animation: cityObCard .45s cubic-bezier(.3,1.6,.5,1) both; }
.city-ob__card b { font-size: 13px; font-weight: 600; line-height: 1.1; color: #1e293b; overflow-wrap: anywhere; }
.city-ob__card.is-decor b { font-size: 10px; }
.city-ob__card span:last-child { color: #64748b; font-weight: 300; }
.city-ob__card.is-wait { background: #ffffff1a; box-shadow: inset 0 0 0 1.5px #ffffff2a; animation: none; }
@keyframes cityObCard { 0% { opacity: 0; transform: perspective(300px) rotateY(90deg) scale(.7); } 60% { opacity: 1; transform: perspective(300px) rotateY(-8deg) scale(1.06); } 100% { transform: none; } }
.city-ob__card-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.city-ob__card-ic.is-coin { color: #b45309; background: #fef3c7; }
.city-ob__card-ic.is-gem { color: #7c3aed; background: #ede9fe; }
.city-ob__card-ic.is-boost { color: #0369a1; background: #e0f2fe; }
.city-ob__card.is-decor .city-thumb { border-radius: 12px; background: color-mix(in srgb, var(--tier, #3b82f6) 14%, #fff); }
.city-ob__card-tier { color: var(--tier) !important; font-weight: 500 !important; }
.city-ob__acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; opacity: 0; transform: translateY(8px); transition: opacity .3s ease, transform .3s ease; pointer-events: none; }
.city-ob__acts.is-on { opacity: 1; transform: none; pointer-events: auto; }
.city-ob__go, .city-ob__later, .city-ob__next { border: 0; border-radius: 999px; padding: 11px 22px; font: inherit; font-size: 14px; cursor: pointer; }
.city-ob__go { background: linear-gradient(180deg, #fde68a, #fbbf24); color: #78350f; font-weight: 600; box-shadow: 0 6px 16px -6px #f59e0b, inset 0 -3px 0 #d9770633; }
.city-ob__later { background: #ffffff22; color: #fff; }
.city-ob__next { background: #fff; color: #334155; }
.city-ob.is-calm *, .city-ob.is-calm { animation-duration: 0s !important; transition: none !important; }
.city-ob.is-calm .city-ob__rays, .city-ob.is-calm .city-ob__ring, .city-ob.is-calm .city-ob__confetti, .city-ob.is-calm .city-ob__beam, .city-ob.is-calm .city-ob__stars, .city-ob.is-calm .city-ob__seam { display: none; }
@media (prefers-reduced-motion: reduce) { .city-ob, .city-ob *, .city-coach, .city-coach *, .city-spend { animation: none !important; transition: none !important; } .city-ob__rays, .city-ob__ring, .city-ob__confetti, .city-ob__beam, .city-ob__stars, .city-ob__seam { display: none; } }

/* --- tutorial coach marks ------------------------------------------------------------------ */
.city-coach { position: fixed; inset: 0; z-index: 9100; }
.city-coach__hole { position: fixed; border-radius: 18px; box-shadow: 0 0 0 200vmax rgba(15, 23, 42, .58), 0 0 0 3px #ffffffcc, 0 0 24px 6px #fff6;
    transition: left .35s cubic-bezier(.3,1.2,.5,1), top .35s cubic-bezier(.3,1.2,.5,1), width .35s ease, height .35s ease; pointer-events: none; }
.city-coach__hole.is-none { left: 50%; top: 50%; width: 0; height: 0; box-shadow: 0 0 0 200vmax rgba(15, 23, 42, .58); }
.city-coach__bubble { position: fixed; width: min(320px, calc(100vw - 24px)); box-sizing: border-box; padding: 14px 16px 12px; border-radius: 22px; background: #fff; color: #334155;
    box-shadow: 0 18px 40px -14px #0008; animation: cityCoachIn .4s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes cityCoachIn { from { opacity: 0; transform: translateY(8px) scale(.94); } }
.city-coach__dots { display: flex; gap: 5px; margin-bottom: 8px; }
.city-coach__dots span { width: 6px; height: 6px; border-radius: 3px; background: #e2e8f0; transition: width .3s ease, background .3s ease; }
.city-coach__dots span.is-done { background: #c7d2fe; }
.city-coach__dots span.is-on { width: 18px; background: #6B8DD6; }
.city-coach__title { font-size: 15px; font-weight: 600; color: #1e293b; }
.city-coach__text { margin: 4px 0 0; font-size: 13px; font-weight: 300; line-height: 1.45; }
.city-coach__list { margin: 6px 0 0; padding: 0 0 0 16px; font-size: 12px; font-weight: 300; line-height: 1.45; }
.city-coach__acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.city-coach__skip, .city-coach__next, .city-coach__act { border: 0; border-radius: 999px; padding: 8px 16px; font: inherit; font-size: 13px; cursor: pointer; }
.city-coach__skip { background: transparent; color: #64748b; }
.city-coach__next { background: #6B8DD6; color: #fff; box-shadow: inset 0 -2px 0 #0000001a; }
body.night-mode .city-coach__bubble { background: #1f2937; color: #cbd5e1; }
body.night-mode .city-coach__title { color: #f1f5f9; }
.city-row__cost { display: inline-flex; align-items: center; gap: 2px; margin-top: 2px; font-size: 11px; color: #92400e; }
body.night-mode .city-row__cost { color: #fcd34d; }

/* --- one city: fullscreen build mode, upgrade costs, the bag, the market, boxes, previews ---- */
.city-card.is-full .city-stage.is-edit .city-editcard { bottom: calc(var(--dock) + 10px); }
.city-card.is-full .city-stage.is-edit .city-mode { z-index: 5; }

/* cost chips, Clash style: what it takes, the short ones in red */
.city-costs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 0 10px; }
.city-costchip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 999px; background: #f3f5f8; color: #334155; font-size: 12px; box-shadow: inset 0 0 0 1px #e4e8ee; }
.city-costchip b { font-weight: 500; }
.city-costchip.is-coins { color: #92400e; background: #fffbeb; box-shadow: inset 0 0 0 1px #fde68a; }
.city-costchip.is-gems { color: #6d28d9; background: #f5f3ff; box-shadow: inset 0 0 0 1px #ddd6fe; }
.city-costchip__name { font-weight: 300; }
.city-costchip.is-short { color: #b91c1c; background: #fef2f2; box-shadow: inset 0 0 0 1.5px #f87171; }
.city-costchip.is-short b { color: #dc2626; text-shadow: 0 1px 0 #fff; }
.city-costchip i { font-style: normal; font-size: 10px; font-weight: 500; padding: 0 5px; border-radius: 999px; background: #dc2626; color: #fff; }
.city-sheet__lock { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; border-radius: 12px; background: #f3f5f8; color: #64748b; font-size: 13px; font-weight: 300; }
.city-sheet__after { margin-top: -2px; }
.city-sheet__after .city-sheet__up { width: 100%; justify-content: center; }
.city-cost__gem { display: inline-flex; align-items: center; gap: 2px; color: #ddd6fe; }
body.night-mode .city-costchip { background: #1f2937; color: #e5e7eb; box-shadow: none; }
body.night-mode .city-costchip.is-short { background: #450a0a; color: #fecaca; box-shadow: inset 0 0 0 1.5px #b91c1c; }
body.night-mode .city-costchip.is-short b { text-shadow: none; color: #fca5a5; }
body.night-mode .city-sheet__lock { background: #1f2937; color: #94a3b8; }

/* the bag */
.city-bag__ic { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px; color: var(--tier, #475569); background: color-mix(in srgb, var(--tier, #94a3b8) 14%, #fff); }
.city-bag__item.is-none { opacity: .55; }
.city-bag__n { flex: none; min-width: 34px; text-align: right; font-size: 14px; font-weight: 500; color: #334155; }
.city-bag__card { cursor: default; padding-bottom: 8px; }
.city-bag__place { margin-top: 4px; }
body.night-mode .city-bag__n { color: #e5e7eb; }
body.night-mode .city-bag__ic { background: #1f2937; }

/* the market */
.city-market-closed { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 12px; border-radius: 14px; background: #f3f5f8; color: #64748b; font-size: 14px; text-align: center; }
.city-got { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 6px 8px 6px 6px; border-radius: 12px; background: #ecfdf5; color: #065f46; font-size: 13px; animation: cityEditIn .25s ease-out; }
.city-got span { flex: 1; min-width: 0; }
.city-mitem .city-row__count { margin-left: 6px; }
body.night-mode .city-market-closed { background: #1f2937; color: #94a3b8; }
body.night-mode .city-got { background: #064e3b; color: #d1fae5; }

/* worlds: your city, and the rest coming soon */
.city-soon { display: inline-block; margin-top: 3px; padding: 2px 8px; border-radius: 999px; background: #eef2ff; color: #6366f1; font-size: 10.5px; font-weight: 400; }
.city-live-pill { color: #059669; }
button.city-world-card { border: 0; font: inherit; color: inherit; cursor: pointer; transition: transform .12s ease; }
button.city-world-card:active { transform: scale(.97); }
body.night-mode .city-soon { background: #312e81; color: #c7d2fe; }

/* a coming-soon world's preview */
.city-preview { position: fixed; inset: 0; z-index: 90; background: linear-gradient(#ffffff, #cfe3f6); animation: cityEditIn .25s ease-out; }
body.night-mode .city-preview { background: linear-gradient(#1e293b, #0b1220); }
.city-preview__stage { position: absolute; inset: 0; touch-action: none; }
.city-preview__stage canvas { display: block; width: 100% !important; height: 100% !important; }
.city-preview__cap { position: absolute; left: 50%; top: calc(env(safe-area-inset-top) + 14px); transform: translateX(-50%); max-width: calc(100% - 120px); overflow: hidden; text-overflow: ellipsis; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .88); color: #334155; font-size: 15px; white-space: nowrap; pointer-events: none; box-shadow: 0 4px 16px rgba(54, 63, 81, .14); }
.city-preview__hint { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 14px); margin: 0; text-align: center; font-size: 14px; font-weight: 400; color: #475569; pointer-events: none; }
/* turn and zoom buttons (a drag turns too): a row above the hint */
.city-preview__ctrls { position: absolute; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 44px); transform: translateX(-50%); display: flex; gap: 8px; }
.city-preview__btn { min-width: 48px; height: 48px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .94); color: #334155; font: inherit; font-size: 16px; font-weight: 500; box-shadow: 0 4px 16px rgba(54, 63, 81, .18); cursor: pointer; touch-action: manipulation; }
.city-preview__btn--sq { padding: 0; width: 48px; }
.city-preview__btn:active { transform: scale(.95); }
body.night-mode .city-preview__btn { background: rgba(17, 24, 39, .9); color: #e5e7eb; }
.city-preview__wait { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; color: #64748b; pointer-events: none; }
.city-preview__x { position: absolute; right: max(12px, env(safe-area-inset-right)); top: calc(env(safe-area-inset-top) + 8px); width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(54, 63, 81, .88); color: #fff; cursor: pointer; }
/* previous / next world: round buttons at the middle of each side, with the neighbour's name under the arrow */
.city-preview__step { position: absolute; top: 50%; transform: translateY(-50%); width: 64px; min-height: 64px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 0; border-radius: 20px; background: rgba(255, 255, 255, .82); color: #334155; font: inherit; font-size: 11px; line-height: 1.15; box-shadow: 0 4px 16px rgba(54, 63, 81, .14); -webkit-tap-highlight-color: transparent; }
.city-preview__step span { max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-preview__step--prev { left: max(10px, env(safe-area-inset-left)); }
.city-preview__step--next { right: max(10px, env(safe-area-inset-right)); }
.city-preview__step:active { transform: translateY(-50%) scale(.94); }
body.night-mode .city-preview__step { background: rgba(17, 24, 39, .85); color: #e5e7eb; }
body.night-mode .city-preview__cap { background: rgba(17, 24, 39, .85); color: #e5e7eb; }
body.night-mode .city-preview__hint { color: #94a3b8; }

/* mystery boxes: the daily limit */
.city-box-btn.is-limit { animation: none; filter: saturate(.4); opacity: .8; }
.city-box-btn.is-limit { display: inline-flex; align-items: center; gap: 6px; padding-right: 10px; }
.city-box-btn__limit { max-width: 88px; font-size: 10.5px; line-height: 1.2; color: #64748b; text-align: left; white-space: normal; }
.city-card.is-full .city-box-btn__limit { display: none; }
body.night-mode .city-box-btn__limit { color: #94a3b8; }
.city-ob__limit { margin: 12px 0 0; text-align: center; font-size: 13px; color: #ffffffcc; }
.city-ob__itemprize { display: grid; place-items: center; width: 140px; height: 140px; margin: 0 auto; border-radius: 32px; color: var(--c, #6366f1); background: #fff; box-shadow: 0 0 40px color-mix(in srgb, var(--c, #6366f1) 50%, transparent); }
.city-ob__card-ic.is-item { color: #4338ca; background: #e0e7ff; }

/* training a citizen */
.city-train { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 10px 12px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px #e4e8ee; }
.city-train__lv { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #64748b; }
.city-train__lv i { width: 8px; height: 8px; border-radius: 50%; background: #e2e8f0; }
.city-train__lv i.is-on { background: #6B8DD6; }
.city-train__lv b { margin-left: 4px; font-weight: 400; }
body.night-mode .city-train { background: #111827; box-shadow: inset 0 0 0 1px #374151; }

/* first run: the welcome card */
.city-welcome { text-align: center; }
.city-welcome__title { font-size: 24px; margin: 6px 0 2px; }
.city-welcome__sub { margin: 0 0 16px; font-size: 15px; }
.city-welcome__form { display: flex; flex-direction: column; gap: 8px; max-width: 320px; margin: 0 auto; }
.city-welcome__label { font-size: 12px; color: #64748b; text-align: left; }
.city-welcome__input { height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid #e2e8f0; font: inherit; font-size: 15px; color: #334155; background: #f8fafc; }
.city-welcome__input:focus { outline: 2px solid #6B8DD6; outline-offset: 1px; }
.city-welcome__skip { border: 0; background: none; color: #6b7a99; font: inherit; font-size: 13px; padding: 6px; cursor: pointer; }
body.night-mode .city-welcome__input { background: #111827; border-color: #374151; color: #e5e7eb; }
.city-coach__act { background: #10b981; color: #fff; }

/* --- simple and fun: name opens the city card, one call to action, tabs that appear as you go --- */
.city-namebtn { grid-column: 1; grid-row: 1; display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; justify-self: start; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.city-namebtn .city-title { min-width: 0; }
.city-namebtn__ic { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #f1f5f9; color: #64748b; transition: transform .25s ease; }
.city-namebtn.is-open .city-namebtn__ic { transform: rotate(180deg); }
.city-info { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: -4px 0 14px; padding: 12px 14px; border-radius: 16px; background: #f8fafc; box-shadow: inset 0 0 0 1px #eef1f5; animation: cityPanel .2s ease-out; }
.city-info__next { margin: 0; font-size: 12.5px; font-weight: 300; color: #64748b; }
.city-info .city-help { width: auto; height: 30px; padding: 0 12px 0 9px; gap: 5px; display: inline-flex; align-items: center; border-radius: 999px; font: inherit; font-size: 12px; background: #fff; box-shadow: inset 0 0 0 1px #e4e8ee; }
.city-next { display: inline-flex; align-items: center; gap: 5px; height: 36px; max-width: 190px; padding: 0 13px; border: 0; border-radius: 999px; background: #ecfdf5; color: #065f46; font: inherit; font-size: 12.5px; font-weight: 400; cursor: pointer; box-shadow: inset 0 0 0 1px #bbf7d0; animation: citySpendIn .3s ease-out; }
.city-next > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-next__cost { flex: none; display: inline-flex; align-items: center; gap: 2px; padding: 1px 7px; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: 11px; }
.city-next:active, .city-collect:active { transform: scale(.96); }
.city-tool__new { position: absolute; top: 6px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: #f472b6; box-shadow: 0 0 0 2px #fff; animation: cityNewDot 1.8s ease-in-out infinite; }
@keyframes cityNewDot { 50% { transform: scale(1.25); } }
.city-card.is-full .city-tool__new { top: 2px; right: 2px; }
.city-chip--coin.is-bump { animation: cityCoinBump .28s ease-out; }
@keyframes cityCoinBump { 40% { transform: scale(1.14); } }
.city-flycoin { position: fixed; z-index: 10000; width: 18px; height: 18px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle at 35% 30%, #fff7cc 0 18%, #fcd34d 19% 60%, #f59e0b 61%); box-shadow: 0 1px 3px rgba(146, 64, 14, .35), inset 0 0 0 1.5px rgba(180, 83, 9, .4); }
.city-celebrate { position: absolute; left: 50%; bottom: 62px; z-index: 6; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 20px; background: rgba(255, 255, 255, .96); box-shadow: 0 6px 24px rgba(54, 63, 81, .18); max-width: calc(100% - 24px); pointer-events: none; animation: cityCelebrate .45s cubic-bezier(.2, 1.4, .4, 1); }
.city-celebrate__pic { flex: none; width: 52px; height: 52px; border-radius: 14px; overflow: hidden; background: linear-gradient(180deg, #e0f2fe, #ecfdf5); }
.city-celebrate__text { display: flex; flex-direction: column; min-width: 0; }
.city-celebrate__text b { font-weight: 500; font-size: 14px; color: #334155; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-celebrate__text span { font-size: 12px; font-weight: 300; color: #64748b; }
@keyframes cityCelebrate { from { opacity: 0; transform: translate(-50%, 14px) scale(.85); } }
.city-card.is-full .city-celebrate { bottom: calc(var(--dock) + 10px); }
.city-away { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 24px; background: rgba(15, 23, 42, .32); animation: cityObIn .25s ease-out; }
.city-away__card { width: min(320px, 100%); box-sizing: border-box; padding: 24px 22px 16px; border-radius: 24px; background: #fff; text-align: center; box-shadow: 0 18px 50px rgba(15, 23, 42, .22); animation: cityCelebrate .45s cubic-bezier(.2, 1.4, .4, 1); --x: 0; }
.city-away__coin { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #fef3c7; color: #b45309; margin-bottom: 8px; }
.city-away__title { margin: 0 0 4px; font-size: 22px; font-weight: 300; color: #334155; }
.city-away__text { margin: 0 0 16px; font-size: 14px; font-weight: 300; color: #64748b; line-height: 1.45; }
.city-away__text b { font-weight: 500; color: #92400e; }
.city-away__go { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.city-away__later { margin-top: 6px; border: 0; background: none; padding: 8px; font: inherit; font-size: 13px; font-weight: 300; color: #94a3b8; cursor: pointer; }
.city-daynight { position: absolute; right: 13px; bottom: 98px; width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .9); color: #64748b; box-shadow: 0 1px 8px rgba(54, 63, 81, .08); cursor: pointer;
    opacity: 0; pointer-events: none; transition: opacity .5s ease; }
.city-stage.show-ctrls .city-daynight, .city-daynight:focus-visible { opacity: 1; pointer-events: auto; transition-duration: .2s; }
.city-card.is-full .city-daynight { top: calc(var(--top) + 238px); bottom: auto; right: max(13px, calc(env(safe-area-inset-right) + 3px)); }
body.night-mode .city-namebtn__ic, body.night-mode .city-info .city-help { background: #1f2937; color: #94a3b8; box-shadow: none; }
body.night-mode .city-info { background: #111827; box-shadow: inset 0 0 0 1px #1f2937; }
body.night-mode .city-next { background: #052e16; color: #bbf7d0; box-shadow: none; }
body.night-mode .city-celebrate, body.night-mode .city-away__card, body.night-mode .city-daynight { background: rgba(17, 24, 39, .95); color: #e5e7eb; }
body.night-mode .city-celebrate__text b, body.night-mode .city-away__title { color: #e5e7eb; }
@media (prefers-reduced-motion: reduce) { .city-celebrate, .city-away, .city-away__card, .city-tool__new, .city-next { animation: none !important; } }
.city-view { position: absolute; right: 13px; bottom: 58px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .9); color: #64748b; box-shadow: 0 1px 8px rgba(54, 63, 81, .08); cursor: pointer; }
.city-view:active { transform: scale(.92); }
.city-card.is-full .city-view { top: calc(var(--top) + 196px); bottom: auto; right: max(13px, calc(env(safe-area-inset-right) + 3px)); }
body.night-mode .city-view { background: rgba(17, 24, 39, .95); color: #e5e7eb; }
/* how to earn coins, and the city centre upgrade */
button.city-chip--coin.is-open { box-shadow: inset 0 0 0 1.5px #f59e0b; }
.city-earn { gap: 6px; }
.city-earn__title { font-size: 14px; font-weight: 400; color: #334155; margin-bottom: 2px; }
.city-earn__row { display: flex; align-items: center; gap: 8px; width: 100%; }
.city-earn__ic { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fef3c7; color: #b45309; }
.city-earn__text { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 300; color: #475569; line-height: 1.35; }
.city-earn__go { flex: none; border: 0; border-radius: 999px; padding: 4px 10px; background: #fff; color: #334155; font: inherit; font-size: 11.5px; cursor: pointer; box-shadow: inset 0 0 0 1px #e4e8ee; }
.city-thup { display: flex; flex-direction: column; gap: 6px; }
.city-thup__go { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.city-thup__go.is-short { opacity: .7; cursor: default; }
.city-thup__costs { display: flex; gap: 10px; justify-content: center; font-size: 12.5px; color: #64748b; }
.city-thup__unlocks { margin: 0; text-align: center; font-size: 12px; font-weight: 300; color: #64748b; }
.city-thup__label { font-size: 13px; color: #334155; }
.city-thup__bar { width: 100%; }
.city-row--feature { background: linear-gradient(180deg, #fffbeb, #fef3c7); box-shadow: inset 0 0 0 1.5px #fcd34d; border-radius: 14px; }
body.night-mode .city-earn__title, body.night-mode .city-thup__label { color: #e5e7eb; }
body.night-mode .city-earn__text { color: #cbd5e1; }
body.night-mode .city-earn__ic { background: #422006; color: #fde68a; }
body.night-mode .city-earn__go { background: #1f2937; color: #e5e7eb; box-shadow: none; }
body.night-mode .city-row--feature { background: #2a2110; box-shadow: inset 0 0 0 1.5px #92400e; }
/* --- ui wave: home, collect all, gems help, study timer, cozy row, sandbox --- */
.city-head__main { min-width: 0; }
.city-homebtn { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; background: #f1f4f8; color: #475569; cursor: pointer; margin-right: 4px; }
.city-head:has(.city-homebtn) .city-head__main { display: flex; align-items: center; flex-wrap: wrap; column-gap: 6px; row-gap: 6px; }
.city-head:has(.city-homebtn) .city-head__main .city-chips { flex-basis: 100%; }
.city-homebtn:active { transform: scale(.94); }
.city-collect.is-hot { box-shadow: 0 0 0 0 rgba(245, 158, 11, .55); animation: cityCollectGlow 2s ease-out infinite; }
@keyframes cityCollectGlow { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .5); } 70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); } 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); } }
button.city-chip--gem { border: 0; font: inherit; font-size: 12px; cursor: pointer; }
button.city-chip--gem.is-open { box-shadow: inset 0 0 0 1.5px #8b5cf6; }
.city-earn--gem .city-earn__ic { background: #ede9fe; color: #6d28d9; }
.city-earn__soon { margin: 2px 0 0; font-size: 12px; font-weight: 300; color: #94a3b8; font-style: italic; }
.city-sandbox-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; background: #fee2e2; color: #b91c1c; font-size: 11px; font-weight: 500; letter-spacing: .02em; }
.city-cozyrow { display: flex; flex-wrap: wrap; gap: 6px; }
.city-cozybtn { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px; border: 0; border-radius: 999px; background: #fff; color: #334155; font: inherit; font-size: 12px; cursor: pointer; box-shadow: inset 0 0 0 1px #e4e8ee; }
.city-cozybtn--book { color: #1d4ed8; }
.city-sandbox-reset { color: #b91c1c; }
.city-stars { display: inline-flex; gap: 2px; }
.city-stars i { width: 11px; height: 11px; background: #e2d6bd; clip-path: polygon(50% 0, 62% 35%, 100% 38%, 70% 60%, 80% 100%, 50% 78%, 20% 100%, 30% 60%, 0 38%, 38% 35%); }
.city-stars i.is-on { background: #f5b301; }
.city-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 300; color: #475569; cursor: pointer; }
.city-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.city-switch__track { position: relative; flex: none; width: 34px; height: 20px; border-radius: 999px; background: #cbd5e1; transition: background .2s; }
.city-switch__track::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.city-switch input:checked + .city-switch__track { background: #f59e0b; }
.city-switch input:checked + .city-switch__track::after { transform: translateX(14px); }
.city-switch input:focus-visible + .city-switch__track { outline: 2px solid #3b82f6; outline-offset: 2px; }
/* the stage bar: study (or the running timer) and the camera, bottom left */
.city-stagebar { position: absolute; left: 10px; bottom: 10px; z-index: 2; display: flex; align-items: center; gap: 6px; }
.city-study { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 14px 0 12px; border: 0; border-radius: 999px; background: #363f51; color: #fff; font: inherit; font-size: 13px; cursor: pointer; box-shadow: 0 2px 10px rgba(54, 63, 81, .18); }
.city-study:active, .city-camera:active { transform: scale(.95); }
.city-camera { width: 36px; height: 36px; border: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .9); color: #475569; cursor: pointer; box-shadow: 0 1px 8px rgba(54, 63, 81, .08); }
.city-studypick { position: absolute; left: 0; bottom: 44px; min-width: 180px; max-width: 240px; max-height: 240px; overflow-y: auto; padding: 8px; border-radius: 16px; background: #fff; box-shadow: 0 8px 28px rgba(54, 63, 81, .2); display: flex; flex-direction: column; gap: 2px; animation: cityPanel .18s ease-out; }
.city-studypick__title { padding: 2px 8px 6px; font-size: 12px; font-weight: 300; color: #64748b; }
.city-studypick__item { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 10px; font: inherit; font-size: 13px; color: #334155; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-studypick__item:hover, .city-studypick__item:focus-visible { background: #f1f5f9; }
.city-timer { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 4px 0 12px; border-radius: 999px; background: rgba(255, 255, 255, .95); color: #334155; font-size: 12.5px; box-shadow: 0 2px 10px rgba(54, 63, 81, .14); max-width: 230px; }
.city-timer__dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: cityTimerDot 1.6s ease-in-out infinite; }
@keyframes cityTimerDot { 50% { opacity: .35; } }
.city-timer__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 300; }
.city-timer__time { font-weight: 500; font-variant-numeric: tabular-nums; }
.city-timer__stop { flex: none; width: 28px; height: 28px; border: 0; border-radius: 50%; display: grid; place-items: center; background: #fee2e2; color: #b91c1c; cursor: pointer; }
.city-card.is-full .city-stagebar { bottom: calc(var(--dock) + 10px); left: max(10px, env(safe-area-inset-left)); }
.city-card.is-full .city-toast { bottom: calc(var(--dock) + 56px); }
/* day / night and the view angle: always visible, never faded */
.city-daynight { opacity: 1; pointer-events: auto; width: 36px; height: 36px; right: 12px; bottom: 100px; z-index: 2; color: #d97706; box-shadow: 0 2px 10px rgba(54, 63, 81, .14); }
.city-daynight.is-auto { color: #64748b; }
.city-daynight__auto { position: absolute; right: -2px; bottom: -2px; width: 15px; height: 15px; border-radius: 50%; background: #363f51; color: #fff; font-size: 9px; line-height: 15px; text-align: center; font-weight: 500; }
.city-view { width: 36px; height: 36px; right: 12px; bottom: 58px; box-shadow: 0 2px 10px rgba(54, 63, 81, .14); }
.city-card.is-full .city-daynight { top: calc(var(--top) + 240px); }
body.night-mode .city-homebtn, body.night-mode .city-cozybtn, body.night-mode .city-studypick, body.night-mode .city-timer, body.night-mode .city-camera { background: #1f2937; color: #e5e7eb; box-shadow: none; }
body.night-mode .city-studypick__item { color: #e5e7eb; }
@media (prefers-reduced-motion: reduce) { .city-collect.is-hot, .city-timer__dot { animation: none !important; } }

/* the gem dome sheet: gems waiting, rate per study hour, collect gems */
.city-gemdome { margin-bottom: 10px; }
.city-gemdome .city-stats { margin: 8px 0 4px; }
.city-gemdome__go { background: linear-gradient(180deg, #8fb8ff, #6f8fe8); color: #fff; }
.city-gemdome__go.is-short { background: #e7ebf3; color: #8a93a6; }
.city-stats--gem > div { background: #f2f5ff; }
.city-stats--gem b { color: #4b63b8; }

/* store: place or sell (2026-10-22) */
.city-bag__btns { display: flex; gap: 4px; margin-top: 4px; justify-content: center; flex-wrap: wrap; }
.city-bag__btns .city-bag__place { margin-top: 0; }
.city-bag__sell { background: #fff7e0; color: #92400e; box-shadow: inset 0 0 0 1px #fcd34d; }
.city-bag__sell.is-armed, .city-editcard__btn.is-armed { background: #f59e0b; color: #fff; }

/* the steady camera strip: zoom and quarter turns, always shown (2026-10-22) */
.city-zoom, .city-rot, .city-view { display: none !important; }
.city-cam { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); z-index: 3; display: flex; flex-direction: column; border-radius: 22px; background: rgba(255, 255, 255, .94); box-shadow: 0 2px 12px rgba(54, 63, 81, .16); overflow: hidden; }
.city-cam button { width: 42px; height: 42px; border: 0; background: transparent; color: #374151; display: grid; place-items: center; cursor: pointer; touch-action: manipulation; }
.city-cam button + button { border-top: 1px solid #eef1f5; }
.city-cam button:nth-child(3) { border-top: 6px solid #f3f5f8; }
.city-cam button:active { background: #eef1f6; }
.city-card.is-full .city-cam { right: max(10px, env(safe-area-inset-right)); }
body.night-mode .city-cam { background: rgba(17, 24, 39, .9); }
body.night-mode .city-cam button { color: #e5e7eb; }
body.night-mode .city-cam button + button { border-top-color: #374151; }
body.night-mode .city-cam button:nth-child(3) { border-top-color: #1f2937; }

/* --- lock-in UX (2026-10-23): readable text (14px and up) and finger-sized targets (44px) for kids to grandparents --- */
.city-card .city-panel__lead, .city-card .city-row__sub, .city-card .city-row__name, .city-card .city-chip,
.city-card .city-progress__label, .city-card .city-progress__sub, .city-card .city-info__next, .city-card .city-earn__text,
.city-card .city-editcard__sub, .city-card .city-editcard__tip, .city-card .city-editcard__btn, .city-card .city-btn,
.city-card .city-btn--sm, .city-card .city-banner, .city-card .city-study, .city-card .city-collect, .city-card .city-next,
.city-card .city-mode button, .city-card .city-row__cost, .city-card .city-row__count, .city-card .city-shop__name,
.city-card .city-stats span, .city-card .city-thup__unlocks, .city-card .city-sheet__step, .city-card .city-earn__go,
.city-card .city-switch, .city-card .city-help, .city-card .city-toast, .city-card .city-bubble, .city-card .city-celebrate__text span { font-size: 14px; }
.city-card .city-tool { font-size: 13.5px; min-height: 56px; }
.city-card .city-tool__badge { font-size: 12px; min-width: 18px; height: 18px; line-height: 18px; }
.city-card .city-shop__tier { font-size: 11px; line-height: 16px; }
.city-card.is-full .city-progress__label { font-size: 14px; }
.city-card .city-progress__pct, .city-card.is-full .city-progress__pct { font-size: 13px; }
.city-ob__card b { font-size: 15px; }
.city-ob__card span:last-child, .city-ob__card-tier { font-size: 13px; }
.city-ob__itemprize.is-gold { color: #d97706; }
.city-ob__acts { flex-direction: column; align-items: center; }
.city-ob__go, .city-ob__later, .city-ob__next { min-height: 48px; min-width: 220px; font-size: 16px; }
.city-ob__later { background: #ffffff2e; }
.city-coach__text { font-size: 15px; }
.city-coach__title { font-size: 17px; }
.city-coach__skip, .city-coach__next, .city-coach__act { min-height: 44px; font-size: 15px; padding: 10px 18px; }
.city-welcome__label, .city-welcome__skip { font-size: 14px; }
.city-welcome__skip { min-height: 44px; }
.city-found__go { min-height: 48px; font-size: 16px; }

/* targets */
.city-card .city-homebtn, .city-card .city-sheet__x, .city-card .city-daynight, .city-card .city-full { width: 44px; height: 44px; }
.city-card .city-cam button { width: 44px; height: 44px; }
.city-card .city-collect, .city-card .city-study, .city-card .city-next { height: 44px; min-height: 44px; }
.city-card .city-mode button { height: 40px; padding: 0 14px; }
.city-card .city-btn { min-height: 44px; }
.city-card .city-earn__go { min-height: 36px; padding: 6px 14px; }
.city-card .city-banner--gate { min-height: 40px; padding: 0 14px; font-size: 14px; }
.city-card .city-progress { min-height: 40px; }
.city-card .city-head .city-chip { height: 34px; padding: 0 12px; font-size: 15px; }
/* a bigger invisible hit area around the header chips and the small round buttons */
.city-card .city-head button.city-chip { position: relative; }
.city-card .city-head button.city-chip::before { content: ''; position: absolute; inset: -6px -2px; }
.city-card .city-thup__busy { margin: 4px 0 8px; padding: 10px 12px; border-radius: 12px; background: #f1f5f9; color: #475569; text-align: center; }
.city-daynight__auto { width: 16px; height: 16px; font-size: 11px; line-height: 16px; }
.city-card.is-full .city-cam { top: calc(50% + 10px); }
/* the name shrinks (with …) instead of dropping below the home button when collect all is wide */
.city-head:has(.city-homebtn) .city-head__main .city-namebtn { flex: 1 1 0; min-width: 0; }
.city-namebtn .city-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-card .city-head .city-box-btn { min-width: 48px; min-height: 48px; display: grid; place-items: center; }

.city-cam { overflow: visible; }
.city-cam > button:first-child { border-radius: 22px 22px 0 0; }
.city-cam > button:last-child { border-radius: 0 0 22px 22px; }
/* the camera strip sits under the look / move switch (not centred), compact, so the day / night button and the dock stay clear */
.city-cam { top: 58px; transform: none; }
.city-cam button { width: 38px; height: 38px; }
.city-card.is-full .city-cam { top: calc(var(--top) + 56px); }
.city-card.is-full .city-daynight { top: auto; bottom: calc(env(safe-area-inset-bottom) + 92px); }

/* --- board layout (2026-10-23, after Polytopia): the city on a starry board, three labelled numbers on top,
   round labelled buttons along the bottom --- */
.city-card .city-stats3 { display: flex; align-items: flex-end; gap: 14px; flex-wrap: nowrap; }
.city-card .city-stats3 .city-stat { display: flex; flex-direction: column; align-items: center; gap: 0; height: auto; min-height: 0; padding: 0 2px; border: 0; border-radius: 8px;
    background: none; box-shadow: none; color: #1f2937; font: inherit; line-height: 1.1; cursor: pointer; }
.city-card .city-stats3 .city-stat--people { cursor: default; }
.city-card .city-stats3 .city-stat::before { display: none; }
.city-card .city-stats3 .city-stat__label { font-size: 12px; font-weight: 400; opacity: .7; text-transform: capitalize; }
.city-card .city-stats3 .city-stat__val { display: inline-flex; align-items: center; gap: 4px; font-size: 19px; font-weight: 500; font-variant-numeric: tabular-nums; }
.city-card .city-stats3 .city-chip--coin .city-stat__val svg { color: #f59e0b; }
.city-card .city-stats3 .city-chip--gem .city-stat__val svg { color: #8b5cf6; }
.city-card .city-stats3 .city-stat--people .city-stat__val svg { color: #10b981; }
.city-card .city-stats3 .city-stat.is-open { box-shadow: none; text-decoration: underline; text-underline-offset: 4px; }
body.night-mode .city-card .city-stats3 .city-stat { color: #f1f5f9; background: none; }
/* fullscreen: no bar, just the numbers over the dark sky */
.city-card.is-full { --dock: calc(env(safe-area-inset-bottom) + 104px); }
.city-card.is-full .city-head, body.night-mode .city-card.is-full .city-head { background: linear-gradient(rgba(20, 50, 95, .45), rgba(20, 50, 95, 0)); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; padding-bottom: 14px; }
.city-card.is-full .city-title, .city-card.is-full .city-namebtn { color: #fff; }
.city-card.is-full .city-head__main { justify-content: space-between; }
.city-card.is-full .city-stats3 { margin: 0 auto; }
.city-card.is-full .city-stats3 .city-stat { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.city-card.is-full .city-stats3 .city-stat__label { font-size: 13px; opacity: .85; }
.city-card.is-full .city-stats3 .city-stat__val { font-size: 22px; font-weight: 400; }
/* the dock: round outlined buttons with their names underneath, no tray */
.city-card.is-full .city-tools, body.night-mode .city-card.is-full .city-tools { gap: 22px; padding: 0; bottom: calc(env(safe-area-inset-bottom) + 30px); background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.city-card.is-full .city-tool { width: 58px; height: 58px; min-height: 58px; border: 3px solid #334155; background: #fff; color: #334155; box-shadow: 0 4px 14px rgba(0, 0, 0, .35); overflow: visible; }
body.night-mode .city-card.is-full .city-tool { border-color: #fff; background: #1f2937; color: #fff; }
.city-card.is-full .city-tool.is-on, body.night-mode .city-card.is-full .city-tool.is-on { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.city-card.is-full .city-tool > span:not(.city-tool__badge):not(.city-tool__new) { position: absolute; top: calc(100% + 5px); left: 50%; transform: translateX(-50%); width: auto; height: auto; overflow: visible; clip: auto;
    color: #fff; font-size: 14px; font-weight: 400; white-space: nowrap; text-transform: capitalize; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.city-card.is-full .city-tool svg { width: 24px; height: 24px; }
/* the city tab (not fullscreen): the same round buttons, dark labels */
.city-card:not(.is-full) .city-tools { display: flex; justify-content: center; gap: 18px; padding-bottom: 6px; }
.city-card:not(.is-full) .city-tool { width: 54px; height: 54px; min-height: 54px; padding: 0; border-radius: 50%; border: 2.5px solid #334155; background: #fff; color: #334155; justify-content: center; margin-bottom: 20px; overflow: visible; }
.city-card:not(.is-full) .city-tool.is-on { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.city-card:not(.is-full) .city-tool > span:not(.city-tool__badge):not(.city-tool__new) { position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 13px; color: #334155; text-transform: capitalize; }
body.night-mode .city-card:not(.is-full) .city-tool { background: #111827; border-color: #e5e7eb; color: #e5e7eb; }
body.night-mode .city-card:not(.is-full) .city-tool > span:not(.city-tool__badge):not(.city-tool__new) { color: #e5e7eb; }
/* fullscreen top: the numbers centred, the one call to action under them, close in the corner */
.city-card.is-full { --top: calc(env(safe-area-inset-top) + 134px); }
.city-card.is-full .city-head { flex-direction: column; align-items: center; gap: 6px; padding-right: 56px; padding-left: 56px; }
.city-card.is-full .city-head__main { width: 100%; justify-content: center; }
.city-card.is-full .city-head__main { display: flex; justify-content: center; width: auto; }
.city-card.is-full .city-head__main .city-homebtn { display: none; }
.city-card.is-full .city-namebtn { height: 26px; padding: 0 10px; border-radius: 999px; background: rgba(255, 255, 255, .14); }
.city-card.is-full .city-namebtn .city-title { font-size: 13px; color: #fff; max-width: 60vw; }
.city-card.is-full .city-head > .city-stats3 { order: -1; }
.city-card.is-full .city-head__side:empty { display: none; }
.city-card.is-full .city-head__close { position: absolute; right: max(10px, env(safe-area-inset-right)); top: calc(env(safe-area-inset-top) + 10px); }
/* city tab: the numbers get their own row under the name */
.city-card:not(.is-full) .city-head > .city-stats3 { grid-column: 1 / -1; grid-row: 2; justify-content: center; gap: 22px; }
/* the button names stay readable over the light frosted land */
.city-card.is-full .city-tool > span:not(.city-tool__badge):not(.city-tool__new) { padding: 1px 8px; border-radius: 999px; background: rgba(7, 11, 24, .4); }
/* the City tab's way home: a clear labelled button in the top-left corner */
.city-card.is-full .city-head__home { position: absolute; left: max(10px, env(safe-area-inset-left)); top: calc(env(safe-area-inset-top) + 8px); z-index: 5;
    display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 12px; border: 2px solid #fff; border-radius: 999px;
    background: rgba(7, 11, 24, .55); color: #fff; font: inherit; font-size: 15px; cursor: pointer; text-transform: capitalize; }
.city-card.is-full .city-head:has(.city-head__home) { padding-left: 104px; padding-right: 12px; }
/* the tech tree (Build tab): one card per branch, its buildings in order joined by a line */
.city-tech { margin-top: 12px; padding: 10px 10px 4px; border-radius: 16px; background: #f8fafc; }
.city-tech__head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 15px; font-weight: 500; color: #1f2937; }
.city-tech__ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #3b82f6; color: #fff; }
.city-tech[data-tech="housing"] .city-tech__ic { background: #f59e0b; }
.city-tech[data-tech="food"] .city-tech__ic { background: #ef4444; }
.city-tech[data-tech="education"] .city-tech__ic { background: #3b82f6; }
.city-tech[data-tech="health"] .city-tech__ic { background: #10b981; }
.city-tech[data-tech="culture"] .city-tech__ic { background: #8b5cf6; }
.city-tech[data-tech="training"] .city-tech__ic { background: #64748b; }
.city-tech__name { flex: 1; }
.city-tech__n { font-size: 13px; font-weight: 400; color: #64748b; }
.city-tech.is-done .city-tech__n { color: #059669; }
.city-tech__chain { position: relative; padding-left: 14px; }
.city-tech__chain::before { content: ''; position: absolute; left: 4px; top: 8px; bottom: 18px; width: 3px; border-radius: 2px; background: #cbd5e1; }
.city-tech__chain > .city-row { position: relative; }
.city-tech__chain > .city-row::before { content: ''; position: absolute; left: -14px; top: 50%; width: 11px; height: 3px; background: #cbd5e1; }
body.night-mode .city-tech { background: #111827; }
body.night-mode .city-tech__head { color: #f1f5f9; }
.city-card .city-cost--lock { min-width: 44px; width: 44px; padding: 0; justify-content: center; color: #94a3b8; }
/* tap a locked row (or its lock): why it's locked, in plain words, just under it */
.city-card .city-cost--lock:not(:disabled) { cursor: pointer; }
.city-row.is-locked[role="button"] { cursor: pointer; }
.city-row__why { margin: -2px 0 8px; padding: 8px 12px; border-radius: 12px; background: #fef3c7; color: #78350f; font-size: 14px; line-height: 1.4; }
body.night-mode .city-row__why { background: #2a2110; color: #fde68a; }
/* a second (third) build under way at once: a slim row under the first in the HUD pill */
.city-progress__row--more { margin-top: 4px; }
.city-tech .city-row { padding: 8px; gap: 10px; }
.city-tech .city-thumb { width: 52px !important; height: 52px !important; }
/* finish the build under way now, with gems */
.city-card .city-speed { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 12px; border: 0; border-radius: 999px;
    background: #8b5cf6; color: #fff; font: inherit; font-size: 13px; box-shadow: 0 2px 8px rgba(139, 92, 246, .35); cursor: pointer; pointer-events: auto; }

/* --- store cards (2026-10-23): every card the same shape (picture, two-line name, place, then the sell price),
   and in fullscreen the sheet stops above the dock so the round buttons never sit on the cards --- */
.city-bag__decor { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.city-bag__card { justify-content: flex-start; gap: 6px; padding: 10px 8px 10px; border-radius: 18px; background: #fff;
    box-shadow: 0 1px 2px rgba(54, 63, 81, .06), inset 0 0 0 1px color-mix(in srgb, var(--tier, #e4e8ee) 35%, #eef1f5); }
.city-bag__card .city-thumb { width: 72px !important; height: 72px !important; border-radius: 16px; background: radial-gradient(circle at 50% 38%, #f6fbef 0%, #e6f0dc 100%); overflow: hidden; }
.city-bag__card .city-thumb img { width: 100%; height: 100%; }
.city-bag__card .city-shop__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; line-height: 1.25; font-size: 13px; color: #334155; }
.city-bag__card .city-shop__count { top: 8px; right: 10px; padding: 1px 6px; border-radius: 999px; background: #f1f5f9; font-size: 11px; color: #64748b; }
.city-bag__btns { display: flex; flex-direction: column; align-self: stretch; gap: 6px; margin-top: auto; flex-wrap: nowrap; }
.city-card .city-bag__btns .city-btn { width: 100%; min-height: 38px; margin: 0; padding: 0 8px; border-radius: 12px; font-size: 13px; }
.city-card .city-bag__btns .city-bag__sell { min-height: 32px; font-size: 12px; }
.city-card.is-full .city-sheets { bottom: var(--dock); left: 8px; right: 8px; max-height: min(60dvh, calc(100dvh - var(--dock) - 150px)); border-radius: 22px;
    padding-bottom: 14px; box-shadow: 0 8px 30px rgba(7, 11, 24, .35); }
body.night-mode .city-bag__card { background: #1f2937; }
body.night-mode .city-bag__card .city-shop__name { color: #e5e7eb; }
body.night-mode .city-bag__card .city-thumb { background: radial-gradient(circle at 50% 38%, #334155 0%, #1f2937 100%); }
body.night-mode .city-bag__card .city-shop__count { background: #111827; color: #9ca3af; }
/* a long press on the city never selects the button labels or opens the copy menu */
.city-card.is-full { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.city-card.is-full input, .city-card.is-full textarea { -webkit-user-select: text; user-select: text; }

/* The Nous loading screen over the City page while the 3D city builds (city.js CityBoot) */
.city-boot > .nous-loader { z-index: 9500; transition: opacity .4s ease; }
.city-boot.is-leaving > .nous-loader { opacity: 0; pointer-events: none; }
/* plain "nous" here, no ring round the n; the outer loader arc and glow stay (owner, 2026-11-01) */
.city-boot .nous-logo-ring { display: none; }
/* move mode in fullscreen: the toast sits at the top only (the fullscreen bottom offset stretched it into a tall dark pill) */
.city-card.is-full .city-stage.is-edit .city-toast { top: calc(env(safe-area-inset-top) + 14px); bottom: auto; }
/* fullscreen top: gold, gems and people with the city name under them sit at the right; home stays top-left */
.city-card.is-full .city-head > .city-stats3, .city-card.is-full .city-head > .city-head__main { align-self: flex-end; margin: 0; }
.city-card.is-full .city-head:has(.city-head__home) { padding-right: max(14px, env(safe-area-inset-right)); }
/* fullscreen top: the collect button lines up on the right under the numbers too (no gap at the right edge) */
.city-card.is-full .city-head > .city-head__side { align-self: flex-end; margin: 0; }
/* fullscreen: the build pill stops before the look / move switch on its row (it ran under it) */
.city-card.is-full .city-hud { max-width: calc(100% - 184px - env(safe-area-inset-right)); }
.city-card.is-full .city-progress__row { flex: 1 1 auto; min-width: 0; } /* so the name shortens (…) and the bar and % stay inside */

/* --- r1023 (2026-10-23): bigger button text (15-16px, primary 16-17px), the world switcher, your people,
   and the coming-soon cards that look tappable --- */
.city-card .city-btn, .city-card .city-btn--sm, .city-card .city-quiet-btn, .city-card .city-earn__go, .city-card .city-help,
.city-card .city-mode button, .city-card .city-collect, .city-card .city-study, .city-card .city-next, .city-card .city-tabs button,
.city-card .city-tabs--mini button, .city-card .city-land-btn, .city-card .city-spend, .city-card .city-cozybtn, .city-card .city-speed,
.city-card .city-editbar button span, .city-card .city-editcard__btn, .city-card button.city-chip, .city-card .city-banner--gate,
.city-card .city-studypick__item, .city-card .city-row__name, .city-card .city-bag__btns .city-btn, .city-card .city-bag__btns .city-bag__sell,
.city-card .city-world-card .city-btn, .city-away__later, .city-welcome__skip, .city-card .city-switch { font-size: 15px; }
.city-card .city-btn--wide, .city-card .city-thup .city-btn, .city-found__go { font-size: 16px; }
.city-card .city-sheet .city-sheet__go { font-size: 17px; font-weight: 500; }
.city-card .city-quiet-btn { min-height: 44px; }
.city-card .city-bag__btns .city-btn, .city-card .city-bag__btns .city-bag__sell { min-height: 44px; }
.city-card .city-land-btn, .city-card .city-spend, .city-card .city-cozybtn, .city-card .city-speed, .city-card .city-info .city-help { min-height: 44px; height: auto; padding-top: 0; padding-bottom: 0; }
.city-card .city-mode button { height: 44px; }
.city-card .city-tabs button { min-height: 44px; }
.city-card .city-gemshop__item { font-size: 14px; }
.city-card .city-gemshop__head { font-size: 15px; }
/* the dock's names: 15px under the round buttons */
.city-card:not(.is-full) .city-tool > span:not(.city-tool__badge):not(.city-tool__new),
.city-card.is-full .city-tool > span:not(.city-tool__badge):not(.city-tool__new) { font-size: 15px; }
.city-card .city-stats3 .city-stat__label { font-size: 14px; }
.city-card .city-stats3 button.city-stat { min-height: 44px; }
.city-card .city-stats3 .city-stat--people { cursor: pointer; }
/* the name at the top is the world switcher: a clear chevron */
.city-card .city-namebtn { min-height: 44px; }
.city-card .city-namebtn__ic { width: 28px; height: 28px; background: #e2e8f0; color: #334155; }
.city-card.is-full .city-namebtn { height: 40px; padding: 0 6px 0 14px; gap: 8px; background: rgba(7, 11, 24, .45); border: 2px solid rgba(255, 255, 255, .85); }
.city-card.is-full .city-namebtn .city-title { font-size: 16px; }
.city-card.is-full .city-namebtn__ic { background: rgba(255, 255, 255, .9); color: #1f2937; }
/* the drop-downs from the top (world switcher, city card, how to earn): over the city in fullscreen */
.city-card.is-full .city-info { position: absolute; z-index: 6; left: 10px; right: 10px; top: calc(var(--top) - 2px); max-width: 440px; margin: 0 auto;
    max-height: calc(100dvh - var(--top) - var(--dock) - 12px); overflow-y: auto; overscroll-behavior: contain; background: rgba(255, 255, 255, .98); box-shadow: 0 10px 30px rgba(7, 11, 24, .3); }
body.night-mode .city-card.is-full .city-info { background: rgba(17, 24, 39, .98); }
.city-worldmenu { align-items: stretch; gap: 6px; }
.city-worldmenu .city-earn__title { font-size: 15px; }
.city-worldmenu__row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 12px 8px 8px; border: 0; border-radius: 14px; background: #fff;
    box-shadow: inset 0 0 0 1px #e4e8ee; font: inherit; color: #1f2937; text-align: left; cursor: pointer; }
.city-worldmenu__row:hover { box-shadow: inset 0 0 0 2px #93c5fd; }
.city-worldmenu__row:active { transform: scale(.99); }
.city-worldmenu__row.is-here { background: #eff6ff; box-shadow: inset 0 0 0 2px #3b82f6; cursor: default; }
.city-worldmenu__row--link { min-height: 52px; background: transparent; }
.city-worldmenu__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.city-worldmenu__text b { font-size: 16px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-worldmenu__text span { font-size: 14px; font-weight: 300; color: #64748b; }
.city-worldmenu__here { flex: none; padding: 4px 10px; border-radius: 999px; background: #3b82f6; color: #fff; font-size: 14px; }
.city-worldmenu__go { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px; border-radius: 999px; background: #363f51; color: #fff; font-size: 15px; }
.city-worldmenu__go svg { transform: rotate(-90deg); }
.city-worldmenu__ic { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: #f1f5f9; color: #334155; }
.city-worldmenu__note { margin: 2px 4px; font-size: 14px; color: #64748b; }
.city-info__people { align-self: stretch; }
body.night-mode .city-worldmenu__row { background: #1f2937; color: #e5e7eb; box-shadow: inset 0 0 0 1px #374151; }
body.night-mode .city-worldmenu__row--link { background: transparent; }
body.night-mode .city-worldmenu__row.is-here { background: #1e3a5f; box-shadow: inset 0 0 0 2px #3b82f6; }
body.night-mode .city-worldmenu__ic { background: #273244; color: #e5e7eb; }
body.night-mode .city-worldmenu__text span, body.night-mode .city-worldmenu__note { color: #94a3b8; }
/* your people: a face, a name and a job each */
.city-person { width: 100%; border: 0; font: inherit; text-align: left; cursor: pointer; min-height: 60px; }
.city-person.is-on { box-shadow: inset 0 0 0 2px #3b82f6; }
.city-person__face { flex: none; width: 48px; height: 48px; display: grid; place-items: end center; overflow: hidden; border-radius: 12px; background: #e9f0f6; }
.city-person__go { flex: none; color: #94a3b8; }
.city-person__go svg { transform: rotate(-90deg); }
.city-people .city-row__text { display: flex; flex-direction: column; }
.city-card .city-citizen { margin-bottom: 10px; }
/* coming-soon worlds: cards that look like you can tap them */
.city-worlds { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.city-world-card { border: 0; font: inherit; cursor: pointer; padding: 12px 8px 10px; gap: 4px; background: #fff; box-shadow: 0 2px 8px rgba(54, 63, 81, .1), inset 0 0 0 1px #e4e8ee;
    transition: transform .15s ease, box-shadow .15s ease; }
.city-world-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(54, 63, 81, .16), inset 0 0 0 2px #93c5fd; }
.city-world-card:active { transform: scale(.97); }
.city-world-card .city-theme__name { font-size: 16px; font-weight: 500; }
.city-world-card .city-theme__blurb, .city-card .city-world-card .city-theme__blurb { font-size: 14px; }
.city-world-card .city-soon, .city-card .city-soon { font-size: 14px; padding: 3px 10px; }
.city-world-card__go { display: inline-flex; align-items: center; justify-content: center; gap: 5px; align-self: stretch; min-height: 40px; margin-top: 6px; border-radius: 12px; background: #363f51; color: #fff; font-size: 15px; }
body.night-mode .city-world-card__go { background: #3b82f6; }
/* fullscreen top: only the buttons in it catch taps, the see-through band does not (it can reach over the look / move switch) */
.city-card.is-full .city-head { pointer-events: none; padding-bottom: 8px; }
.city-card.is-full .city-head > *, .city-card.is-full .city-head__main > *, .city-card.is-full .city-head__side > * { pointer-events: auto; }
.city-card.is-full .city-head__main, .city-card.is-full .city-head__side { pointer-events: none; }
.city-card.is-full .city-namebtn { height: 32px; position: relative; }
.city-card.is-full .city-namebtn::before { content: ''; position: absolute; inset: -6px -4px; }
.city-card.is-full .city-namebtn__ic { width: 24px; height: 24px; }
.city-worldmenu { box-sizing: border-box; max-width: 480px; }
/* the study pill on the city: 14px text and a stop button you can hit (44px tap area) */
.city-card .city-timer { height: 44px; font-size: 14px; }
.city-card .city-study { height: 44px; }
.city-card .city-timer__stop { width: 36px; height: 36px; position: relative; }
.city-card .city-timer__stop::before { content: ''; position: absolute; inset: -4px; }
.city-card .city-studypick__title { font-size: 14px; }
/* the build bar's details open as a tidy card under the bar: full width, ordinary corners, never taller than a
   third of the screen, and never under the look/move switch */
.city-hud.is-open { max-width: min(330px, calc(100% - 190px)); }
.city-card.is-full .city-hud.is-open { max-width: min(360px, calc(100% - 190px)); }
.city-hud.is-open .city-progress { display: flex; flex-direction: column; align-items: stretch; border-radius: 18px; height: auto; max-height: 34vh; overflow-y: auto; }
.city-hud.is-open .city-progress__row { width: 100%; }
.city-hud.is-open .city-progress__more { width: 100%; margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.city-hud.is-open .city-progress__sub { white-space: normal; text-align: left; font-size: 13px; line-height: 1.35; }
/* People: every citizen with what they do (free, building crew, a job) */
.city-crow__list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.city-crow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 14px; background: #f8fafc; }
.city-crow__who { display: flex; flex-direction: column; min-width: 0; }
.city-crow__name { font-size: 15px; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-crow__job { font-size: 13px; color: #64748b; text-transform: lowercase; }
.city-crow__role { flex: none; max-width: 58%; min-height: 44px; padding: 0 10px; border-radius: 12px; border: 1px solid #cbd5e1; background: #fff; color: #1f2937; font: inherit; font-size: 14px; }
body.night-mode .city-crow { background: #1f2937; }
body.night-mode .city-crow__name { color: #e5e7eb; }
body.night-mode .city-crow__role { background: #111827; color: #e5e7eb; border-color: #374151; }
.city-card .city-stats3 .city-stat--people { cursor: pointer; }
/* People rows: the person (tap for their profile) and what they do, side by side */
.city-crew .city-crow { padding: 4px 8px 4px 0; margin-bottom: 6px; }
.city-crew .city-crow.is-on { box-shadow: inset 0 0 0 2px #3b82f6; }
.city-crew .city-crow > .city-person { flex: 1 1 auto; min-width: 0; margin: 0; background: transparent; box-shadow: none; }
.city-crew .city-crow__role { max-width: 46%; }
/* the top stack (numbers, city name, collect) is taller now: start the look/move row and build bar below it */
.city-card.is-full { --top: calc(env(safe-area-inset-top) + 148px); }
/* narrow phones: smaller, tighter numbers so they clear the Home button */
@media (max-width: 400px) {
    .city-card.is-full .city-stats3 { gap: 8px; }
    .city-card.is-full .city-stats3 .city-stat__val { font-size: 18px; }
    .city-card.is-full .city-stats3 .city-stat__val svg { width: 13px; height: 13px; }
}

/* Offline with no copy of the city yet (city.js NeedsConnection) */
.city-update { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: #fff6e5; color: #6b5a33; text-align: center; }
.city-update__title { margin: 0; font-size: 14px; font-weight: 400; color: #4a3d1f; }
.city-update__sub { margin: 2px 0 0; font-size: 12px; font-weight: 300; }
.city-offline { padding: 40px 16px; text-align: center; color: #6b7a99; font-weight: 300; }
.city-offline--compact { padding: 20px 16px; }
.city-offline__title { font-size: 16px; font-weight: 400; color: #363f51; margin: 0 0 6px; }
.city-offline__sub { font-size: 14px; line-height: 1.5; margin: 0 auto 14px; max-width: 300px; }
.city-offline__retry { min-height: 44px; padding: 0 22px; margin-top: 8px; font-size: 15px; }
.night-mode .city-offline__title { color: #e2e8f0; }
/* --- r1023 hud (2026-10-23): the fullscreen right side as one tidy column. The numbers on top, then one row with
   the call to action next to the city name (it used to hang under the name and over look / move), then look / move,
   then the camera buttons, 10px apart, all on the same right edge --- */
.city-card.is-full .city-head { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; align-items: center; column-gap: 8px; row-gap: 6px; }
.city-card.is-full .city-head > .city-stats3 { order: -2; flex: 0 0 auto; margin-left: auto; }
.city-card.is-full .city-head::after { content: ''; order: -1; flex: 0 0 100%; height: 0; }
.city-card.is-full .city-head > .city-head__side { order: 0; align-self: center; flex: 1 1 0; min-width: 0; display: flex; justify-content: flex-end; }
.city-card.is-full .city-head > .city-head__main { order: 1; align-self: center; flex: 0 1 auto; min-width: 0; max-width: 60%; justify-content: flex-end; }
.city-card.is-full .city-head__side .city-collect, .city-card.is-full .city-head__side .city-next { height: 40px; min-height: 40px; max-width: 200px; }
.city-card.is-full .city-head__side .city-next > span:first-of-type { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-card.is-full .city-head .city-box-btn { width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; border-radius: 50%; background: rgba(255, 255, 255, .94); box-shadow: 0 2px 12px rgba(54, 63, 81, .16); }
.city-card.is-full .city-head .city-box-btn svg { width: 30px; height: 30px; }
body.night-mode .city-card.is-full .city-head .city-box-btn { background: rgba(17, 24, 39, .9); box-shadow: 0 2px 12px rgba(0, 0, 0, .3); }
/* the head is now two rows (about 100px) instead of three, so the land starts higher */
.city-card.is-full { --top: calc(env(safe-area-inset-top) + 108px); }
.city-card.is-full .city-mode, .city-card.is-full .city-cam { right: max(14px, env(safe-area-inset-right)); }
.city-card.is-full .city-cam { top: calc(var(--top) + 68px); }
.city-card.is-full .city-hud, .city-card.is-full .city-hud.is-open { left: max(14px, env(safe-area-inset-left)); max-width: calc(100% - 28px - 168px - env(safe-area-inset-left) - env(safe-area-inset-right)); }
.city-card.is-full .city-head__side > * { flex: none; }
/* the right-hand column (2026-10-27): look / move switch over the camera strip, just above the lighting button, all
   anchored to the bottom so the camera strip opens upwards and nothing overlaps; the HUD may use the whole width above */
.city-side { display: contents; }
.city-card.is-full .city-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; position: absolute; z-index: 3;
    right: max(14px, env(safe-area-inset-right)); bottom: calc(env(safe-area-inset-bottom) + 152px); }
.city-card.is-full .city-side .city-mode, .city-card.is-full .city-side .city-cam { position: static; top: auto; right: auto; bottom: auto; transform: none; }
.city-card.is-full .city-daynight { top: auto; bottom: calc(env(safe-area-inset-bottom) + 106px); right: max(14px, env(safe-area-inset-right)); }
.city-card.is-full .city-hud, .city-card.is-full .city-hud.is-open { max-width: calc(100% - 28px - env(safe-area-inset-left) - env(safe-area-inset-right)); }
/* build mode: no lighting button, the column sits where it was (the edit card is on the left, see .city-editcard) */
.city-card.is-full .city-stage.is-edit ~ .city-side { bottom: calc(env(safe-area-inset-bottom) + 106px); }
/* dark mode: style.css paints every button a flat grey (!important), which lost the on state of look / move and
   the gold of collect; the city's own colours win again */
body.night-mode .city-card .city-mode button { background: transparent !important; }
body.night-mode .city-card .city-mode button.is-on { background: #e5e7eb !important; color: #0f172a; }
body.night-mode .city-card .city-stage.is-edit .city-mode button.is-on { background: #10b981 !important; color: #fff; }
body.night-mode .city-card .city-cam button { background: transparent !important; }
body.night-mode .city-card .city-collect { background: linear-gradient(180deg, #fde68a, #f59e0b) !important; color: #78350f; box-shadow: 0 2px 8px rgba(245, 158, 11, .35) !important; }
body.night-mode .city-card.is-full .city-head .city-box-btn { background: rgba(17, 24, 39, .9) !important; box-shadow: 0 2px 12px rgba(0, 0, 0, .3) !important; }
body.night-mode .city-card.is-full .city-namebtn { background: rgba(7, 11, 24, .45) !important; border: 2px solid rgba(255, 255, 255, .85) !important; }
body.night-mode .city-card .city-mode button.is-on svg { color: #0f172a; stroke: #0f172a; }

/* the camera buttons fold into one round compass button under look / move; open, they drop down above it */
.city-cam { border-radius: 22px; }
.city-cam__tools { display: flex; flex-direction: column; }
.city-cam__tools > button:first-child { border-radius: 22px 22px 0 0; }
.city-cam .city-cam__toggle { border-radius: 22px; }
.city-cam.is-open .city-cam__toggle { border-top: 1px solid #eef1f5; border-radius: 0 0 22px 22px; }
body.night-mode .city-cam.is-open .city-cam__toggle { border-top-color: #374151; }
/* the build chip: the full name on its own line, the bar and "45% · 2h left" under it */
.city-progress__row { flex-wrap: wrap; row-gap: 3px; }
.city-progress__row .city-progress__label, .city-card.is-full .city-progress__row .city-progress__label { flex: 1 1 calc(100% - 22px); order: 0; white-space: normal; overflow: visible; line-height: 1.25; }
.city-progress__row .city-progress__more-ic { order: 1; }
.city-progress__row .city-progress__bar, .city-card.is-full .city-progress__row .city-progress__bar { order: 2; flex: 1 1 40px; min-width: 40px; }
.city-progress__row .city-progress__pct { order: 3; }
.city-card.is-full .city-progress { border-radius: 16px; }
/* the small card: look / move are icons only (the words stay for screen readers) so the build chip beside them has room */
.city-card:not(.is-full) .city-mode button { padding: 0 13px; }
.city-card:not(.is-full) .city-mode__txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* build mode: the card sits bottom left so the middle of the map stays clear */
.city-editcard { left: max(14px, env(safe-area-inset-left)); transform: none; animation-name: cityEditInLeft; }
@keyframes cityEditInLeft { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* the box reveal: sell everything in it at once */
.city-ob__sell { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.city-ob__sell svg { color: #fcd34d; }

/* a citizen's thought for the day (city-wisdom.js): now and then one speaks up, fades in, then fades away */
.city-bubble--wisdom { max-width: 240px; padding: 9px 13px 8px; font-size: 14px; line-height: 1.4; border-radius: 16px; animation: city-wisdom-fade var(--life, 7s) ease both; }
.city-bubble__by { display: block; margin-top: 3px; font-size: 14px; color: #8a93a6; font-weight: 300; }
.city-bubble__by::before { content: '\2014\00a0'; }
@keyframes city-wisdom-fade { 0% { opacity: 0; margin-top: -2px; } 8% { opacity: 1; margin-top: -8px; } 88% { opacity: 1; margin-top: -8px; } 100% { opacity: 0; margin-top: -12px; } }
/* the meditation centre asking you in: a tappable bubble that gently pulses */
.city-bubble--invite { pointer-events: auto; cursor: pointer; border: 0; font: inherit; font-size: 14px; font-weight: 500; padding: 9px 14px; border-radius: 16px; color: #0f766e; display: flex; align-items: center; gap: 2px;
  width: max-content; max-width: min(320px, calc(100% - 12px)); text-align: left;
  animation: city-wisdom-fade var(--life, 9s) ease both, city-invite-pulse 2.4s ease-in-out infinite; }
@keyframes city-invite-pulse { 0%, 100% { box-shadow: 0 4px 14px rgba(54, 63, 81, .18), 0 0 0 0 rgba(20, 184, 166, .35); } 50% { box-shadow: 0 4px 14px rgba(54, 63, 81, .18), 0 0 0 8px rgba(20, 184, 166, 0); } }
body.night-mode .city-bubble--invite { color: #5eead4; }
.city-bubble--invite svg { flex: none; }
@media (prefers-reduced-motion: reduce) { .city-bubble--wisdom, .city-bubble--invite { animation: none; } }
body.night-mode .city-bubble__by { color: #94a3b8; }
/* a saved city in a world you don't own (locked until bought, never deleted) */
.city-world--saved .city-thumb { filter: grayscale(.6); opacity: .7; }
.city-world--saved .city-btn { display: inline-flex; align-items: center; gap: 4px; }
.city-worldmenu__go--locked { background: #e2e8f0; color: #475569; }
.city-worldmenu__go--locked svg { transform: none; }
.city-locked__card { padding-top: 22px; }
.city-locked__pic { position: relative; display: inline-grid; place-items: center; width: 96px; height: 96px; margin-bottom: 8px; border-radius: 24px; background: #f1f5f9; }
.city-locked__pic > :first-child { filter: grayscale(.5); opacity: .8; }
.city-locked__badge { position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #475569; box-shadow: 0 2px 8px rgba(15, 23, 42, .16); }
.city-locked__buy { display: flex; width: 100%; box-sizing: border-box; justify-content: center; }
.city-locked__soon { margin: 0 0 8px; padding: 10px 12px; border-radius: 14px; background: #f8fafc; font-size: 13px; font-weight: 300; color: #64748b; line-height: 1.4; }
body.night-mode .city-locked__pic, body.night-mode .city-locked__soon { background: rgba(255, 255, 255, .06); color: #cbd5e1; }
body.night-mode .city-locked__badge { background: #1f2937; color: #e5e7eb; }
body.night-mode .city-worldmenu__go--locked { background: rgba(255, 255, 255, .1); color: #cbd5e1; }
/* next builder: a lifetime-study milestone bar in the people panel */
.city-builder-next { margin: -4px 0 10px; padding: 8px 10px; border-radius: 10px; background: #fff8eb; border: 1px solid #fde8c4; }
.city-builder-next__row { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #8a5a12; }
.city-builder-next__bar { height: 5px; margin-top: 6px; border-radius: 3px; background: #f3e3c3; overflow: hidden; }
.city-builder-next__bar span { display: block; height: 100%; background: linear-gradient(90deg, #f59e0b, #fbbf24); transform-origin: left; transition: transform 1s ease; }
body.night-mode .city-builder-next { background: #2a2418; border-color: #4a3b1f; }
body.night-mode .city-builder-next__row { color: #fcd34d; }
body.night-mode .city-builder-next__bar { background: #3b3222; }

/* build chip text is 14px and the name stays on one line, cut with an ellipsis, so the chip fits beside look / move */
.city-progress__row .city-progress__label, .city-card.is-full .city-progress__row .city-progress__label { min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.city-card .city-progress__pct, .city-card.is-full .city-progress__pct, .city-hud.is-open .city-progress__sub, .city-card .city-progress__more .city-progress__sub { font-size: 14px; }
.city-card.is-full .city-hud, .city-card.is-full .city-hud.is-open { max-width: calc(100% - 160px - 40px - env(safe-area-inset-left) - env(safe-area-inset-right)); }
.city-card .city-banner, .city-card.is-full .city-banner, .city-progress__more-ic { font-size: 14px; }
.city-card .city-banner--gate { min-height: 44px; }
.city-builder-next__row { font-size: 14px; }

/* citizen satisfaction bar, under the gold / gems / people numbers */
.city-satisfy { grid-column: 1 / -1; grid-row: 3; order: 9; width: 100%; box-sizing: border-box; position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; padding: 4px 12px; border: 0; border-radius: 12px;
    background: rgba(16, 185, 129, .1); color: #065f46; font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.city-satisfy__label { display: inline-flex; align-items: center; gap: 4px; flex: none; font-weight: 500; }
.city-satisfy__bar { flex: 1; min-width: 40px; height: 8px; border-radius: 4px; background: rgba(54, 63, 81, .12); overflow: hidden; }
.city-satisfy__bar span { display: block; height: 100%; background: #10b981; transform-origin: left; transition: transform .6s ease, background .3s; }
.city-satisfy__val { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.city-satisfy__mood { flex: none; opacity: .75; }
.city-satisfy.is-okay { background: rgba(245, 158, 11, .12); color: #854d0e; }
.city-satisfy.is-okay .city-satisfy__bar span { background: #f59e0b; }
.city-satisfy.is-unhappy { background: rgba(248, 113, 113, .14); color: #991b1b; }
.city-satisfy.is-unhappy .city-satisfy__bar span { background: #f87171; }
.city-satisfy.is-open { box-shadow: inset 0 0 0 1.5px currentColor; }
.city-card.is-full { --top: calc(env(safe-area-inset-top) + 176px); }
.city-card.is-full .city-satisfy { align-self: stretch; width: auto; max-width: 420px; margin: 0 auto; padding: 4px 12px; background: rgba(255, 255, 255, .82); }
body.night-mode .city-satisfy { color: #6ee7b7; background: rgba(16, 185, 129, .16); }
body.night-mode .city-satisfy.is-okay { color: #fcd34d; }
body.night-mode .city-satisfy.is-unhappy { color: #fca5a5; }
body.night-mode .city-satisfy__bar { background: rgba(255, 255, 255, .14); }
/* the happiness panel (from the satisfaction bar): a ring, needs, what would help, the city goal */
.city-moodring { --ring: #10b981; position: relative; flex: none; pointer-events: none; padding: 0; border: 0; border-radius: 50%;
    background: conic-gradient(var(--ring) var(--pct), rgba(226, 232, 240, .95) 0); box-shadow: 0 2px 10px rgba(54, 63, 81, .18); display: grid; place-items: center; }
.city-moodring.is-happy { --ring: #22c55e; }
.city-moodring.is-okay { --ring: #f59e0b; }
.city-moodring.is-unhappy { --ring: #ef4444; }
.city-moodring__in { width: calc(100% - 10px); height: calc(100% - 10px); border-radius: 50%; background: #fff; color: #363f51; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; gap: 1px; }
.city-moodring__in svg { color: var(--ring); }
.city-moodring__in b { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.city-satisfy__dot { position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%; background: #f59e0b; border: 2px solid #fff; animation: city-moodpulse 1.6s ease-in-out infinite; }
@keyframes city-moodpulse { 50% { transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .city-satisfy__dot { animation: none; } }
body.night-mode .city-moodring__in { background: #111827; color: #e5e7eb; }
.city-mood__head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.city-mood__title { font-size: 18px; font-weight: 500; color: #363f51; }
.city-mood__sub, .city-mood__tip { font-size: 14px; color: #6b7a99; line-height: 1.35; }
.city-mood__tip { margin: -4px 0 14px; }
.city-mood__label { font-size: 14px; font-weight: 500; color: #363f51; margin: 4px 0 8px; }
.city-mood .city-need { grid-template-columns: 82px 1fr 52px 84px; font-size: 14px; min-height: 44px; }
.city-mood .city-need:not(.is-short) { grid-template-columns: 82px 1fr 52px 84px; }
.city-need__note { font-size: 14px; color: #6b7a99; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-need__go { min-height: 40px; padding: 0 12px; border: 0; border-radius: 999px; background: #363f51; color: #fff; font-size: 14px; cursor: pointer; }
.city-goal { padding: 12px; border-radius: 14px; background: #fff; display: grid; gap: 10px; }
.city-goal.is-done { background: #fef9c3; }
.city-goal__row { display: flex; align-items: center; gap: 10px; }
.city-goal__ic { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #f1f5f9; color: #f59e0b; }
.city-goal.is-done .city-goal__ic { background: #22c55e; color: #fff; }
.city-goal__text { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: #6b7a99; }
.city-goal__text b { font-size: 16px; font-weight: 500; color: #363f51; }
.city-goal__bar { height: 8px; border-radius: 4px; background: #e4e8ee; overflow: hidden; }
.city-goal__bar span { display: block; height: 100%; background: #f59e0b; transform-origin: left; transition: transform .6s ease; }
.city-goal__claim { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; }
.city-goal__claim:disabled { opacity: .55; }
body.night-mode .city-goal { background: #1f2937; }
body.night-mode .city-goal.is-done { background: #3f3a1a; }
body.night-mode .city-mood__title, body.night-mode .city-mood__label, body.night-mode .city-goal__text b { color: #f1f5f9; }
/* the mayor's desk: the mayor's face and line, then today's request, this week's and the plan (reuses .city-goal) */
.city-mayor { display: grid; gap: 4px; }
.city-mayor__head { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 12px; margin-bottom: 8px; }
.city-mayor__face { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #fef3c7; color: #b45309; overflow: hidden; }
.city-mayor__who { display: flex; flex-direction: column; gap: 2px; }
.city-mayor__who b { font-size: 18px; font-weight: 500; color: #363f51; }
.city-mayor__who small { font-size: 13px; color: #6b7a99; }
.city-mayor__say { grid-column: 1 / -1; position: relative; margin: 8px 0 0; padding: 10px 14px; border-radius: 14px; background: #fff; font-size: 15px; line-height: 1.35; color: #363f51; }
.city-mayor__say::before { content: ''; position: absolute; top: -6px; left: 22px; width: 12px; height: 12px; background: inherit; transform: rotate(45deg); border-radius: 2px; }
.city-mayor__task { margin-bottom: 8px; }
.city-mayor__task.is-claimed { opacity: .7; }
.city-mayor__task.is-claimed .city-goal__ic { background: #22c55e; color: #fff; }
body.night-mode .city-mayor__face { background: #3f3a1a; color: #fcd34d; }
body.night-mode .city-mayor__who b { color: #f1f5f9; }
body.night-mode .city-mayor__say { background: #1f2937; color: #f1f5f9; }
body.night-mode .city-mayor .city-goal__ic, body.night-mode .city-mayor .city-goal__bar { background: #334155; }

/* 10-minute "time to study?" nudge, above the study button */
.city-nudge { position: absolute; left: 10px; bottom: 64px; z-index: 4; width: min(280px, calc(100% - 20px)); padding: 14px; border-radius: 18px; background: #fff; box-shadow: 0 10px 30px rgba(54, 63, 81, .22); animation: cityPanel .2s ease-out; }
.city-card.is-full .city-nudge { bottom: calc(var(--dock) + 64px); left: max(10px, env(safe-area-inset-left)); }
.city-nudge__title { font-size: 17px; font-weight: 700; color: #2f3747; }
.city-nudge__sub { margin-top: 4px; font-size: 14px; line-height: 1.4; color: #5d6678; }
.city-nudge__row { margin-top: 12px; display: flex; gap: 8px; }
.city-nudge__row button { min-height: 44px; padding: 0 16px; border-radius: 999px; font-size: 15px; font-weight: 600; border: 0; cursor: pointer; }
.city-nudge__go { flex: 1; background: #3f8f6b; color: #fff; }
.city-nudge__later { background: #eef1f5; color: #4a5366; }
.city-world__look { margin-right: 6px; min-height: 44px; }
.city-mood .city-need.is-tap { cursor: pointer; }
.city-mood .city-need--sub { min-height: 36px; padding-left: 12px; color: #6b7a99; }
.city-mood .city-need--sub .city-need__name { font-size: 14px; }

/* tech tree: a building with every copy up reads as built, not locked */
.city-row.is-built { opacity: 1; }
.city-row__built { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #d1fae5; color: #047857; }
body.night-mode .city-row__built { background: #064e3b; color: #a7f3d0; }

/* the meditation centre's 5-minute breathing exercise: a cosy room at dusk (a moon window, candles, a plant) */
.city-breathe { position: fixed; inset: 0; z-index: 9000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; overscroll-behavior: contain; overflow: hidden auto;
    padding: calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); text-align: center; color: #fdf4ff; font-family: inherit;
    background: linear-gradient(180deg, #2e2350 0%, #4a3468 45%, #7a4d6e 78%, #a8676a 100%); animation: cityObIn .5s ease both; outline: none; }
.city-breathe > :not(.city-breathe__room) { position: relative; z-index: 1; }
.city-breathe__room { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.city-breathe__window { position: absolute; top: calc(8% + env(safe-area-inset-top)); left: 50%; width: min(52vw, 230px); aspect-ratio: 3 / 4; transform: translateX(-50%);
    border-radius: 999px 999px 18px 18px; background: linear-gradient(180deg, #1b1840 0%, #3b2f6b 70%, #6b4a7c 100%);
    box-shadow: inset 0 0 0 6px rgba(253, 230, 200, .14), 0 0 60px rgba(196, 181, 253, .18); opacity: .55; overflow: hidden; }
.city-breathe__moon { position: absolute; top: 16%; left: 58%; width: 22%; aspect-ratio: 1; border-radius: 50%; background: #fef3c7; box-shadow: 0 0 24px 6px rgba(254, 243, 199, .45); }
.city-breathe__window i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff; animation: cityBreatheTwinkle 3.6s ease-in-out infinite; }
.city-breathe__window i:nth-of-type(2n) { animation-delay: 1.4s; }
.city-breathe__window i:nth-of-type(3n) { animation-delay: 2.3s; }
.city-breathe__floor { position: absolute; left: 0; right: 0; bottom: 0; height: 17%; background: linear-gradient(180deg, #8a5a4a 0%, #6d4436 100%); box-shadow: 0 -2px 0 rgba(255, 220, 190, .18); }
.city-breathe__shelf { position: absolute; bottom: 17%; width: 72px; height: 10px; border-radius: 4px 4px 0 0; background: #a3705c; display: flex; align-items: flex-end; justify-content: center; gap: 12px; }
.city-breathe__shelf.is-left { left: 6%; }
.city-breathe__shelf.is-right { right: 6%; }
.city-breathe__shelf > span { position: relative; bottom: 10px; }
.city-breathe__candle { width: 12px; height: 26px; border-radius: 3px; background: #fdf2e9; }
.city-breathe__candle.is-small { height: 16px; }
.city-breathe__candle::before { content: ''; position: absolute; left: 50%; top: -13px; width: 8px; height: 12px; margin-left: -4px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    background: radial-gradient(circle at 50% 70%, #fff7d6 0%, #fbbf24 55%, #f97316 100%); box-shadow: 0 0 18px 6px rgba(251, 191, 36, .35); transform-origin: 50% 100%; animation: cityBreatheFlame 2.2s ease-in-out infinite alternate; }
.city-breathe__candle.is-small::before { animation-delay: .7s; }
.city-breathe__plant { width: 26px; height: 20px; border-radius: 0 0 8px 8px; background: #e7a27c; }
.city-breathe__plant::before { content: ''; position: absolute; left: 50%; bottom: 18px; width: 34px; height: 34px; margin-left: -17px; border-radius: 50% 50% 40% 40%;
    background: radial-gradient(circle at 30% 60%, #86efac 0 30%, transparent 31%), radial-gradient(circle at 70% 55%, #4ade80 0 30%, transparent 31%), radial-gradient(circle at 50% 30%, #6ee7b7 0 32%, transparent 33%); }
.city-breathe__x { position: absolute !important; top: calc(14px + env(safe-area-inset-top)); right: 14px; width: 48px; height: 48px; color: #fdf4ff; background: rgba(255, 255, 255, .16); }
.city-breathe__buddy { width: 150px; height: auto; margin-bottom: -4px; overflow: visible; }
.city-breathe__buddy-body { transform-origin: 80px 112px; animation: cityBreatheBuddy 8s ease-in-out infinite; }
.city-breathe__buddy-sparks { animation: cityBreatheTwinkle 4s ease-in-out infinite; }
.city-breathe__title { margin: 0; text-wrap: balance; font-size: 24px; font-weight: 700; }
.city-breathe__note { margin: 0 0 4px; max-width: 320px; font-size: 16px; line-height: 1.5; color: #f5e1ee; }
.city-breathe__pick { width: min(100%, 360px); display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px 18px; min-height: 76px; border: 0; border-radius: 22px;
    font: inherit; color: #3b2a4d; background: #fdf2f8; box-shadow: 0 6px 0 rgba(0, 0, 0, .14), 0 10px 24px rgba(0, 0, 0, .18); cursor: pointer; transition: transform .15s ease; }
.city-breathe__pick.is-box { background: #ecfdf5; }
.city-breathe__pick:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0, 0, 0, .14); }
.city-breathe__pick:focus-visible { outline: 3px solid #fde68a; outline-offset: 3px; }
.city-breathe__pick-ic { flex: none; position: relative; width: 46px; height: 46px; border-radius: 50%; background: #fbcfe8; }
.city-breathe__pick-ic::after { content: ''; position: absolute; inset: 12px; border-radius: 50%; background: #f472b6; animation: cityBreatheBuddy 6s ease-in-out infinite; }
.city-breathe__pick.is-box .city-breathe__pick-ic { border-radius: 14px; background: #a7f3d0; }
.city-breathe__pick.is-box .city-breathe__pick-ic::after { border-radius: 5px; background: #10b981; }
.city-breathe__pick-text { display: flex; flex-direction: column; gap: 3px; }
.city-breathe__pick-text b { font-size: 18px; }
.city-breathe__pick-text span { font-size: 15px; opacity: .8; }
.city-breathe__ring { position: relative; width: 250px; height: 250px; max-width: 66vw; max-height: 66vw; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; border: 2px solid rgba(253, 230, 255, .25); }
.city-breathe__ring.is-box { border-radius: 30px; border: 3px solid rgba(253, 230, 255, .35); }
.city-breathe__dot { position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: #fde68a; box-shadow: 0 0 16px 4px rgba(253, 230, 138, .6); left: 0; top: 100%; }
.city-breathe__orb { width: 82%; height: 82%; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #3b2a4d;
    background: radial-gradient(circle at 40% 35%, #fff1f7 0%, #f9a8d4 45%, #c084fc 100%); box-shadow: 0 0 60px rgba(244, 170, 220, .5); transform: scale(.45); will-change: transform; }
.city-breathe__ring.is-box .city-breathe__orb { width: 70%; height: 70%; }
.city-breathe__orb.is-done { width: 120px; height: 120px; transform: none; }
.city-breathe__phase { margin: 8px 0 0; font-size: 28px; font-weight: 700; min-height: 1.3em; }
.city-breathe__count { margin: 0; font-size: 22px; font-weight: 600; color: #fbcfe8; min-height: 1.3em; font-variant-numeric: tabular-nums; }
.city-breathe__left { margin: 0; font-size: 15px; color: #e9d5ff; font-variant-numeric: tabular-nums; }
.city-breathe__btns { display: flex; gap: 12px; margin-top: 6px; }
.city-breathe__btns .city-quiet-btn { color: #fdf4ff; min-height: 56px; min-width: 128px; padding: 0 24px; border-radius: 999px; font-size: 17px; background: rgba(255, 255, 255, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
.city-breathe .city-btn--wide { min-height: 56px; font-size: 17px; }
@keyframes cityBreatheBuddy { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05, 1.07); } }
@keyframes cityBreatheTwinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes cityBreatheFlame { 0% { transform: scale(1) rotate(-3deg); } 100% { transform: scale(.88, 1.08) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .city-breathe, .city-breathe *, .city-breathe *::before, .city-breathe *::after { animation: none !important; } .city-breathe__orb { transform: none; } }

/* People panel: how more people move in, one live step per rule */
.city-grow { margin: 0 0 12px; padding: 10px 12px; border-radius: 14px; background: #f0fdf4; }
.city-grow__title { margin-bottom: 6px; font-size: 14px; font-weight: 500; color: #065f46; }
.city-grow__step { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.city-grow__step + .city-grow__step { border-top: 1px dashed rgba(6, 95, 70, .15); }
.city-grow__ic { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: #fef3c7; color: #b45309; }
.city-grow__step.is-ok .city-grow__ic { background: #10b981; color: #fff; }
.city-grow__text { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 13px; color: #374151; }
.city-grow__text b { font-weight: 500; }
.city-grow__text span { font-size: 12px; opacity: .75; }
.city-grow__go { flex: none; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: #10b981; color: #fff; font: inherit; font-size: 12px; cursor: pointer; }
body.night-mode .city-grow { background: rgba(16, 185, 129, .1); }
body.night-mode .city-grow__title { color: #6ee7b7; }
body.night-mode .city-grow__text { color: #e5e7eb; }

/* wide buttons sit centred at about half the width instead of spanning the sheet (2026-10-25) */
.city-btn--wide { display: flex; width: fit-content; min-width: 50%; max-width: 100%; margin-left: auto; margin-right: auto; padding-left: 20px; padding-right: 20px; white-space: normal; text-align: center; }

/* Phones: a calmer top and a slimmer build card (owner screenshots 2026-10-26: too crowded).
   satisfaction keeps its icon, bar and %; look/move keep their icons; the edit card buttons are shorter. */
@media (max-width: 480px) {
    .city-card .city-satisfy__mood { display: none; }
    .city-card .city-satisfy__label { font-size: 0; gap: 0; }
    .city-card.is-full .city-satisfy { max-width: 220px; }
    .city-card .city-mode__txt { display: none; }
    .city-card .city-mode button { padding: 0 12px; }
    .city-card .city-cam button { width: 38px; height: 38px; }
    .city-editcard__nudge { margin-top: 6px; gap: 6px; }
    .city-editcard__nudge button { min-height: 34px; height: 34px; }
    .city-editcard__btn { min-height: 48px; font-size: 11px; gap: 2px; }
    .city-editcard__btn span { white-space: nowrap; }
}

/* Saving and backups: the small chip on the stage while a change saves, and the backups panel */
.city-sync { position: absolute; left: 10px; bottom: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 10px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .9); color: #4a5568; font: inherit; font-size: 12px; box-shadow: 0 2px 8px rgba(54, 63, 81, .12); cursor: pointer; animation: cityToast .2s ease-out; }
.city-sync.is-saved { color: #059669; }
.city-sync.is-failed { color: #dc2626; }
.city-sync.is-offline { color: #b45309; }
.city-backups__head { display: grid; gap: 8px; margin-bottom: 10px; }
.city-backups__sync { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: #4a5568; }
.city-backups__sync.is-saved { color: #059669; }
.city-backups__sync.is-failed { color: #dc2626; }
.city-backups__sync.is-offline { color: #b45309; }
.city-backups__sub { margin: 0; font-size: 12px; color: #718096; line-height: 1.4; }
.city-backups__now { justify-self: start; }
.city-backups__empty { margin: 0; font-size: 13px; color: #718096; }
.city-backups__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 320px; overflow-y: auto; }
.city-backups__row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: #fff; }
.city-backups__text { flex: 1; min-width: 0; display: grid; font-size: 13px; color: #363f51; }
.city-backups__text span { font-size: 12px; color: #718096; }
/* fullscreen: the next-build pill is just the hammer and the price (the label ran it off the left edge beside the
   city name and mood); the label stays as its title and aria-label */
.city-card.is-full .city-head__side > .city-next { height: 34px; min-height: 34px; padding: 0 10px; gap: 4px; font-size: 13px; }
.city-card.is-full .city-head__side > .city-next:has(.city-next__cost) > span:first-of-type { display: none; }
.city-card.is-full .city-head__side > .city-next .city-next__cost { font-size: 12px; padding: 1px 6px; }
