/* Shop labels wrap at word boundaries; card actions share a baseline. */
#rarities-shop-window{width:min(540px,100%)}
#rarities-shop-window #rarities-shop-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,8.5rem),1fr));gap:12px;align-items:stretch}
#rarities-shop-grid .rarity-product{display:flex;flex-direction:column;align-items:center;padding:12px 10px;min-width:0}
#rarities-shop-window #rarities-shop-grid .rarity-product-name{width:100%;flex:1 0 auto;min-height:0;margin:2px 0 8px;font-size:.93rem;line-height:1.25;word-break:normal;overflow-wrap:normal;hyphens:none}
#rarities-shop-grid .rarity-product-price{flex:none;margin:0 0 9px;font-size:.89rem;line-height:1.3;white-space:nowrap}
#rarities-shop-grid .rarity-product>button:not(.rarity-product-icon-button){flex:none;min-height:44px;line-height:1.3;word-break:normal;overflow-wrap:normal;white-space:normal}
#rarities-shop-grid .rarity-product-icon,#rarities-shop-grid .rarity-product-icon-button{flex:none}
/* Equal icon rows and reserved label space prevent multi-line captions moving icons. */
#merchant-chest-reward-modal{padding:calc(44px + var(--safe-top,0px)) max(12px,var(--safe-right,0px)) calc(12px + var(--safe-bottom,0px)) max(12px,var(--safe-left,0px))}
#merchant-chest-reward-modal.safe-modal-overlay > #merchant-chest-reward-window{display:flex;flex-direction:column;width:min(380px,100%);max-height:calc(min(100dvh,var(--modal-viewport-height,100dvh)) - var(--safe-top,0px) - var(--safe-bottom,0px) - 76px);padding:38px 14px 18px;overflow:visible}
#merchant-chest-reward-window .merchant-chest-reward-title{flex:none;margin:0 0 16px}
#merchant-reward-track{--merchant-loot-size:4.75rem;flex:1 1 auto;display:flex;flex-wrap:wrap;align-items:flex-start;align-content:flex-start;justify-content:center;gap:14px 10px;min-height:0;width:100%;margin:0 auto;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
#merchant-reward-track[data-reward-count="4"]{max-width:calc(2 * var(--merchant-loot-size) + 10px)}
#merchant-reward-track .merchant-reward-item{flex:0 0 var(--merchant-loot-size);display:grid;grid-template-rows:46px auto;align-content:start;justify-items:center;gap:6px;min-width:0;box-sizing:border-box}
#merchant-reward-track .merchant-reward-item__icon{width:44px;height:44px;box-sizing:border-box}
#merchant-reward-track .merchant-reward-item__label{display:block;width:var(--merchant-loot-size);max-width:none;min-height:3.75em;margin:0;font:700 .75rem/1.25 system-ui,sans-serif;text-align:center;word-break:normal;overflow-wrap:normal;hyphens:none}
#merchant-chest-reward-window .merchant-reward-done{flex:none;align-self:center;margin-top:16px}
@media(max-height:450px){#merchant-chest-reward-window{padding-top:30px;padding-bottom:12px}#merchant-chest-reward-window .merchant-chest-reward-title{margin-bottom:10px}#merchant-chest-reward-window .merchant-reward-done{margin-top:10px}}
