/* 3K-Classic player market (ตลาดผู้เล่น) - simple layout; builds on css/site.css + explorer.css */
.s-wrap { max-width: 860px; margin: 0 auto; }
.m-preview { margin: 0 auto 16px; text-align: center; padding: 8px 14px; border-radius: 8px; background: #5e0d09; color: #ffe9b8; font-size: 14px; border: 1px solid #c9963e; }

/* 3 steps */
.s-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.s-step { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 10px; background: rgba(251, 243, 224, .1); border: 1px solid var(--line); color: var(--paper-2); font-size: 15px; line-height: 1.35; }
.s-step b { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(#c6341f, #7c120b); color: #fff; font-size: 18px; border: 2px solid #f0c060; }

/* search */
.s-search { display: flex; gap: 10px; margin-bottom: 16px; }
.s-search input { flex: 1; min-width: 0; font: inherit; font-size: 19px; padding: 13px 16px; border-radius: 10px; border: 2px solid #c9963e; background: #fbf3e0; color: #3a2414; }
.s-search input:focus { outline: 3px solid rgba(227, 179, 88, .5); }
.s-search .btn { font-size: 18px; padding: 0 22px; }

/* tabs */
.s-tabs { display: flex; gap: 6px; margin-bottom: 12px; border-bottom: 2px solid var(--gold-3); }
.s-tabs button { flex: 1; font: inherit; font-family: var(--font-head); font-size: 17px; padding: 11px 6px; border: 0; border-radius: 8px 8px 0 0; cursor: pointer; background: rgba(251, 243, 224, .08); color: var(--paper-2); }
.s-tabs button.on { background: linear-gradient(#f6ead0, #e6cfa3); color: #6a160c; }

/* item rows (for sale / recent trades) */
.s-row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; font: inherit; cursor: pointer; padding: 12px 16px; margin-bottom: 8px; border: 2px solid #6b4322; border-radius: 10px; background: linear-gradient(#f6ead0, #ecd9b3); color: #3a2414; }
.s-row:hover { border-color: #c9963e; box-shadow: 0 0 0 3px rgba(227, 179, 88, .35); }
.s-ic { flex: none; width: 48px; height: 48px; background: #120c08 center/contain no-repeat; border: 2px solid #6b4322; border-radius: 6px; }
.s-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.s-name { font-size: 18px; font-weight: 700; }
.s-shop { font-size: 14px; color: #5a3d24; }
.s-price { flex: none; text-align: right; font-family: 'Chonburi', var(--font-body); font-size: 22px; color: #8f1a12; line-height: 1.2; }
.s-price small { display: block; font-family: var(--font-body); font-size: 12.5px; color: #6b4b2c; }
.s-tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px; font-size: 12.5px; background: #2f7a1f; color: #fff; vertical-align: middle; font-weight: 700; }
.s-empty { text-align: center; padding: 34px 10px; border-radius: 10px; background: rgba(251, 243, 224, .1); color: var(--paper-2); font-size: 17px; }

/* shops */
.s-shops { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }
.s-shopcard { padding: 12px 14px; border: 2px solid #6b4322; border-radius: 10px; background: linear-gradient(#f6ead0, #ecd9b3); color: #3a2414; }
.s-shopcard-h { display: flex; flex-direction: column; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 2px solid #c9963e; }
.s-shopcard-h b { font-size: 19px; color: #6a160c; font-family: 'Chonburi', var(--font-body); }
.s-shopcard-h span { font-size: 14px; color: #5a3d24; }
.s-line { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 2px; font: inherit; text-align: left; cursor: pointer; background: none; border: 0; border-bottom: 1px dashed rgba(122, 80, 40, .35); color: #3a2414; }
.s-line:hover { background: rgba(201, 150, 62, .18); }
.s-line .s-ic { width: 36px; height: 36px; }
.s-line > span:not(.s-ic) { flex: 1; font-weight: 600; } .s-line small { font-weight: 400; color: #6b4b2c; }
.s-line b { color: #8f1a12; font-size: 17px; }
.s-buy { margin-top: 8px; font-size: 14px; color: #1f4f7a; }

/* popup */
.s-pop-h { margin: 0 30px 10px 0; font-size: 22px; color: #6a160c; }
.s-offer { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px dashed rgba(122, 80, 40, .4); }
.s-offer .s-price { min-width: 120px; text-align: left; }
.s-offer small { color: #6b4b2c; }
.s-how { margin: 12px 0 0; padding: 10px 12px; border-radius: 8px; background: rgba(201, 150, 62, .2); font-size: 15px; color: #4a3220; }

@media (max-width: 640px) {
  .s-steps { grid-template-columns: 1fr; gap: 6px; }
  .s-step { padding: 8px 12px; }
  .s-row { padding: 10px 12px; gap: 10px; }
  .s-ic { width: 42px; height: 42px; }
  .s-name { font-size: 16px; }
  .s-price { font-size: 18px; }
  .s-tabs button { font-size: 15px; }
  .s-shops { grid-template-columns: 1fr; }
}

/* ของที่วางขาย = table with clear headers (cards with labels on mobile) */
.s-tbl { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.s-tbl th { text-align: left; font-family: var(--font-head); font-weight: 400; font-size: 15px; color: var(--gold-2); padding: 4px 10px; white-space: nowrap; }
.s-tbl td { padding: 10px; background: linear-gradient(#f6ead0, #ecd9b3); color: #3a2414; border-top: 2px solid #6b4322; border-bottom: 2px solid #6b4322; font-size: 15.5px; vertical-align: middle; }
.s-tbl td:first-child { border-left: 2px solid #6b4322; border-radius: 10px 0 0 10px; }
.s-tbl td:last-child { border-right: 2px solid #6b4322; border-radius: 0 10px 10px 0; }
.s-tbl tr[data-item] { cursor: pointer; }
.s-tbl tr[data-item]:hover td { background: #fff5dc; border-color: #c9963e; }
.s-tbl .r { text-align: right; white-space: nowrap; }
.s-it { display: flex; align-items: center; gap: 10px; } .s-it b { font-size: 16.5px; }
.s-it .s-ic { width: 42px; height: 42px; }
.s-p { font-family: 'Chonburi', var(--font-body); font-size: 19px; color: #8f1a12; }
.s-shopname { font-weight: 700; color: #6a160c; }
.s-who { font-weight: 700; color: #1f4f7a; }
.s-kv { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 14.5px; color: #5a3d24; }
.s-kv b { color: #3a2414; }
.s-shopcard-h .lab { font-size: 12.5px; color: #6b4b2c; }
.s-offer .s-kv { flex: 1; flex-direction: column; }
@media (max-width: 760px) {
  .s-tbl thead { display: none; }
  .s-tbl, .s-tbl tbody, .s-tbl tr, .s-tbl td { display: block; }
  .s-tbl tr { margin-bottom: 10px; border: 2px solid #6b4322; border-radius: 10px; overflow: hidden; }
  .s-tbl td, .s-tbl td:first-child, .s-tbl td:last-child { border: 0; border-radius: 0; padding: 4px 12px; display: flex; justify-content: space-between; gap: 10px; text-align: right; }
  .s-tbl td:first-child { padding-top: 10px; } .s-tbl td:last-child { padding-bottom: 10px; }
  .s-tbl td::before { content: attr(data-l); font-size: 13px; color: #6b4b2c; text-align: left; white-space: nowrap; }
  .s-tbl td:first-child::before { content: none; }
}

/* layout: category sidebar + main */
.s-body { display: grid; grid-template-columns: 230px 1fr; gap: 16px; align-items: start; }
.s-wrap { max-width: 1100px; }
#cats { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 10px; background: rgba(251, 243, 224, .08); border: 1px solid var(--line); }
.s-cat { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; font: inherit; font-size: 15px; padding: 9px 12px; border: 0; border-radius: 8px; cursor: pointer; background: none; color: var(--paper-2); }
.s-cat span { font-size: 13px; opacity: .8; }
.s-cat:hover { background: rgba(227, 179, 88, .12); }
.s-cat.on { background: linear-gradient(#f6ead0, #e6cfa3); color: #6a160c; font-weight: 700; }
.s-subs { display: flex; flex-wrap: wrap; gap: 5px; padding: 8px 2px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.s-sub { font: inherit; font-size: 13px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--gold-3); background: none; color: var(--paper-2); cursor: pointer; }
.s-sub.on { background: linear-gradient(#c6341f, #7c120b); color: #fff; border-color: #f0c060; }
.s-cat-t { color: #6b4b2c; font-size: 14px; }
.s-shops-n { font-weight: 700; color: #2f6a1f; }

/* แยกตามร้าน: merchant picker + chosen shop */
.s-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-bottom: 12px; }
.s-pickbtn { display: flex; flex-direction: column; gap: 1px; text-align: left; font: inherit; cursor: pointer; padding: 9px 12px; border-radius: 10px; border: 2px solid #6b4322; background: rgba(251, 243, 224, .1); color: var(--paper-2); }
.s-pickbtn b { font-size: 15.5px; color: #fbe2a0; } .s-pickbtn span { font-size: 13px; }
.s-pickbtn.on { background: linear-gradient(#f6ead0, #e6cfa3); border-color: #c9963e; color: #4a3220; }
.s-pickbtn.on b { color: #6a160c; }
.s-shopbox { padding: 12px 14px; border-radius: 12px; border: 2px solid #c9963e; background: rgba(251, 243, 224, .06); }
.s-shopbox-h { display: flex; flex-direction: column; margin-bottom: 6px; color: var(--paper-2); }
.s-shopbox-h .lab { font-size: 13px; opacity: .8; }
.s-shopbox-h b { color: #fbe2a0; } .s-shopbox-h > b { font-size: 24px; font-family: 'Chonburi', var(--font-body); }
.s-shopbox .s-kv { color: var(--paper-2); } .s-shopbox .s-kv b { color: #fbe2a0; }
.s-shopbox .s-buy { color: #bfe3ff; margin-top: 6px; } .s-shopbox .s-buy b { color: #fff; }
.s-offer { flex-wrap: wrap; } .s-offer .btn { margin-left: auto; }
@media (max-width: 860px) {
  .s-body { grid-template-columns: 1fr; }
  #cats { position: static; flex-direction: row; flex-wrap: wrap; padding: 8px; }
  .s-cat { width: auto; padding: 6px 10px; font-size: 14px; }
  .s-subs { width: 100%; }
}

/* buy buttons + buy popup */
.s-buycell { width: 1%; white-space: nowrap; text-align: right; }
.s-buybtn { font: inherit; font-weight: 700; font-size: 15px; padding: 7px 14px; border-radius: 8px; cursor: pointer; border: 2px solid #f0c060; background: linear-gradient(#2f9a1f, #1d6a12); color: #fff; white-space: nowrap; }
.s-buybtn:hover { background: linear-gradient(#3bb426, #237d16); }
.s-offer-btns { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.s-tbl tr[data-buy] { cursor: pointer; }
.s-tbl tr[data-buy]:hover td { background: #fff5dc; border-color: #c9963e; }
.s-buy-item { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: #fff6df; border: 1px solid #c9963e; margin-bottom: 10px; }
.s-buy-item > div { display: flex; flex-direction: column; } .s-buy-item b { font-size: 18px; } .s-buy-item span { font-size: 14.5px; color: #4a3220; }
.s-buy-item .s-p { font-size: 18px; }
.s-buy-kv { flex-direction: column; gap: 4px; font-size: 15.5px; margin-bottom: 8px; }
.s-buy-pop h4 { margin: 12px 0 4px; font-size: 17px; color: #6a160c; }
.s-buy-steps { margin: 0 0 8px 20px; padding: 0; line-height: 1.8; font-size: 15.5px; }
.s-note { font-size: 13.5px; color: #6b4b2c; margin: 6px 0; }
.s-buy-act { display: flex; justify-content: flex-start; margin-top: 8px; }
@media (max-width: 760px) { .s-buycell { width: auto; } .s-buycell::before { content: none !important; } .s-tbl td.s-buycell { justify-content: flex-end; padding-bottom: 10px; } }
.s-offer { display: grid; grid-template-columns: 130px 1fr; gap: 6px 14px; align-items: center; }
.s-offer .s-kv { min-width: 0; }
.s-offer .s-kv > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-offer .s-tag { justify-self: start; grid-column: 1; }
.s-offer-btns { grid-column: 1 / -1; margin-left: 0; justify-content: flex-end; }
.s-offer .s-offer-btns .btn { margin-left: 0; }
