/* Face-to-face trade, official UI_Trade (ui_trade.unity3d): 430x345, content bod002 417x311 at
   (7,28); left panel = the other player, right = self (bod013 205x257); in each a 190x190 box
   with the general (128x128 picture, 5 gear slots 40x40, name/LV/HP bar 35 high) or the 25 item
   slots (official stacks both at the same place; the 武將/道具 switch is ours), gold bar 125x25,
   確認 / 交易 buttons 70x25. Positions computed from the prefab RectTransforms. */
#trade-overlay{position:fixed;inset:0;z-index:62;background:rgba(0,0,0,.35)}
.trade-window{position:absolute;left:50%;top:50%;width:430px;height:345px;transform:translate(-50%,-50%) scale(var(--trade-scale,1));
  border-image:url('ui/common0_bod011.png') 8 fill/8px stretch;font:700 14px TSClient,'Microsoft JhengHei',sans-serif;color:#111}
.trade-title{position:absolute;left:12px;top:5px;color:#fff;font-size:15px;text-shadow:1px 1px #347fb8,-1px -1px #347fb8}
.trade-close{position:absolute;left:404px;top:4px;width:21px;height:21px;padding:0;border:0;background:url('ui/common0_but002D.png') center/contain no-repeat;cursor:pointer}
.trade-content{position:absolute;left:7px;top:28px;width:417px;height:311px;box-sizing:border-box;border-image:url('ui/common0_bod002.png') 15 12 12 15 fill/10px 8px 8px 10px stretch}
.trade-side{position:absolute;top:4px;width:205px;height:257px;box-sizing:border-box;border-image:url('ui/common0_bod013.png') 4 5 9 4 fill/4px 5px 9px 4px stretch}
.trade-side.other{left:4px}
.trade-side.self{left:208px}
.trade-name{position:absolute;left:8px;top:5px;max-width:120px;overflow:hidden;white-space:nowrap;font-size:16px}
.trade-state{position:absolute;right:8px;top:7px;font-size:12px;color:#1c8b3b}
/* Spans the title bar width: only its buttons take clicks, so × stays pressable. */
.trade-modes{position:absolute;left:0;right:0;top:-24px;display:flex;justify-content:center;gap:6px;pointer-events:none}
.trade-modes button{pointer-events:auto}
/* ui/trade/tab.png: official but065D pre-rendered 120x42 (no nine-slice seams when scaled). */
.trade-mode{width:56px;height:22px;padding:0;border:0;background:url('ui/trade/tab.png') center/100% 100% no-repeat;color:#fff;font:700 13px TSClient,sans-serif;text-shadow:1px 1px #3c7171;cursor:pointer;opacity:.6}
.trade-mode.active{opacity:1}
.trade-box{position:absolute;left:7.5px;top:28.5px;width:190px;height:190px;box-sizing:border-box}
.trade-box.general{border-image:url('ui/common0_bod013.png') 4 5 9 4 fill/4px 5px 9px 4px stretch}
.trade-npc{position:absolute;left:31px;top:1px;width:128px;height:128px;display:flex;align-items:flex-end;justify-content:center;overflow:hidden}
/* The general at its native sprite size (the portrait canvas is drawn 1.15x), feet just above the
   gear row like the official 128x128 RawImage. */
.trade-npc canvas{width:111px;height:130px;flex:none;margin-bottom:12px}
.trade-empty{position:absolute;left:0;right:0;top:52px;text-align:center;color:#8a8aa8;font-size:14px}
.trade-arrow{position:absolute;top:85.5px;width:27px;height:19px;padding:0;border:0;background:url('ui/common0_but003D.png') center/contain no-repeat;cursor:pointer}
.trade-arrow.prev{left:11.5px;transform:scaleX(-1)}
.trade-arrow.next{left:151.5px}
/* Slots drawn like the bag cells (ui/bag/item-slot.png = official bod003 as a square slot). */
.trade-equip{position:absolute;top:116px;width:40px;height:40px;box-sizing:border-box;background:url('ui/bag/item-slot.png') center/100% 100% no-repeat}
.trade-equip img,.trade-item img{position:absolute;inset:3px;width:calc(100% - 6px);height:calc(100% - 6px);object-fit:contain}
.trade-info{position:absolute;left:0;right:0;bottom:0;height:35px;box-sizing:border-box;border-image:url('ui/common0_bod013.png') 4 5 9 4 fill/4px 5px 9px 4px stretch;font-size:13px}
.trade-info .trade-n{position:absolute;left:8px;top:1px;max-width:175px;overflow:hidden;white-space:nowrap}
.trade-info .trade-lv{position:absolute;left:8px;top:16px;color:#5c55a5}
.trade-info .trade-hp{position:absolute;left:70px;top:16px;color:#5c55a5}
.trade-box.items{display:grid;grid-template-columns:repeat(5,36px);grid-auto-rows:36px;gap:2px;padding:1px}
.trade-item{position:relative;padding:0;border:0;box-sizing:border-box;background:url('ui/bag/item-slot.png') center/100% 100% no-repeat}
.trade-item b{position:absolute;left:3px;bottom:1px;color:#fff;font:700 10px TSClient,sans-serif;text-shadow:-1px 0 #111,1px 0 #111,0 -1px #111,0 1px #111}
.trade-side.self .trade-item{cursor:pointer}
.trade-gold{position:absolute;left:40px;top:224.5px;width:125px;height:25px;box-sizing:border-box;padding:0 6px;border:0;border-image:url('ui/common0_bod019.png') 7 fill/5px stretch;color:#fff;font:700 15px TSClient,sans-serif;text-align:right;line-height:25px}
input.trade-gold{background:none;outline:none}
.trade-coin{position:absolute;left:10.5px;top:230px;width:22px;height:14px;background:url('ui/common0_icon018.png') center/contain no-repeat}
/* Official but001D pre-rendered at its own proportions (ui/shop/confirm.png, 124x50, the same
   button as 確定 in the quantity window); 70x28 keeps that shape (prefab 70x25). */
.trade-button{position:absolute;top:272px;width:70px;height:28px;padding:0;border:0;background:url('ui/shop/confirm.png') center/100% 100% no-repeat;color:#fff19b;font:700 15px TSClient,sans-serif;text-shadow:-1px 0 #6862ae,1px 0 #6862ae,0 -1px #6862ae,0 1px #6862ae;cursor:pointer}
.trade-button:disabled{filter:grayscale(1);opacity:.6;cursor:default}
.trade-check{left:128.5px}
.trade-go{left:218.5px}
/* Bag picker for the item offer (ours: official item selection is in encrypted Lua). */
.trade-picker{position:absolute;left:208px;top:4px;width:205px;height:257px;z-index:3;box-sizing:border-box;padding:6px;overflow-y:auto;
  border-image:url('ui/common0_bod013.png') 4 5 9 4 fill/4px 5px 9px 4px stretch;display:grid;grid-template-columns:repeat(5,36px);grid-auto-rows:36px;gap:2px;align-content:start}
.trade-picker-title{grid-column:1/-1;height:20px;font-size:13px;color:#5c55a5}
.trade-item:disabled{opacity:1;cursor:default}
/* General sheet over one side (ours; UI_Trade has no stat view): tap the general to open, any tap closes. */
.trade-detail{position:absolute;top:4px;width:205px;height:257px;z-index:3;box-sizing:border-box;padding:8px 10px;cursor:pointer;border-image:url('ui/common0_bod013.png') 4 5 9 4 fill/4px 5px 9px 4px stretch;font-size:13px}
.trade-detail.other{left:4px}
.trade-detail.self{left:208px}
.trade-detail-head{display:flex;align-items:center;gap:6px;height:30px}
.trade-detail-head img{width:26px;height:26px;object-fit:contain}
.trade-detail-head b{font-size:16px;max-width:95px;overflow:hidden;white-space:nowrap}
.trade-detail-head span{margin-left:auto;color:#5c55a5}
.trade-detail-line{height:20px;line-height:20px;color:#5c55a5}
.trade-detail-stats{display:grid;grid-template-columns:1fr 1fr;gap:2px;margin:4px 0}
.trade-detail-stat{display:flex;justify-content:space-between;height:22px;line-height:22px;padding:0 7px;background:#e0eeee;border-bottom:2px solid #d3e4e5}
.trade-detail-stat span{color:#fff;text-shadow:-1px 0 #86adad,1px 0 #86adad,0 -1px #86adad,0 1px #86adad}
.trade-detail-stat b{color:#315d60}
.trade-detail-skills{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}
.trade-detail-skill{position:relative;width:34px;height:34px;background:#201d42;border:1px solid #aac5c6}
.trade-detail-skill img{width:100%;height:100%}
.trade-detail-skill b{position:absolute;right:2px;bottom:0;color:#fff;font-size:11px;text-shadow:1px 1px #111,-1px -1px #111}
.trade-detail-none{color:#8a8aa8}
