diff --git a/PATCH_NOTES.md b/PATCH_NOTES.md
index 305a63f..a18517f 100644
--- a/PATCH_NOTES.md
+++ b/PATCH_NOTES.md
@@ -1,23 +1,27 @@
# Patch notes
-## 15.20.12
+## 15.20.16
- Added canonical item visual, food, and disease registries; wired food decay/visual helpers and mystery-drug disease sampling to registry data.
- Generated the tool palette from `TOOL_CATEGORIES` at runtime and removed duplicated category markup from `index.html`.
-- Added compact family-tree personality tags and a selected-Tarinai recent-change section for personality, damage, item-effect, disease, and ant-carry causes.
+- Added compact family-tree personality tags, daily personality-change details, and selected-Tarinai rolling recent-change causes for personality, damage, item-effect, disease, and ant-carry changes.
- Added `InputModeManager` for touch-first mobile classification and `WeatherSystem` for weather transitions/rain-water spawning.
- Added central domain events for placement, eating, decay, effects, diseases, damage, death, birth, fights, ants, weather, and rain item drops.
- Moved item-effect modifiers, active summaries, apply/tick behavior callbacks, and food interest class queries into registries.
+- Moved explosion-disease base infection chance reads into `DiseaseRegistry` while preserving protein/niterop disease multipliers.
+- Moved serving-food nutrition and hunger-relief reads into `FoodRegistry`, including laxative's zero hunger relief.
+- Routed direct love/fight/sleep item eating through `EffectRegistry` while preserving the previous bite-specific stress, fear, and sleep-disease chance behavior.
+- Routed sleep drug, rain-water item, and water-bowl field visuals through `item_visual_registry.js`; added water-bowl icon-generation support.
- Moved canonical sound gains, sample paths, categories, cooldowns, and ID category mapping out of `audio.js` into `sound_pack.js`.
- Added named ant ecology extension hooks/comments without changing ant balance.
-- Bumped cache/version references to `15.20.12`; documented the new source-of-truth rules.
+- Bumped cache/version references to `15.20.16`; documented the new source-of-truth rules.
## 15.20.12
- Updated documentation after inspecting the current game surface: field choices, startup flow, tool groups, chart/family/debug surfaces, localStorage settings, and validation fallback when Node is unavailable.
- Removed unused `css/styles.css` shim and no-op `js/ui_family.js` loader entry; refactored duplicate world initialization and allocation-heavy live-count paths.
-- Removed item-effect speech bubbles: `ドン`, `ぐるる`, `すっきり`, `Hg xN`, `ちまっ`, `でかっ`, `へにゃ`, `ムキッ`, and `mm...`.
+- Removed the unwanted item-effect speech bubbles listed in `docs/prompt.txt`.
- Reorganized the tool palette into color-coded collapsible groups: operation, food/water/grass, medicine/effects, habitat/living things, hazards/obstacles.
- Changed the tool UI ball icon to a soccer-ball emoji preview.
- Changed time phases: morning 05:00, day 10:00, evening 17:00, night 20:00.
@@ -32,3 +36,88 @@
- Consolidated documentation into dense English files; left `docs/prompt.txt` untouched.
- Restored rain, revised water/zunda/mercury item sprites, added zunchi-slave head zunchi, fight win rate, fight defeat chance, and post-wake lock.
- Earlier patches added parameter items, persistent item effects, WebP assets, sound categories, push notifications, ant systems, family tree UI, performance manager, event bus, manifest generation, CSS split, and large-file JS split.
+
+## Debug patch: panic chain and action reasons
+
+- Removed the friend-only panic chain that made only a best friend follow a panic target.
+- Added general nearby panic contagion: any nearby live tarinai in panic can cause another tarinai to panic. Neuroticism, distance, and current stress affect the probability.
+- Added / completed visible action reasons for:
+ - eating all food and effect items
+ - eating grass, ant corpses, and zunchi
+ - drinking / touching water
+ - resting near stone, bed, and nest box
+ - sunbathing
+ - zunchi-slave avoidance
+ - being pinched / dragged
+ - firecracker blast panic
+ - explosion-disease blast panic
+ - falling object / stone / genkotsu impact
+ - high-speed ball collision
+ - high-speed tarinai collision
+ - intimidation, intimidation escape, fights, birth ritual, and thaw surprise
+ - fence-blocked path give-up
+- Added state labels for `sunbath`, `ant_attack`, `ant_intimidate`, and `frozen`.
+- Expanded target labels for all current tool/item target types, including medicine/effect items, ant corpses, ant nests, firecrackers, pushpins, signboards, and fences.
+- Verification performed:
+ - `node --check` over every `js/*.js`
+ - state-label coverage scan: no uncovered tarinai states
+ - old friend-panic chain scan: zero matches
+
+
+## おしり鋲・冷凍操作変更パッチ
+- ずんちどれい化条件の喧嘩勝率を30%以下に変更。
+- 衰弱死因判定を厳格化。
+- 冷凍手段をクリック式から「つまむで冷凍UIへ運ぶ」方式へ変更。
+- 新アイテム「おしり鋲」を追加。刺さるとずんちを溜め、日光浴不可。抜くと溜まったずんちが高速で飛散。
+- 高速ずんち衝突時の吹き飛び・パニック理由文を追加。
+
+## 15.22.0 統合リファクタ
+
+- `snapshot_system.js` を追加し、セーブ/ロードと冷凍で重複していた `clonePlain` / `copyOwnData` / `applyOwnData` / 参照復元 / スナップショット作成・復元を共通化。
+- `tarinai_action_state.js` を追加し、`setActionState()` / `enterPanic()` / `beginEating()` により、状態変更・パニック化・食事開始の理由文設定を統合。
+- 直接 `state = "panic"` していた処理を `enterPanic()` 経由へ変更。爆竹、爆発病、高速ボール、高速衝突、アリ、画鋲、近傍パニック連鎖、関係者死亡、解凍時の訃報などが対象。
+- 直接 `state = "eat"` していた食事処理を `beginEating()` 経由へ変更。
+- `physics_helpers.js` を追加し、壁反射・摩擦・回転を `TarinaiPhysics.applyKinematicItemMotion()` に共通化。おしり鋲/画鋲/高速ずんちの移動処理に適用。
+- `ITEM_TRAITS` と `PIN_BEHAVIORS` を追加し、アイテム分類と画鋲/おしり鋲の差分挙動をテーブル化。
+- `text_catalog.js` に状態ラベル、対象ラベル、理由文補完を集約。`ui_selected.js` はカタログ参照へ変更。
+- `family_graph.js` を追加し、家系グラフの連結成分探索を共通化。同期家系データと描画側に適用。
+- `relation_event_system.js` を追加し、関係者死亡の即時反応と冷凍個体への遅延通知を共通化。
+- `ui_helpers.js` を追加し、HTMLエスケープ等のUI共通処理を切り出し。
+- 構文チェック: 全 `js/*.js` OK。
+- 重複確認: `clonePlain` / `copyOwnData` / `applyOwnData` は `snapshot_system.js` に集約、直接 `state = "panic"` と直接 `state = "eat"` は除去済み。
+
+## 15.23.0 safe duplicate integration pass
+
+- `registry_base.js` を追加し、`food_registry.js` / `effect_registry.js` / `disease_registry.js` の `get` / `has` / `label` / `color` / `debugSnapshot` 系の共通基盤を統合。
+- `patch_helpers.js` を追加し、後付けの `World.prototype` パッチを `TarinaiPatcher.patchWorld()` 経由に統合。冷凍・関係者死亡通知で利用。
+- `data.js` に `sleepFurniture` / `draggable` trait と、`isPinType()` / `isSleepFurnitureType()` / `lodgedPinFor()` / `hasLodgedPinEffect()` / `normalizedToolSizeFor()` / `toolSizeScaleFor()` を追加。
+- `ui_tools.js` と `world_view.js` のツールサイズ算出を `normalizedToolSizeFor()` / `toolSizeScaleFor()` に統合。
+- `tarinai_action_state.js` に `currentLodgedPin()` / `currentLodgedPinBehavior()` / `hasLodgedPinEffect()` / `goIdle()` / `startSleeping()` / `seekTarget()` を追加。
+- `blockedByOshibyo` 系の重複判定を `hasLodgedPinEffect("blocksZunchi")` に統合。
+- 画鋲/おしり鋲の型判定を `isPinType()` に寄せ、描画・配置・つまみ・削除判定の分岐を整理。
+- 睡眠家具判定を `isSleepFurnitureType()` に寄せ、ベッド/巣箱の直書き判定を削減。
+- 手動アリ近傍探索の一部を `world.nearbyAnts()` に寄せた。
+- `pruneExtinctFamilies()` を `TarinaiFamilyGraph.connectedComponents()` に寄せた。`family_graph.js` 側のデフォルト edge も親子参照を使うようにした。
+- `save_system.js` / `freeze_system.js` / `ui_selected.js` のHTMLエスケープを `TarinaiUIHelpers.htmlEscape()` に統合。
+- `assets.js` のスプライト/汚れオーバーレイ用キャンバス生成を `TarinaiPhysics.createCachedCanvas()` に寄せた。
+- 危険度の高い `render.js` 全体再設計、`Tarinai.update()` の状態機械化、`ants.js` の状態機械化、`items.js` 描画全体のレジストリ化は未実施。
+- 確認: 全 `js/*.js` の `node --check` 通過。
+
+### 15.23.0 追確認
+
+- `service-worker.js` / `app_manifest.json` のスクリプト一覧を `index.html` の実ロード順に同期。新規共通化ファイルもキャッシュ対象に追加。
+- アリ運搬中に寝ているたりないの状態変更も `startSleeping()` 経由へ寄せた。
+- 最終確認: 全 `js/*.js` と `service-worker.js` の `node --check` 通過。
+- 最終確認: `blockedByOshibyo`、`type === "oshibyo"`、`type === "pushpin"` の直接判定は 0件。`clonePlain` / `copyOwnData` / `applyOwnData` / `isPlainObject` は `snapshot_system.js` のみ。
+
+## 15.24.0 safe integration / UI escape recursion fix
+
+- Fixed `Maximum call stack size exceeded` caused by `ui_helpers.htmlEscape()` calling the global `escapeHtml()` while `ui_selected.escapeHtml()` called back into `TarinaiUIHelpers.htmlEscape()`.
+- Made `TarinaiUIHelpers.htmlEscape()` a pure escaping function and loaded `ui_helpers.js` before `ui_selected.js`.
+- Added a guard in `ui_selected.escapeHtml()` so it never delegates to itself.
+- Added a data URL favicon link to stop the browser's default `/favicon.ico` 404 request.
+- Bumped static asset version to `15.24.0` in `app_manifest.json`, `index.html`, `service-worker.js`, and `js/version.js` to avoid stale cached scripts.
+- Reduced target-label duplication: item labels now come from `TOOL_DEFINITIONS` / `toolLabel()`, with `text_catalog.js` holding only non-tool overrides.
+- Removed the remaining synchronous family-tree DFS fallback blocks in `ui_family_data.js` and `ui_family_render.js`; both now use `TarinaiFamilyGraph.connectedComponents()`.
+- Simplified the remaining manual ant proximity fallback in `tarinai_needs_items.js` to `world.nearbyAnts()`.
+- Verification: all `js/*.js` and `service-worker.js` pass `node --check`.
diff --git a/README.md b/README.md
index 9466597..7a87766 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
-# Tarinai Colony Observation Game
+# Tarinai Colony Observation Game
-Buildless single-page browser simulation. Open `index.html`; no package manager, transpiler, server API, or module loader is required. Runtime order is explicit `
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+