/* Shared inventory surfaces; keep the existing PixelLab item art. */
#game-shell .bag-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
#game-shell .bag-summary span{display:grid;gap:6px;padding:12px;border-color:#466058;background:linear-gradient(145deg,#203c32,#152c25);border-radius:10px;color:#f0e5c6;font-size:13px}
#game-shell .bag-summary small{color:#a9c4b8;font-size:11px}
#game-shell .bag-summary progress{width:100%;height:6px;accent-color:#83cbb0}
#game-shell .bag-summary .is-full{border-color:#dca16d;color:#ffd3a0}
#game-shell .bag-summary .is-full progress{accent-color:#e9b06e}
#game-shell .bag-contents,#game-shell .bag-selected{padding:14px;border-color:#466058;border-radius:12px;background:linear-gradient(160deg,#1c352c,#12271f);box-shadow:0 6px 20px #06130d26}
#game-shell .bag-layout h3{padding-bottom:12px;border-bottom:1px solid #b8d1bc22;color:#f0dfae}
#game-shell .bag-slot{border-width:1px;border-color:#557267;border-bottom:3px solid var(--rarity,#557267);border-radius:9px;background:linear-gradient(145deg,#30483c,#192e25)}
#game-shell .bag-slot[aria-pressed=true]{border-color:#e9ce89;background:linear-gradient(145deg,#526348,#2b4231);box-shadow:inset 0 0 0 1px #e9ce89,0 0 0 2px #e9ce892b}
#game-shell .bag-slot-count{padding:3px 5px;font-size:12px;right:3px;bottom:3px}
#game-shell .bag-slot .item-image{position:relative;z-index:1;border:0!important;filter:none!important;background:transparent;box-shadow:none;animation:none}
#game-shell .bag-slot:has([data-item-grade]){isolation:isolate;border:1px solid var(--rarity);border-bottom-width:3px;box-shadow:inset 0 0 0 1px #ffffff1c,inset 0 0 12px color-mix(in srgb,var(--rarity) 16%,transparent),0 2px 4px #0005}
#game-shell .bag-slot:has([data-item-grade])::before{content:'';position:absolute;inset:3px;border-radius:5px;pointer-events:none;background:linear-gradient(var(--rarity),var(--rarity)) left top/9px 2px,linear-gradient(var(--rarity),var(--rarity)) left top/2px 9px,linear-gradient(var(--rarity),var(--rarity)) right bottom/9px 2px,linear-gradient(var(--rarity),var(--rarity)) right bottom/2px 9px;background-repeat:no-repeat;opacity:.75}
#game-shell .bag-slot:has([data-item-grade]:not([data-item-grade=Common]))::after{content:'';position:absolute;inset:-3px -2px 1px;border-radius:9px;pointer-events:none;background:radial-gradient(ellipse at 15% 75%,var(--rarity),transparent 48%),radial-gradient(ellipse at 85% 65%,var(--rarity),transparent 48%),radial-gradient(ellipse at 35% 95%,var(--rarity),transparent 42%),radial-gradient(ellipse at 70% 100%,var(--rarity),transparent 45%);background-size:80% 130%,75% 140%,90% 120%,85% 150%;background-repeat:no-repeat;filter:blur(3px);opacity:.3;animation:bag-grade-smoke 5.6s ease-in-out infinite;transform-origin:center bottom}
#game-shell .bag-slot:has([data-item-grade=Epic])::after{animation-delay:-1.6s}
#game-shell .bag-slot:has([data-item-grade=Legendary])::after{animation-delay:-3.2s;opacity:.25}
#game-shell .bag-slot:has([data-item-grade=Divine])::after{animation-delay:-2.4s;opacity:.3}
#game-shell .bag-slot-count,#game-shell .bag-slot-lock{z-index:2}
#game-shell .bag-slot[aria-pressed=true]:has([data-item-grade]){outline:2px solid #e9ce89;outline-offset:1px}
@keyframes bag-grade-smoke{0%,100%{transform:translateY(3px) scale(.92);background-position:0% 100%,100% 90%,15% 100%,90% 100%;opacity:.22}35%{transform:translateY(-4px) scale(1);background-position:15% 65%,85% 50%,25% 85%,75% 65%;opacity:.43}70%{transform:translateY(-8px) scale(1.04);background-position:5% 20%,95% 10%,40% 50%,65% 30%;opacity:.32}}
@media(prefers-reduced-motion:reduce){#game-shell .bag-slot:has([data-item-grade])::after{animation:none!important;opacity:.16}}
#game-shell .bag-selected-body .inventory-item{border-color:#6b816344;background:#0e211b80;border-radius:9px;line-height:1.7;overflow-wrap:anywhere}
#game-shell .bag-select-hint{min-height:220px;border:1px dashed #587569;border-radius:10px;color:#b4cbbf;background:#142b2280;line-height:1.8}
#game-shell .bag-gear,#game-shell .bag-more{border-color:#466058;border-radius:10px;background:#182f26}
#game-shell .bag-slots,.warehouse-columns [data-storage-rows],.group-storage-columns [data-storage-rows]{scrollbar-width:thin;scrollbar-color:#688f78 #12261f}
.warehouse-drawer{background:linear-gradient(155deg,#1b3027,#101f19)}
.warehouse-keeper-card{border-color:#917a4e;padding:10px 14px}
.warehouse-keeper-card img{width:60px;height:76px}
.warehouse-capacity{background:linear-gradient(125deg,#294737,#1b3228);border-color:#607c59;color:#c2d2c3;margin-top:14px;border-radius:12px}
.warehouse-capacity strong{color:#f1dfaa;font-variant-numeric:tabular-nums}
.warehouse-capacity progress{height:10px;accent-color:#9dc78c}
.warehouse-status{padding:10px 12px;border-radius:8px;background:#7ebc8c10;border:1px solid #7ebc8c30;line-height:1.6}
.warehouse-columns{gap:12px;margin:16px 0;align-items:start}
.warehouse-columns>section,.warehouse-gold,.warehouse-upgrades,.group-storage-columns>.group-card{padding:14px;border:1px solid #496251;border-radius:12px;background:#142b22}
.warehouse-columns h3,.group-storage-columns h4{margin:0 0 12px;color:#f0dfae;line-height:1.5}
.warehouse-columns>section:first-child h3{border-left:3px solid #91c8ab;padding-left:10px}
.warehouse-columns>section:last-child h3{border-left:3px solid #d7ba76;padding-left:10px}
.warehouse-columns p{line-height:1.7;color:#b9cbbd}
.warehouse-columns [data-storage-rows],.group-storage-columns [data-storage-rows]{max-height:440px;overflow:auto;overscroll-behavior:contain;padding:0 3px 3px 0}
.warehouse-item{display:flex;flex-direction:column;align-items:stretch;gap:10px;padding:12px;margin:8px 0;border:1px solid #50694d80;border-radius:10px;background:linear-gradient(135deg,#263c2e,#1a3026)}
.warehouse-item>div:first-child{display:grid;grid-template-columns:44px minmax(0,1fr);column-gap:10px;align-items:center;min-width:0}
.warehouse-item .item-image-row{grid-row:1 / 3;width:44px;height:44px;object-fit:contain;image-rendering:pixelated;border-radius:6px;background:#0a1c1780;padding:4px;box-sizing:border-box}
.warehouse-item strong{font-size:14px;line-height:1.5;color:#eee4c5}
.warehouse-item small{font-size:12px;line-height:1.5;color:#afc6b8;margin-top:3px}
.warehouse-actions{flex-wrap:wrap}
.warehouse-actions button,.group-storage-actions button{min-height:44px;border-color:#84b09a;background:#2c5040;color:#e3f0df;font-weight:600;border-radius:8px}
.warehouse-item [data-transfer=withdraw]{background:#514632;border-color:#b89d67;color:#f5e4ba}
.warehouse-actions button:hover:enabled,.group-storage-actions button:hover:enabled{filter:brightness(1.15)}
.warehouse-columns [data-deposit-all]{width:100%;min-height:44px;padding:10px;border:1px solid #87b69a;border-radius:8px;background:#294c3a;color:#e5eed8;cursor:pointer}
.warehouse-columns [data-deposit-all]:disabled{opacity:.45;cursor:not-allowed}
.warehouse-empty,.group-storage-empty{padding:24px 14px;text-align:center;line-height:1.8;border:1px dashed #55745d;border-radius:10px;color:#afc4b6}
.warehouse-gold{margin:14px 0}
.warehouse-gold h3{margin-top:0;color:#ecd7a0}
.warehouse-wallet{gap:8px;font-variant-numeric:tabular-nums}
.warehouse-wallet>span{padding:8px 10px;border:1px solid #64785644;border-radius:8px;background:#20382a}
.warehouse-upgrades{margin-top:16px}
.warehouse-columns .storage-list-controls,.group-storage-columns .storage-list-controls{grid-template-columns:minmax(0,1fr);gap:8px;padding:10px;background:#0d211a80;border-radius:9px}
.warehouse-columns .storage-list-controls input,.warehouse-columns .storage-list-controls select{border-color:#637e68;min-height:44px;border-radius:7px}
.group-storage-item{border-radius:10px;background:linear-gradient(135deg,#263c2e,#1a3026);border-color:#50694d80}
.group-storage-meter{height:8px;border-radius:8px;overflow:hidden}
.group-storage-actions button:focus-visible,.storage-list-controls :is(input,select):focus-visible{outline:2px solid #eed194;outline-offset:2px}
@media(max-width:760px){
 #game-shell .bag-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
 #game-shell .bag-summary span{padding:10px;font-size:12px}
 #game-shell .bag-contents,#game-shell .bag-selected{padding:12px}
 #game-shell .bag-select-hint{min-height:100px}
 .warehouse-columns{grid-template-columns:1fr}
 .warehouse-columns>section,.warehouse-gold,.warehouse-upgrades{padding:12px}
 .warehouse-columns [data-storage-rows],.group-storage-columns [data-storage-rows]{max-height:340px}
}
@media(prefers-reduced-motion:no-preference){#game-shell .bag-slot{transition:background .15s,border-color .15s}.warehouse-actions button,.group-storage-actions button{transition:filter .15s}}

.bag-craft-uses{margin-top:8px;min-width:0;text-align:left}
.bag-craft-uses summary{padding:8px;font-size:12px;border:1px solid #86734d;border-radius:8px;background:#29362d;color:#eed194;cursor:pointer;overflow-wrap:anywhere}
.bag-craft-uses summary:focus-visible{outline:2px solid #eed194;outline-offset:2px}
.bag-craft-uses section{display:grid;grid-template-columns:28px minmax(0,1fr);gap:8px;align-items:start;padding:7px 0;border-bottom:1px solid #86734d66;overflow-wrap:anywhere}
.bag-craft-uses section .bag-craft-icon{width:28px!important;height:28px!important;min-width:28px;max-width:28px;object-fit:contain;margin:0!important}
.bag-craft-copy{min-width:0}
.bag-craft-copy strong{font-size:12px;line-height:1.35}
.bag-craft-uses p{font-size:11px;line-height:1.4;margin:3px 0}

/* Broken gear stays red even in the bag's grade-colored cells. */
#game-shell .bag-slot:has([data-item-broken]){border-color:#ff7970;background:radial-gradient(ellipse at 50% 70%,#df363655,transparent 80%),#321d1b;box-shadow:inset 0 0 10px #ff484849,0 0 8px #e33a3a80}
#game-shell .bag-slot:has([data-item-broken])::before{background:none}
#game-shell .bag-slot:has([data-item-broken])::after{background:none;animation:none;filter:none}
#game-shell .bag-slot .item-image-broken[data-item-broken]{background:radial-gradient(ellipse at 50% 80%,#ed33336b,transparent 75%);box-shadow:inset 0 0 7px #ff48485c,0 0 7px #df252570;animation:none}
#game-shell .bag-slot .item-image-broken>.item-broken-badge{right:-2px;bottom:-2px;font-size:10px;line-height:14px}
