.modal:has(> .trader) { max-width: none; }
.trader { display: flex; flex-direction: column; align-items: center; gap: 16px; width: min(560px, 86vw); }
.trader-head { display: flex; align-items: flex-end; gap: 18px; width: 100%; }
.trader-portrait { flex: none; width: 96px; height: 128px; display: flex; align-items: flex-end; justify-content: center; }
.trader-portrait canvas { display: block; }
.trader-ph { width: 96px; height: 128px; display: flex; align-items: center; justify-content: center; background: var(--bg3); box-shadow: 0 0 0 4px var(--ink); color: var(--muted); font-size: 24px; }
.trader-bubble { position: relative; flex: 1; background: var(--fg); color: var(--ink); padding: 14px 16px; box-shadow: 0 0 0 4px var(--ink); margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.trader-bubble::before { content: ''; position: absolute; left: -16px; bottom: 16px; width: 12px; height: 8px; background: var(--fg); box-shadow: -4px 0 0 0 var(--ink), 0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink); }
.trader-bubble p { margin: 0; line-height: 1.3; font-size: 15px; }
.trader-who { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: #5a4632; }
.trader-claim { color: #2a2a8a; }
.trader-rushline { color: #b02020; }
.trader-timer { align-self: flex-end; }
.trader-timer.rush { color: var(--bad); }
.trader-deal { display: flex; align-items: center; justify-content: center; gap: 20px; width: 100%; }
.trader-side { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 150px; }
.trader-theirs { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.trader-arrow { font-size: 28px; color: var(--accent); }
.trader-price { min-height: 80px; display: flex; align-items: center; }
.trader-missing { width: 150px; height: 100px; display: flex; align-items: center; justify-content: center; background: var(--bg3); color: var(--muted); }
.trader-pane { width: 100%; display: flex; justify-content: center; }
.trader-pane:empty { display: none; }
.trader-detail { --px: 3px; width: 100%; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; background: var(--bg3); }
.trader-detail-name { font-size: 16px; color: var(--rc); }
.trader-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 28px; }
.trader-wear { width: 100%; }
.trader-actions { flex-wrap: wrap; }
.btn.trader-call { background: var(--bad); color: var(--fg); }
.trader-got { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.trader-empty { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.trader-empty h2, .trader-empty p { margin: 0; }
.trader-desk { width: 192px; height: 24px; background: #5a4632; box-shadow: 0 0 0 4px var(--ink), inset 0 4px 0 0 #7a6248, inset 0 -4px 0 0 #3a2c1e; margin: 30px 0 8px; }
.trader-deal canvas, .trader-portrait canvas, .bm canvas { image-rendering: pixelated; }
.trader-m-flee { animation: trader-out .5s steps(5) forwards; }
.trader-m-laugh { animation: trader-hop .3s steps(2) 4 alternate; }
.trader-m-huff { animation: trader-out 1.2s steps(5) .4s forwards; }
.trader-m-bye { animation: trader-out 1s steps(5) .4s forwards; }
@keyframes trader-out { to { transform: translateX(-160px); opacity: 0; } }
@keyframes trader-hop { to { transform: translateY(-8px); } }

.bm { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.bm-head { display: flex; align-items: flex-end; gap: 22px; width: 100%; max-width: 720px; }
.bm-figure { display: flex; align-items: flex-end; gap: 8px; flex: none; }
.bm-merchant, .bm-lantern { display: flex; align-items: flex-end; }
.bm-merchant-ph { width: 96px; height: 128px; background: #1c2a1c; box-shadow: 0 0 0 4px var(--ink); }
.bm-lantern-ph { width: 48px; height: 80px; background: #3fdc6a; box-shadow: 0 0 0 4px var(--ink), 0 0 0 12px rgba(63, 220, 106, .18); }
.bm-lantern.off .bm-lantern-ph { background: #1f4a2a; box-shadow: 0 0 0 4px var(--ink); }
.bm-lantern.off canvas { opacity: .45; }
.bm-talk { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.bm-talk h2 { margin: 0; color: #3fdc6a; }
.bm-bubble { margin-bottom: 0; }
.bm-bubble::before { bottom: 12px; }
.bm-timer { align-self: flex-end; }
.bm-stock { display: grid; grid-template-columns: repeat(4, 162px); gap: 18px; justify-content: center; }
.bm-slot { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 6px; }
.bm-slot .card-sm { width: 150px; }
.bm-slot.sold .card, .bm-slot.sold .bm-keyart { opacity: .35; }
.bm-price { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 150px; }
.bm-keys { justify-content: flex-end; }
.bm-keyart { width: 150px; min-height: 92px; display: flex; align-items: center; justify-content: center; gap: 4px; background: var(--bg3); box-shadow: 0 0 0 3px var(--ink); }
.bm-keyph { width: 32px; height: 48px; background: #f2c23a; box-shadow: 0 0 0 4px var(--ink); }
.bm-keyname { font-size: 15px; text-align: center; }
.bm-closed { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; min-width: min(480px, 80vw); }
.bm-closed h2, .bm-closed p { margin: 0; }
.bm-curtain { width: 240px; height: 140px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; background: repeating-linear-gradient(90deg, #4a1420 0 16px, #3a0e18 16px 24px); box-shadow: 0 0 0 4px var(--ink), inset 0 8px 0 0 #6a2030; }
.bm-want { width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; background: var(--bg3); box-shadow: 0 0 0 4px var(--ink); }
.bm-want-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bm-want-head h3 { margin: 0; color: #3fdc6a; }
.bm-mult { display: flex; align-items: center; gap: 8px; color: #3fdc6a; }
.bm-want-say { margin: 0; line-height: 1.3; font-size: 15px; }
.bm-want-items { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
.bm-want-none { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 40px; color: var(--muted); text-align: center; }
.bm-want.done .bm-want-say, .bm-want.done .bm-mult { opacity: .45; }
.trader-said.cave { color: #1f7a3a; }
.trader-said.firm { color: #5a4632; }
.trader-foot { align-self: flex-end; }
.trader-ledger { width: 100%; text-align: left; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; padding: 14px 16px; background: var(--bg3); }
.trader-ledger-h { grid-column: 1 / -1; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.trader-reg { display: flex; align-items: center; gap: 12px; min-width: 0; }
.trader-reg-pic { flex: none; width: 48px; height: 64px; display: flex; align-items: flex-end; justify-content: center; }
.trader-reg-pic canvas { display: block; image-rendering: pixelated; }
.trader-reg-pic .trader-ph { width: 48px; height: 64px; font-size: 14px; }
.trader-reg.unmet .trader-reg-pic { filter: brightness(0); opacity: .5; }
.trader-reg-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.trader-reg-name { font-size: 15px; }
.trader-reg-stats { font-size: 13px; color: var(--muted); }
.trader-ledger-rules { grid-column: 1 / -1; margin: 0; font-size: 13px; line-height: 1.35; color: var(--muted); }
.trader-mood { font-size: 13px; color: var(--muted); }
.trader-mood.good { color: var(--good); }
.trader-mood.bad { color: var(--bad); }
@media (max-width: 760px) { .bm-stock { grid-template-columns: repeat(2, 162px); } .trader-deal { flex-direction: column; } .trader-ledger { grid-template-columns: 1fr; } .trader-arrow { transform: rotate(90deg); } }
