/* Casa de Intercambio (José, 29 nov; juego/intercambio.js). Same 720 px layer units as style.css.
   Phone: one column (deal on top, then tabs: my spares · theirs · chat). PC (body.wide): my spares | deal + chat | theirs. */
.trq-casa,.trq-mesa,.trq-done{width:100%;display:flex;flex-direction:column;gap:14px;align-items:stretch}
.trq-casa .sub,.trq-done .sub{align-self:center}
.trq-safe{display:flex;flex-direction:column;gap:4px;padding:14px 18px 14px 74px;border-radius:16px;position:relative;
  background:linear-gradient(180deg,#16261fdd,#0e1814dd);border:2px solid #3f7a5c;color:#d9eadf;font-size:21px;line-height:1.35}
.trq-safe::before{content:'🛡';position:absolute;left:18px;top:50%;transform:translateY(-50%);font-size:38px;filter:saturate(.7)}
.trq-safe b{color:#9be3b9;font-size:23px}
.trq-safe.small{padding:8px 14px 8px 58px;font-size:18px}.trq-safe.small::before{font-size:28px;left:16px}.trq-safe.small b{font-size:19px}
.trq-warn{margin:0;padding:10px 14px;border-radius:12px;background:#3a2a10;border:1px solid #c9973a;color:#ffe2a6;font-size:20px;text-align:center}
.trq-need{margin:0;padding:0 8px 0 34px;font-size:24px;line-height:1.45;color:#efe6d6;text-align:left;max-width:640px}
.trq-need li{margin:6px 0}

/* card tiles */
.trq-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;width:100%;align-content:start}
.trq-grid.mini{grid-template-columns:repeat(6,1fr);gap:8px}
.trq-grid.offer{grid-template-columns:repeat(3,1fr);gap:8px;min-height:150px}
.trq-t{position:relative;aspect-ratio:5/7;padding:0;border:0;border-radius:10px;overflow:hidden;background:#1a120f;cursor:pointer;
  box-shadow:0 5px 12px #000a;outline:2px solid #5a4636;outline-offset:-2px;min-width:0}
.trq-t>img,.trq-t>.nfwrap,.trq-t>.nfwrap img,.trq-t>.ttile{width:100%;height:100%;display:block;object-fit:cover}
.trq-t.r-rar{outline-color:#6fa8dc}.trq-t.r-epi{outline-color:#b07ae0}.trq-t.r-leg{outline-color:#ffd36a}
.trq-t:active{transform:scale(.96)}
.trq-n{position:absolute;right:5px;bottom:5px;min-width:34px;padding:1px 7px;border-radius:9px;background:#000d;color:#fff;font-size:20px;text-align:center}
.trq-f{position:absolute;left:0;right:0;top:0;padding:2px 4px;font-style:normal;font-size:14px;font-weight:700;text-align:center;color:#111;
  background:linear-gradient(90deg,#cfe9ff,#fff,#cfe9ff)}
.trq-f{white-space:nowrap;overflow:hidden}
.trq-grid.offer .trq-f{font-size:11px;padding:1px 2px;letter-spacing:-.3px}
.trq-f.f2{background:linear-gradient(90deg,#ff9a9a,#ffe08a,#9af0b0,#9ad0ff,#d9a0ff)}
.trq-f.f3{background:linear-gradient(90deg,#b8862b,#ffe9a8,#b8862b);color:#2a1a00}
.trq-sh{position:absolute;inset:0;pointer-events:none;mix-blend-mode:screen;opacity:.55;
  background:linear-gradient(115deg,transparent 30%,#ffffff66 45%,#9fd3ff55 52%,transparent 66%);background-size:260% 100%;animation:trqsh 3.4s linear infinite}
.trq-sh.f2{background-image:linear-gradient(115deg,transparent 25%,#ff7a7a55 38%,#ffe07a55 46%,#7affb055 54%,#7ac8ff55 62%,transparent 75%)}
.trq-sh.f3{background-image:linear-gradient(115deg,transparent 28%,#ffd36a77 44%,#fff6c877 52%,transparent 68%)}
@keyframes trqsh{from{background-position:120% 0}to{background-position:-140% 0}}
.still .trq-sh,.lite .trq-sh{animation:none;background-position:40% 0}
.trq-x{position:absolute;left:5px;bottom:5px;width:34px;height:34px;border-radius:50%;background:#7a2f22;border:2px solid #ffd9a0;color:#fff;
  font:700 26px/28px sans-serif;text-align:center;font-style:normal}
.trq-x.add{background:#2f6a45;border-color:#9be3b9}
.trq-empty{grid-column:1/-1;margin:0;padding:18px 10px;font-size:20px;color:var(--muted);text-align:center;line-height:1.35}

/* the deal: what I give · what I get */
.trq-deal{display:grid;grid-template-columns:1fr auto 1fr;gap:6px;align-items:stretch}
.trq-side{display:flex;flex-direction:column;gap:8px;padding:10px;border-radius:16px;background:#150f0ccc;border:2px solid #5a4636;min-width:0}
.trq-side.ok{border-color:#59c98a;box-shadow:0 0 18px #59c98a55 inset}
.trq-side h4{margin:0;font-size:22px;color:#ffd9a0;display:flex;justify-content:space-between;gap:6px;align-items:baseline;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.trq-side h4 small{font-size:16px;color:var(--muted);font-weight:normal}
.trq-swap{align-self:center;font-size:34px;color:#ffd36a;opacity:.85}
.trq-val{display:flex;gap:6px;align-items:baseline;justify-content:center;font-size:17px;color:var(--muted);margin-top:auto}
.trq-val b{font-size:26px;color:#9fd3ff}
.trq-okl{text-align:center;font-size:18px;color:var(--muted);padding:4px;border-radius:9px;background:#0006}
.trq-side.ok .trq-okl{color:#0d2417;background:#59c98a;font-weight:700}
.trq-act{display:flex;flex-direction:column;gap:8px;align-items:stretch}
.trq-act .btn{width:100%;min-height:72px;font-size:27px}
.trq-act .btn[aria-disabled="true"]{filter:grayscale(.8) brightness(.7)}
.trq-act .gnote,.trq-wait{margin:0;font-size:19px;text-align:center;color:var(--muted)}
.trq-wait{color:#9be3b9;font-size:21px}
.trq-count{display:flex;gap:16px;align-items:center;justify-content:center;padding:10px 16px;border-radius:16px;background:#12281c;border:2px solid #59c98a}
.trq-count b{font-size:64px;line-height:1;color:#9be3b9;min-width:54px;text-align:center;animation:trqp 1s ease-in-out infinite}
.trq-count span{font-size:21px;color:#d9eadf}
@keyframes trqp{50%{transform:scale(1.18)}}
.still .trq-count b{animation:none}

/* panes */
.trq-cols{display:flex;flex-direction:column;gap:12px}
.trq-mid{display:flex;flex-direction:column;gap:12px;min-width:0}
.trq-col{display:none;flex-direction:column;gap:10px;min-width:0}
.trq-mesa[data-tab="mias"] .trq-mias,.trq-mesa[data-tab="suyas"] .trq-suyas,.trq-mesa[data-tab="chat"] .trq-chat{display:flex}
.trq-col .gh3{margin:0}
.trq-tabs{display:flex;gap:6px}.trq-tabs .stab{font-size:19px;min-height:60px}
.trq-filt{display:flex;flex-direction:column;gap:8px}
.trq-chips{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding-bottom:2px}
.trq-chip{flex:none;min-height:48px;padding:4px 14px;border-radius:24px;border:2px solid #6b5137;background:#1a120f;color:#e8dcc4;font:600 19px var(--serif,serif)}
.trq-chip.on{background:#5a2a1e;border-color:#ffd36a;color:#ffd9a0}
.trq-filt .search{font-size:21px;padding:10px 16px}
.trq-chat .chatlog{height:300px}
/* on the phone the order is: deal, accept, tabs, then the chosen pane */
.trq-mias{order:2}.trq-suyas{order:3}.trq-mid{order:1}

/* history */
.trq-h{padding:10px 14px;border-radius:12px;background:#1a120f;border:1px solid #3a2c22;font-size:20px;color:#efe6d6}
.trq-h>div{display:flex;justify-content:space-between;gap:8px;align-items:baseline}.trq-h b{color:#ffd9a0;font-size:22px}
.trq-h small{color:var(--muted);font-size:16px}.trq-h p{margin:4px 0 0;line-height:1.3}.trq-h em{font-style:normal;color:#9fd3ff;margin-right:4px}
.trq-h.rev{opacity:.6}
#trq-hist{display:flex;flex-direction:column;gap:8px}

/* done */
.trq-done{align-items:center}
.trq-fly{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;width:100%}
.trq-fly .trq-t{width:150px;flex:none;animation:trqin .7s cubic-bezier(.2,.9,.3,1.2) both;animation-delay:calc(var(--i) * 90ms)}
.trq-fly.out .trq-t{width:104px;filter:saturate(.6) brightness(.8);animation-name:trqout}
@keyframes trqin{from{transform:translateX(260px) rotate(14deg) scale(.6);opacity:0}}
@keyframes trqout{from{transform:translateX(-260px) rotate(-14deg) scale(1.2);opacity:0}}
.still .trq-fly .trq-t{animation:none}
.trq-names{margin:0;font-size:21px;color:#efe6d6;text-align:center;max-width:640px}
.trq-done .btn{min-height:68px;margin-top:8px}

/* small tiles of the deal: the count and the «−» must not touch */
.trq-grid.offer .trq-n{min-width:0;padding:0 5px;font-size:15px;right:3px;bottom:3px}
.trq-grid.offer .trq-x{width:28px;height:28px;font-size:22px;line-height:23px;left:3px;bottom:3px}
/* Social › Amigos: room for «Intercambiar» in the friend row (the dot already says who is online) */
.frow:has([data-trq])>span{display:none}
.frow:has([data-trq])>b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.frow:has([data-trq]) .btn{flex:none;min-width:0}
.frow [data-trq]{padding:2px 16px;font-size:19px}
.frow:has([data-trq]) [data-retar]{padding:2px 22px}
.frow:has([data-trq]) [data-fmenu]{width:64px}
#casa-trq{min-height:64px}

/* PC and tablets in landscape (the layer is at most 1180 px wide): the deal, the accept button and the chat on the
   left; my spare copies and theirs on the right, everything visible at once (no tabs) */
body.wide .trq-casa,body.wide .trq-done{max-width:860px;margin:0 auto}
body.wide .trq-cols{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);grid-template-areas:'mid mias' 'mid suyas';gap:16px;align-items:start}
body.wide .trq-mid{grid-area:mid}body.wide .trq-mias{grid-area:mias}body.wide .trq-suyas{grid-area:suyas}
body.wide .trq-col{display:flex}
body.wide .trq-tabs{display:none}
body.wide .trq-col.trq-mias,body.wide .trq-col.trq-suyas{padding:12px;border-radius:16px;background:#150f0c99;border:1px solid #3a2c22;max-height:520px;overflow-y:auto}
body.wide .trq-col .trq-grid{grid-template-columns:repeat(5,1fr)}
body.wide .trq-grid.offer{grid-template-columns:repeat(3,1fr);min-height:120px}
body.wide .trq-chat .chatlog{height:300px}
body.wide .trq-grid.mini{grid-template-columns:repeat(8,1fr)}
