/* Original game shop system. Shared item artwork and accepted town assets. */
.shop-world{--shop-accent:#4f8071;--shop-soft:#b6d6b8;color:#51432e;min-height:var(--view-height);padding:calc(12px + env(safe-area-inset-top)) 14px calc(28px + env(safe-area-inset-bottom));background:linear-gradient(#2a4c4190,#203d39e6),url('../assets/tower-courtyard-v2.webp') center/cover fixed}
.shop-world[data-shop=weapons]{--shop-accent:#aa6940;--shop-soft:#e3bd83}.shop-world[data-shop=food]{--shop-accent:#b47848;--shop-soft:#e6cc92}.shop-wrap{max-width:1060px;margin:auto}.shop-header{display:flex;align-items:center;gap:14px;color:#fff0cb;padding:0 2px 18px}.shop-header .icon-button{margin:0;width:44px;height:44px;flex-shrink:0}.shop-header>div{flex:1}.shop-header small{font-size:10px;letter-spacing:.13em;color:#dac99e}.shop-header h1{font-size:24px;letter-spacing:.08em;margin-top:3px;text-shadow:0 2px #283d2e}.shop-header .game-icon{width:29px;height:29px}
.shop-switch{display:flex;max-width:510px;margin:0 auto 15px;gap:9px}.shop-switch button{flex:1;min-height:49px;display:flex;align-items:center;justify-content:center;gap:7px;border:2px solid #7d6443;border-radius:15px;background:linear-gradient(#f7e7c3,#d9bd87);box-shadow:inset 0 2px #fffa,0 3px #674c34;color:#685238;font-weight:700}.shop-switch button[aria-current=page]{background:linear-gradient(#b9d5b2,#6f9b7a);color:#243f31;border-color:#e5c982;box-shadow:inset 0 2px #fff8,0 3px #b89b59}.shop-switch .game-icon{width:33px;height:33px}
.shop-counter{display:flex;align-items:center;position:relative;overflow:hidden;min-height:205px;border:3px solid #816041;outline:2px solid #f6dc9e;outline-offset:-7px;border-radius:23px;background:radial-gradient(ellipse at 20% 10%,#fff8e6,transparent 60%),linear-gradient(130deg,var(--shop-soft),#f8e9c7);box-shadow:0 5px #564632,0 10px 20px #142e3440}.shop-counter:after{content:"";position:absolute;left:0;right:0;bottom:0;height:15px;background:linear-gradient(#c49861,#997044);border-top:3px solid #7f5c3b;box-shadow:inset 0 3px #eacc96;pointer-events:none}.shop-counter-scene{position:relative;width:44%;height:218px;flex-shrink:0}.shop-building{position:absolute;opacity:.25;left:-12%;width:130%;height:100%;object-fit:contain;filter:sepia(.2)}.shop-npc{position:absolute;width:100%;height:210px;object-fit:contain;bottom:8px;filter:drop-shadow(0 4px 0 #624e342b)}.shop-nameplate{position:absolute;bottom:13px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:8px;white-space:nowrap;font-weight:800;border:2px solid #8c6740;border-radius:9px;padding:4px 12px;background:#fff0cce8;box-shadow:0 2px #785b3f;font-size:14px}.shop-nameplate small{font-size:9px;font-weight:500}.shop-dialogue{padding:19px 22px 25px 8px;position:relative}.shop-dialogue>small{font:700 9px Georgia,serif;letter-spacing:.14em;color:var(--shop-accent)}.shop-dialogue h2{font-size:23px;line-height:1.6;margin:10px 0}.shop-dialogue p{font-size:12px;color:#7e6a4c;line-height:1.8;max-width:300px}
.shop-purse{display:flex;align-items:center;gap:10px;color:#f8e4b4;border:1px solid #a38a60;border-radius:12px;background:#283f32de;margin-top:15px;padding:8px 12px;min-height:47px}.shop-purse>span{font-weight:800;font-size:19px;display:flex;align-items:center;gap:5px}.shop-purse>small{font-size:10px;color:#c5c7ae;margin-left:auto}.shop-purse>b{font-size:11px;white-space:nowrap}.shop-purse img,.shop-price img,.shop-total img{width:25px;height:25px;object-fit:contain}
.shop-status{color:#fff1c6;font-size:12px;line-height:1.7;margin:12px 2px}.shop-status:empty{display:none}.shop-status.error{color:#ffe0cc;border-left:3px solid #efab8b;padding-left:8px}.shop-status button{border:0;background:#e5d0a1;color:#59442a;border-radius:8px;padding:8px 10px;margin-left:5px;display:inline-flex;gap:3px;align-items:center;min-height:44px}.shop-status svg{width:16px;height:16px}
.shop-content{display:grid;grid-template-columns:minmax(0,1fr) 325px;gap:18px;margin-top:19px;align-items:start}.shop-stock,.shop-detail{background:linear-gradient(140deg,#fff4d7,#e9d3a0);border:2px solid #977246;border-radius:19px;padding:17px;box-shadow:inset 0 2px #fff8,0 4px #775c3c}.shop-stock-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;border-bottom:1px solid #c9aa74;padding-bottom:12px}.shop-stock-title h2{font-size:20px}.shop-stock-title span{font-size:11px;color:#96764e}.shop-filters{display:flex;gap:7px;margin-bottom:14px}.shop-filters button{flex:1;min-height:44px;border:1px solid #b39769;border-radius:10px;background:#f5e6c3;color:#816740;font-weight:700}.shop-filters button[aria-pressed=true]{background:var(--shop-accent);color:#fff3d3;border-color:#6f603e;box-shadow:inset 0 2px #fff3,0 2px #77613e}.shop-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}.shop-item{display:flex;flex-direction:column;align-items:center;padding:7px 4px 9px;border:2px solid #c4a97a;background:#fbefd0;border-radius:13px;box-shadow:0 3px #b49664;min-width:0;position:relative}.shop-item[aria-pressed=true]{border-color:#427261;background:#d8e4bc;box-shadow:inset 0 0 0 2px #fff4c4,0 3px #3e6756}.shop-item[aria-pressed=true]:after{content:'✓';position:absolute;right:5px;top:4px;font-size:12px;font-weight:800;border-radius:50%;padding:2px 4px;background:#427261;color:#fff5c9}.shop-item-art{display:grid;place-items:center;position:relative;background:radial-gradient(#f5ddb0,#d8bd86);border:1px solid #b69b69;border-radius:12px;width:100%;max-width:100px;aspect-ratio:1;margin:0 auto 7px}.shop-item[data-quality=fine] .shop-item-art,.shop-item-art[data-quality=fine]{background:radial-gradient(#e4edb6,#9fb578);border-color:#708456}.shop-item-art img,.shop-item-art svg{width:90%;height:90%;object-fit:contain;filter:drop-shadow(0 3px 2px #55412b35)}.shop-item-art i{position:absolute;bottom:3px;right:4px;font-size:9px;font-style:normal;background:#fff1d5d9;padding:2px 4px;border-radius:5px;color:#80633c}.shop-item>b{font-size:12px;line-height:1.5;white-space:normal}.shop-price{font-weight:750;display:flex;align-items:center;gap:2px;margin-top:3px;font-size:13px}.shop-price img{width:20px;height:20px}.shop-item>small{font-size:9px;color:#8d744e;margin-top:3px}.shop-stock-note{font-size:10px;color:#8b7351;line-height:1.7;margin-top:17px}.shop-detail{position:sticky;top:15px}.shop-detail-heading{display:flex;align-items:center;gap:11px}.shop-detail-heading>.shop-item-art{width:78px;flex-shrink:0;margin:0}.shop-detail-heading small{font-size:10px;color:#8a714b}.shop-detail-heading h2{font-size:21px;margin:5px 0 6px}.shop-detail-heading div>span{font-size:11px;color:#94784f}.shop-description{font-size:12px;line-height:1.8;margin:17px 0;color:#7a694c}.shop-comparison{background:#fff9e8aa;border:1px solid #ccb58a;border-radius:10px;padding:10px 12px}.shop-comparison p{font-size:10px;color:#8d7b58;margin-bottom:6px}.shop-comparison>div{display:flex;gap:10px;align-items:center;font-size:12px;min-height:27px}.shop-comparison b{margin-left:auto}.shop-comparison em{font-size:10px;font-style:normal;min-width:46px;text-align:right}.shop-comparison .up{color:#427259}.shop-comparison .down{color:#a25036}.shop-comparison .same{color:#958362}.shop-supply-effect{display:grid;gap:7px;border:1px solid #c9ab76;border-radius:11px;background:#e6dfb8;padding:13px}.shop-supply-effect b{font-size:17px;color:#527357}.shop-supply-effect span{font-size:10px;color:#80704c}.shop-quantity{display:flex;align-items:center;gap:12px;margin:18px 0 10px}.shop-quantity>span{margin-right:auto;font-size:12px}.shop-quantity button{min-width:44px;min-height:44px;border:2px solid #a88b5e;border-radius:11px;background:linear-gradient(#fff8e1,#e9d39d);font-size:21px;box-shadow:0 2px #a38658}.shop-quantity output{font-weight:800;min-width:20px;text-align:center}.shop-total{display:flex;align-items:center;justify-content:space-between;margin:14px 0;font-size:12px}.shop-total b{display:flex;align-items:center;font-size:22px;color:#8a6131;gap:6px}.shop-buy{width:100%;font-size:14px}.shop-buy-note{display:block;font-size:10px;line-height:1.7;text-align:center;color:#8e7854;margin:13px 0 4px}.shop-link{display:flex;align-items:center;justify-content:center;width:100%;min-height:44px;background:transparent;border:0;color:#4e7b6b;font-size:12px;font-weight:700;gap:7px}.shop-link svg{width:17px;height:17px}.shop-footer{margin:24px 0 0;text-align:center;color:#c1c9ad;font-size:10px;line-height:1.8}.shop-loading,.shop-load-error{max-width:500px;margin:80px auto;padding:24px;color:#f8e7c3;text-align:center}.shop-load-error{color:#6e593a}.shop-load-error>*{margin-bottom:20px}
.trial-extra-supply{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid #b69c64;border-radius:10px;margin:12px 0;text-align:left;font-size:13px}.trial-extra-supply input{width:22px;height:22px;flex-shrink:0;accent-color:#587962}.trial-extra-supply small{display:block;font-size:10px;color:#87764f;margin-top:5px}
body[data-screen=shop] .preview-bar{position:static;margin-top:0}
@media(max-width:759px){.shop-world{padding-inline:12px}.shop-header{gap:12px;padding-bottom:16px}.shop-header h1{font-size:22px}.shop-content{display:block;margin-top:14px}.shop-stock{padding:13px}.shop-detail{position:static;margin-top:17px;padding:16px}.shop-counter{min-height:180px}.shop-counter-scene{height:185px;width:43%}.shop-npc{height:180px;width:120%;left:-10%}.shop-nameplate{padding:4px 8px;font-size:12px;gap:4px}.shop-dialogue{padding:15px 15px 24px 6px}.shop-dialogue h2{font-size:19px;line-height:1.5;margin:8px 0}.shop-dialogue p{font-size:10px}.shop-dialogue>small{font-size:7px;letter-spacing:.08em}.shop-grid{gap:9px}.shop-purse{gap:7px;padding:7px 9px}.shop-purse>span{font-size:17px}.shop-purse>small{font-size:9px}.shop-purse>b{font-size:10px}.shop-switch{gap:8px}.shop-switch button{font-size:12px}.shop-stock-title{margin-bottom:12px;padding-bottom:10px}.shop-stock-title h2{font-size:17px}}
@media(min-width:760px){.shop-counter-scene{height:230px;width:40%}.shop-npc{height:232px}.shop-dialogue{padding-left:25px}.shop-dialogue h2{font-size:30px}.shop-counter{min-height:230px}.shop-header h1{font-size:30px}.shop-switch{position:absolute;top:calc(24px + env(safe-area-inset-top));left:50%;width:330px;transform:translateX(-25%)}.shop-header{padding-bottom:24px}}
.shop-counter-scene .shop-npc{height:calc(100% - 26px);bottom:15px}

.shop-dialogue h2{text-wrap:balance}.shop-buy-feedback{font-size:12px;color:#476c49;line-height:1.6;margin:13px 0 0}.shop-buy-feedback.error{color:#9b4833}
/* Give game menus their own touch-scroller in the native WKWebView host. */
body[data-screen=shop]{overflow:hidden;padding:0}
.shop-world{height:var(--view-height);min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch}
.shop-wrap{position:relative}
@media(min-width:760px){.shop-switch{top:8px}}

.shop-world{scroll-padding-top:calc(12px + env(safe-area-inset-top))}.shop-back-stock{justify-content:flex-start;margin:-8px 0 9px}.shop-detail:focus{outline:none}@media(min-width:760px){.shop-back-stock{display:none}}
