/* 広場の独立素材。既存背景・フッター・キャラクター画像はそのまま。 */
#wachaField .plaza-facility{position:absolute;transform:translate(-50%,-88%);padding:0!important;border:0!important;border-radius:0!important;min-width:0;min-height:0;background:none!important;box-shadow:none!important;line-height:0;cursor:grab;touch-action:none;overflow:visible}
#wachaField .plaza-facility[hidden]{display:none!important}
#wachaField .plaza-facility img{display:block;width:100%;height:auto;pointer-events:none;filter:drop-shadow(0 2px 1px #47392128)}
#wachaField .plaza-facility:active{transform:translate(-50%,-88%)}
.facility-marker{position:absolute;z-index:140;transform:translate(-50%,-35%);font-size:clamp(10px,1.4vw,15px);line-height:1.15;font-weight:bold;white-space:nowrap;color:#fff3bf;background:#215853;border:1px solid #d8b35a;padding:3px 6px!important;min-width:0;min-height:0;border-radius:8px;pointer-events:auto;cursor:pointer;box-shadow:none}
#wachaField .facility-marker:active{transform:translate(-50%,-35%)}.facility-marker[hidden]{display:none!important}.facility-marker[data-phase=ready]{background:#995e24}
/* 仕事用の専用キャラ原画が揃うまでは控えめな姿勢変化。攻撃画像は流用しない。 */
#wachaField .wacha-actor.facility-working img{animation:plaza-work .8s ease-in-out infinite;transform-origin:50% 85%}
@keyframes plaza-work{0%,100%{rotate:-2deg}50%{rotate:3deg;translate:0 -2px}}
@media(prefers-reduced-motion:reduce){#wachaField .wacha-actor.facility-working img{animation:none}}
#facilityPanel{color:#493720;border:3px solid #b28a47;border-radius:12px;background:#fff0d1;box-shadow:0 4px 20px #24382c88;max-width:min(680px,94vw);width:540px;max-height:90dvh;padding:10px;overflow:auto}
#facilityPanel::backdrop{background:#22383066}#facilityPanel .facility-head{display:flex;align-items:center;justify-content:space-between;gap:6px}#facilityPanel h2,#facilityPanel h3,#facilityPanel p{margin:3px 0}#facilityPanel .facility-content{display:grid;grid-template-columns:minmax(100px,38%) 1fr;align-items:center;gap:10px}#facilityPanel .facility-content img{width:100%;max-height:145px;object-fit:contain}#facilityPanel .facility-info{font-size:13px;line-height:1.35}#facilityPanel .facility-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px;padding-top:6px}#facilityPanel label{font-size:13px;display:flex;gap:4px;align-items:center}#facilityPanel select{max-width:160px;padding:5px;border-radius:5px;border:1px solid #bd9a62;background:#fff8e7;color:#493720}#facilityPanel button{padding:6px 15px;min-height:32px;color:#fff5da;border:0;box-shadow:none;background:var(--reg-secondary) center/100% 100% no-repeat;text-shadow:0 1px 2px #26392e}#facilityPanel button.primary{background:var(--reg-primary) center/100% 100% no-repeat}#facilityPanel button:disabled{opacity:.5}#facilityPanel .facility-status{font-weight:bold;color:#286057}
@media(max-height:360px){#facilityPanel{padding:6px}#facilityPanel h2{font-size:17px}#facilityPanel .facility-content img{max-height:100px}#facilityPanel .facility-info{font-size:11px}#facilityPanel button{min-height:28px;font-size:11px}#facilityPanel h3{font-size:14px}}

#wachaField .plaza-facility.facility-dragging{cursor:grabbing;outline:2px solid #f5d88a;outline-offset:3px;border-radius:8px!important}#wachaField .plaza-facility.facility-blocked{outline-color:#e98879}#facilityPanel .facility-hint{font-size:11px;color:#725f43;text-align:center;margin-top:8px}
/* One loading artwork per run. Normal title layout remains untouched. */
#entry.intro .entry-town,#entry.intro .entry-shade,#entry.intro .entry-mast{visibility:hidden!important}
#entry.intro .entry-scene{background:radial-gradient(ellipse at center,#345758,#192f3b 76%)}
#entry.intro[data-intro-variant=characters] .entry-brand{visibility:hidden!important}
#entry.intro[data-intro-variant=characters] .entry-art{visibility:visible!important;object-fit:contain!important}
#entry.intro:not([data-intro-variant=characters]) .entry-art{visibility:hidden!important;opacity:0!important}
#entry.intro:not([data-intro-variant=characters]) .entry-brand{visibility:visible!important;top:50%!important;left:50%!important;transform:translate(-50%,-50%)!important;width:min(80vw,86dvh,720px)!important;height:72dvh!important;max-height:none!important}
#entry.intro .entry-controls{visibility:hidden!important;pointer-events:none!important}
#entry.intro .entry-splash-caption{display:flex!important;bottom:12px;left:16px;color:#fff1cf;text-shadow:0 2px 4px #142c37}

#entry.intro .entry-brand,#entry.intro .entry-art{transition:none!important}#wachaField .facility-marker{touch-action:none;cursor:grab}
/* Item sprites only; keep the approved scene and navigation unchanged. */
#facilityPanel .facility-product{max-height:108px;object-fit:contain}
#facilityPanel .item-costs{display:flex;flex-wrap:wrap;gap:4px;align-items:flex-start}#facilityPanel .item-cost{display:grid;justify-items:center;grid-template-rows:40px auto auto;min-width:48px;max-width:80px;text-align:center;font-size:10px;line-height:1.1}#facilityPanel .item-cost img{width:40px;height:40px}#facilityPanel .item-short{color:#a72f2d}
#facilityPanel .recipe-choices{display:flex;gap:4px;overflow-x:auto;padding:3px 0 5px}#facilityPanel .recipe-choice{display:grid;justify-items:center;flex:0 0 74px;min-width:0;white-space:normal;line-height:1.1;padding:4px!important;background:#f8e6bf;border:1px solid #b39766;border-radius:6px;color:#493720;text-shadow:none;font-size:9px}#facilityPanel .recipe-choice[aria-pressed=true]{border:2px solid #27645b;background:#e6efcf}#facilityPanel .recipe-choice img{width:44px;height:44px;object-fit:contain}#facilityPanel .recipe-choice span{min-height:20px}
#plazaInventory{box-sizing:border-box;color:#493720;border:3px solid #b28a47;border-radius:12px;background:#fff0d1;width:min(730px,94vw);max-width:94vw;max-height:92dvh;padding:8px;overflow:auto;box-shadow:0 4px 20px #24382c88}#plazaInventory::backdrop{background:#22383066}#plazaInventory .facility-head{display:flex;align-items:center;justify-content:space-between;gap:8px}#plazaInventory h2{margin:0;font-size:clamp(16px,3vw,24px)}#plazaInventory button{color:#fff5da;background:var(--reg-secondary) center/100% 100% no-repeat;border:0;padding:5px 12px;min-height:30px;box-shadow:none;text-shadow:0 1px 2px #26392e}#plazaInventory .inventory-tabs{display:flex;gap:4px;margin:6px 0}#plazaInventory .inventory-tabs button{flex:1;min-width:0;white-space:nowrap}#plazaInventory .inventory-tabs button[aria-pressed=true]{background:var(--reg-primary) center/100% 100% no-repeat}#plazaInventory .inventory-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(98px,1fr));gap:5px}#plazaInventory .inventory-item{display:grid;justify-items:center;align-content:start;gap:2px;padding:4px;text-align:center;border:1px solid #c7ac7f;border-radius:6px;background:#fff9e9;font-size:11px;line-height:1.2}#plazaInventory .inventory-item img{width:58px;height:58px;object-fit:contain}#plazaInventory .unavailable{color:#817562}#plazaInventory .inventory-item button{font-size:10px;min-height:23px;padding:2px 8px}#wachaDialog #plazaInventoryGo{margin-left:auto}#wachaDialog .wacha-head #wachaPickerToggle{margin-left:0}
.battle-material-loot{display:flex;flex-wrap:wrap;gap:4px;justify-content:center}.battle-material-cell{display:inline-flex;align-items:center;gap:1px;font-size:11px}.battle-material-cell img{width:29px;height:29px;object-fit:contain}
@media(max-height:360px){#facilityPanel .facility-product{max-height:70px}#facilityPanel .recipe-choice img{width:34px;height:34px}#facilityPanel .recipe-choice{flex-basis:66px}#facilityPanel .item-cost{grid-template-rows:30px auto auto}#facilityPanel .item-cost img{width:30px;height:30px}#plazaInventory .inventory-item img{width:43px;height:43px}#plazaInventory .inventory-grid{grid-template-columns:repeat(auto-fill,minmax(85px,1fr))}}
@media(max-height:450px){#facilityPanel{box-sizing:border-box;padding:6px;max-height:94dvh}#facilityPanel .facility-head h2{font-size:18px}#facilityPanel .facility-head button{min-height:26px;padding:3px 12px}#facilityPanel .recipe-choices{padding:2px 0 3px;gap:3px}#facilityPanel .recipe-choice{flex-basis:66px;padding:2px!important}#facilityPanel .recipe-choice img{width:34px;height:34px}#facilityPanel .recipe-choice span{min-height:18px}#facilityPanel .facility-info{line-height:1.15;font-size:11px}#facilityPanel .facility-info h3{font-size:15px}#facilityPanel .facility-info p,#facilityPanel .facility-info h3{margin:2px 0}#facilityPanel .item-cost{grid-template-rows:28px auto auto;min-width:42px;font-size:9px}#facilityPanel .item-cost img{width:28px;height:28px}#facilityPanel .facility-actions{padding-top:3px;gap:4px}#facilityPanel .facility-actions button{min-height:26px;padding:3px 13px;font-size:11px}#facilityPanel .facility-hint{font-size:9px;line-height:1.1;margin:3px 0}#facilityPanel .facility-product{max-height:92px}}
@media(max-height:360px){#facilityPanel .facility-hint{display:none}#plazaInventory .inventory-item{padding:3px;gap:1px}#plazaInventory .inventory-grid{gap:3px}}

/* PLAZA5: 通常は設備を固定。編集時のみ移動/収納を表示する。 */
#wachaField .plaza-facility,#wachaField .facility-marker{cursor:pointer;touch-action:manipulation}
#wachaField.facility-edit-mode .plaza-facility,#wachaField.facility-edit-mode .facility-marker{cursor:grab;touch-action:none}
#wachaField.facility-edit-mode .plaza-facility{outline:1px dashed #ffe4a2;outline-offset:2px;border-radius:8px!important}
#wachaField.facility-edit-mode .wacha-actor{pointer-events:none}
#wachaDialog #facilityEditGo[aria-pressed=true]{background:var(--reg-primary) center/100% 100% no-repeat;color:#fff3d2}
#wachaDialog #plazaInventoryGo{margin-left:0}#wachaDialog #facilityShopGo{margin-left:auto}
#wachaDialog .wacha-head{gap:4px}#wachaDialog .wacha-caption{display:none}
#facilityShop{box-sizing:border-box;color:#493720;border:3px solid #b28a47;border-radius:12px;background:#fff0d1;width:min(700px,95vw);max-width:95vw;max-height:94dvh;padding:8px;overflow:auto;box-shadow:0 4px 20px #24382c88}
#facilityShop::backdrop{background:#22383066}#facilityShop .facility-head{display:flex;justify-content:space-between;align-items:center;gap:5px}#facilityShop h2,#facilityShop p{margin:3px 0}#facilityShop h2{font-size:18px}#facilityShop .shop-wallet{font-weight:bold;color:#286057;font-size:13px}#facilityShop .shop-hint{font-size:11px}#facilityShop .shop-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}#facilityShop .shop-card{display:grid;justify-items:center;align-content:start;gap:3px;padding:4px;border:1px solid #c7ac7f;border-radius:7px;background:#fff9e9;text-align:center;font-size:12px}#facilityShop .shop-focus{border:2px solid #27645b}#facilityShop img{width:100%;height:clamp(72px,22dvh,155px);object-fit:contain}#facilityShop button{color:#fff5da;background:var(--reg-secondary) center/100% 100% no-repeat;border:0;padding:5px 10px;min-height:28px;box-shadow:none;text-shadow:0 1px 2px #26392e;font-size:11px}#facilityShop button.primary{background:var(--reg-primary) center/100% 100% no-repeat}#facilityShop button:disabled{opacity:.5}#facilityShop .shop-card button{width:100%;white-space:normal}
@media(max-height:360px){#facilityShop{padding:5px}#facilityShop .shop-grid{gap:3px}#facilityShop .shop-card{font-size:10px;padding:3px}#facilityShop .shop-card button{font-size:10px;padding:3px 4px}#wachaDialog .wacha-head .wacha-control{min-width:0;padding:3px 5px;font-size:10px}}
/* LIFE2: 既存の羊皮紙・金枠のメニューと同じ意匠。 */
.meal-life-dialog{box-sizing:border-box;color:#493720;border:3px solid #b28a47;border-radius:12px;background:#fff0d1;width:min(680px,94vw);max-height:92dvh;overflow:auto;padding:10px;box-shadow:0 4px 20px #24382c88}.meal-life-dialog::backdrop{background:#22383066}.meal-life-head{display:flex;justify-content:space-between;align-items:center;gap:8px}.meal-life-head h2{font-size:clamp(16px,3vw,23px);margin:0}.meal-life-summary,.meal-life-log,.meal-life-prefs>div{display:flex;align-items:center;gap:6px}.meal-life-summary img{width:65px;height:65px;object-fit:contain}.meal-life-people{display:grid;grid-template-columns:repeat(auto-fit,minmax(90px,1fr));gap:4px}.meal-life-person{display:flex!important;align-items:center;flex-direction:column;white-space:pre-line!important;font-size:11px!important;padding:5px!important;min-width:0}.meal-life-person img{width:55px;height:55px;object-fit:contain}.meal-life-person[aria-pressed=true]{outline:2px solid #b58d32;outline-offset:-2px;background:var(--reg-primary) center/100% 100% no-repeat}.meal-life-message{white-space:pre-line;font-size:12px}.meal-life-story{text-align:center}.meal-life-story img{height:clamp(80px,38dvh,240px);max-width:90%;object-fit:contain}.meal-life-story h3,.meal-life-story p{margin:5px 0}.meal-life-section{display:grid;gap:5px;min-width:0}.meal-life-prefs{display:flex;flex-wrap:wrap;gap:5px}.meal-life-prefs img,.meal-life-log img{width:34px;height:34px;object-fit:contain;flex:none}.meal-life-controls{display:flex;flex-wrap:wrap;gap:4px}.meal-life-controls select{max-width:100%;min-width:0}.meal-life-section button{white-space:normal}.meal-life-log{font-size:11px}.meal-life-section h3{margin:5px 0 0}.meal-life-dialog button:disabled{opacity:.5}
@media(max-height:360px){.meal-life-dialog{padding:6px}.meal-life-summary img{width:45px;height:45px}.meal-life-person img{width:39px;height:39px}.meal-life-person{padding:3px!important}.meal-life-message{font-size:11px}}
/* 仲間選択は装飾過多の横長ボタンを避け、立ち絵を主役にする。 */
#mealLifeDialog .meal-life-person{background:#fff9e9!important;border:1px solid #b89b65!important;border-radius:8px;color:#493720!important;text-shadow:none!important;box-shadow:none!important;line-height:1.2;gap:2px;min-height:0;font-weight:700}#mealLifeDialog .meal-life-person img{height:clamp(42px,17dvh,125px);width:100%;max-width:125px}#mealLifeDialog .meal-life-person[aria-pressed=true]{background:#e6efcf!important;outline:2px solid #47776a;outline-offset:-2px}#mealLifeDialog .meal-life-person[aria-pressed=true]:disabled{opacity:1}#mealLifeDialog .meal-life-story img{height:clamp(110px,42dvh,300px)}
/* v0.9.9: dedicated full-screen meal selection; use existing town art and registered buttons. */
#mealLifeDialog.meal-growth-screen{position:fixed;inset:0;margin:0;width:100vw;height:100dvh;max-width:none;max-height:none;border:0;border-radius:0;padding:clamp(8px,2vmin,22px);overflow:hidden;background:linear-gradient(#163d38a8,#163d38d9),url('../assets/backgrounds/bg_02_town_square.png') center/cover;color:#fff4d8;box-shadow:none;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:clamp(5px,1.5vmin,16px)}
#mealLifeDialog.meal-growth-screen:not([open]){display:none}#mealLifeDialog.meal-growth-screen .meal-life-head{padding:4px 8px;border-bottom:2px solid #c9a05d}#mealLifeDialog.meal-growth-screen .meal-life-head h2{font-size:clamp(17px,3.4vmin,30px)}
.meal-growth-body{display:grid;grid-template-columns:minmax(105px,23%) minmax(0,1fr);gap:clamp(5px,1.5vmin,18px);min-height:0}.meal-growth-screen .meal-life-summary{flex-direction:column;justify-content:center;text-align:center;min-width:0;min-height:0;gap:4px;background:#fff0d1;color:#493720;border:2px solid #c9a05d;border-radius:12px;padding:6px;font-size:clamp(10px,2vmin,18px)}.meal-growth-screen .meal-life-summary img{width:100%;height:clamp(42px,24dvh,250px);object-fit:contain;min-height:0}.meal-growth-main{display:grid;grid-template-rows:minmax(0,1fr) auto;gap:5px;min-width:0;min-height:0}.meal-growth-screen .meal-life-people{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:clamp(3px,1vmin,12px);align-items:stretch;min-height:0}.meal-growth-screen .meal-life-people .meal-life-person{justify-content:center;overflow:hidden;min-width:0;min-height:0;font-size:clamp(10px,1.9vmin,19px)!important;padding:3px!important;gap:3px}.meal-growth-screen .meal-life-person span,.meal-growth-screen .meal-life-person strong{white-space:normal;overflow-wrap:anywhere;text-align:center}.meal-growth-screen .meal-life-person .meal-xp{color:#24664c;font-weight:900}#mealLifeDialog.meal-growth-screen .meal-life-person img{height:clamp(44px,29dvh,260px);max-width:100%;object-fit:contain;flex-shrink:1;min-height:32px}.meal-growth-nav{display:flex;justify-content:center;align-items:center;gap:14px;min-height:0}.meal-growth-nav:empty{display:none}.meal-growth-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:0;border-top:2px solid #c9a05d;padding-top:4px}.meal-growth-bottom .meal-life-message{margin:0;font-size:clamp(10px,1.9vmin,18px);flex:1;min-width:0}.meal-growth-screen button:not(.meal-life-person){background:var(--reg-secondary) center/100% 100% no-repeat;color:#fff4d8;border:0;min-height:32px;padding:6px 14px;text-shadow:0 1px 2px #33260c}.meal-growth-screen button.primary{background:var(--reg-primary) center/100% 100% no-repeat;white-space:nowrap;font-size:clamp(12px,2.5vmin,23px);min-width:120px}.meal-level-up .meal-xp{animation:meal-level-pop .55s ease-out}.meal-level-up{outline:3px solid #d9a332!important;outline-offset:-3px}@keyframes meal-level-pop{from{transform:scale(.75)}60%{transform:scale(1.12)}to{transform:scale(1)}}@media(prefers-reduced-motion:reduce){.meal-level-up .meal-xp{animation:none}}@media(max-height:360px){.meal-growth-screen .meal-life-person span{font-size:10px}.meal-growth-screen .meal-life-summary{gap:2px}.meal-growth-screen button:not(.meal-life-person){min-height:29px;padding:4px 10px}}@media(orientation:portrait){.meal-growth-body{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr)}.meal-growth-screen .meal-life-summary{flex-direction:row;flex-wrap:wrap}.meal-growth-screen .meal-life-summary img{width:55px;height:55px}.meal-growth-screen .meal-life-people{grid-template-columns:repeat(3,minmax(0,1fr))}.meal-growth-screen .meal-life-person img{max-height:16dvh}}
#mealLifeDialog.meal-growth-screen .meal-life-person img{height:clamp(44px,37dvh,300px)}.meal-growth-screen .meal-life-people .meal-life-person{font-size:clamp(11px,2.5vmin,20px)!important;border:2px solid #bb9554!important}.meal-growth-screen .meal-life-person strong{font-size:1.12em}.meal-growth-screen .meal-life-person .meal-xp{font-size:1.15em}.meal-growth-screen .meal-life-summary{font-size:clamp(11px,2.5vmin,19px)}.meal-growth-screen .meal-life-person[aria-pressed=true]{outline:3px solid #e8b94e!important;outline-offset:-3px}.meal-growth-screen .meal-life-person:focus-visible{box-shadow:inset 0 0 0 3px #327b8e!important}
