/* 그림자 영웅 - the shop (js/rpgui.js shop). The shopkeeper stands on the left and talks about the picked item;
   every item is on one screen on the right: fifteen 투척품, eight 소모품 (2026-12-01: eight tiles a row, still three rows), no tabs and no
   scrolling on a normal screen. */
#scr-menu .menu-panel:has(.shop-stall){overflow:hidden;display:flex}
#scr-menu .menu-panel:has(.shop-stall)>.card{display:flex;flex-direction:column;flex:1;min-height:0;height:100%}
.eq-root:has(.shop-stall){display:flex;flex-direction:column;flex:1;min-height:0;margin:0}
.items-box.overview .eq-root:has(.shop-stall){height:100%}

.shop-stall{--icon:54px;display:grid;grid-template-columns:minmax(170px,25%) minmax(0,1fr);gap:14px;flex:1;min-height:0;color:var(--ui-ink);font:500 13px/1.3 var(--sans)}
.shop-keeper{display:flex;flex-direction:column;min-height:0;border:1px solid var(--ui-line);border-radius:6px;overflow:hidden;background:#12161d}
.shop-keeper-art{flex:1 1 0;min-height:0;width:100%;object-fit:cover;object-position:50% 24%;display:block}
.shop-talk{flex:none;display:grid;gap:6px;padding:10px 12px;border-top:1px solid var(--ui-line);background:#161c25}
.shop-talk-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.shop-talk-head b{font:700 16px/1.2 var(--sans)}
.shop-talk-head span{color:var(--ui-muted);font-size:12px;white-space:nowrap}
.shop-count{font-style:normal;color:var(--ui-ink)}
.shop-gain{margin-left:6px;color:#f2d28a;font-style:normal;font-weight:700}      /* the running count of a held buy button */
.shop-buy,.shop-item{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.shop-talk p{margin:0;min-height:2.9em;color:#c9d3dd;font-size:12.5px;line-height:1.45}
.shop-buy{display:flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:4px 8px;border:1px solid #ce5a4d;border-radius:4px;background:#b43b31;color:#fff7f2;font:700 14px/1.2 var(--sans);touch-action:manipulation}
.shop-buy:disabled{background:var(--ui-raised);border-color:var(--ui-line);color:var(--ui-muted)}
.shop-note{color:var(--ui-muted);font-size:11px;line-height:1.35}
.coin{width:1.15em;height:1.15em;object-fit:contain;flex:none;vertical-align:-.18em}

.shop-goods{display:flex;flex-direction:column;gap:8px;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:1px 2px 1px 1px}
.shop-purse{display:flex;align-items:center;gap:7px;flex:none;font:700 15px/1.2 var(--sans)}
.shop-purse small{margin-left:auto;color:var(--ui-muted);font:500 12px/1.2 var(--sans);text-align:right}
.shop-group{display:grid;gap:5px;flex:none}
.shop-group h4{margin:0;color:var(--ui-muted);font:700 12.5px/1.2 var(--sans)}
.shop-group h4 small{font-weight:500}
.shop-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:6px}
.shop-item{position:relative;display:grid;justify-items:center;align-content:start;gap:3px;min-width:0;padding:8px 4px 7px;border:1px solid var(--ui-line);border-radius:6px;background:var(--ui-raised);color:var(--ui-ink);font:inherit;touch-action:manipulation}
.shop-item:hover{border-color:#6b7b8d}
.shop-item[aria-pressed="true"]{border-color:var(--ui-focus);background:color-mix(in srgb,var(--ui-accent) 16%,var(--ui-raised))}
.shop-icon{position:relative;width:var(--icon);height:var(--icon);max-width:70%}
.shop-icon img{width:100%;height:100%;object-fit:contain;display:block}
.shop-have{position:absolute;right:-9px;bottom:-3px;min-width:19px;padding:1px 4px;border:1px solid var(--ui-line);border-radius:9px;background:#0e1218;color:var(--ui-ink);font:700 11px/1.3 var(--sans);font-style:normal;text-align:center}
.shop-item b{max-width:100%;font:600 12.5px/1.2 var(--sans);text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.shop-price{display:flex;align-items:center;gap:3px;color:#f2d28a;font:700 12.5px/1.2 var(--sans)}
.shop-item.poor .shop-price{color:var(--ui-loss)}
.shop-item.full .shop-price{color:var(--ui-muted)}
/* 2026-12-02 (user): 물약·포션 등 소모품은 X 표시, 구입 불가 */
.shop-item.closed .shop-icon img{opacity:.38;filter:grayscale(.85)}
.shop-item.closed b{color:var(--ui-muted)}
.shop-item.closed .shop-price{color:var(--ui-loss)}
.shop-x{position:absolute;inset:-4px;display:grid;place-items:center;color:#ff5a4a;font:900 calc(var(--icon) * .9)/1 var(--sans);font-style:normal;text-shadow:0 0 3px #000,0 0 6px #000;pointer-events:none}
.shop-services{display:flex;gap:8px;flex:none;margin-top:auto;padding-top:8px;border-top:1px solid var(--ui-line)}
.shop-services .supply-tab{flex:1;min-width:0;white-space:normal}
.shop-stall.throw-only .shop-grid{grid-template-columns:repeat(8,minmax(0,1fr))}
.shop-stall.throw-only{--icon:64px}

/* narrow pop-ups (the merchant window, anything that is not the wide panel): no picture, the talk on top, five tiles a row */
.items-box:not(.overview) .shop-stall{grid-template-columns:minmax(0,1fr);gap:8px;--icon:44px}
.items-box:not(.overview) .shop-keeper-art{display:none}
.items-box:not(.overview) .shop-grid{grid-template-columns:repeat(5,minmax(0,1fr))}

@media(max-width:1000px){
 .shop-stall{--icon:44px;gap:10px;grid-template-columns:minmax(150px,24%) minmax(0,1fr)}
 .shop-stall.throw-only{--icon:52px}
 .shop-purse small{font-size:11px}
}
@media(max-height:600px) and (orientation:landscape){
 .shop-stall{--icon:26px;gap:8px;font-size:11px;grid-template-columns:minmax(132px,22%) minmax(0,1fr)}
 .shop-stall.throw-only{--icon:36px}
 .shop-talk{gap:4px;padding:6px 8px}
 .shop-talk-head b{font-size:13px}.shop-talk-head span{font-size:10px}
 .shop-talk p{font-size:10.5px;line-height:1.35;min-height:2.7em}
 .shop-buy{min-height:30px;font-size:12px}
 .shop-goods{gap:3px}
 .shop-purse{font-size:12px}.shop-purse small{font-size:10px}
 .shop-group{gap:2px}.shop-group h4{font-size:10px}
 .shop-grid{gap:4px}
 .shop-item{gap:1px;padding:3px 2px 2px;border-radius:4px}
 .shop-item b{font-size:10.5px}.shop-price{font-size:10.5px}
 .shop-have{right:-10px;bottom:-4px;min-width:15px;padding:0 3px;font-size:9.5px}
 .shop-services{gap:4px;padding-top:3px}
 .shop-services .supply-tab{min-height:24px;padding:1px 6px;font-size:10.5px}
}
@media(max-height:400px) and (orientation:landscape){      /* 2026-12-01: 23 goods on a phone held sideways (812x375) without scrolling */
 .shop-stall{--icon:22px}
 .shop-stall.throw-only{--icon:30px}
 .shop-item{padding:2px 2px 1px}
}
@media(max-height:340px) and (orientation:landscape){
 .shop-stall{--icon:20px}
 .shop-stall.throw-only{--icon:28px}
 .shop-purse small{display:none}
 .shop-talk p{min-height:0}
}
/* 2026-12-01: a phone held upright - the shopkeeper becomes a strip above the goods (picture beside the talk), five tiles a row */
@media(max-width:600px) and (orientation:portrait){
 .shop-stall{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:6px;--icon:26px}
 .shop-stall.throw-only{--icon:32px}
 .shop-keeper{flex-direction:row}
 .shop-keeper-art{flex:0 0 76px;width:76px;height:auto;align-self:stretch}
 .shop-talk{flex:1;min-width:0;gap:4px;border-top:0;border-left:1px solid var(--ui-line);padding:6px 8px}
 .shop-talk-head b{font-size:14px}
 .shop-talk p{min-height:0;font-size:11.5px;line-height:1.35}
 .shop-buy{min-height:32px;font-size:13px}
 .shop-goods{gap:4px}
 .shop-purse{font-size:13px}.shop-purse small{display:none}
 .shop-group{gap:3px}.shop-group h4{font-size:11px}
 .shop-grid,.shop-stall.throw-only .shop-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
 .shop-item{gap:1px;padding:3px 2px 2px;border-radius:5px}
 .shop-item b{font-size:11px}.shop-price{font-size:11px}
 .shop-services{gap:6px;padding-top:5px}
 .shop-services .supply-tab{min-height:30px;padding:2px 6px;font-size:11px}
}
