/* MoGoDice Sticker Trade Board. Mobile-first. Original tiles only, no game art. */
.trade-page { --tr-bg: #1b0f33; --tr-card: #2a174d; --tr-deep: #2d1657; --tr-gold: #f5c542; --tr-line: #5b3a9a;
  --tr-have: #4fd17a; --tr-need: #ff7b7b; --tr-muted: #b89cf0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tr-main { padding: 1.2rem 0 2.5rem; }
.tr-intro { text-align: center; margin-bottom: 1rem; }
.tr-intro h1 { font-family: var(--font-display); color: var(--tr-gold); font-size: clamp(1.8rem, 6vw, 2.6rem); margin: .2rem 0; letter-spacing: .5px; }
.tr-unofficial { display: inline-block; background: var(--tr-gold); color: var(--tr-deep); font-weight: 700; font-size: .72rem;
  padding: .2rem .55rem; border-radius: 6px; letter-spacing: .3px; margin: 0; }
.tr-lede { color: var(--muted); margin: .2rem 0; }
.tr-rule { color: #ffd0d0; font-weight: 600; font-size: .92rem; margin: .4rem 0; }
.tr-join { display: grid; gap: .5rem; background: linear-gradient(90deg, #4a2a86, var(--tr-card)); border: 2px dashed var(--tr-gold);
  border-radius: 14px; padding: 1rem; margin: 0 0 1rem; text-align: center; }
.tr-join strong { color: var(--tr-gold); font-size: 1.1rem; }
.tr-join .btn { justify-self: center; }
.tr-layout { display: grid; gap: 1rem; }
.tr-col { display: grid; gap: 1rem; min-width: 0; }
.tr-side { display: grid; gap: 1rem; align-content: start; min-width: 0; }
.tr-card { background: var(--tr-card); border: 2px solid var(--tr-line); border-radius: 16px; padding: 1rem; color: #f3eaff; }
.tr-card h3 { color: var(--tr-gold); font-size: 1.1rem; margin: 0 0 .6rem; font-family: var(--font-display); letter-spacing: .3px; }
.tr-fine { font-size: .82rem; color: var(--tr-muted); margin: .5rem 0 0; }
.tr-fine code { color: var(--tr-gold); }

/* ---------- Tap grid (matches mockup grid.html) ---------- */
.tr-grid-card { border: 3px solid var(--tr-gold); border-radius: 18px; }
.tr-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .3rem; }
.tr-kicker { font-size: .78rem; color: var(--tr-muted); letter-spacing: 1px; text-transform: uppercase; }
.tr-badge-unoff { background: var(--tr-gold); color: var(--tr-deep); font-size: .62rem; font-weight: 700; padding: .2rem .4rem; border-radius: 4px; white-space: nowrap; }
.tr-grid-card h2 { font-family: var(--font-display); color: var(--tr-gold); font-size: 1.5rem; margin: 0 0 .25rem; letter-spacing: .3px; }
.tr-prog { font-size: .92rem; margin-bottom: .35rem; }
.tr-bar { height: 10px; background: var(--tr-bg); border-radius: 5px; overflow: hidden; margin-bottom: .9rem; }
.tr-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7a4fd0, var(--tr-gold)); transition: width .3s; }
.tr-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.tr-tile { position: relative; min-height: 132px; border-radius: 12px; padding: .7rem .35rem .55rem; text-align: center; display: flex;
  flex-direction: column; justify-content: space-between; align-items: center; gap: .2rem; cursor: pointer; user-select: none;
  background: #241446; border: 3px solid #3d2a6b; color: #f3eaff; font: inherit; -webkit-tap-highlight-color: transparent;
  transition: transform .08s, box-shadow .2s; }
.tr-tile:active { transform: scale(.97); }
.tr-tile:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.tr-tile .stars { color: var(--tr-gold); font-size: .95rem; letter-spacing: -1px; line-height: 1; }
.tr-tile .icon { font-size: 1.7rem; line-height: 1; opacity: .4; }
.tr-tile .name { font-size: .8rem; font-weight: 700; line-height: 1.15; word-break: break-word; }
.tr-tile .st { font-size: .62rem; font-weight: 700; padding: .15rem .45rem; border-radius: 10px; background: #3d2a6b; color: #cbb8f0; letter-spacing: .3px; }
.tr-tile.have { background: linear-gradient(160deg, #5a35a8, #3a2070); border: 3px solid var(--tr-have); }
.tr-tile.have .icon, .tr-tile.spare .icon { opacity: 1; }
.tr-tile.have .st { background: var(--tr-have); color: #103a1d; }
.tr-tile.need { background: #1f1140; border: 3px dashed var(--tr-need); }
.tr-tile.need .stars { color: #7d6aa3; }
.tr-tile.need .icon { opacity: .35; }
.tr-tile.need .name { color: #c9b8ea; }
.tr-tile.need .st { background: var(--tr-need); color: #3a0d0d; }
.tr-tile.spare { background: linear-gradient(160deg, #6b42c4, #3a2070); border: 3px solid var(--tr-gold); box-shadow: 0 0 12px #f5c54288; }
.tr-tile.spare .st { background: var(--tr-gold); color: var(--tr-deep); }
.tr-tile .plus { position: absolute; top: 5px; left: 5px; background: var(--tr-gold); color: var(--tr-deep); font-weight: 700; font-size: .75rem;
  padding: .05rem .4rem; border-radius: 8px; }
.tr-tile .gold-badge { position: absolute; top: 5px; right: 5px; background: linear-gradient(180deg, #ffe58a, #e8a801); color: #3a2500;
  font-size: .55rem; font-weight: 800; padding: .1rem .3rem; border-radius: 5px; letter-spacing: .4px; box-shadow: 0 0 6px #f5c54299; }
.tr-tile.is-gold .name { color: #ffe9a0; }
.tr-tile .adj { display: flex; gap: .3rem; }
.tr-tile .adj span { display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%; background: var(--tr-bg);
  border: 1px solid var(--tr-gold); color: var(--tr-gold); font-weight: 700; font-size: .9rem; line-height: 1; }
.tr-legend { display: flex; flex-wrap: wrap; gap: .35rem .8rem; justify-content: center; font-size: .75rem; margin-top: .8rem; color: #d8c8f5; }
.tr-legend .lg { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .25rem; vertical-align: -1px; }
.lg.need { border: 2px dashed var(--tr-need); } .lg.have { border: 2px solid var(--tr-have); }
.lg.spare { border: 2px solid var(--tr-gold); box-shadow: 0 0 5px var(--tr-gold); } .lg.clear { border: 2px solid #3d2a6b; }
.lg.goldb { width: auto !important; height: auto !important; font-size: .55rem; padding: 0 .25rem; background: var(--tr-gold); color: #3a2500; }
.tr-btns { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .8rem; }
.tr-btn2 { font: inherit; font-size: .82rem; padding: .6rem .4rem; border-radius: 10px; background: var(--tr-bg); border: 1px solid var(--tr-line);
  color: #f3eaff; cursor: pointer; }
.tr-btn2:hover { border-color: var(--tr-gold); }
.tr-setnav { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .8rem; }
.tr-arrow { font: inherit; font-size: .9rem; border: 1px solid var(--tr-gold); color: var(--tr-gold); background: transparent; border-radius: 9px;
  padding: .45rem .8rem; cursor: pointer; white-space: nowrap; }
.tr-arrow:disabled { opacity: .35; cursor: default; }
.tr-setpick select, .tr-filters select, .tr-filters input[type=search], .tr-fl-form input, .tr-offer-form select, .tr-chat-form input {
  font: inherit; font-size: .9rem; background: var(--tr-bg); color: #f3eaff; border: 1px solid var(--tr-line); border-radius: 9px; padding: .5rem .6rem; min-width: 0; }
.tr-setpick { flex: 1; display: flex; justify-content: center; }
.tr-setpick select { max-width: 100%; text-align: center; }
.tr-save { min-height: 1.1em; font-size: .78rem; color: var(--tr-muted); text-align: center; margin: .4rem 0 0; }

/* ---------- Tabs, board ---------- */
.tr-tabbar { display: flex; gap: .4rem; margin-bottom: .8rem; }
.tr-tab { flex: 1; font: inherit; font-weight: 700; padding: .65rem .5rem; border-radius: 12px; border: 1px solid var(--tr-line);
  background: var(--tr-bg); color: #f3eaff; cursor: pointer; }
.tr-tab.is-on { background: #7a4fd0; border-color: #a98af0; }
.tr-count { display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 1em; background: var(--tr-need); color: #fff; font-size: .75rem; }
.tr-filters { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin-bottom: .6rem; }
.tr-filters input[type=search] { grid-column: 1 / -1; }
.tr-check { display: flex; align-items: center; gap: .35rem; font-size: .88rem; }
.tr-modes { display: flex; gap: .35rem; overflow-x: auto; padding-bottom: .3rem; margin-bottom: .6rem; scrollbar-width: none; }
.tr-modes::-webkit-scrollbar { display: none; }
.tr-modes button { font: inherit; font-size: .8rem; white-space: nowrap; padding: .4rem .8rem; border-radius: 20px; border: 0; background: var(--tr-bg); color: #f3eaff; cursor: pointer; }
.tr-modes button.is-on { background: #7a4fd0; }
.tr-active-filter { font-size: .85rem; background: #3a2070; border-radius: 9px; padding: .45rem .6rem; margin-bottom: .6rem; display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.tr-active-filter button { font: inherit; font-size: .8rem; background: none; border: 1px solid var(--tr-gold); color: var(--tr-gold); border-radius: 7px; padding: .15rem .5rem; cursor: pointer; }
.tr-posts { display: grid; gap: .7rem; }
.tr-post { background: #1f1140; border: 1px solid var(--tr-line); border-radius: 12px; padding: .8rem; font-size: .9rem; line-height: 1.45; }
.tr-post.is-match { border: 2px dashed var(--tr-gold); background: linear-gradient(90deg, #4a2a86, #1f1140); }
.tr-who { font-weight: 700; display: flex; justify-content: space-between; gap: .5rem; }
.tr-who small { color: var(--tr-muted); font-weight: 400; }
.tr-line { margin-top: .25rem; }
.tr-line > b { font-size: .8rem; }
.tr-line.need > b { color: #ff9e9e; } .tr-line.have > b { color: #9ef0b0; }
.chip { display: inline-block; margin: .12rem .15rem 0 0; padding: .05rem .45rem; border-radius: 8px; background: #2d1a57; border: 1px solid #4a2f80; font-size: .8rem; white-space: nowrap; }
.chip .s { color: var(--tr-gold); }
.chip .g { background: var(--tr-gold); color: #3a2500; font-size: .58rem; font-weight: 800; padding: 0 .25rem; border-radius: 4px; margin-left: .2rem; vertical-align: 1px; }
.chip.mine { border-color: var(--tr-have); }
.tr-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .55rem; flex-wrap: wrap; }
.tr-small { font-size: .78rem; color: var(--tr-muted); }
.tr-btn { font: inherit; font-weight: 700; font-size: .85rem; background: var(--tr-gold); color: var(--tr-deep); border: 0; border-radius: 9px; padding: .5rem .9rem; cursor: pointer; white-space: nowrap; }
.tr-btn:disabled { opacity: .5; cursor: default; }
.tr-btn.ghost { background: transparent; color: var(--tr-gold); border: 1px solid var(--tr-gold); }
.tr-btn.danger { background: transparent; color: var(--tr-need); border: 1px solid var(--tr-need); }
.tr-offer-form { display: grid; gap: .45rem; margin-top: .6rem; padding: .6rem; border-radius: 10px; background: #2a174d; }
.tr-offer-form label { display: grid; gap: .2rem; font-size: .8rem; color: var(--tr-muted); }
.tr-empty { color: var(--tr-muted); font-size: .9rem; text-align: center; padding: 1rem .5rem; list-style: none; }
.tr-pager { display: flex; justify-content: space-between; align-items: center; margin-top: .8rem; font-size: .85rem; }

/* ---------- Offers + chat ---------- */
.tr-offers-h { font-size: .85rem; letter-spacing: 1px; text-transform: uppercase; color: var(--tr-muted); margin: .4rem 0 .4rem; }
.tr-offer { background: #1f1140; border: 1px solid var(--tr-line); border-radius: 12px; padding: .75rem; margin-bottom: .6rem; font-size: .9rem; }
.tr-offer.st-accepted { border: 2px solid var(--tr-have); }
.tr-offer.st-pending { border: 2px dashed var(--tr-gold); }
.tr-offer-head { display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.pill { font-size: .68rem; font-weight: 800; text-transform: uppercase; padding: .12rem .45rem; border-radius: 8px; background: #3d2a6b; letter-spacing: .4px; }
.pill.pending { background: var(--tr-gold); color: var(--tr-deep); } .pill.accepted { background: var(--tr-have); color: #103a1d; }
.pill.confirmed { background: #7a4fd0; color: #fff; } .pill.declined, .pill.cancelled, .pill.expired { background: #3d2a6b; color: #cbb8f0; }
.tr-swap { margin: .35rem 0; }
.tr-link-box { background: #123a22; border: 1px solid var(--tr-have); border-radius: 9px; padding: .5rem .6rem; margin: .45rem 0; font-size: .85rem; word-break: break-word; overflow-wrap: anywhere; min-width: 0; }
.tr-link-box a { color: #9ef0b0; font-weight: 700; }
.tr-link-label { margin: 0 0 .35rem; word-break: normal; overflow-wrap: anywhere; }
.tr-code-row { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; min-width: 0; }
.tr-friend-code { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 800; letter-spacing: .04em; color: #9ef0b0; font-size: .95rem; background: #0c2818; border-radius: 8px; padding: .28rem .5rem; min-width: 0; max-width: 100%; word-break: break-all; }
.tr-copy-code { flex: 0 0 auto; padding: .35rem .7rem; min-height: 36px; }
.tr-code-help { margin: .4rem 0 0; font-size: .8rem; color: #cfead6; line-height: 1.4; word-break: normal; overflow-wrap: anywhere; }
.tr-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }
.tr-chat { margin-top: .6rem; border-top: 1px solid #4a2f80; padding-top: .55rem; }
.tr-msgs { max-height: 240px; overflow-y: auto; display: grid; gap: .35rem; padding: .2rem; }
.tr-msg { max-width: 85%; padding: .35rem .55rem; border-radius: 10px; background: #2d1a57; font-size: .85rem; line-height: 1.35; }
.tr-msg.mine { justify-self: end; background: #5a35a8; }
.tr-msg .meta { display: flex; justify-content: space-between; gap: .6rem; font-size: .68rem; color: var(--tr-muted); margin-bottom: .1rem; }
.tr-msg .rep { background: none; border: 0; color: var(--tr-muted); font-size: .68rem; cursor: pointer; text-decoration: underline; padding: 0; }
.tr-chat-form { display: flex; gap: .4rem; margin-top: .45rem; }
.tr-chat-form input { flex: 1; }
.tr-chat-note { font-size: .74rem; color: var(--tr-muted); margin-top: .3rem; }

/* ---------- Feed ---------- */
.tr-live-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: var(--tr-have); margin-right: .45rem;
  vertical-align: 2px; box-shadow: 0 0 0 0 #4fd17a99; animation: trpulse 2s infinite; }
@keyframes trpulse { 0% { box-shadow: 0 0 0 0 #4fd17a99; } 70% { box-shadow: 0 0 0 8px #4fd17a00; } 100% { box-shadow: 0 0 0 0 #4fd17a00; } }
@media (prefers-reduced-motion: reduce) { .tr-live-dot { animation: none; } }
.tr-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.tr-feed-item { background: #1f1140; border: 1px solid var(--tr-line); border-radius: 11px; padding: .55rem .65rem; font-size: .86rem; line-height: 1.4; cursor: pointer; }
.tr-feed-item:hover, .tr-feed-item:focus-visible { border-color: var(--tr-gold); outline: none; }
.tr-feed-item .k { font-size: .68rem; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.tr-feed-item.trade .k { color: #9ef0b0; } .tr-feed-item.need .k { color: #ff9e9e; }
.tr-feed-item .t { float: right; font-size: .72rem; color: var(--tr-muted); }
.tr-feed-item.is-new { animation: trnew 1.2s ease-out; }
@keyframes trnew { from { background: #4a2a86; } to { background: #1f1140; } }
.tr-fl-form { display: flex; gap: .4rem; margin-top: .6rem; }
.tr-fl-form input { flex: 1; }
.tr-fl-status { font-size: .8rem; margin: .4rem 0 0; min-height: 1em; color: var(--tr-muted); }
.tr-fl-status.ok { color: #9ef0b0; } .tr-fl-status.err { color: #ff9e9e; }
.tr-rules ol { margin: 0; padding-left: 1.2rem; font-size: .88rem; line-height: 1.5; }
.tr-toast { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); background: var(--tr-deep); border: 2px solid var(--tr-gold);
  color: #fff; padding: .6rem 1rem; border-radius: 12px; z-index: 50; max-width: 92vw; font-size: .9rem; box-shadow: 0 6px 20px #0008; }
.tr-toast.err { border-color: var(--tr-need); }
.trade-page .site-footer .copyright { font-size: .8rem; line-height: 1.5; text-align: center; }

@media (min-width: 560px) {
  .tr-grid { gap: .75rem; }
  .tr-tile { min-height: 150px; }
  .tr-tile .name { font-size: .9rem; }
  .tr-tile .icon { font-size: 2.1rem; }
  .tr-filters { grid-template-columns: 2fr 1fr 1fr auto; }
  .tr-filters input[type=search] { grid-column: auto; }
  .tr-posts { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 980px) {
  .tr-layout { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; }
  .tr-grid-card { max-width: 560px; margin-inline: auto; width: 100%; }
}

/* hidden must win over the display rules above */
.trade-page [hidden] { display: none !important; }
.tr-layout { grid-template-columns: minmax(0, 1fr); }
.tr-setpick { min-width: 0; }
.tr-setpick select { width: 100%; }
#board, #friend-link, #tr-grid-card { scroll-margin-top: var(--header-offset, 12rem); }
@media (min-width: 980px) {
  .tr-layout { grid-template-columns: minmax(0, 1fr) 330px; }
}
.tr-col, .tr-side { grid-template-columns: minmax(0, 1fr); }
.tr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tr-btns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tr-tile .name { overflow-wrap: anywhere; }

/* Sticky sidebar: stays in view while the board scrolls (desktop/tablet-wide only) */
@media (min-width: 980px) {
  .tr-layout { align-items: start; }
  .tr-side {
    position: sticky;
    top: calc(var(--header-offset, 16rem) + .25rem);
    max-height: calc(100vh - var(--header-offset, 16rem) - 1rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #f5c542 transparent;
    padding-right: 4px;
  }
}

/* =====================================================================
   v2: trading-first /trader/ homepage — slim header, daily sidebar,
   compact join, phone bottom sheets, richer feed chips.
   ===================================================================== */
.trade-page .tr-main { overflow-x: clip; } /* clip (not hidden) keeps position: sticky working */
.trade-page input, .trade-page select, .trade-page textarea { font-size: 16px; } /* no iOS zoom on focus */

/* Slim header: logo + nav in one row on wide screens, two short rows on phones */
.slim-header .header-inner { flex-direction: row; justify-content: space-between; gap: .8rem; padding: .45rem 0; }
.slim-header .logo .logo-banner { width: auto; height: 46px; max-width: 42vw; }
.slim-header .nav { margin-left: auto; }
@media (max-width: 759px) {
  .slim-header .header-inner { flex-direction: column; align-items: stretch; gap: .35rem; padding: .35rem 0 .4rem; }
  .slim-header .logo { justify-content: center; }
  .slim-header .logo .logo-banner { height: 34px; max-width: 70vw; }
  .slim-header .nav { width: 100%; margin: 0; justify-content: flex-start; }
  .slim-header .nav a { font-size: .78rem; padding: .5rem .62rem; min-height: 36px; }
  .slim-header .nav-ico { font-size: .95rem; }
}
.trader-home .tr-main { padding-top: .8rem; }
.trader-home .tr-intro { margin-bottom: .7rem; }
.trader-home .tr-intro h1 { font-size: clamp(1.55rem, 5.5vw, 2.3rem); }
.trader-home .tr-lede { font-size: .92rem; }
.trader-home .tr-rule { font-size: .85rem; }

/* Compact join */
.tr-join { text-align: left; gap: .45rem; padding: .85rem; }
.tr-join-sub { font-size: .86rem; color: #e3d6ff; }
.tr-join-form { display: flex; gap: .45rem; flex-wrap: wrap; }
.tr-join-form input { flex: 1 1 11rem; min-width: 0; min-height: 44px; padding: .55rem .7rem; border-radius: 10px;
  border: 1px solid var(--tr-line); background: #170c30; color: #fff; }
.tr-join-form .btn { min-height: 44px; padding: .5rem 1.1rem; }
.tr-restore summary { cursor: pointer; font-size: .84rem; color: var(--tr-muted); padding: .3rem 0; }
.tr-restore .tr-join-form { margin-top: .35rem; }
.tr-join-status { margin: 0; font-size: .86rem; min-height: 1em; }
.tr-join-status.ok { color: #9ef0b0; } .tr-join-status.err { color: #ff9e9e; }
.tr-welcome { margin: 0 0 1rem; }
.tr-restore-once { display: grid; gap: .4rem; background: #2b1a10; border: 2px solid var(--tr-gold); border-radius: 14px; padding: .8rem; }
.tr-restore-once strong { color: var(--tr-gold); }
.tr-restore-once span { font-size: .86rem; }

/* Sidebar cards (collapsible <details>) */
.sb-group { display: grid; gap: .8rem; align-content: start; min-width: 0; }
.sb-card { padding: .2rem .9rem .8rem; }
.sb-card > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  cursor: pointer; min-height: 46px; padding-top: .55rem; }
.sb-card > summary::-webkit-details-marker { display: none; }
.sb-card > summary h3 { margin: 0; display: flex; align-items: center; gap: .4rem; font-size: 1.05rem; }
.sb-chev { width: .6rem; height: .6rem; border-right: 2px solid var(--tr-gold); border-bottom: 2px solid var(--tr-gold);
  transform: rotate(45deg); transition: transform .2s; margin-right: .2rem; flex: none; }
.sb-card[open] > summary .sb-chev { transform: rotate(-135deg); }
.sb-count { background: var(--tr-gold); color: var(--tr-deep); font-family: var(--font-body); font-size: .72rem; font-weight: 800;
  border-radius: 999px; padding: .05rem .45rem; }
.sb-list { list-style: none; margin: .45rem 0 0; padding: 0; display: grid; gap: .45rem; }
.sb-empty { font-size: .85rem; color: var(--tr-muted); }
.sb-link { display: flex; align-items: center; justify-content: space-between; gap: .6rem; background: #1f1140;
  border: 1px solid var(--tr-line); border-radius: 12px; padding: .5rem .55rem .5rem .7rem; }
.sb-link-txt { display: grid; min-width: 0; }
.sb-link-txt strong { font-size: .92rem; line-height: 1.25; overflow-wrap: anywhere; }
.sb-link-txt small { font-size: .74rem; color: var(--tr-muted); }
.sb-link-txt small.soon { color: #ffb3b3; }
.sb-claim { flex: none; display: inline-grid; place-items: center; min-height: 40px; min-width: 64px; padding: 0 .85rem; border-radius: 10px;
  background: linear-gradient(180deg, #ffe07a, #f5b301); color: #2a1600; font-weight: 800; text-decoration: none; font-size: .88rem; }
.sb-claim:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.sb-shields .sb-claim { background: transparent; color: var(--tr-gold); border: 1.5px solid var(--tr-gold); }
.sb-ev { background: #1f1140; border: 1px solid var(--tr-line); border-radius: 12px; padding: .5rem .65rem; }
.sb-ev-album { border-style: dashed; }
.sb-ev-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.sb-ev-top strong { font-size: .92rem; line-height: 1.25; }
.sb-pill { flex: none; font-size: .68rem; font-weight: 800; padding: .12rem .45rem; border-radius: 999px; background: #3d8b55; color: #eafff0; white-space: nowrap; }
.sb-pill.hot { background: #c0392b; } .sb-pill.next { background: #7a4fd0; }
.sb-when { font-size: .76rem; color: var(--tr-muted); margin-top: .1rem; }
.sb-more summary { font-size: .76rem; color: var(--tr-gold); cursor: pointer; margin-top: .2rem; }
.sb-more p { font-size: .8rem; margin: .3rem 0 0; line-height: 1.4; }
.sb-more a { color: var(--tr-gold); }

/* Layout. Phones: board (and offers) first after the hero/join, then dice, shields,
   events and activity. Desktop: one sticky column on the right, unchanged. */
@media (max-width: 979px) {
  .trader-home .tr-side { display: contents; }
  .trader-home .tr-col { order: 0; }
  .trader-home .sb-links { order: 1; grid-template-columns: minmax(0, 1fr); }
  .trader-home .sb-events { order: 2; }
  .trader-home .sb-more { order: 3; }
}
@media (min-width: 600px) and (max-width: 979px) {
  .trader-home .sb-links, .trader-home .sb-events { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (min-width: 980px) {
  .trader-home .tr-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .trader-home .tr-side { gap: .8rem; }
  .trader-home .sb-card > summary { cursor: default; }
  .trader-home .sb-card > summary .sb-chev { display: none; }
}

/* Thumb-sized controls */
.tr-tile { min-height: 112px; }
.tr-btn, .tr-btn2, .tr-arrow, .tr-tab, .tr-modes button { min-height: 44px; }
.tr-tile .adj span { width: 1.9rem; height: 1.9rem; font-size: 1rem; }
@media (max-width: 599px) {
  .tr-card { padding: .8rem; border-radius: 14px; }
  .tr-grid { gap: .45rem; }
  .tr-tile { padding: .55rem .25rem .45rem; }
  .tr-tile .name { font-size: .78rem; }
  .tr-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tr-filters .tr-check { grid-column: 1 / -1; min-height: 36px; display: flex; align-items: center; gap: .4rem; }
  .tr-modes { margin-inline: -.8rem; padding-inline: .8rem; scroll-padding-inline: .8rem; }
  .tr-modes button { font-size: .82rem; padding: .45rem .85rem; }
  .tr-posts { grid-template-columns: minmax(0, 1fr); }
  .tr-btns .tr-btn2 { font-size: .8rem; }
}

/* Feed chips wrap */
.tr-feed-row { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin-top: .3rem; }
.tr-feed-row .lbl { font-size: .78rem; color: #d8c8f5; margin-right: .15rem; }
.tr-feed-item .chip { margin: 0; font-size: .74rem; white-space: normal; max-width: 100%; overflow-wrap: anywhere; }
.chip.need { border-color: #a24a5f; } .chip.has { border-color: #3e8a58; }
.chip.more { background: transparent; border-style: dashed; color: var(--tr-gold); font-weight: 700; }

/* Offer form + chat: bottom sheet on phones */
.tr-sheet-title { display: none; }
.tr-chat-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.tr-chat-x { font: inherit; background: transparent; color: var(--tr-gold); border: 1px solid var(--tr-line); border-radius: 10px; min-width: 44px; min-height: 40px; cursor: pointer; }
.tr-offer-form .tr-sheet-close { display: none; }
@media (max-width: 759px) {
  .tr-offer-form, .tr-chat {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; margin: 0; max-height: 82vh; overflow-y: auto;
    background: var(--tr-card); border: 2px solid var(--tr-gold); border-bottom: 0; border-radius: 18px 18px 0 0;
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom)); box-shadow: 0 0 0 100vmax rgba(5, 2, 12, .62), 0 -8px 30px #000a;
    animation: trsheet .22s ease-out;
  }
  .tr-offer-form::before, .tr-chat::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: #6c51a3; margin: -.4rem auto .6rem; }
  .tr-offer-form { display: grid; gap: .6rem; }
  .tr-offer-form .tr-sheet-title { display: block; margin: 0; font-family: var(--font-display); color: var(--tr-gold); font-size: 1.15rem; }
  .tr-offer-form .tr-sheet-close { display: block; }
  .tr-offer-form select, .tr-offer-form .tr-btn { width: 100%; min-height: 46px; }
  .tr-chat .tr-msgs { max-height: 48vh; }
  html.tr-sheet-open, html.tr-sheet-open body { overflow: hidden; }
}
@keyframes trsheet { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }

/* Leaderboard page under the slim header */
.tr-lb-intro { text-align: center; padding: 1rem 0 0; }
.tr-lb-intro h1 { font-family: var(--font-display); color: var(--tr-gold); font-size: clamp(1.5rem, 5vw, 2.2rem); margin: .3rem 0; }
.tr-lb-intro a { color: var(--tr-gold); }
.trader-lb .section { padding-top: 1.2rem; }
.trade-page .tr-filters input[type=search], .trade-page .tr-filters select, .trade-page .tr-setpick select,
.trade-page .tr-fl-form input, .trade-page .tr-chat-form input, .trade-page .tr-offer-form select { font-size: 16px; }
.sb-group { grid-template-columns: minmax(0, 1fr); }
.tr-layout > *, .sb-group > * { min-width: 0; }
.tr-fl-form input { min-width: 0; }

/* =====================================================================
   v3: one scroll page — slim logo header, homepage-style hero,
   stacked board / offers / leaderboard / how-it-works. No jump nav.
   ===================================================================== */
.trader-home { --header-offset: 4.75rem; }
.trader-home .slim-header .header-inner {
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: .4rem 0;
}
.trader-home .slim-header .logo .logo-banner { width: auto; height: 46px; max-width: 52vw; }
@media (max-width: 759px) {
  .trader-home { --header-offset: 3.5rem; }
  .trader-home .slim-header .header-inner { flex-direction: row; padding: .28rem 0; }
  .trader-home .slim-header .logo .logo-banner { height: 34px; max-width: 72vw; }
}

/* Hero: reuse root kicker / gold h1 / lede, but keep it compact so the
   board stays close to the top on phones. */
.trader-home .hero { padding: .7rem 0 .45rem; }
.trader-home .hero h1 {
  font-size: clamp(1.75rem, 8.4vw, 2.2rem);
  line-height: 1.06;
  margin: 0 0 .3rem;
}
.trader-home .hero .lede {
  font-size: .82rem;
  line-height: 1.35;
  margin: 0 auto .5rem;
  max-width: 38rem;
  color: var(--muted);
}
.trader-home .hero .kicker { margin-bottom: .35rem; }
.trader-home .hero .btn { min-height: 44px; padding: .45rem 1.05rem; }
.trader-home .hero-grid > div:first-child,
.trader-home .hero .lede,
.trader-home .hero .kicker { text-align: center; margin-inline: auto; }
.trader-home .hero-actions { justify-content: center; }
@media (min-width: 760px) {
  .trader-home .hero { padding: 1.6rem 0 1rem; }
  .trader-home .hero h1 { font-size: clamp(2.15rem, 5vw, 3.2rem); margin-bottom: .65rem; }
  .trader-home .hero .lede { font-size: 1.08rem; margin-bottom: 1rem; }
}
@media (max-width: 639px) {
  /* Override the root homepage left-align so this hero stays centered. */
  .trader-home .hero-grid > div:first-child { text-align: center; }
  .trader-home .hero .lede,
  .trader-home .hero .kicker { margin-inline: auto; }
  .trader-home .hero-actions { justify-content: center; align-items: center; gap: .5rem; }
  .trader-home .hero-actions .btn { width: auto; min-width: 10.5rem; }
}

.tr-section-h {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--tr-gold);
  font-size: 1.35rem;
  letter-spacing: .3px;
  margin: 0 0 .7rem;
  display: flex;
  align-items: center;
  gap: .45rem;
  -webkit-text-fill-color: var(--tr-gold);
  filter: none;
  background: none;
}
.tr-offers-card .tr-count { margin-left: .15rem; }

#join, #board, #offers, #daily, #events, #leaderboard, #how, #friend-link, #tr-grid-card, #top, #share-panel, #community-board, #community-rewards {
  scroll-margin-top: var(--header-offset);
}

.trader-home .tr-main { padding-top: .2rem; }
.trader-home .tr-lb-section { padding-top: 1.6rem; padding-bottom: 1.2rem; }
.trader-home .tr-how-section { padding-top: .4rem; padding-bottom: 2rem; }
.trader-home .tr-how-section .tr-card { max-width: 44rem; }

.tr-welcome a { color: var(--tr-gold); }

/* Pulse the dice/events card when a hero button jumps to it. */
@keyframes sb-pulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 197, 66, .7); }
  70% { box-shadow: 0 0 0 10px rgba(245, 197, 66, 0); }
  100% { box-shadow: none; }
}
.sb-pulse { animation: sb-pulse .8s ease-out 2; border-color: var(--tr-gold) !important; }

/* Floating back-to-top, phones only, after scrolling.
   Class must not be .tr-top — that name is already the album kicker row. */
.tr-backtop {
  display: none;
  position: fixed;
  right: max(.7rem, env(safe-area-inset-right));
  bottom: max(.8rem, env(safe-area-inset-bottom));
  z-index: 45;
  min-width: 44px;
  min-height: 44px;
  padding: 0 .85rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe07a, #f5b301);
  color: #2a1600;
  font-weight: 800;
  font-size: .85rem;
  text-decoration: none;
  place-items: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
}
.tr-backtop:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (max-width: 759px) {
  .tr-backtop:not([hidden]) { display: inline-grid; }
}

/* Desktop sticky sidebar sits just under the slim logo header.
   JS keeps --header-offset in sync with the real header height. */
@media (min-width: 980px) {
  .trader-home .tr-side {
    top: var(--header-offset);
    max-height: calc(100vh - var(--header-offset) - .5rem);
  }
}
.trader-home .tr-album-line {
  text-align: center;
  color: var(--muted);
  font-size: .86rem;
  margin: 0 0 .65rem;
}
@media (max-width: 759px) {
  .trader-home .tr-album-line { font-size: .8rem; margin: 0 0 .4rem; }
  .trader-home .tr-main { padding-top: 0; padding-bottom: 1.5rem; }
  .trader-home .tr-join { margin-bottom: .7rem; padding: .7rem .75rem; }
}

/* MoGoDice trade-account sign in / create / set password (2026-11-26) */
.tr-auth-tabs { display: flex; gap: 3px; background: #2a1850; border-radius: 12px; padding: 3px; margin: .15rem 0 .2rem; }
.tr-auth-tab { flex: 1; min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: #e3d6ff; font: inherit; font-weight: 600; cursor: pointer; }
.tr-auth-tab[aria-selected="true"] { background: var(--tr-gold); color: #1a1020; }
.tr-auth-form { display: grid; gap: .35rem; margin-top: .2rem; }
.tr-auth-form label { font-size: .82rem; color: #e3d6ff; }
.tr-auth-form input { width: 100%; min-height: 44px; padding: .55rem .7rem; border-radius: 10px; box-sizing: border-box; }
.tr-auth-form .btn { justify-self: start; min-height: 44px; margin-top: .15rem; }
.tr-auth-reassure { font-size: .8rem; color: #e3d6ff; margin: .35rem 0 0; line-height: 1.4; }
.tr-auth-forgot-wrap { margin: .35rem 0 0; }
.tr-auth-link { background: none; border: 0; padding: 0; color: var(--tr-gold); font: inherit; font-size: .84rem; cursor: pointer; text-decoration: underline; }
.tr-auth-forgot-h { display: block; color: var(--tr-gold); font-size: 1rem; margin-bottom: .15rem; }
.tr-account { display: flex; align-items: center; gap: .35rem; background: none; border: 0; padding: .15rem 0 .45rem; margin: 0; }
.tr-account-line { margin: 0; font-size: .88rem; color: #e3d6ff; }
.tr-account-line strong { color: var(--tr-gold); font-weight: 600; }
.tr-account-out { background: none; border: 0; padding: 0; color: var(--tr-gold); font: inherit; font-size: .88rem; cursor: pointer; text-decoration: underline; }
.tr-pw-banner { display: flex; align-items: center; justify-content: space-between; gap: .6rem; font-size: .84rem; line-height: 1.35; background: #2b1a10; border: 1px solid rgba(255, 215, 0, .45); border-radius: 10px; padding: .4rem .7rem; margin: 0 0 .7rem; color: #f3e7c8; }
.tr-pw-dismiss { background: none; border: 0; color: #e3d6ff; font-size: 1rem; line-height: 1; cursor: pointer; padding: .15rem .3rem; }
.tr-set-password { display: grid; gap: .35rem; background: #1a1033; border: 1px solid rgba(255, 215, 0, .3); border-radius: 12px; padding: .7rem .8rem; margin: 0 0 .8rem; }
.tr-set-password-status { margin: 0; font-size: .86rem; min-height: 1em; }
.tr-set-password-status.ok { color: #9ef0b0; }
.tr-set-password-status.err { color: #ff9e9e; }
.tr-signed-mark { margin: 0 0 1rem; }
#tr-legacy-join { margin-top: .25rem; }
#tr-legacy-join .tr-join-form { margin-top: .4rem; }
