/* =========================================================================
   เฟส 2.1: แลกเสื้อ + แชท (สไตล์เฟส 4: แผงไม้เข้ม ขอบทอง เส้นเข้ม)
   ========================================================================= */
.small-btn.unread { position: relative; }
.small-btn.unread::after, .chat-room.unread::after { content: ""; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: #ef476f; border: 2px solid #1c1613; }

/* ---------- ข้อเสนอแลก ---------- */
.tr-row { flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; padding: 9px; border-radius: 14px; background: linear-gradient(180deg, #33261d, #22180f); border: 1.5px solid #ffd166; }
.tr-row:not(.open) { border-color: #4f3a2a; opacity: .7; }
.tr-who { font-size: 12px; } .tr-who small { color: #aaa; margin-left: 4px; }
.tr-swap { display: flex; align-items: center; gap: 6px; }
.tr-side { flex: 1; display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; min-height: 44px; align-items: center; padding: 4px; border-radius: 10px; background: rgba(0, 0, 0, .25); }
.tr-side i { font-size: 11px; color: #888; }
.tr-arrow { font-size: 20px; color: var(--gold); font-weight: 900; }
.tr-shirt { width: 40px; height: 40px; border-radius: 8px; background: radial-gradient(circle, rgba(255, 255, 255, .08), transparent 70%); border: 1.5px solid #3d2b1f; padding: 2px; }
.tr-shirt.t3 { border-color: #c77dff; } .tr-shirt.t4 { border-color: #ffbe0b; } .tr-shirt.t5 { border-color: #ff4d6d; } .tr-shirt.t6 { border-color: #00f5d4; }
.tr-btns { display: flex; gap: 6px; } .tr-btns .small-btn { flex: 1; }

/* ---------- หน้าต่างเสนอแลก ---------- */
.tr-modal { max-width: 460px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.tr-col { display: flex; flex-direction: column; gap: 5px; } .tr-col > b { font-size: 12px; }
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 5px; max-height: 180px; overflow-y: auto; padding: 4px; border-radius: 12px; background: rgba(0, 0, 0, .25); }
.tr-pick { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border-radius: 10px; background: #1c140e; border: 2px solid #3d2b1f; color: #ddd; font-family: inherit; cursor: pointer; }
.tr-pick .tr-shirt { width: 48px; height: 48px; border: none; }
.tr-pick small { font-size: 9px; color: #b5a99c; }
.tr-pick.on { border-color: var(--gold); background: radial-gradient(circle at 50% 30%, rgba(255, 209, 102, .25), #1c140e 70%); box-shadow: 0 0 10px rgba(255, 209, 102, .35); }

/* ---------- แชท ---------- */
.chat-rooms { display: flex; gap: 5px; overflow-x: auto; flex-shrink: 0; padding-bottom: 2px; scrollbar-width: none; }
.chat-room { position: relative; flex-shrink: 0; padding: 6px 12px; border-radius: 20px; border: 1.5px solid #4f3a2a; background: #22180f; color: #ddd; font-family: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.chat-room.on { background: var(--gold); color: #2b1a10; border-color: #1a1412; }
.chat-box { flex: 1; min-height: 260px; max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 14px;
    background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .015) 0 2px, transparent 2px 6px), #160f0b; border: 1.5px solid #3d2b1f; box-shadow: inset 0 2px 8px rgba(0, 0, 0, .5); }
.chat-msg { display: flex; align-items: flex-end; gap: 6px; max-width: 86%; }
.chat-msg.me { align-self: flex-end; flex-direction: row-reverse; }
.chat-bub { padding: 6px 10px; border-radius: 14px 14px 14px 4px; background: #33261d; border: 1px solid #4f3a2a; font-size: 13px; line-height: 1.4; word-break: break-word; }
.chat-msg.me .chat-bub { border-radius: 14px 14px 4px 14px; background: linear-gradient(180deg, #ffd166, #f4a261); color: #2b1a10; border-color: #1a1412; }
.chat-bub small { display: block; font-size: 9.5px; color: #b5a99c; margin-bottom: 1px; }
.chat-msg.me .chat-bub small { color: #6b4226; text-align: right; }
.chat-rep { color: #888; cursor: pointer; text-decoration: none; margin-left: 4px; }
.chat-form { display: flex; gap: 6px; flex-shrink: 0; }
.chat-form input { flex: 1; min-width: 0; background: #0f0c0b; color: #fff; border: 1.5px solid #4a382e; border-radius: 20px; padding: 9px 14px; font-family: inherit; font-size: 14px; }
.chat-form .small-btn { width: auto; padding: 0 18px; border-radius: 20px; }

/* ---------- กระดานอันดับหลายหัวข้อ ---------- */
.lb-cats { display: flex; gap: 5px; overflow-x: auto; flex-shrink: 0; padding-bottom: 3px; scrollbar-width: none; }
.lb-cats::-webkit-scrollbar { display: none; }
.lb-cat { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 68px; padding: 6px 8px; border-radius: 12px; border: 1.5px solid #4f3a2a;
    background: linear-gradient(180deg, #33261d, #22180f); color: #ddd; font-family: inherit; font-size: 10px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.lb-cat span { font-size: 18px; line-height: 1.1; }
.lb-cat.on { background: linear-gradient(180deg, #ffd166, #f4a261); color: #2b1a10; border-color: #1a1412; box-shadow: 0 3px 0 #1a1412; }
.lb-scope { display: flex; gap: 0; flex-shrink: 0; border-radius: 20px; overflow: hidden; border: 1.5px solid #4f3a2a; align-self: flex-start; }
.lb-scope button { padding: 5px 14px; border: none; background: #22180f; color: #bbb; font-family: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.lb-scope button.on { background: var(--gold); color: #2b1a10; }
.lb-desc { font-size: 11px; color: #b5a99c; flex-shrink: 0; } .lb-desc b { color: #fff; }
.lb-me { font-size: 12px; color: #ddd; background: rgba(255, 209, 102, .1); border: 1.5px solid rgba(255, 209, 102, .4); border-radius: 10px; padding: 6px 10px; flex-shrink: 0; }
.lb-me b { color: var(--gold); }
/* อันดับขายแพงสุด: เสื้อที่ขาย */
.lb-row:has(.lb-best) { flex-wrap: wrap; }
.lb-best { order: 5; flex-basis: 100%; display: flex; align-items: center; gap: 6px; margin-top: 4px; padding: 4px 8px; border-radius: 10px; border: 1.5px solid #4f3a2a;
    background: rgba(0, 0, 0, .28); color: #ddd; font-family: inherit; text-align: left; cursor: pointer; min-width: 0; }
.lb-best .ms { width: 34px; height: 34px; flex-shrink: 0; }
.lb-best-txt { display: flex; flex-direction: column; min-width: 0; } .lb-best-txt b { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .lb-best-txt small { font-size: 9.5px; color: #b5a99c; }
.lb-best.t3 { border-color: #7b4fa0; } .lb-best.t4 { border-color: #b8860b; } .lb-best.t5 { border-color: #c9184a; } .lb-best.t6 { border-color: #00b8a0; }
.lb-best.none { cursor: default; font-size: 10px; color: #888; padding: 2px 8px; }
