.fund-shop {
  width: min(590px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  max-height: min(90dvh, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 12px));
  padding: 0;
  border: 2px solid #a4936c;
  border-radius: 7px;
  box-shadow: 0 0 0 3px #25332a, 0 10px 35px #051912b0;
  background: #20372e;
  color: #efe8ce;
  font: 15px/1.4 var(--mono, monospace);
  overscroll-behavior: contain;
  overflow: auto;
  scrollbar-color: #62745d #21372e;
}
.fund-shop::backdrop {background: #061611bd;}
.fund-shop-panel {padding: 18px 20px 17px;}
.fund-shop-header, .fund-balance-line {display: flex; align-items:center; justify-content:space-between; gap:12px;}
.fund-shop-header h2 {margin: 0; color:#fff0c2; font:normal clamp(24px,6vw,34px)/1.15 var(--pixel,monospace);}
.fund-shop button, .fund-rules summary {min-height:44px; touch-action:manipulation; cursor:pointer;}
.fund-shop button {
  border:1px solid #7d8c73; border-radius:4px; padding:8px 12px; color:#f2e9ca;
  background:#2a4136; font:700 14px/1.25 var(--mono,monospace);
}
.fund-shop button:focus-visible, .fund-rules summary:focus-visible {outline: 3px solid #f2c36b; outline-offset:2px;}
.fund-shop button:active:enabled {transform:translateY(1px);}
.fund-close {flex:none;}
.fund-balance-line {
  margin:14px 0; padding:9px 13px;
  border:1px solid #9c845b; border-radius:3px; background:#ede1b9; color:#374335;
  box-shadow:inset 0 -2px #cebe91;
}
.fund-bank-label {font-weight:700;}
.fund-balance {display:inline-flex;align-items:center; gap:7px; color:#514329; font:normal 25px/1.2 var(--pixel,monospace);}
.fund-balance::before {
  content:''; width:14px;height:15px; background:
    linear-gradient(90deg,transparent 36%,#fff0a4 36% 49%,transparent 49%) center/100% 56% no-repeat,
    linear-gradient(90deg,#b27a35 16%,#f1c468 16% 73%,#d39141 73%);
  clip-path:polygon(26% 0,74% 0,74% 9%,88% 9%,88% 21%,100% 21%,100% 79%,88% 79%,88% 91%,74% 91%,74% 100%,26% 100%,26% 91%,12% 91%,12% 79%,0 79%,0 21%,12% 21%,12% 9%,26% 9%);
}
.fund-shop-tabs {display:flex;gap:6px; margin:0 0 12px;}
.fund-shop-tabs button {flex:1;}
.fund-shop-tabs button[aria-pressed=true] {background:#42523a; border-color:#dfc383; box-shadow:inset 0 -2px #c6a768; color:#fff0c2;}
.fund-products {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px;}
.fund-product {
  display:grid; grid-template-columns:49px minmax(0,1fr); align-content:start; gap:6px 10px;
  padding:10px; border:1px solid #64735a; background:#293e31; border-radius:4px;
}
.fund-product-face {
  display:grid;place-items:center;width:49px;height:55px; margin-top:1px;
  border:1px solid #9c936c;border-radius:3px;
  background:repeating-linear-gradient(0deg,transparent 0 5px,#c6b58d66 5px 6px),#dfd0a4;
}
.fund-product-face img {width:44px;height:44px;object-fit:contain;image-rendering:pixelated;}
.fund-product-copy {display:contents;}
.fund-item-city {grid-column:2; grid-row:1; align-self:start; font-size:12px; font-weight:700; color:#c7d39e;}
.fund-product h3 {grid-row:1;grid-column:2; margin:20px 0 0; color:#f6e6ad; font:700 16px/1.2 var(--mono,monospace);}
.fund-product p {grid-column:1/-1; margin:2px 0; font-size:14px; line-height:1.35; color:#e5e2c9;}
.fund-buy-row {grid-column:1/-1;margin-top:3px; display:grid;gap:4px;}
.fund-shop .fund-buy {background:#e9bb68;color:#313426;border-color:#e8cc86; box-shadow:inset 0 -2px #b58440;}
.fund-shop .fund-buy:disabled {background:#334a38;border-color:#65765b;box-shadow:none; color:#caceb5;cursor:default;}
.fund-shop .fund-owned .fund-buy {border-color:#8ca17b;color:#c8e5b7;}
.fund-needed {font-size:12px;color:#c6ceb2;line-height:1.3;}
.fund-needed:empty, .fund-feedback:empty {display:none;}
.fund-feedback {margin:10px 0 0;font-size:14px;color:#f7dc9a;}
.fund-rules {margin:10px 0 0;border-top:1px solid #69795b;}
.fund-rules summary {padding:12px 0 6px;color:#e2d4ac;font-weight:700;}
.fund-rules p {margin:2px 0 0;color:#d2d8bd;line-height:1.45;font-size:14px;}
.fund-ornament {
  position:absolute;left:1%;top:0;width:7%; aspect-ratio:1; z-index:2;
  pointer-events:none; user-select:none; image-rendering:pixelated;
  filter:drop-shadow(1px 1px 0 #27262080);
}
.fund-ornament[data-city="george-town"], .fund-ornament[data-city="dalat"] {left:auto;right:.7%;}
.fund-ornament[data-city="taishan"] {left:.4%;}
.fund-ornament img {position:absolute;inset:0;display:block;width:100%;height:100%;max-width:none;image-rendering:pixelated;}
.fund-ornament-lit {opacity:var(--stall,0);filter:drop-shadow(0 0 2px #ffdc8b);}
@media (max-width:460px) {
  .fund-shop {width:calc(100% - 14px);}
  .fund-shop-panel {padding:12px;}
  .fund-products {grid-template-columns:1fr;}
  .fund-product {grid-template-columns:54px minmax(0,1fr); gap:5px 11px;}
  .fund-product-face {grid-row:1/4; width:54px;height:61px;}
  .fund-product-face img {width:50px;height:50px;}
  .fund-product h3 {grid-row:2; margin:0;}
  .fund-product p {grid-column:2;grid-row:3;margin:0 0 1px;}
  .fund-buy-row {display:flex;align-items:center;flex-wrap:wrap;gap:6px;}
  .fund-buy-row button {flex:1;}
  .fund-needed {flex:1;text-align:center;}
  .fund-bank-label {font-size:14px;}
}
@media (max-height:500px) and (orientation:landscape) {
  .fund-shop-panel {padding:9px 13px;}
  .fund-shop-header h2 {font-size:25px;}
  .fund-balance-line {margin:6px 0;}
}

.fund-toy-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0}
.fund-toy-buttons .fund-close{min-height:44px;margin:0;padding:8px;color:#f6e6b9}
