/* (31 Oct 2026, brief #22) trading album cards with friends (js/trade.js). (16 Nov 2026, user) REDESIGNED: one full-screen window, one top bar with the round back arrow,
   friends and offers scroll SIDEWAYS, "You give" / "You get" are two sideways strips, a bottom bar with the fair message and the Send button. Nothing scrolls up and down. */
.atrade{position:relative; margin-left:10px; vertical-align:middle; font-size:12px !important}
.tdot:not(:empty){position:absolute; right:-6px; top:-6px; min-width:16px; padding:0 4px; border-radius:99px; background:#c4262b; color:#fff; font-style:normal; font-size:10px; font-weight:800; line-height:16px}
html body #tradeBox:not(#_){position:fixed; inset:0; z-index:62; display:block; padding:0; overflow:hidden; background:#04120f var(--g-bg) center/cover no-repeat; --tf:clamp(11px,min(3.3vh,1.9vw),16px)}
html body #tradeBox[hidden]{display:none}
html body:has(#tradeBox:not([hidden])) #albumBack:not(#_){visibility:hidden}
.tpanel.tw{position:absolute; inset:0; width:min(960px,100%); margin:0 auto; box-sizing:border-box; display:flex; flex-direction:column; gap:calc(var(--tf)*.55); padding:max(6px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); background:none; border:0; border-radius:0; overflow:hidden; color:#f4ead2; font-size:var(--tf)}
/* the top bar */
.twbar{flex:none; display:flex; align-items:center; gap:calc(var(--tf)*.9); min-height:44px; padding-left:46px}
.twbar .xback{position:static !important; flex:none}
.twbar h3{padding-left:6px; margin:0; flex:1; min-width:0; font:400 calc(var(--tf)*1.7)/1.1 var(--f-display,Georgia),Georgia,serif; color:#f5cf9f; text-transform:none; letter-spacing:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.twwith{display:inline-flex; align-items:center; gap:calc(var(--tf)*.7)} .twwith .av{--avs:34px; width:var(--avs); height:var(--avs); flex:none; margin:calc((var(--fs,1) - 1) / 2 * var(--avs))}   /* the frame is bigger than the picture (--fs): the margin keeps the whole frame in its own space */
.twright{display:flex; gap:8px; flex:none}
.twinfo{width:34px; height:34px; border-radius:50%; border:1.5px solid rgba(240,192,138,.55); background:rgba(255,255,255,.06); color:#f5cf9f; font:700 16px/1 Georgia,serif; cursor:pointer; padding:0}
.twinfo.on{background:rgba(240,192,138,.28)}
.twnote{flex:none; margin:0; padding:calc(var(--tf)*.5) calc(var(--tf)*.8); border-radius:10px; background:rgba(0,0,0,.35); border:1px solid rgba(240,192,138,.25); font-size:calc(var(--tf)*.85); line-height:1.35; color:#e9dcb8}
/* sections */
.twsec{flex:none; display:flex; flex-direction:column; gap:calc(var(--tf)*.4); min-height:0} .twsec.grow{flex:1}
.tw h4{margin:0; font-size:calc(var(--tf)*.8); color:#e8c98a; text-transform:uppercase; letter-spacing:.09em; font-weight:700}
.tw h4 small{text-transform:none; letter-spacing:0; color:#c9b89a; font-weight:600; margin-left:8px; font-size:calc(var(--tf)*.85)}
.twempty{margin:0; padding:calc(var(--tf)*.8); color:#c9b89a; font-size:var(--tf)}
/* friends: sideways cards */
.twfr,.twcards,.tgrid{display:flex; gap:calc(var(--tf)*.7); overflow-x:auto; overflow-y:hidden; scrollbar-width:none; -webkit-overflow-scrolling:touch; touch-action:pan-x; scroll-snap-type:x proximity}
.twfr::-webkit-scrollbar,.twcards::-webkit-scrollbar,.tgrid::-webkit-scrollbar{display:none}
.twf{position:relative; flex:none; justify-content:flex-start; scroll-snap-align:start; width:calc(var(--tf)*7); display:flex; flex-direction:column; align-items:center; gap:2px; padding:calc(var(--tf)*.6) calc(var(--tf)*.4); border-radius:14px; background:rgba(255,255,255,.05); border:1.5px solid rgba(240,192,138,.28); color:#f4ead2; font:inherit; cursor:pointer}
.twf:active{background:rgba(240,192,138,.18); border-color:rgba(240,192,138,.7)}
.twf .av{--avs:calc(var(--tf)*3.2); width:var(--avs); height:var(--avs); flex:none; margin:calc((var(--fs,1) - 1) / 2 * var(--avs))}
.twf b{max-width:100%; font-size:calc(var(--tf)*.95); white-space:nowrap; overflow:hidden; text-overflow:ellipsis} .twf small{font-size:calc(var(--tf)*.75); color:#c9b89a}
.twdot{position:absolute; top:calc(var(--tf)*.5); right:calc(var(--tf)*.6); width:calc(var(--tf)*.8); height:calc(var(--tf)*.8); border-radius:50%; background:#6b5d4a; border:2px solid #1a120b} .twdot.on{background:#4fd69c}
/* offers / history: sideways cards under two tabs */
.twtabs{display:flex; gap:8px; flex:none}
.twtabs button{padding:calc(var(--tf)*.35) calc(var(--tf)*1.1); border-radius:99px; border:1.5px solid rgba(240,192,138,.35); background:rgba(255,255,255,.04); color:#e9dcb8; font:600 calc(var(--tf)*.95)/1.2 inherit; cursor:pointer}
.twtabs button.on{background:rgba(240,192,138,.22); border-color:rgba(240,192,138,.85); color:#fff4dc}
.twtabs i{display:inline-block; min-width:1.4em; padding:0 5px; margin-left:4px; border-radius:99px; background:#c4262b; color:#fff; font-style:normal; font-size:.8em; line-height:1.5em; text-align:center}
.twcards{flex:1; min-height:0; align-items:stretch}
.toffer{flex:none; scroll-snap-align:start; width:calc(var(--tf)*19); display:flex; flex-direction:column; gap:calc(var(--tf)*.4); padding:calc(var(--tf)*.7); border-radius:14px; background:rgba(255,255,255,.05); border:1.5px solid rgba(240,192,138,.25); font-size:calc(var(--tf)*.9); overflow:hidden}
.toffer.hist{width:calc(var(--tf)*15)}
.twoh{display:flex; justify-content:space-between; align-items:center; gap:8px} .twoh b{color:#fff4dc}
.tst{font-style:normal; font-size:calc(var(--tf)*.75); font-weight:700; padding:1px 8px; border-radius:99px; background:rgba(255,255,255,.1); color:#e9dcb8; white-space:nowrap}
.tst.pending{background:rgba(240,192,138,.25); color:#ffe2a8} .tst.done{background:rgba(79,214,156,.22); color:#9be39b} .tst.declined,.tst.failed,.tst.expired,.tst.cancelled{background:rgba(255,154,138,.16); color:#ffb4a8}
.tline{display:flex; flex-wrap:wrap; gap:4px; align-items:center} .tline small{color:#c9b89a; margin-right:4px}
.tchip{font-size:calc(var(--tf)*.8); padding:1px 7px; border-radius:99px; background:rgba(0,0,0,.35); border:1px solid rgba(255,255,255,.2)}
.tchip.r-R{border-color:#7cc4ff} .tchip.r-E{border-color:#d9a8ff} .tchip.r-L{border-color:#ffd36a} .tarrow{color:#e8c98a}
.tacts{display:flex; gap:8px; margin-top:auto} .tacts .btn,.tacts .ghost{width:auto; margin:0; padding:calc(var(--tf)*.5) calc(var(--tf)*1.1)}
.twerr:empty{display:none} .twerr{flex:none; margin:0; text-align:center}
/* the trade: two sideways strips of album cards */
.twside{flex:1; min-height:0; display:flex; flex-direction:column; gap:calc(var(--tf)*.35); padding:calc(var(--tf)*.5) calc(var(--tf)*.7); border-radius:14px; background:rgba(0,0,0,.28); border:1px solid rgba(240,192,138,.2)}
.tgrid{flex:1; min-height:0; align-items:center; padding:2px}
.tcard2{position:relative; flex:none; scroll-snap-align:start; width:calc(var(--tf)*4.6); padding:3px !important; display:grid; gap:2px; justify-items:center}
.tcard2 .apic{display:block; width:100%} .tcard2 .apic img{width:100%; height:auto; max-height:calc(var(--tf)*5.4); object-fit:contain}
.tcard2 b{font-size:calc(var(--tf)*.62); line-height:1.1; text-align:center; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.tcard2 small{font-size:calc(var(--tf)*.6); color:#c9b89a} .tcard2 .tv{position:absolute; left:2px; top:2px; font-style:normal; font-size:calc(var(--tf)*.65); font-weight:800; padding:0 4px; border-radius:99px; background:rgba(0,0,0,.65); color:#ffe7a8}
.tcard2 .tn{position:absolute; right:2px; top:2px; font-style:normal; font-size:calc(var(--tf)*.7); font-weight:800; padding:0 5px; border-radius:99px; background:var(--saffron,#d39a5e); color:#1d1405}
.tcard2.on{outline:2.5px solid var(--saffron,#d39a5e); outline-offset:1px}
.twfoot{flex:none; display:flex; align-items:center; gap:calc(var(--tf)*1); padding-top:2px} .twfoot .tfair{flex:1; margin:0; font-size:calc(var(--tf)*.95)} .twfoot .btn{width:auto; margin:0; padding:calc(var(--tf)*.6) calc(var(--tf)*2)}
.tbad{color:#ff9a8a; font-weight:700} .twarn{color:#ffd36a; font-weight:700} .tok{color:#9be39b; font-weight:700}
@media (max-height:380px){ .twbar{min-height:38px} .twf .av{--avs:calc(var(--tf)*2.8)} .tcard2{width:calc(var(--tf)*4.1)} }
